libsaria: Get info from play_list
It's easier with everything in one single list.
This commit is contained in:
parent
5ae5a349de
commit
922c9e86ef
|
@ -41,19 +41,6 @@ namespace libsaria
|
||||||
it->update();
|
it->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool library::get_info(ino_t &id, void (*func)(Track &))
|
|
||||||
{
|
|
||||||
bool found = false;
|
|
||||||
list<LibraryPath>::iterator it;
|
|
||||||
for (it = path_list.begin(); it != path_list.end(); it++) {
|
|
||||||
if (it->get_info_id(id, func) == true) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
void library::refresh()
|
void library::refresh()
|
||||||
{
|
{
|
||||||
rebuild_list();
|
rebuild_list();
|
||||||
|
|
|
@ -54,6 +54,17 @@ namespace libsaria
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool library::get_info(ino_t &id, void (*func)(Track &))
|
||||||
|
{
|
||||||
|
list<TrackTag>::iterator it;
|
||||||
|
if (find_id(id, it)) {
|
||||||
|
Track tag(&(*it));
|
||||||
|
func(tag);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int library::size()
|
unsigned int library::size()
|
||||||
{
|
{
|
||||||
return play_list.size();
|
return play_list.size();
|
||||||
|
|
|
@ -33,18 +33,6 @@ list<TrackTag>::iterator LibraryPath::find_id(ino_t &id)
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LibraryPath::get_info_id(ino_t &id, void (*func)(Track &))
|
|
||||||
{
|
|
||||||
list<TrackTag>::iterator it;
|
|
||||||
it = find_id(id);
|
|
||||||
if (it != file_list.end()) {
|
|
||||||
Track track = Track(&(*it));
|
|
||||||
func(track);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LibraryPath::LibraryPath(string dir)
|
LibraryPath::LibraryPath(string dir)
|
||||||
{
|
{
|
||||||
path = dir;
|
path = dir;
|
||||||
|
|
Loading…
Reference in New Issue