
#include <ocarina/library.h>
#include <ocarina/body.h>
#include <ocarina/gtk.h>
#include "songlist/songlist.h"

#include <libsaria/library.h>
#include <libsaria/track.h>
#include <libsaria/print.h>

#include <list>
using namespace std;

static SongList library_list;
static void fill_library();

void library_init()
{
	library_list.init("Library");
	add_page(library_list.get_label(), library_list.get_window(), true);
	fill_library();
}

static void fill_library()
{
	list<Track> track_list;
	libsaria_library_list(track_list);
	print("track list size: ");
	println(track_list.size());
	library_list.insert(track_list);
}

void ocarina_library_refresh()
{
	library_list.clear();
	fill_library();
}
