libsaria: Insert all tracks into one giant list

This puts everything in one place for easy use (I hope)
This commit is contained in:
Bryan Schumaker 2011-11-06 12:34:41 -05:00
parent b55ac22866
commit 637ea47a60
3 changed files with 19 additions and 0 deletions

View File

@ -22,6 +22,7 @@ class LibraryPath
LibraryPath(InFile &, string); LibraryPath(InFile &, string);
~LibraryPath(); ~LibraryPath();
list<TrackTag> *get_list();
void for_each(libsaria::SourceModel *); void for_each(libsaria::SourceModel *);
string get_path(); string get_path();
void get_info(void (*)(struct libsaria::library::PathInfo &)); void get_info(void (*)(struct libsaria::library::PathInfo &));

View File

@ -1,11 +1,24 @@
#include <list>
using namespace std;
#include "library.h" #include "library.h"
static list<TrackTag> play_list;
namespace libsaria namespace libsaria
{ {
void library::rebuild_list() void library::rebuild_list()
{ {
list<LibraryPath> *path_list = get_path_list();
list<LibraryPath>::iterator it;
list<TrackTag> *tag_list;
for (it = path_list->begin(); it != path_list->end(); it++) {
tag_list = it->get_list();
play_list.insert(play_list.end(), tag_list->begin(), tag_list->end());
}
println("Rebuilding play list"); println("Rebuilding play list");
} }

View File

@ -21,6 +21,11 @@ string LibraryPath::get_path()
return path; return path;
} }
list<TrackTag> *LibraryPath::get_list()
{
return &file_list;
}
void LibraryPath::get_info(void (*info_func)(struct libsaria::library::PathInfo &)) void LibraryPath::get_info(void (*info_func)(struct libsaria::library::PathInfo &))
{ {
struct libsaria::library::PathInfo info; struct libsaria::library::PathInfo info;