[vlc-commits] Rename vlc_key_t to vlc_action_t
Rémi Denis-Courmont
git at videolan.org
Wed May 4 11:43:19 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 4 12:42:24 2011 +0300| [061648407e0f6fe93a63c3aa214bf315a4d612a7] | committer: Rémi Denis-Courmont
Rename vlc_key_t to vlc_action_t
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=061648407e0f6fe93a63c3aa214bf315a4d612a7
---
include/vlc_keys.h | 6 +++---
modules/control/globalhotkeys/win32.c | 2 +-
modules/control/lirc.c | 2 +-
modules/lua/libs/misc.c | 2 +-
src/config/keys.c | 17 +++++++++++------
src/control/media_player.c | 4 ++--
6 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/include/vlc_keys.h b/include/vlc_keys.h
index 01c59b0..c3a79da 100644
--- a/include/vlc_keys.h
+++ b/include/vlc_keys.h
@@ -89,7 +89,7 @@
VLC_EXPORT( char *, vlc_keycode2str, (uint_fast32_t i_key) ) LIBVLC_USED;
VLC_EXPORT( uint_fast32_t, vlc_str2keycode, (const char *str) ) LIBVLC_USED;
-typedef enum vlc_key {
+typedef enum vlc_action {
ACTIONID_NONE = 0,
ACTIONID_QUIT,
ACTIONID_PLAY_PAUSE,
@@ -200,9 +200,9 @@ typedef enum vlc_key {
ACTIONID_RATE_SLOWER_FINE,
ACTIONID_RATE_FASTER_FINE,
-} vlc_key_t;
+} vlc_action_t;
-VLC_EXPORT( vlc_key_t, vlc_GetActionId, (const char *psz_key) ) LIBVLC_USED;
+VLC_EXPORT( vlc_action_t, vlc_GetActionId, (const char *psz_key) ) LIBVLC_USED;
struct hotkey
{
diff --git a/modules/control/globalhotkeys/win32.c b/modules/control/globalhotkeys/win32.c
index fa458ed..a5f4a86 100644
--- a/modules/control/globalhotkeys/win32.c
+++ b/modules/control/globalhotkeys/win32.c
@@ -304,7 +304,7 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
return 0;
/* search for key associated with VLC */
- vlc_key_t action = vlc_GetActionId( psz_atomName );
+ vlc_action_t action = vlc_GetActionId( psz_atomName );
if( action != ACTIONID_NONE )
{
var_SetInteger( p_intf->p_libvlc,
diff --git a/modules/control/lirc.c b/modules/control/lirc.c
index e8c4780..03e15ae 100644
--- a/modules/control/lirc.c
+++ b/modules/control/lirc.c
@@ -186,7 +186,7 @@ static void Process( intf_thread_t *p_intf )
{
if( !strncmp( "key-", c, 4 ) )
{
- vlc_key_t i_key = vlc_GetActionId( c );
+ vlc_action_t i_key = vlc_GetActionId( c );
if( i_key )
var_SetInteger( p_intf->p_libvlc, "key-action", i_key );
else
diff --git a/modules/lua/libs/misc.c b/modules/lua/libs/misc.c
index b0a6695..f98d28a 100644
--- a/modules/lua/libs/misc.c
+++ b/modules/lua/libs/misc.c
@@ -237,7 +237,7 @@ static int vlclua_intf_should_die( lua_State *L )
static int vlclua_action_id( lua_State *L )
{
- vlc_key_t i_key = vlc_GetActionId( luaL_checkstring( L, 1 ) );
+ vlc_action_t i_key = vlc_GetActionId( luaL_checkstring( L, 1 ) );
if (i_key == 0)
return 0;
lua_pushnumber( L, i_key );
diff --git a/src/config/keys.c b/src/config/keys.c
index 5c2f8d5..a03ff46 100644
--- a/src/config/keys.c
+++ b/src/config/keys.c
@@ -230,7 +230,7 @@ found:
struct action
{
char name[MAXACTION];
- vlc_key_t value;
+ vlc_action_t value;
};
static const struct action actions[] =
@@ -341,8 +341,8 @@ static const struct action actions[] =
struct mapping
{
- uint32_t key; ///< Key code
- vlc_key_t action; ///< Action ID
+ uint32_t key; ///< Key code
+ vlc_action_t action; ///< Action ID
};
static int keycmp (const void *a, const void *b)
@@ -379,9 +379,14 @@ static int vlc_key_to_action (vlc_object_t *obj, const char *varname,
return var_SetInteger (obj, "key-action", (*pent)->action);
}
-
+/**
+ * Sets up all key mappings for a given action.
+ * \param map tree (of struct mapping entries) to write mappings to
+ * \param confname VLC configuration item to read mappings from
+ * \param action action ID
+ */
static void vlc_MapAction (vlc_object_t *obj, void **map,
- const char *confname, vlc_key_t action)
+ const char *confname, vlc_action_t action)
{
char *keys = var_InheritString (obj, confname);
if (keys == NULL)
@@ -496,7 +501,7 @@ static int actcmp(const void *key, const void *ent)
* Get the action ID from the action name in the configuration subsystem.
* @return the action ID or ACTIONID_NONE on error.
*/
-vlc_key_t vlc_GetActionId(const char *name)
+vlc_action_t vlc_GetActionId (const char *name)
{
const struct action *act;
diff --git a/src/control/media_player.c b/src/control/media_player.c
index 333d32a..ba1215c 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -43,9 +43,9 @@
#include "media_player_internal.h"
/*
- * mapping of libvlc_navigate_mode_t to vlc_key_t
+ * mapping of libvlc_navigate_mode_t to vlc_action_t
*/
-static const vlc_key_t libvlc_navigate_to_action[] =
+static const vlc_action_t libvlc_navigate_to_action[] =
{
ACTIONID_NAV_ACTIVATE,
ACTIONID_NAV_UP,
More information about the vlc-commits
mailing list