mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-13 20:39:57 +01: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:
parent
bcd3120779
commit
6c23c4d660
@ -42,6 +42,7 @@ LatchManager::LatchManager( QObject* parent )
|
||||
, m_state( NotLatched )
|
||||
{
|
||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( paused() ), SLOT( audioPaused() ) );
|
||||
}
|
||||
|
||||
LatchManager::~LatchManager()
|
||||
@ -66,7 +67,6 @@ LatchManager::latchRequest( const source_ptr& source )
|
||||
|
||||
m_state = Latching;
|
||||
m_waitingForLatch = source;
|
||||
connect( AudioEngine::instance(), SIGNAL( paused() ), source->playlistInterface().data(), SLOT( audioPaused() ) );
|
||||
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
|
||||
LatchManager::catchUpRequest()
|
||||
{
|
||||
|
@ -48,7 +48,8 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void playlistChanged( Tomahawk::playlistinterface_ptr );
|
||||
|
||||
void audioPaused();
|
||||
|
||||
private:
|
||||
enum State {
|
||||
NotLatched = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user