playqueue: Change cur when tracks are directly selected
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
e9416e6ace
commit
d240ff44bc
|
@ -49,6 +49,7 @@ void PlayqueueModel::on_row_changed(unsigned int row)
|
|||
void PlayqueueModel::on_path_selected(const Gtk::TreePath &path)
|
||||
{
|
||||
audio :: load_trackid(queue->operator[](path[0]));
|
||||
queue->set_cur(path[0]);
|
||||
audio :: play();
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
unsigned int operator[](unsigned int);
|
||||
unsigned int next();
|
||||
void reset_cur();
|
||||
void set_cur(unsigned int);
|
||||
#ifdef CONFIG_TEST
|
||||
void reset();
|
||||
#endif /* CONFIG_TEST */
|
||||
|
|
|
@ -167,7 +167,7 @@ void audio :: next()
|
|||
|
||||
cur_trackid = id;
|
||||
o_recently_played.add_front(id);
|
||||
o_recently_played.reset_cur();
|
||||
o_recently_played.set_cur(0);
|
||||
}
|
||||
|
||||
void audio :: previous()
|
||||
|
@ -198,7 +198,7 @@ void audio :: load_trackid(unsigned int track_id)
|
|||
|
||||
cur_trackid = track_id;
|
||||
o_recently_played.add_front(track_id);
|
||||
o_recently_played.reset_cur();
|
||||
o_recently_played.set_cur(0);
|
||||
}
|
||||
|
||||
unsigned int audio :: current_trackid()
|
||||
|
|
|
@ -361,9 +361,9 @@ unsigned int Playqueue :: next()
|
|||
return res;
|
||||
}
|
||||
|
||||
void Playqueue :: reset_cur()
|
||||
void Playqueue :: set_cur(unsigned int c)
|
||||
{
|
||||
cur = 0;
|
||||
cur = c;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TEST
|
||||
|
|
Loading…
Reference in New Issue
Block a user