Commit 7b001a2b authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: input manager updates. Remove some events with the core changes.

This is unfinished work.
parent 05d3d3a1
...@@ -80,7 +80,7 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -80,7 +80,7 @@ void InputManager::setInput( input_thread_t *_p_input )
{ {
vlc_object_hold( p_input ); vlc_object_hold( p_input );
emit statusChanged( PLAYING_S ); emit statusChanged( PLAYING_S );
UpdateMeta(); UpdateName();
UpdateArt(); UpdateArt();
UpdateTeletext(); UpdateTeletext();
UpdateNavigation(); UpdateNavigation();
...@@ -117,6 +117,8 @@ void InputManager::delInput() ...@@ -117,6 +117,8 @@ void InputManager::delInput()
emit artChanged( NULL ); emit artChanged( NULL );
emit rateChanged( INPUT_RATE_DEFAULT ); emit rateChanged( INPUT_RATE_DEFAULT );
emit voutChanged( false ); emit voutChanged( false );
emit chapterChanged( 0 );
emit titleChanged( 0 );
vlc_object_release( p_input ); vlc_object_release( p_input );
p_input = NULL; p_input = NULL;
UpdateTeletext(); UpdateTeletext();
...@@ -150,7 +152,9 @@ void InputManager::customEvent( QEvent *event ) ...@@ -150,7 +152,9 @@ void InputManager::customEvent( QEvent *event )
i_type != ItemStateChanged_Type && i_type != ItemStateChanged_Type &&
i_type != StatisticsUpdate_Type && i_type != StatisticsUpdate_Type &&
i_type != InterfaceVoutUpdate_Type && i_type != InterfaceVoutUpdate_Type &&
i_type != MetaChanged_Type ) i_type != MetaChanged_Type &&
i_type != NameChanged_Type &&
i_type != InfoChanged_Type )
return; return;
if( !hasInput() ) return; if( !hasInput() ) return;
...@@ -162,7 +166,9 @@ void InputManager::customEvent( QEvent *event ) ...@@ -162,7 +166,9 @@ void InputManager::customEvent( QEvent *event )
i_type != ItemStateChanged_Type && i_type != ItemStateChanged_Type &&
i_type != StatisticsUpdate_Type && i_type != StatisticsUpdate_Type &&
i_type != InterfaceVoutUpdate_Type && i_type != InterfaceVoutUpdate_Type &&
i_type != MetaChanged_Type i_type != MetaChanged_Type &&
i_type != NameChanged_Type &&
i_type != InfoChanged_Type
) )
&& ( i_input_id != ple->i_id ) ) && ( i_input_id != ple->i_id ) )
return; return;
...@@ -181,29 +187,37 @@ void InputManager::customEvent( QEvent *event ) ...@@ -181,29 +187,37 @@ void InputManager::customEvent( QEvent *event )
UpdateStats(); UpdateStats();
break; break;
case ItemChanged_Type: case ItemChanged_Type:
UpdateMeta();
UpdateStatus(); UpdateStatus();
UpdateArt(); // UpdateName();
// UpdateArt();
break;
case ItemStateChanged_Type:
// TODO: Fusion with above state
UpdateStatus();
// UpdateName();
// UpdateNavigation(); This shouldn't be useful now
// UpdateTeletext(); Same
break;
case NameChanged_Type:
UpdateName();
break; break;
case MetaChanged_Type: case MetaChanged_Type:
UpdateMeta(); UpdateName(); /* Needed for NowPlaying */
// UpdateMeta();
UpdateArt(); UpdateArt();
break; break;
case ItemStateChanged_Type: case InfoChanged_Type:
UpdateStatus(); // UpdateInfo();
UpdateNavigation();
UpdateMeta();
UpdateTeletext();
break; break;
case ItemTitleChanged_Type: case ItemTitleChanged_Type:
UpdateNavigation(); UpdateNavigation();
UpdateMeta(); UpdateName(); /* Display the name of the Chapter */
break; break;
case ItemRateChanged_Type: case ItemRateChanged_Type:
UpdateRate(); UpdateRate();
break; break;
case ItemEsChanged_Type: case ItemEsChanged_Type:
UpdateSPU(); // We don't do anything. Why ?
break; break;
case ItemTeletextChanged_Type: case ItemTeletextChanged_Type:
UpdateTeletext(); UpdateTeletext();
...@@ -276,7 +290,7 @@ void InputManager::UpdateRate() ...@@ -276,7 +290,7 @@ void InputManager::UpdateRate()
} }
} }
void InputManager::UpdateMeta() void InputManager::UpdateName()
{ {
/* Update text, name and nowplaying */ /* Update text, name and nowplaying */
QString text; QString text;
...@@ -323,7 +337,7 @@ void InputManager::UpdateMeta() ...@@ -323,7 +337,7 @@ void InputManager::UpdateMeta()
if( oldName != text ) if( oldName != text )
{ {
emit nameChanged( text ); emit nameChanged( text );
oldName=text; oldName = text;
} }
} }
...@@ -338,11 +352,6 @@ bool InputManager::hasAudio() ...@@ -338,11 +352,6 @@ bool InputManager::hasAudio()
return false; return false;
} }
void InputManager::UpdateSPU()
{
UpdateTeletext();
}
void InputManager::UpdateTeletext() void InputManager::UpdateTeletext()
{ {
if( hasInput() ) if( hasInput() )
...@@ -745,7 +754,7 @@ static int InputEvent( vlc_object_t *p_this, const char *, ...@@ -745,7 +754,7 @@ static int InputEvent( vlc_object_t *p_this, const char *,
break; break;
case INPUT_EVENT_TITLE: case INPUT_EVENT_TITLE:
case INPUT_EVENT_CHAPTER: /* TODO is that correct ? */ case INPUT_EVENT_CHAPTER:
event = new IMEvent( ItemTitleChanged_Type, 0 ); event = new IMEvent( ItemTitleChanged_Type, 0 );
break; break;
...@@ -764,11 +773,15 @@ static int InputEvent( vlc_object_t *p_this, const char *, ...@@ -764,11 +773,15 @@ static int InputEvent( vlc_object_t *p_this, const char *,
event = new IMEvent( StatisticsUpdate_Type, 0 ); event = new IMEvent( StatisticsUpdate_Type, 0 );
break; break;
case INPUT_EVENT_ITEM_META: case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */
case INPUT_EVENT_ITEM_INFO:
case INPUT_EVENT_ITEM_NAME:
event = new IMEvent( MetaChanged_Type, 0 ); event = new IMEvent( MetaChanged_Type, 0 );
break; break;
case INPUT_EVENT_ITEM_INFO: /* Codec Info */
event = new IMEvent( InfoChanged_Type, 0 );
break;
case INPUT_EVENT_ITEM_NAME:
event = new IMEvent( NameChanged_Type, 0 );
break;
case INPUT_EVENT_PROGRAM: case INPUT_EVENT_PROGRAM:
case INPUT_EVENT_RECORD: case INPUT_EVENT_RECORD:
......
...@@ -48,6 +48,8 @@ enum { ...@@ -48,6 +48,8 @@ enum {
InterfaceVoutUpdate_Type, InterfaceVoutUpdate_Type,
StatisticsUpdate_Type, StatisticsUpdate_Type,
MetaChanged_Type, MetaChanged_Type,
NameChanged_Type,
InfoChanged_Type,
FullscreenControlToggle_Type = QEvent::User + IMEventType + 20, FullscreenControlToggle_Type = QEvent::User + IMEventType + 20,
FullscreenControlShow_Type, FullscreenControlShow_Type,
...@@ -107,11 +109,10 @@ private: ...@@ -107,11 +109,10 @@ private:
void delCallbacks(); void delCallbacks();
void UpdateRate(); void UpdateRate();
void UpdateMeta(); void UpdateName();
void UpdateStatus(); void UpdateStatus();
void UpdateNavigation(); void UpdateNavigation();
void UpdatePosition(); void UpdatePosition();
void UpdateSPU();
void UpdateTeletext(); void UpdateTeletext();
void UpdateArt(); void UpdateArt();
void UpdateVout(); void UpdateVout();
......
...@@ -174,8 +174,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -174,8 +174,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Status on the systray */ /* Status on the systray */
if( sysTray ) if( sysTray )
{ {
CONNECT( THEMIM->getIM(), statusChanged( int ), this, CONNECT( THEMIM->getIM(), statusChanged( int ),
updateSystrayTooltipStatus( int ) ); this, updateSystrayTooltipStatus( int ) );
} }
/* END CONNECTS ON IM */ /* END CONNECTS ON IM */
......
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