[vlc-devel] [PATCH 1/4] input: split INPUT_EVENT_ES in 3 events: ES_ADD, ES_DELETE, ES_SELECT
Felix Abecassis
felix.abecassis at gmail.com
Fri Jul 18 19:40:49 CEST 2014
---
include/vlc_input.h | 6 ++++--
modules/gui/macosx/intf.m | 4 +++-
modules/gui/qt4/input_manager.cpp | 4 +++-
modules/gui/skins2/src/vlcproc.cpp | 7 +++++--
src/input/event.c | 6 +++---
5 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/include/vlc_input.h b/include/vlc_input.h
index 88bfe65..d03e101 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -356,8 +356,10 @@ typedef enum input_event_type_e
/* A program ("program") has been added or removed or selected,
* or "program-scrambled" has changed.*/
INPUT_EVENT_PROGRAM,
- /* A ES has been added or removed or selected */
- INPUT_EVENT_ES,
+ /* A ES has been added, removed or selected */
+ INPUT_EVENT_ES_ADD,
+ INPUT_EVENT_ES_DELETE,
+ INPUT_EVENT_ES_SELECT,
/* "teletext-es" has changed */
INPUT_EVENT_TELETEXT,
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index fefe18d..fc1365e 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -326,7 +326,9 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
case INPUT_EVENT_STATISTICS:
[[[VLCMain sharedInstance] info] performSelectorOnMainThread:@selector(updateStatistics) withObject: nil waitUntilDone: NO];
break;
- case INPUT_EVENT_ES:
+ case INPUT_EVENT_ES_ADD:
+ case INPUT_EVENT_ES_DELETE:
+ case INPUT_EVENT_ES_SELECT:
break;
case INPUT_EVENT_TELETEXT:
break;
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index f72b3b3..de5d65e 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -351,7 +351,9 @@ static int InputEvent( vlc_object_t *p_this, const char *,
event = new IMEvent( IMEvent::ItemTitleChanged );
break;
- case INPUT_EVENT_ES:
+ case INPUT_EVENT_ES_ADD:
+ case INPUT_EVENT_ES_DELETE:
+ case INPUT_EVENT_ES_SELECT:
event = new IMEvent( IMEvent::ItemEsChanged );
break;
case INPUT_EVENT_TELETEXT:
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index dcf3b30..d79a0ff 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -411,7 +411,9 @@ int VlcProc::onGenericCallback2( vlc_object_t *pObj, const char *pVariable,
case INPUT_EVENT_STATE:
case INPUT_EVENT_POSITION:
case INPUT_EVENT_RATE:
- case INPUT_EVENT_ES:
+ case INPUT_EVENT_ES_ADD:
+ case INPUT_EVENT_ES_DELETE:
+ case INPUT_EVENT_ES_SELECT:
case INPUT_EVENT_CHAPTER:
case INPUT_EVENT_RECORD:
b_remove = true;
@@ -491,7 +493,8 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
break;
}
- case INPUT_EVENT_ES:
+ case INPUT_EVENT_ES_ADD:
+ case INPUT_EVENT_ES_DELETE:
{
// Do we have audio
vlc_value_t audio_es;
diff --git a/src/input/event.c b/src/input/event.c
index 453e04b..a467235 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -278,19 +278,19 @@ static const char *GetEsVarName( int i_cat )
void input_SendEventEsAdd( input_thread_t *p_input, int i_cat, int i_id, const char *psz_text )
{
if( i_cat != UNKNOWN_ES )
- VarListAdd( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES,
+ VarListAdd( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES_ADD,
i_id, psz_text );
}
void input_SendEventEsDel( input_thread_t *p_input, int i_cat, int i_id )
{
if( i_cat != UNKNOWN_ES )
- VarListDel( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES, i_id );
+ VarListDel( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES_DELETE, i_id );
}
/* i_id == -1 will unselect */
void input_SendEventEsSelect( input_thread_t *p_input, int i_cat, int i_id )
{
if( i_cat != UNKNOWN_ES )
- VarListSelect( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES, i_id );
+ VarListSelect( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES_SELECT, i_id );
}
void input_SendEventTeletextAdd( input_thread_t *p_input,
--
1.9.1
More information about the vlc-devel
mailing list