[vlc-devel] commit: New event (voutListChanged) in input manager. (Laurent Aimar )

git version control git at videolan.org
Mon Jan 5 21:26:46 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Dec 27 15:04:17 2008 +0100| [cb3432ffc069dbb544a61818bdecd96f56c147b9] | committer: Laurent Aimar 

New event (voutListChanged) in input manager.

It will be used to properly attach/detach the fullscreen controller
independantly of embed vout.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cb3432ffc069dbb544a61818bdecd96f56c147b9
---

 modules/gui/qt4/input_manager.cpp |   52 ++++++++++++++++++++++++++++--------
 modules/gui/qt4/input_manager.hpp |    3 ++
 2 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 7d3d53b..c55b7dc 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -127,6 +127,7 @@ void InputManager::delInput()
     emit teletextPossible( false );
     emit AtoBchanged( false, false );
     emit voutChanged( false );
+    emit voutListChanged( NULL, 0 );
 
     /* Reset all InfoPanels but stats */
     emit artChanged( NULL );
@@ -154,7 +155,8 @@ void InputManager::customEvent( QEvent *event )
          i_type != InfoChanged_Type &&
          i_type != SynchroChanged_Type &&
          i_type != CachingEvent_Type &&
-         i_type != BookmarksChanged_Type )
+         i_type != BookmarksChanged_Type &&
+         i_type != InterfaceAoutUpdate_Type )
         return;
 
     if( i_type == CachingEvent_Type )
@@ -173,7 +175,8 @@ void InputManager::customEvent( QEvent *event )
           i_type != NameChanged_Type &&
           i_type != InfoChanged_Type &&
           i_type != SynchroChanged_Type &&
-          i_type != BookmarksChanged_Type
+          i_type != BookmarksChanged_Type &&
+          i_type != InterfaceAoutUpdate_Type
         )
         && ( i_input_id != ple->i_id ) )
         return;
@@ -241,6 +244,9 @@ void InputManager::customEvent( QEvent *event )
     case BookmarksChanged_Type:
         emit bookmarksChanged();
         break;
+    case InterfaceAoutUpdate_Type:
+        UpdateAout();
+        break;
     default:
         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 *,
         event = new IMEvent( ItemTeletextChanged_Type, 0 );
         break;
 
+    case INPUT_EVENT_STATISTICS:
+        event = new IMEvent( StatisticsUpdate_Type, 0 );
+        break;
+
     case INPUT_EVENT_VOUT:
         event = new IMEvent( InterfaceVoutUpdate_Type, 0 );
         break;
-
-    case INPUT_EVENT_STATISTICS:
-        event = new IMEvent( StatisticsUpdate_Type, 0 );
+    case INPUT_EVENT_AOUT:
+        event = new IMEvent( InterfaceAoutUpdate_Type, 0 );
         break;
 
     case INPUT_EVENT_ITEM_META: /* Codec MetaData + Art */
@@ -482,18 +491,37 @@ void InputManager::UpdateVout()
 {
     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 );
-        b_video = p_vout != NULL;
-        if( p_vout )
-            vlc_object_release( p_vout );
+        /* */
+        bool b_old_video = b_video;
+        b_video = i_vout > 0;
         if( !!b_old_video != !!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()
 {
     float f_newCache = var_GetFloat( p_input, "cache" );
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index f3356ee..b763583 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -48,6 +48,7 @@ enum {
     ItemTeletextChanged_Type,
     InterfaceVoutUpdate_Type,
     StatisticsUpdate_Type, /*10*/
+    InterfaceAoutUpdate_Type,
     MetaChanged_Type,
     NameChanged_Type,
     InfoChanged_Type,
@@ -126,6 +127,7 @@ private:
     void UpdateInfo();
     void UpdateMeta();
     void UpdateVout();
+    void UpdateAout();
     void UpdateStats();
     void UpdateCaching();
 
@@ -182,6 +184,7 @@ signals:
     void synchroChanged();
     void bookmarksChanged();
     void cachingChanged( float );
+    void voutListChanged( vout_thread_t **pp_vout, int i_vout );
 };
 
 class MainInputManager : public QObject




More information about the vlc-devel mailing list