playqueue: Add a path_selected function
This is called by the GUI to tell the playqueue that a track has been selected. This gives the PQ a chance to (possibly) remove it. Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
04ffffb4e8
commit
5f582e639b
|
@ -58,7 +58,7 @@ void PlayqueueModel::on_row_changed(unsigned int row)
|
||||||
void PlayqueueModel::on_path_selected(const Gtk::TreePath &path)
|
void PlayqueueModel::on_path_selected(const Gtk::TreePath &path)
|
||||||
{
|
{
|
||||||
audio :: load_trackid(path_to_id(path));
|
audio :: load_trackid(path_to_id(path));
|
||||||
queue->set_cur(path[0]);
|
queue->path_selected(path[0]);
|
||||||
audio :: play();
|
audio :: play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ public:
|
||||||
unsigned int operator[](unsigned int);
|
unsigned int operator[](unsigned int);
|
||||||
unsigned int next();
|
unsigned int next();
|
||||||
void set_cur(unsigned int);
|
void set_cur(unsigned int);
|
||||||
|
void path_selected(unsigned int);
|
||||||
#ifdef CONFIG_TEST
|
#ifdef CONFIG_TEST
|
||||||
void reset();
|
void reset();
|
||||||
#endif /* CONFIG_TEST */
|
#endif /* CONFIG_TEST */
|
||||||
|
|
|
@ -374,6 +374,15 @@ void Playqueue :: set_cur(unsigned int c)
|
||||||
cur = c;
|
cur = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Playqueue :: path_selected(unsigned int id)
|
||||||
|
{
|
||||||
|
cur = id;
|
||||||
|
if (!(flags &PQ_REPEAT)) {
|
||||||
|
del(cur);
|
||||||
|
cur--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_TEST
|
#ifdef CONFIG_TEST
|
||||||
void Playqueue :: reset()
|
void Playqueue :: reset()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue