libsaria: Playlist knows about the renderer
I plan on using this to fill in each playlist instead of using my current iterator system. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
f795af5d6c
commit
055f349cd1
|
@ -19,6 +19,9 @@ enum PlaylistFlags {
|
|||
namespace libsaria
|
||||
{
|
||||
|
||||
/* Forward declaration of PlaylistRenderer class */
|
||||
class PlaylistRenderer;
|
||||
|
||||
class Playlist {
|
||||
private:
|
||||
unsigned int flags;
|
||||
|
@ -26,6 +29,7 @@ namespace libsaria
|
|||
list<Track *> plist;
|
||||
list<Track *>::iterator it;
|
||||
list<Track *>::iterator cur;
|
||||
PlaylistRenderer *renderer;
|
||||
|
||||
void init_common(string, unsigned int);
|
||||
|
||||
|
@ -39,6 +43,8 @@ namespace libsaria
|
|||
Playlist(string, unsigned int);
|
||||
~Playlist();
|
||||
|
||||
void set_renderer(PlaylistRenderer *);
|
||||
|
||||
void do_load();
|
||||
void do_save();
|
||||
void load();
|
||||
|
|
|
@ -36,6 +36,11 @@ namespace libsaria
|
|||
{
|
||||
}
|
||||
|
||||
void Playlist::set_renderer(PlaylistRenderer *render)
|
||||
{
|
||||
renderer = render;
|
||||
}
|
||||
|
||||
void Playlist::reload()
|
||||
{
|
||||
plist.clear();
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace libsaria
|
|||
void PlaylistRenderer::set_playlist(Playlist *plist)
|
||||
{
|
||||
playlist = plist;
|
||||
playlist->set_renderer(this);
|
||||
}
|
||||
|
||||
}; /* Namespace: libsaria */
|
||||
|
|
Loading…
Reference in New Issue