libsaria: Move the renderer into the playlist namespace

This makes more sense to me conceptually than having a class called
PlaylistRenderer.  I also commented out a lot of code, so the renderer
doesn't do anything right now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-19 08:02:51 -04:00
parent 59789ebc85
commit b1eb47006d
8 changed files with 42 additions and 21 deletions

View File

@ -5,14 +5,29 @@
namespace libsaria
{
namespace playlist
{
class PlaylistRenderer {
class Renderer {
private:
unsigned int flags;
Playlist *playlist;
public:
Renderer(unsigned int);
~Renderer();
};
}; /* Namespace: playlist */
/*class PlaylistRenderer {
private:
unsigned int flags;
Playlist *playlist;
virtual void on_playlist_empty();
public:
PlaylistRenderer();
PlaylistRenderer(unsigned int);
~PlaylistRenderer();
void set_playlist(Playlist *, bool);
@ -22,7 +37,7 @@ namespace libsaria
void fill();
virtual void insert(Track *, unsigned int) = 0;
virtual void index_removed(int) = 0;
};
};*/
}; /* Namespace: libsaria */

View File

@ -23,7 +23,7 @@ class MenuItem
GtkWidget *get_widget();
};
class SongList : public libsaria::PlaylistRenderer
class SongList : public libsaria::playlist::Renderer
{
private:
list <MenuItem> *menu_items;

View File

@ -1,6 +1,6 @@
// Copyright (c) 2012 Bryan Schumaker.
#include <libsaria/playlist.h>
#include <libsaria/renderer.h>
//#include <libsaria/renderer.h>
#include <libsaria/index.h>
#include <libsaria/prefs.h>

View File

@ -3,7 +3,7 @@
#include <libsaria/index.h>
#include <libsaria/library.h>
#include <libsaria/playlist.h>
#include <libsaria/renderer.h>
//#include <libsaria/renderer.h>
/*static bool compare_tracks(libsaria::Track *one, libsaria::Track *two)
{*/

View File

@ -4,19 +4,25 @@
namespace libsaria
{
PlaylistRenderer::PlaylistRenderer()
namespace playlist
{
playlist = NULL;
}
PlaylistRenderer::~PlaylistRenderer()
{
}
Renderer::Renderer(unsigned int f)
{
playlist = NULL;
flags = f;
}
void PlaylistRenderer::set_playlist(Playlist *plist, bool del_render)
Renderer::~Renderer()
{
}
}; /* Namespace: playlist */
/*void PlaylistRenderer::set_playlist(Playlist *plist, bool del_render)
{
/*playlist = plist;
playlist->set_renderer(this, del_render);*/
playlist = plist;
playlist->set_renderer(this, del_render);
}
Playlist *PlaylistRenderer::get_playlist()
@ -37,12 +43,12 @@ namespace libsaria
}
void PlaylistRenderer::on_playlist_empty()
{
{*/
/*
* This function is meant to be overridden by
* inherited classes so they can do whatever
* cleanup is necessary on the UI end.
*/
}
//}
}; /* Namespace: libsaria */

View File

@ -29,10 +29,10 @@ namespace ocarina
void queue::new_playlist(libsaria::Playlist *plist)
{
queue_list = new SongList();
/*queue_list = new SongList();
queue_list->set_playlist(plist, true);
queue_list->init("Queue", &queue_menu, false);
queue_list->fill();
queue_list->fill();*/
}
void queue::init()

View File

@ -46,7 +46,7 @@ void SongList::insert(libsaria::Track *track, unsigned int index)
void SongList::fill()
{
freeze();
PlaylistRenderer::fill();
//PlaylistRenderer::fill();
thaw();
set_label_text();
}

View File

@ -3,7 +3,7 @@
#include <ocarina/body.h>
#include "songlist.h"
SongList::SongList() {}
SongList::SongList():libsaria::playlist::Renderer(0) {}
SongList::~SongList() {}
struct column_info {