diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-05-28 21:19:39 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-05-28 21:20:37 +0200 |
commit | c79624b24a0c662f1e1d404b87fe9559fd6900e6 (patch) | |
tree | d23809959607dc2fb7746fd3c2ada83fffe1e865 /plugins/gtkui | |
parent | e1363a40577d0027d0fd858aa85b5dafdf5eac0c (diff) |
reset the playqueue if a user attempts to play the selected file (bug #928)
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/callbacks.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 3ca754bf..8185fe66 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -119,6 +119,7 @@ void on_playbtn_clicked (GtkButton *button, gpointer user_data) { + // NOTE: this function is a copy of action_play_cb DB_output_t *output = deadbeef->get_output (); if (output->state () == OUTPUT_STATE_PAUSED) { ddb_playlist_t *plt = deadbeef->plt_get_curr (); @@ -136,7 +137,7 @@ on_playbtn_clicked (GtkButton *button, deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, cur, 0); } else { - deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 0, 0); + deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 1, 0); } } else { @@ -145,7 +146,13 @@ on_playbtn_clicked (GtkButton *button, deadbeef->plt_unref (plt); } else { - deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 0, 0); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + int cur = -1; + if (plt) { + cur = deadbeef->plt_get_cursor (plt, PL_MAIN); + deadbeef->plt_unref (plt); + } + deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, cur, 0); } } |