Commit cb3432ff authored by Laurent Aimar's avatar Laurent Aimar

New event (voutListChanged) in input manager.

It will be used to properly attach/detach the fullscreen controller
independantly of embed vout.
parent 9decc181
...@@ -127,6 +127,7 @@ void InputManager::delInput() ...@@ -127,6 +127,7 @@ void InputManager::delInput()
emit teletextPossible( false ); emit teletextPossible( false );
emit AtoBchanged( false, false ); emit AtoBchanged( false, false );
emit voutChanged( false ); emit voutChanged( false );
emit voutListChanged( NULL, 0 );
/* Reset all InfoPanels but stats */ /* Reset all InfoPanels but stats */
emit artChanged( NULL ); emit artChanged( NULL );
...@@ -154,7 +155,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -154,7 +155,8 @@ void InputManager::customEvent( QEvent *event )
i_type != InfoChanged_Type && i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type && i_type != SynchroChanged_Type &&
i_type != CachingEvent_Type && i_type != CachingEvent_Type &&
i_type != BookmarksChanged_Type ) i_type != BookmarksChanged_Type &&
i_type != InterfaceAoutUpdate_Type )
return; return;
if( i_type == CachingEvent_Type ) if( i_type == CachingEvent_Type )
...@@ -173,7 +175,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -173,7 +175,8 @@ void InputManager::customEvent( QEvent *event )
i_type != NameChanged_Type && i_type != NameChanged_Type &&
i_type != InfoChanged_Type && i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type && i_type != SynchroChanged_Type &&
i_type != BookmarksChanged_Type i_type != BookmarksChanged_Type &&
i_type != InterfaceAoutUpdate_Type
) )
&& ( i_input_id != ple->i_id ) ) && ( i_input_id != ple->i_id ) )
return; return;
...@@ -241,6 +244,9 @@ void InputManager::customEvent( QEvent *event ) ...@@ -241,6 +244,9 @@ void InputManager::customEvent( QEvent *event )
case BookmarksChanged_Type: case BookmarksChanged_Type:
emit bookmarksChanged(); emit bookmarksChanged();
break; break;
case InterfaceAoutUpdate_Type:
UpdateAout();
break;
default: default:
msg_Warn( p_intf, "This shouldn't happen: %i", i_type ); msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
} }
...@@ -299,12 +305,15 @@ static int InputEvent( vlc_object_t *p_this, const char *, ...@@ -299,12 +305,15 @@ static int InputEvent( vlc_object_t *p_this, const char *,
event = new IMEvent( ItemTeletextChanged_Type, 0 ); event = new IMEvent( ItemTeletextChanged_Type, 0 );
break; break;
case INPUT_EVENT_STATISTICS:
event = new IMEvent( StatisticsUpdate_Type, 0 );
break;
case INPUT_EVENT_VOUT: case INPUT_EVENT_VOUT:
event = new IMEvent( InterfaceVoutUpdate_Type, 0 ); event = new IMEvent( InterfaceVoutUpdate_Type, 0 );
break; break;
case INPUT_EVENT_AOUT:
case INPUT_EVENT_STATISTICS: event = new IMEvent( InterfaceAoutUpdate_Type, 0 );
event = new IMEvent( StatisticsUpdate_Type, 0 );
break; break;
case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */ case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */
...@@ -482,18 +491,37 @@ void InputManager::UpdateVout() ...@@ -482,18 +491,37 @@ void InputManager::UpdateVout()
{ {
if( hasInput() ) if( hasInput() )
{ {
bool b_old_video = b_video; /* Get current vout lists from input */
int i_vout;
vout_thread_t **pp_vout;
if( input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
{
i_vout = 0;
pp_vout = NULL;
}
/* */
emit voutListChanged( pp_vout, i_vout );
vlc_object_t *p_vout = (vlc_object_t*)vlc_object_find( p_input, /* */
VLC_OBJECT_VOUT, FIND_CHILD ); bool b_old_video = b_video;
b_video = p_vout != NULL; b_video = i_vout > 0;
if( p_vout )
vlc_object_release( p_vout );
if( !!b_old_video != !!b_video ) if( !!b_old_video != !!b_video )
emit voutChanged( b_video ); emit voutChanged( b_video );
/* Release the vout list */
for( int i = 0; i < i_vout; i++ )
vlc_object_release( (vlc_object_t*)pp_vout[i] );
free( pp_vout );
}
}
void InputManager::UpdateAout()
{
if( hasInput() )
{
/* TODO */
} }
} }
void InputManager::UpdateCaching() void InputManager::UpdateCaching()
{ {
float f_newCache = var_GetFloat( p_input, "cache" ); float f_newCache = var_GetFloat( p_input, "cache" );
......
...@@ -48,6 +48,7 @@ enum { ...@@ -48,6 +48,7 @@ enum {
ItemTeletextChanged_Type, ItemTeletextChanged_Type,
InterfaceVoutUpdate_Type, InterfaceVoutUpdate_Type,
StatisticsUpdate_Type, /*10*/ StatisticsUpdate_Type, /*10*/
InterfaceAoutUpdate_Type,
MetaChanged_Type, MetaChanged_Type,
NameChanged_Type, NameChanged_Type,
InfoChanged_Type, InfoChanged_Type,
...@@ -126,6 +127,7 @@ private: ...@@ -126,6 +127,7 @@ private:
void UpdateInfo(); void UpdateInfo();
void UpdateMeta(); void UpdateMeta();
void UpdateVout(); void UpdateVout();
void UpdateAout();
void UpdateStats(); void UpdateStats();
void UpdateCaching(); void UpdateCaching();
...@@ -182,6 +184,7 @@ signals: ...@@ -182,6 +184,7 @@ signals:
void synchroChanged(); void synchroChanged();
void bookmarksChanged(); void bookmarksChanged();
void cachingChanged( float ); void cachingChanged( float );
void voutListChanged( vout_thread_t **pp_vout, int i_vout );
}; };
class MainInputManager : public QObject class MainInputManager : public QObject
......
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