libsaria: Sort play_list by artist
Right now I do a basic string comparison. I should eventually format the strings to remove punctuation and use the same case.
This commit is contained in:
parent
4f2c75499f
commit
095ade27ad
|
@ -9,6 +9,13 @@ using namespace std;
|
||||||
static list<TrackTag> play_list;
|
static list<TrackTag> play_list;
|
||||||
static list<TrackTag>::iterator cur_track = play_list.end();
|
static list<TrackTag>::iterator cur_track = play_list.end();
|
||||||
|
|
||||||
|
bool compare_tracktags(TrackTag one, TrackTag two)
|
||||||
|
{
|
||||||
|
if (one.get_artist() < two.get_artist())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static bool find_id(ino_t &inode, list<TrackTag>::iterator &it)
|
static bool find_id(ino_t &inode, list<TrackTag>::iterator &it)
|
||||||
{
|
{
|
||||||
for (it = play_list.begin(); it != play_list.end(); it++) {
|
for (it = play_list.begin(); it != play_list.end(); it++) {
|
||||||
|
@ -34,6 +41,8 @@ namespace libsaria
|
||||||
tag_list = it->get_list();
|
tag_list = it->get_list();
|
||||||
play_list.insert(play_list.end(), tag_list->begin(), tag_list->end());
|
play_list.insert(play_list.end(), tag_list->begin(), tag_list->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
play_list.sort(compare_tracktags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void library::for_each(SourceModel *model)
|
void library::for_each(SourceModel *model)
|
||||||
|
|
Loading…
Reference in New Issue