[vlc-commits] commit: lua extensions: use an enum and remove demuy declaration. ( Rémi Duraffort )
git at videolan.org
git at videolan.org
Mon Oct 11 21:19:04 CEST 2010
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Oct 11 20:06:02 2010 +0200| [2d0aee25f1cbe0279a9b72f437595ee1c5264c02] | committer: Rémi Duraffort
lua extensions: use an enum and remove demuy declaration.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d0aee25f1cbe0279a9b72f437595ee1c5264c02
---
modules/misc/lua/extension.h | 27 +++++++++++++--------------
modules/misc/lua/extension_thread.c | 4 ++--
2 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/modules/misc/lua/extension.h b/modules/misc/lua/extension.h
index eb54b38..7ac322f 100644
--- a/modules/misc/lua/extension.h
+++ b/modules/misc/lua/extension.h
@@ -27,19 +27,18 @@
#include <vlc_extensions.h>
#include <vlc_arrays.h>
-///< Array of extension_t
-TYPEDEF_ARRAY( extension_t, array_extension_t );
-
/* List of available commands */
-#define CMD_ACTIVATE 1
-#define CMD_DEACTIVATE 2
-#define CMD_TRIGGERMENU 3 /* Arg1 = int*, pointing to id to trigger. free */
-#define CMD_CLICK 4 /* Arg1 = extension_widget_t* */
-#define CMD_CLOSE 5
-#define CMD_SET_INPUT 6 /* No arg. Just signal current input changed */
-#define CMD_UPDATE_META 7 /* No arg. Just signal current input item meta
- * changed */
-#define CMD_PLAYING_CHANGED 8 /* Arg1 = int*, New playing status */
+typedef enum
+{
+ CMD_ACTIVATE = 1,
+ CMD_DEACTIVATE,
+ CMD_TRIGGERMENU, /* Arg1 = int*, pointing to id to trigger. free */
+ CMD_CLICK, /* Arg1 = extension_widget_t* */
+ CMD_CLOSE,
+ CMD_SET_INPUT, /* No arg. Just signal current input changed */
+ CMD_UPDATE_META, /* No arg. Just signal current input item meta changed */
+ CMD_PLAYING_CHANGED /* Arg1 = int*, New playing status */
+} command_type_e;
//Data types
typedef enum
@@ -83,7 +82,7 @@ struct extension_sys_t
/* Queue of commands to execute */
struct command_t
{
- int i_command;
+ command_type_e i_command;
void *data[10]; ///< Optional void* arguments
struct command_t *next; ///< Next command
} *command;
@@ -96,7 +95,7 @@ int Activate( extensions_manager_t *p_mgr, extension_t * );
bool IsActivated( extensions_manager_t *p_mgr, extension_t * );
int Deactivate( extensions_manager_t *p_mgr, extension_t * );
void WaitForDeactivation( extension_t *p_ext );
-int __PushCommand( extension_t *ext, bool unique, int cmd, va_list options );
+int __PushCommand( extension_t *ext, bool unique, command_type_e cmd, va_list options );
static inline int PushCommand( extension_t *ext, int cmd, ... )
{
va_list args;
diff --git a/modules/misc/lua/extension_thread.c b/modules/misc/lua/extension_thread.c
index 78a2608..318eb74 100644
--- a/modules/misc/lua/extension_thread.c
+++ b/modules/misc/lua/extension_thread.c
@@ -207,7 +207,7 @@ void WaitForDeactivation( extension_t *p_ext )
}
/** Push a UI command */
-int __PushCommand( extension_t *p_ext, bool b_unique, int i_command,
+int __PushCommand( extension_t *p_ext, bool b_unique, command_type_e i_command,
va_list args )
{
vlc_mutex_lock( &p_ext->p_sys->command_lock );
@@ -319,7 +319,7 @@ static void* Run( void *data )
{
if( lua_ExecuteFunction( p_mgr, p_ext, "activate", LUA_END ) < 0 )
{
- msg_Dbg( p_mgr, "Could not activate extension!" );
+ msg_Err( p_mgr, "Could not activate extension!" );
Deactivate( p_mgr, p_ext );
cmd = NULL;
}
More information about the vlc-commits
mailing list