[vlc-devel] commit: Qt: input manager updates. Remove some events with the core changes . (Jean-Baptiste Kempf )
git version control
git at videolan.org
Wed Dec 31 13:44:16 CET 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Dec 30 23:29:45 2008 +0100| [7b001a2b3e689c186d329f308446ff467a0a10b9] | committer: Jean-Baptiste Kempf
Qt: input manager updates. Remove some events with the core changes.
This is unfinished work.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b001a2b3e689c186d329f308446ff467a0a10b9
---
modules/gui/qt4/input_manager.cpp | 61 ++++++++++++++++++++++--------------
modules/gui/qt4/input_manager.hpp | 5 ++-
modules/gui/qt4/main_interface.cpp | 4 +-
3 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 3f9739d..77783b8 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -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:
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index f1fc33d..a616d78 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -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();
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 6fc8e24..5d96090 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -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 */
More information about the vlc-devel
mailing list