From dae6ed6ac77ae5e98496189f3a7d70d883245156 Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 18 Nov 2012 21:36:26 +0100 Subject: hotkeys: jump to current --- plugins/hotkeys/Makefile.am | 2 +- plugins/hotkeys/actionhandlers.c | 13 +++++++++++++ plugins/hotkeys/actionhandlers.h | 2 +- plugins/hotkeys/hotkeys.c | 8 ++++---- 4 files changed, 19 insertions(+), 6 deletions(-) (limited to 'plugins/hotkeys') 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 +#endif +#include +#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 = { -- cgit v1.2.3