summaryrefslogtreecommitdiff
path: root/plugins/hotkeys
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-18 21:36:26 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-18 21:36:26 +0100
commitdae6ed6ac77ae5e98496189f3a7d70d883245156 (patch)
tree0b8ef079f2622bd93d72630c5cd693060507d5a1 /plugins/hotkeys
parent467b422e1b015a7b8bd94a03d61aa2a6843464a9 (diff)
hotkeys: jump to current
Diffstat (limited to 'plugins/hotkeys')
-rw-r--r--plugins/hotkeys/Makefile.am2
-rw-r--r--plugins/hotkeys/actionhandlers.c13
-rw-r--r--plugins/hotkeys/actionhandlers.h2
-rw-r--r--plugins/hotkeys/hotkeys.c8
4 files changed, 19 insertions, 6 deletions
diff --git a/plugins/hotkeys/Makefile.am b/plugins/hotkeys/Makefile.am
index 3468f2bd..8b89bfe6 100644
--- a/plugins/hotkeys/Makefile.am
+++ b/plugins/hotkeys/Makefile.am
@@ -1,7 +1,7 @@
if HAVE_HOTKEYS
hotkeysdir = $(libdir)/$(PACKAGE)
pkglib_LTLIBRARIES = hotkeys.la
-hotkeys_la_SOURCES = hotkeys.c hotkeys.h parser.c parser.h
+hotkeys_la_SOURCES = hotkeys.c hotkeys.h parser.c parser.h actionhandlers.c actionhandlers.h
hotkeys_la_LDFLAGS = -module
EXTRA_hotkeys_la_SOURCES = keysyms.inc
diff --git a/plugins/hotkeys/actionhandlers.c b/plugins/hotkeys/actionhandlers.c
index e7532345..820d925b 100644
--- a/plugins/hotkeys/actionhandlers.c
+++ b/plugins/hotkeys/actionhandlers.c
@@ -20,4 +20,17 @@
3. This notice may not be removed or altered from any source distribution.
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <string.h>
+#include "../../gettext.h"
+#include "../../deadbeef.h"
+
+extern DB_functions_t *deadbeef;
+
+int
+action_jump_to_current_handler (DB_plugin_action_t *act, int ctx) {
+ deadbeef->sendmessage (DB_EV_TRACKFOCUSCURRENT, 0, 0, 0);
+}
diff --git a/plugins/hotkeys/actionhandlers.h b/plugins/hotkeys/actionhandlers.h
index e37299fb..7be46151 100644
--- a/plugins/hotkeys/actionhandlers.h
+++ b/plugins/hotkeys/actionhandlers.h
@@ -22,4 +22,4 @@
*/
int
-action_deselect_all_handler (struct DB_plugin_action_s *action, int ctx);
+action_jump_to_current_handler (DB_plugin_action_t *act, int ctx);
diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c
index 451f1d4c..7ca57fe3 100644
--- a/plugins/hotkeys/hotkeys.c
+++ b/plugins/hotkeys/hotkeys.c
@@ -32,7 +32,7 @@
#define trace(fmt,...)
static DB_hotkeys_plugin_t plugin;
-static DB_functions_t *deadbeef;
+DB_functions_t *deadbeef;
static int finished;
static Display *disp;
static intptr_t loop_tid;
@@ -699,11 +699,11 @@ static DB_plugin_action_t action_reload_metadata = {
};
static DB_plugin_action_t action_jump_to_current = {
- .title = "Playback/[stub] Jump to currently playing track",
+ .title = "Playback/Jump to currently playing track",
.name = "jump_to_current_track",
.flags = DB_ACTION_COMMON,
- .callback = NULL,
- .next = NULL
+ .callback = action_jump_to_current_handler,
+ .next = &action_reload_metadata
};
static DB_plugin_action_t action_toggle_cursor_follows_playback = {