Commit 788d2256 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: extension: reindent

parent 7031f81c
......@@ -340,95 +340,92 @@ static void* Run( void *data )
vlc_restorecancel( cancel );
/* Run command */
if( true )
if( LockExtension( p_ext ) )
{
if( LockExtension( p_ext ) )
mutex_cleanup_push( &p_ext->p_sys->running_lock );
switch( cmd->i_command )
{
mutex_cleanup_push( &p_ext->p_sys->running_lock );
switch( cmd->i_command )
case CMD_ACTIVATE:
{
case CMD_ACTIVATE:
if( lua_ExecuteFunction( p_mgr, p_ext, "activate", LUA_END ) < 0 )
{
if( lua_ExecuteFunction( p_mgr, p_ext, "activate", LUA_END ) < 0 )
{
msg_Err( p_mgr, "Could not activate extension!" );
Deactivate( p_mgr, p_ext );
}
break;
msg_Err( p_mgr, "Could not activate extension!" );
Deactivate( p_mgr, p_ext );
}
break;
}
case CMD_DEACTIVATE:
case CMD_DEACTIVATE:
{
msg_Dbg( p_mgr, "Deactivating '%s'", p_ext->psz_title );
if( lua_ExtensionDeactivate( p_mgr, p_ext ) < 0 )
{
msg_Dbg( p_mgr, "Deactivating '%s'", p_ext->psz_title );
if( lua_ExtensionDeactivate( p_mgr, p_ext ) < 0 )
{
msg_Warn( p_mgr, "Extension '%s' did not deactivate properly",
p_ext->psz_title );
}
p_ext->p_sys->b_exiting = true;
RemoveActivated( p_mgr, p_ext );
break;
msg_Warn( p_mgr, "Extension '%s' did not deactivate properly",
p_ext->psz_title );
}
p_ext->p_sys->b_exiting = true;
RemoveActivated( p_mgr, p_ext );
break;
}
case CMD_CLOSE:
{
lua_ExecuteFunction( p_mgr, p_ext, "close", LUA_END );
break;
}
case CMD_CLOSE:
{
lua_ExecuteFunction( p_mgr, p_ext, "close", LUA_END );
break;
}
case CMD_CLICK:
case CMD_CLICK:
{
extension_widget_t *p_widget = cmd->data[0];
assert( p_widget );
msg_Dbg( p_mgr, "Clicking '%s': '%s'",
p_ext->psz_name, p_widget->psz_text );
if( !lua_ExtensionWidgetClick( p_mgr, p_ext, p_widget )
< 0 )
{
extension_widget_t *p_widget = cmd->data[0];
assert( p_widget );
msg_Dbg( p_mgr, "Clicking '%s': '%s'",
p_ext->psz_name, p_widget->psz_text );
if( !lua_ExtensionWidgetClick( p_mgr, p_ext, p_widget )
< 0 )
{
msg_Warn( p_mgr, "Could not translate click" );
}
break;
msg_Warn( p_mgr, "Could not translate click" );
}
break;
}
case CMD_TRIGGERMENU:
{
int *pi_id = cmd->data[0];
assert( pi_id );
msg_Dbg( p_mgr, "Trigger menu %d of '%s'",
*pi_id, p_ext->psz_name );
lua_ExtensionTriggerMenu( p_mgr, p_ext, *pi_id );
break;
}
case CMD_TRIGGERMENU:
{
int *pi_id = cmd->data[0];
assert( pi_id );
msg_Dbg( p_mgr, "Trigger menu %d of '%s'",
*pi_id, p_ext->psz_name );
lua_ExtensionTriggerMenu( p_mgr, p_ext, *pi_id );
break;
}
case CMD_SET_INPUT:
{
lua_ExecuteFunction( p_mgr, p_ext, "input_changed", LUA_END );
break;
}
case CMD_SET_INPUT:
{
lua_ExecuteFunction( p_mgr, p_ext, "input_changed", LUA_END );
break;
}
case CMD_UPDATE_META:
{
lua_ExecuteFunction( p_mgr, p_ext, "meta_changed", LUA_END );
break;
}
case CMD_UPDATE_META:
{
lua_ExecuteFunction( p_mgr, p_ext, "meta_changed", LUA_END );
break;
}
case CMD_PLAYING_CHANGED:
{
lua_ExecuteFunction( p_mgr, p_ext, "playing_changed",
LUA_NUM, *((int *)cmd->data[0]), LUA_END );
break;
}
case CMD_PLAYING_CHANGED:
{
lua_ExecuteFunction( p_mgr, p_ext, "playing_changed",
LUA_NUM, *((int *)cmd->data[0]), LUA_END );
break;
}
default:
{
msg_Dbg( p_mgr, "Unknown command in extension command queue: %d",
cmd->i_command );
break;
}
default:
{
msg_Dbg( p_mgr, "Unknown command in extension command queue: %d",
cmd->i_command );
break;
}
vlc_cleanup_pop();
UnlockExtension( p_ext );
}
vlc_cleanup_pop();
UnlockExtension( p_ext );
}
FreeCommands( cmd );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment