51 lines
818 B
C++
51 lines
818 B
C++
#ifndef OCARINA_SONGLIST_H
|
|
#define OCARINA_SONGLIST_H
|
|
|
|
#include <ocarina/gtk.h>
|
|
#include <libsaria/track.h>
|
|
|
|
#include <list>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
/* Make this a class to inherit from? */
|
|
struct SongListFuncs
|
|
{
|
|
void (*for_each)(void (*)(Track &));
|
|
void (*insert_track)(Track &);
|
|
unsigned int (*size)();
|
|
};
|
|
|
|
class SongList
|
|
{
|
|
private:
|
|
int ins_next;
|
|
SongListFuncs *list_funcs;
|
|
string name;
|
|
|
|
GtkWidget *window;
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *treeview;
|
|
GtkListStore *liststore;
|
|
GtkCellRenderer *textcell;
|
|
|
|
void set_label_text();
|
|
void freeze();
|
|
void thaw();
|
|
|
|
public:
|
|
SongList();
|
|
~SongList();
|
|
|
|
void init(string, SongListFuncs *);
|
|
GtkWidget *get_window();
|
|
GtkWidget *get_label();
|
|
|
|
void insert(Track &);
|
|
void fill();
|
|
void clear();
|
|
};
|
|
|
|
#endif /* OCARINA_SONGLIST_H */
|