summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/gtkui/callbacks.c11
-rw-r--r--plugins/hotkeys/hotkeys.c11
2 files changed, 18 insertions, 4 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);
}
}
diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c
index f1deaac8..4315602d 100644
--- a/plugins/hotkeys/hotkeys.c
+++ b/plugins/hotkeys/hotkeys.c
@@ -587,6 +587,7 @@ hotkeys_reset (void) {
int
action_play_cb (struct DB_plugin_action_s *action, int ctx) {
+ // NOTE: this function is copied as on_playbtn_clicked in gtkui
DB_output_t *output = deadbeef->get_output ();
if (output->state () == OUTPUT_STATE_PAUSED) {
ddb_playlist_t *plt = deadbeef->plt_get_curr ();
@@ -604,7 +605,7 @@ action_play_cb (struct DB_plugin_action_s *action, int ctx) {
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 {
@@ -613,7 +614,13 @@ action_play_cb (struct DB_plugin_action_s *action, int ctx) {
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);
}
return 0;
}