diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2012-03-03 07:10:56 -0500 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2012-03-03 07:10:56 -0500 |
| commit | f688710707f3af56a5949b8ae3957c9408b25392 (patch) | |
| tree | 5e0a15f00d66337123406c09c207f531a4c18eca /apps | |
| parent | a92696d40d3515d4391ffba043894ebbad80cab6 (diff) | |
| download | rockbox-f688710707f3af56a5949b8ae3957c9408b25392.zip rockbox-f688710707f3af56a5949b8ae3957c9408b25392.tar.gz rockbox-f688710707f3af56a5949b8ae3957c9408b25392.tar.bz2 rockbox-f688710707f3af56a5949b8ae3957c9408b25392.tar.xz | |
Change keyclick_click so that it may accept raw buttons or actions.
Adds a new context, CONTEXT_RAWBUTTON, that I hope is out of the way
of everything. Unfortunately have to increment min plugin API version
for the second time today to accomodate additional parameter.
Change-Id: Iaa46b926e57cf377fd4906f2d42bb98e87215033
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/action.c | 2 | ||||
| -rw-r--r-- | apps/action.h | 5 | ||||
| -rw-r--r-- | apps/misc.c | 8 | ||||
| -rw-r--r-- | apps/misc.h | 2 | ||||
| -rw-r--r-- | apps/plugin.h | 6 | ||||
| -rw-r--r-- | apps/plugins/mpegplayer/mpeg_misc.c | 2 |
6 files changed, 16 insertions, 9 deletions
diff --git a/apps/action.c b/apps/action.c index 3747a75..69089d1 100644 --- a/apps/action.c +++ b/apps/action.c @@ -368,7 +368,7 @@ static int get_action_worker(int context, int timeout, #if CONFIG_CODEC == SWCODEC /* Produce keyclick */ - keyclick_click(ret); + keyclick_click(0, ret); #endif return ret; diff --git a/apps/action.h b/apps/action.h index e46e4a6..1bffed3 100644 --- a/apps/action.h +++ b/apps/action.h @@ -42,6 +42,11 @@ #define ALLOW_SOFTLOCK 0 #endif +#define CONTEXT_RAWBUTTON 0x04000000 /* For passing raw button code to + functions that normally take + action codes + (ie. keyclick_click) */ + enum { CONTEXT_STD = 0, /* These CONTEXT_ values were here before me, diff --git a/apps/misc.c b/apps/misc.c index 3fe330b..78ee154 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -887,13 +887,15 @@ void keyclick_set_callback(keyclick_callback cb, void* data) } /* Produce keyclick based upon button and global settings */ -void keyclick_click(int action) +void keyclick_click(int context, int action) { - int button; + int button = action; static long last_button = BUTTON_NONE; bool do_beep = false; - get_action_statuscode(&button); + if (!(context & CONTEXT_RAWBUTTON)) + get_action_statuscode(&button); + /* Settings filters */ if ( #ifdef HAVE_HARDWARE_CLICK diff --git a/apps/misc.h b/apps/misc.h index a3d9ffd..4ae7c19 100644 --- a/apps/misc.h +++ b/apps/misc.h @@ -148,7 +148,7 @@ void system_sound_play(enum system_sound sound); typedef bool (*keyclick_callback)(int action, void* data); void keyclick_set_callback(keyclick_callback cb, void* data); /* Produce keyclick based upon button and global settings */ -void keyclick_click(int action); +void keyclick_click(int context, int action); #endif /* CONFIG_CODEC == SWCODEC */ void push_current_activity(enum current_activity screen); diff --git a/apps/plugin.h b/apps/plugin.h index e07ec92..bddf23b 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -153,12 +153,12 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 217 +#define PLUGIN_API_VERSION 218 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 217 +#define PLUGIN_MIN_API_VERSION 218 /* plugin return codes */ /* internal returns start at 0x100 to make exit(1..255) work */ @@ -705,7 +705,7 @@ struct plugin_api { size_t (*mixer_channel_get_bytes_waiting)(enum pcm_mixer_channel channel); void (*system_sound_play)(enum system_sound sound); - void (*keyclick_click)(int button); + void (*keyclick_click)(int context, int action); #endif /* CONFIG_CODEC == SWCODC */ /* playback control */ diff --git a/apps/plugins/mpegplayer/mpeg_misc.c b/apps/plugins/mpegplayer/mpeg_misc.c index 895fbe0..cbaca70 100644 --- a/apps/plugins/mpegplayer/mpeg_misc.c +++ b/apps/plugins/mpegplayer/mpeg_misc.c @@ -216,7 +216,7 @@ int mpeg_button_get(int timeout) rb->button_get_w_tmo(timeout); /* Produce keyclick */ - rb->keyclick_click(button); + rb->keyclick_click(CONTEXT_RAWBUTTON, button); return mpeg_sysevent_callback(button, NULL); } |