42 lines
794 B
C++
42 lines
794 B
C++
|
|
#include <list>
|
|
using namespace std;
|
|
|
|
#include "library.h"
|
|
|
|
static list<TrackTag> play_list;
|
|
|
|
namespace libsaria
|
|
{
|
|
|
|
void library::rebuild_list()
|
|
{
|
|
list<LibraryPath> *path_list = get_path_list();
|
|
list<LibraryPath>::iterator it;
|
|
list<TrackTag> *tag_list;
|
|
|
|
play_list.clear();
|
|
|
|
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");
|
|
}
|
|
|
|
void library::for_each(SourceModel *model)
|
|
{
|
|
list<TrackTag>::iterator it;
|
|
for (it = play_list.begin(); it != play_list.end(); it++) {
|
|
Track track = Track(&(*it));
|
|
model->insert(track);
|
|
}
|
|
}
|
|
|
|
unsigned int library::size()
|
|
{
|
|
return play_list.size();
|
|
}
|
|
|
|
}; /* Namespace: libsaria */
|