#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;

/* 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;
		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 */
