Commit ae4e524e authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: remove pointer from inputChanged signal (fix #11886 #11887)

All signals, event direct ones, are going to event loop.

Retrieves input_thread at event loop processing time
parent 3b33cbca
......@@ -480,7 +480,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
/* Change the SpeedRate in the Label */
CONNECT( THEMIM->getIM(), rateChanged( float ), this, setRate( float ) );
DCONNECT( THEMIM, inputChanged( input_thread_t * ),
DCONNECT( THEMIM, inputChanged( ),
speedControl, activateOnState() );
setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
......
......@@ -61,8 +61,8 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
rebuild( p_root );
DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, processInputItemUpdate( input_item_t *) );
DCONNECT( THEMIM, inputChanged( input_thread_t * ),
this, processInputItemUpdate( input_thread_t* ) );
DCONNECT( THEMIM, inputChanged( ),
this, processInputItemUpdate( ) );
CONNECT( THEMIM, playlistItemAppended( int, int ),
this, processItemAppend( int, int ) );
CONNECT( THEMIM, playlistItemRemoved( int ),
......@@ -560,8 +560,9 @@ bool PLModel::canEdit() const
/************************* Updates handling *****************************/
/**** Events processing ****/
void PLModel::processInputItemUpdate( input_thread_t *p_input )
void PLModel::processInputItemUpdate( )
{
input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return;
if( p_input && !( p_input->b_dead || !vlc_object_alive( p_input ) ) )
......
......@@ -157,7 +157,7 @@ private:
private slots:
void processInputItemUpdate( input_item_t *);
void processInputItemUpdate( input_thread_t* p_input );
void processInputItemUpdate();
void processItemRemoval( int i_pl_itemid );
void processItemAppend( int i_pl_itemid, int i_pl_itemidparent );
void activateItem( playlist_item_t *p_item );
......
......@@ -49,8 +49,8 @@ ExtensionsManager::ExtensionsManager( intf_thread_t *_p_intf, QObject *parent )
menuMapper = new QSignalMapper( this );
CONNECT( menuMapper, mapped( int ), this, triggerMenu( int ) );
CONNECT( THEMIM->getIM(), playingStatusChanged( int ), this, playingChanged( int ) );
DCONNECT( THEMIM, inputChanged( input_thread_t* ),
this, inputChanged( input_thread_t* ) );
DCONNECT( THEMIM, inputChanged( ),
this, inputChanged( ) );
CONNECT( THEMIM->getIM(), metaChanged( input_item_t* ),
this, metaChanged( input_item_t* ) );
b_unloading = false;
......@@ -264,8 +264,9 @@ void ExtensionsManager::triggerMenu( int id )
}
}
void ExtensionsManager::inputChanged( input_thread_t* p_input )
void ExtensionsManager::inputChanged( )
{
input_thread_t* p_input = THEMIM->getInput();
//This is unlikely, but can happen if no extension modules can be loaded.
if ( p_extensions_manager == NULL )
return ;
......
......@@ -78,7 +78,7 @@ public slots:
private slots:
void triggerMenu( int id );
void inputChanged( input_thread_t *p_input );
void inputChanged( );
void playingChanged( int );
void metaChanged( input_item_t *p_input );
......
......@@ -99,6 +99,11 @@ InputManager::~InputManager()
delInput();
}
void InputManager::inputChangedHandler()
{
setInput( THEMIM->getInput() );
}
/* Define the Input used.
Add the callbacks on input
p_input is held once here */
......@@ -1017,13 +1022,13 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
mute.addCallback( this, SLOT(notifyMute(bool)) );
/* Warn our embedded IM about input changes */
DCONNECT( this, inputChanged( input_thread_t * ),
im, setInput( input_thread_t * ) );
DCONNECT( this, inputChanged(),
im, inputChangedHandler() );
/* initialize p_input (an input can already be running) */
p_input = playlist_CurrentInput( THEPL );
if( p_input )
emit inputChanged( p_input );
emit inputChanged( );
/* Audio Menu */
menusAudioMapper = new QSignalMapper();
......@@ -1034,8 +1039,9 @@ MainInputManager::~MainInputManager()
{
if( p_input )
{
emit inputChanged( NULL );
vlc_object_release( p_input );
p_input = NULL;
emit inputChanged( );
}
var_DelCallback( THEPL, "activity", PLItemChanged, this );
......@@ -1090,7 +1096,7 @@ void MainInputManager::customEvent( QEvent *event )
if( p_input != NULL )
vlc_object_release( p_input );
p_input = playlist_CurrentInput( THEPL );
emit inputChanged( p_input );
emit inputChanged( );
}
/* Playlist Control functions */
......
......@@ -183,8 +183,10 @@ private:
void UpdateProgramEvent();
void UpdateEPG();
void setInput( input_thread_t * );
public slots:
void setInput( input_thread_t * ); ///< Our controlled input changed
void inputChangedHandler(); ///< Our controlled input changed
void sliderUpdate( float ); ///< User dragged the slider. We get new pos
/* SpeedRate Rate Management */
void reverse();
......@@ -309,7 +311,7 @@ private slots:
void menusUpdateAudio( const QString& );
signals:
void inputChanged( input_thread_t * );
void inputChanged( );
void volumeChanged( float );
void soundMuteChanged( bool );
void playlistItemAppended( int itemId, int parentId );
......
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