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