[vlc-devel] commit: Extensions/Qt: listen to input-change events ( Jean-Philippe André )

git version control git at videolan.org
Wed Feb 3 17:21:55 CET 2010


vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Fri Jan 29 12:23:59 2010 +0100| [2d46240cd7d78db0916aae3eb6f619e6bc7c4deb] | committer: Jean-Philippe André 

Extensions/Qt: listen to input-change events

Forward messages to the extensions manager

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

 modules/gui/qt4/extensions_manager.cpp |   24 ++++++++++++++++++++++++
 modules/gui/qt4/extensions_manager.hpp |    1 +
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/extensions_manager.cpp b/modules/gui/qt4/extensions_manager.cpp
index a460f55..c30c507 100644
--- a/modules/gui/qt4/extensions_manager.cpp
+++ b/modules/gui/qt4/extensions_manager.cpp
@@ -22,6 +22,7 @@
  *****************************************************************************/
 
 #include "extensions_manager.hpp"
+#include "input_manager.hpp"
 #include "dialogs/extensions.hpp"
 
 #include "assert.h"
@@ -46,6 +47,8 @@ ExtensionsManager::ExtensionsManager( intf_thread_t *_p_intf, QObject *parent )
 
     menuMapper = new QSignalMapper( this );
     CONNECT( menuMapper, mapped( int ), this, triggerMenu( int ) );
+    CONNECT( THEMIM, inputChanged( input_thread_t* ),
+             this, inputChanged( input_thread_t* ) );
     b_unloading = false;
     b_failed = false;
 }
@@ -243,3 +246,24 @@ void ExtensionsManager::triggerMenu( int id )
         extension_TriggerMenu( p_extensions_manager, p_ext, i_action );
     }
 }
+
+void ExtensionsManager::inputChanged( input_thread_t* p_input )
+{
+    if( p_input )
+        vlc_object_hold( p_input );
+    vlc_mutex_lock( &p_extensions_manager->lock );
+
+    extension_t *p_ext;
+    FOREACH_ARRAY( p_ext, p_extensions_manager->extensions )
+    {
+        if( extension_IsActivated( p_extensions_manager, p_ext ) )
+        {
+            extension_SetInput( p_extensions_manager, p_ext, p_input );
+        }
+    }
+    FOREACH_END()
+
+    vlc_mutex_unlock( &p_extensions_manager->lock );
+    if( p_input )
+        vlc_object_release( p_input );
+}
diff --git a/modules/gui/qt4/extensions_manager.hpp b/modules/gui/qt4/extensions_manager.hpp
index 1edfce5..fd9b9d8 100644
--- a/modules/gui/qt4/extensions_manager.hpp
+++ b/modules/gui/qt4/extensions_manager.hpp
@@ -78,6 +78,7 @@ public slots:
 
 private slots:
     void triggerMenu( int id );
+    void inputChanged( input_thread_t *p_input );
 
 private:
     static ExtensionsManager* instance;




More information about the vlc-devel mailing list