67 lines
1.1 KiB
C++
67 lines
1.1 KiB
C++
#ifndef OCARINA_SONGLIST_H
|
|
#define OCARINA_SONGLIST_H
|
|
|
|
#include <ocarina/gtk.h>
|
|
#include <libsaria/track.h>
|
|
#include <libsaria/model.h>
|
|
|
|
#include <list>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
class MenuItem
|
|
{
|
|
private:
|
|
string text;
|
|
void (*func)();
|
|
|
|
public:
|
|
MenuItem(string, void (*)());
|
|
~MenuItem();
|
|
|
|
GtkWidget *get_widget();
|
|
};
|
|
|
|
/* Make this a class to inherit from? */
|
|
struct SongListFuncs
|
|
{
|
|
void (*for_each)(libsaria::SourceModel *);
|
|
unsigned int (*size)();
|
|
};
|
|
|
|
class SongList : public libsaria::SourceModel
|
|
{
|
|
private:
|
|
int ins_next;
|
|
SongListFuncs *list_funcs;
|
|
list <MenuItem> *menu_items;
|
|
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 *, list<MenuItem> *);
|
|
GtkWidget *get_window();
|
|
GtkWidget *get_label();
|
|
|
|
void insert(Track &);
|
|
void fill();
|
|
void clear();
|
|
|
|
gint right_click(guint, guint64);
|
|
};
|
|
|
|
#endif /* OCARINA_SONGLIST_H */
|