Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
409fc837
Commit
409fc837
authored
Aug 05, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/lastfm: convert to class
parent
6d0ada7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
LastFMPlaylistPlugin.cxx
src/playlist/LastFMPlaylistPlugin.cxx
+15
-11
No files found.
src/playlist/LastFMPlaylistPlugin.cxx
View file @
409fc837
...
...
@@ -30,12 +30,22 @@
#include <assert.h>
#include <string.h>
struct
lastfm_p
laylist
{
struct
LastfmP
laylist
{
struct
playlist_provider
base
;
struct
input_stream
*
is
;
struct
playlist_provider
*
xspf
;
LastfmPlaylist
(
input_stream
*
_is
,
playlist_provider
*
_xspf
)
:
is
(
_is
),
xspf
(
_xspf
)
{
playlist_provider_init
(
&
base
,
&
lastfm_playlist_plugin
);
}
~
LastfmPlaylist
()
{
playlist_plugin_close
(
xspf
);
input_stream_close
(
is
);
}
};
static
struct
{
...
...
@@ -249,28 +259,22 @@ lastfm_open_uri(const char *uri, Mutex &mutex, Cond &cond)
/* create the playlist object */
const
auto
playlist
=
g_new
(
struct
lastfm_playlist
,
1
);
playlist_provider_init
(
&
playlist
->
base
,
&
lastfm_playlist_plugin
);
playlist
->
is
=
is
;
playlist
->
xspf
=
xspf
;
const
auto
playlist
=
new
LastfmPlaylist
(
is
,
xspf
);
return
&
playlist
->
base
;
}
static
void
lastfm_close
(
struct
playlist_provider
*
_playlist
)
{
struct
lastfm_playlist
*
playlist
=
(
struct
lastfm_p
laylist
*
)
_playlist
;
LastfmPlaylist
*
playlist
=
(
LastfmP
laylist
*
)
_playlist
;
playlist_plugin_close
(
playlist
->
xspf
);
input_stream_close
(
playlist
->
is
);
g_free
(
playlist
);
delete
playlist
;
}
static
Song
*
lastfm_read
(
struct
playlist_provider
*
_playlist
)
{
struct
lastfm_playlist
*
playlist
=
(
struct
lastfm_p
laylist
*
)
_playlist
;
LastfmPlaylist
*
playlist
=
(
LastfmP
laylist
*
)
_playlist
;
return
playlist_plugin_read
(
playlist
->
xspf
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment