mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-28 08:10:47 +02:00
Don't connect class B and C in class A. Fix bug where AudioEngine<->SourcePlaylistInterface connection wasn't disconnected
This commit is contained in:
@@ -42,6 +42,7 @@ LatchManager::LatchManager( QObject* parent )
|
|||||||
, m_state( NotLatched )
|
, m_state( NotLatched )
|
||||||
{
|
{
|
||||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||||
|
connect( AudioEngine::instance(), SIGNAL( paused() ), SLOT( audioPaused() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
LatchManager::~LatchManager()
|
LatchManager::~LatchManager()
|
||||||
@@ -66,7 +67,6 @@ LatchManager::latchRequest( const source_ptr& source )
|
|||||||
|
|
||||||
m_state = Latching;
|
m_state = Latching;
|
||||||
m_waitingForLatch = source;
|
m_waitingForLatch = source;
|
||||||
connect( AudioEngine::instance(), SIGNAL( paused() ), source->playlistInterface().data(), SLOT( audioPaused() ) );
|
|
||||||
AudioEngine::instance()->playItem( source->playlistInterface(), source->playlistInterface()->nextResult() );
|
AudioEngine::instance()->playItem( source->playlistInterface(), source->playlistInterface()->nextResult() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,6 +135,18 @@ LatchManager::playlistChanged( Tomahawk::playlistinterface_ptr )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LatchManager::audioPaused()
|
||||||
|
{
|
||||||
|
if ( !m_latchedOnTo.isNull() )
|
||||||
|
{
|
||||||
|
SourcePlaylistInterface* plInterface = qobject_cast< SourcePlaylistInterface* >( m_latchedOnTo->playlistInterface().data() );
|
||||||
|
Q_ASSERT( plInterface );
|
||||||
|
plInterface->audioPaused();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LatchManager::catchUpRequest()
|
LatchManager::catchUpRequest()
|
||||||
{
|
{
|
||||||
|
@@ -48,7 +48,8 @@ public slots:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void playlistChanged( Tomahawk::playlistinterface_ptr );
|
void playlistChanged( Tomahawk::playlistinterface_ptr );
|
||||||
|
void audioPaused();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum State {
|
enum State {
|
||||||
NotLatched = 0,
|
NotLatched = 0,
|
||||||
|
Reference in New Issue
Block a user