Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1a082467
Commit
1a082467
authored
Feb 13, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorized event with variable list code.
parent
0de3c723
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
62 deletions
+68
-62
src/input/event.c
src/input/event.c
+68
-62
No files found.
src/input/event.c
View file @
1a082467
...
@@ -34,7 +34,17 @@
...
@@ -34,7 +34,17 @@
#include "event.h"
#include "event.h"
#include <assert.h>
#include <assert.h>
static
void
Trigger
(
input_thread_t
*
p_input
,
int
i_type
);
/* */
static
void
Trigger
(
input_thread_t
*
,
int
i_type
);
static
void
VarListAdd
(
input_thread_t
*
,
const
char
*
psz_variable
,
int
i_event
,
int
i_value
,
const
char
*
psz_text
);
static
void
VarListDel
(
input_thread_t
*
,
const
char
*
psz_variable
,
int
i_event
,
int
i_value
);
static
void
VarListSelect
(
input_thread_t
*
,
const
char
*
psz_variable
,
int
i_event
,
int
i_value
);
/*****************************************************************************
/*****************************************************************************
* Event for input.c
* Event for input.c
...
@@ -211,34 +221,15 @@ void input_SendEventMetaName( input_thread_t *p_input, const char *psz_name )
...
@@ -211,34 +221,15 @@ void input_SendEventMetaName( input_thread_t *p_input, const char *psz_name )
void
input_SendEventProgramAdd
(
input_thread_t
*
p_input
,
void
input_SendEventProgramAdd
(
input_thread_t
*
p_input
,
int
i_program
,
const
char
*
psz_text
)
int
i_program
,
const
char
*
psz_text
)
{
{
vlc_value_t
val
;
VarListAdd
(
p_input
,
"program"
,
INPUT_EVENT_PROGRAM
,
i_program
,
psz_text
);
vlc_value_t
text
;
val
.
i_int
=
i_program
;
text
.
psz_string
=
(
char
*
)
psz_text
;
var_Change
(
p_input
,
"program"
,
VLC_VAR_ADDCHOICE
,
&
val
,
psz_text
?
&
text
:
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_PROGRAM
);
}
}
void
input_SendEventProgramDel
(
input_thread_t
*
p_input
,
int
i_program
)
void
input_SendEventProgramDel
(
input_thread_t
*
p_input
,
int
i_program
)
{
{
vlc_value_t
val
;
VarListDel
(
p_input
,
"program"
,
INPUT_EVENT_PROGRAM
,
i_program
);
val
.
i_int
=
i_program
;
var_Change
(
p_input
,
"program"
,
VLC_VAR_DELCHOICE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_PROGRAM
);
}
}
void
input_SendEventProgramSelect
(
input_thread_t
*
p_input
,
int
i_program
)
void
input_SendEventProgramSelect
(
input_thread_t
*
p_input
,
int
i_program
)
{
{
vlc_value_t
val
;
VarListSelect
(
p_input
,
"program"
,
INPUT_EVENT_PROGRAM
,
i_program
);
val
.
i_int
=
i_program
;
var_Change
(
p_input
,
"program"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_PROGRAM
);
}
}
static
const
char
*
GetEsVarName
(
int
i_cat
)
static
const
char
*
GetEsVarName
(
int
i_cat
)
...
@@ -256,52 +247,20 @@ static const char *GetEsVarName( int i_cat )
...
@@ -256,52 +247,20 @@ static const char *GetEsVarName( int i_cat )
}
}
void
input_SendEventEsDel
(
input_thread_t
*
p_input
,
int
i_cat
,
int
i_id
)
void
input_SendEventEsDel
(
input_thread_t
*
p_input
,
int
i_cat
,
int
i_id
)
{
{
vlc_value_t
val
;
if
(
i_cat
!=
UNKNOWN_ES
)
VarListDel
(
p_input
,
GetEsVarName
(
i_cat
),
INPUT_EVENT_ES
,
i_id
);
if
(
i_cat
==
UNKNOWN_ES
)
return
;
if
(
i_id
>=
0
)
{
val
.
i_int
=
i_id
;
var_Change
(
p_input
,
GetEsVarName
(
i_cat
),
VLC_VAR_DELCHOICE
,
&
val
,
NULL
);
}
else
{
var_Change
(
p_input
,
GetEsVarName
(
i_cat
),
VLC_VAR_CLEARCHOICES
,
NULL
,
NULL
);
}
Trigger
(
p_input
,
INPUT_EVENT_ES
);
}
}
void
input_SendEventEsAdd
(
input_thread_t
*
p_input
,
int
i_cat
,
int
i_id
,
const
char
*
psz_text
)
void
input_SendEventEsAdd
(
input_thread_t
*
p_input
,
int
i_cat
,
int
i_id
,
const
char
*
psz_text
)
{
{
vlc_value_t
val
;
if
(
i_cat
!=
UNKNOWN_ES
)
vlc_value_t
text
;
VarListAdd
(
p_input
,
GetEsVarName
(
i_cat
),
INPUT_EVENT_ES
,
i_id
,
psz_text
);
if
(
i_cat
==
UNKNOWN_ES
)
return
;
val
.
i_int
=
i_id
;
text
.
psz_string
=
(
char
*
)
psz_text
;
var_Change
(
p_input
,
GetEsVarName
(
i_cat
),
VLC_VAR_ADDCHOICE
,
&
val
,
psz_text
?
&
text
:
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_ES
);
}
}
/* i_id == -1 will unselect */
/* i_id == -1 will unselect */
void
input_SendEventEsSelect
(
input_thread_t
*
p_input
,
int
i_cat
,
int
i_id
)
void
input_SendEventEsSelect
(
input_thread_t
*
p_input
,
int
i_cat
,
int
i_id
)
{
{
vlc_value_t
val
;
if
(
i_cat
!=
UNKNOWN_ES
)
VarListSelect
(
p_input
,
GetEsVarName
(
i_cat
),
INPUT_EVENT_ES
,
i_id
);
if
(
i_cat
==
UNKNOWN_ES
)
return
;
val
.
i_int
=
i_id
;
var_Change
(
p_input
,
GetEsVarName
(
i_cat
),
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_ES
);
}
}
void
input_SendEventTeletext
(
input_thread_t
*
p_input
,
int
i_id
)
void
input_SendEventTeletext
(
input_thread_t
*
p_input
,
int
i_id
)
...
@@ -312,6 +271,7 @@ void input_SendEventTeletext( input_thread_t *p_input, int i_id )
...
@@ -312,6 +271,7 @@ void input_SendEventTeletext( input_thread_t *p_input, int i_id )
var_Change
(
p_input
,
"teletext-es"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
var_Change
(
p_input
,
"teletext-es"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_TELETEXT
);
Trigger
(
p_input
,
INPUT_EVENT_TELETEXT
);
}
}
void
input_SendEventVout
(
input_thread_t
*
p_input
)
void
input_SendEventVout
(
input_thread_t
*
p_input
)
...
@@ -339,3 +299,49 @@ static void Trigger( input_thread_t *p_input, int i_type )
...
@@ -339,3 +299,49 @@ static void Trigger( input_thread_t *p_input, int i_type )
{
{
var_SetInteger
(
p_input
,
"intf-event"
,
i_type
);
var_SetInteger
(
p_input
,
"intf-event"
,
i_type
);
}
}
static
void
VarListAdd
(
input_thread_t
*
p_input
,
const
char
*
psz_variable
,
int
i_event
,
int
i_value
,
const
char
*
psz_text
)
{
vlc_value_t
val
;
vlc_value_t
text
;
val
.
i_int
=
i_value
;
text
.
psz_string
=
(
char
*
)
psz_text
;
var_Change
(
p_input
,
psz_variable
,
VLC_VAR_ADDCHOICE
,
&
val
,
psz_text
?
&
text
:
NULL
);
Trigger
(
p_input
,
i_event
);
}
static
void
VarListDel
(
input_thread_t
*
p_input
,
const
char
*
psz_variable
,
int
i_event
,
int
i_value
)
{
vlc_value_t
val
;
if
(
i_value
>=
0
)
{
val
.
i_int
=
i_value
;
var_Change
(
p_input
,
psz_variable
,
VLC_VAR_DELCHOICE
,
&
val
,
NULL
);
}
else
{
var_Change
(
p_input
,
psz_variable
,
VLC_VAR_CLEARCHOICES
,
&
val
,
NULL
);
}
Trigger
(
p_input
,
i_event
);
}
static
void
VarListSelect
(
input_thread_t
*
p_input
,
const
char
*
psz_variable
,
int
i_event
,
int
i_value
)
{
vlc_value_t
val
;
val
.
i_int
=
i_value
;
var_Change
(
p_input
,
psz_variable
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
i_event
);
}
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