Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
eeda6528
Commit
eeda6528
authored
Feb 08, 2010
by
Srikanth Raju
Committed by
Jean-Philippe André
Feb 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: Add new callback playing_changed for playing status changes
Signed-off-by:
Jean-Philippe André
<
jpeg@videolan.org
>
parent
31d2afee
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1 deletion
+44
-1
include/vlc_extensions.h
include/vlc_extensions.h
+8
-0
modules/misc/lua/extension.c
modules/misc/lua/extension.c
+14
-1
modules/misc/lua/extension.h
modules/misc/lua/extension.h
+1
-0
modules/misc/lua/extension_thread.c
modules/misc/lua/extension_thread.c
+21
-0
No files found.
include/vlc_extensions.h
View file @
eeda6528
...
...
@@ -75,6 +75,7 @@ enum
EXTENSION_TRIGGER
,
/**< arg1: extension_t* */
EXTENSION_TRIGGER_MENU
,
/**< arg1: extension_t*, int (uint16_t) */
EXTENSION_SET_INPUT
,
/**< arg1: extension_t*, arg2 (input_thread_t) */
EXTENSION_PLAYING_CHANGED
,
/**< arg1: extension_t*, arg2 int( playing status ) */
};
/**
...
...
@@ -153,6 +154,13 @@ static inline int extension_SetInput( extensions_manager_t *p_mgr,
return
extension_Control
(
p_mgr
,
EXTENSION_SET_INPUT
,
p_ext
,
p_input
);
}
static
inline
int
extension_PlayingChanged
(
extensions_manager_t
*
p_mgr
,
extension_t
*
p_ext
,
int
state
)
{
return
extension_Control
(
p_mgr
,
EXTENSION_PLAYING_CHANGED
,
p_ext
,
state
);
}
/** Can this extension only be triggered but not activated?
Not compatible with HasMenu */
#define extension_TriggerOnly( mgr, ext ) \
...
...
modules/misc/lua/extension.c
View file @
eeda6528
...
...
@@ -43,12 +43,14 @@ static const luaL_Reg p_reg[] =
#define EXT_TRIGGER_ONLY (1 << 1) ///< Hook: trigger. Not activable
#define EXT_INPUT_LISTENER (1 << 2) ///< Hook: input_changed
#define EXT_META_LISTENER (1 << 3) ///< Hook: meta_changed
#define EXT_PLAYING_LISTENER (1 << 4) ///< Hook: status_changed
const
char
*
const
ppsz_capabilities
[]
=
{
"menu"
,
"trigger"
,
"input-listener"
,
"meta-listener"
,
"playing-listener"
,
NULL
};
...
...
@@ -529,7 +531,18 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
UnlockExtension
(
p_ext
);
break
;
}
case
EXTENSION_PLAYING_CHANGED
:
{
extension_t
*
p_ext
;
p_ext
=
(
extension_t
*
)
va_arg
(
args
,
extension_t
*
);
assert
(
p_ext
->
psz_name
!=
NULL
);
i
=
(
int
)
va_arg
(
args
,
int
);
if
(
p_ext
->
p_sys
->
i_capabilities
&
EXT_PLAYING_LISTENER
)
{
PushCommand
(
p_ext
,
CMD_PLAYING_CHANGED
,
i
);
}
break
;
}
default:
msg_Warn
(
p_mgr
,
"Control '%d' not yet implemented in Extension"
,
i_control
);
...
...
modules/misc/lua/extension.h
View file @
eeda6528
...
...
@@ -39,6 +39,7 @@ TYPEDEF_ARRAY( extension_t, array_extension_t );
#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 */
//Data types
typedef
enum
...
...
modules/misc/lua/extension_thread.c
View file @
eeda6528
...
...
@@ -122,6 +122,7 @@ static void FreeCommands( struct command_t *command )
break
;
case
CMD_TRIGGERMENU
:
case
CMD_PLAYING_CHANGED
:
free
(
command
->
data
[
0
]
);
// Arg1 is int*, to free
break
;
...
...
@@ -228,6 +229,19 @@ int __PushCommand( extension_t *p_ext, bool b_unique, int i_command,
cmd
->
data
[
0
]
=
pi
;
}
break
;
case
CMD_PLAYING_CHANGED
:
{
int
*
pi
=
malloc
(
sizeof
(
int
)
);
if
(
!
pi
)
{
free
(
cmd
);
vlc_mutex_unlock
(
&
p_ext
->
p_sys
->
command_lock
);
return
VLC_ENOMEM
;
}
*
pi
=
va_arg
(
args
,
int
);
cmd
->
data
[
0
]
=
pi
;
}
break
;
case
CMD_CLOSE
:
case
CMD_SET_INPUT
:
case
CMD_UPDATE_META
:
...
...
@@ -362,6 +376,13 @@ static void* Run( void *data )
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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment