Commit 2d46240c authored by Jean-Philippe André's avatar Jean-Philippe André

Extensions/Qt: listen to input-change events

Forward messages to the extensions manager
parent 32ec9c1e
......@@ -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 );
}
......@@ -78,6 +78,7 @@ public slots:
private slots:
void triggerMenu( int id );
void inputChanged( input_thread_t *p_input );
private:
static ExtensionsManager* instance;
......
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