mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
Handle re-latches
This commit is contained in:
@@ -360,6 +360,7 @@ SourceTreeView::doLatchOn( const source_ptr& source )
|
|||||||
|
|
||||||
PlaylistInterface* pi = AudioEngine::instance()->playlist();
|
PlaylistInterface* pi = AudioEngine::instance()->playlist();
|
||||||
|
|
||||||
|
bool catchUp = false;
|
||||||
if ( pi && dynamic_cast< SourcePlaylistInterface* >( pi ) )
|
if ( pi && dynamic_cast< SourcePlaylistInterface* >( pi ) )
|
||||||
{
|
{
|
||||||
SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi );
|
SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi );
|
||||||
@@ -367,7 +368,8 @@ SourceTreeView::doLatchOn( const source_ptr& source )
|
|||||||
{
|
{
|
||||||
//it's a catch-up -- logic in audioengine should take care of it
|
//it's a catch-up -- logic in audioengine should take care of it
|
||||||
AudioEngine::instance()->next();
|
AudioEngine::instance()->next();
|
||||||
return;
|
catchUp = true;
|
||||||
|
m_latch = sourcepi->getSharedPointer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,8 +380,11 @@ SourceTreeView::doLatchOn( const source_ptr& source )
|
|||||||
cmd->setTimestamp( QDateTime::currentDateTime().toTime_t() );
|
cmd->setTimestamp( QDateTime::currentDateTime().toTime_t() );
|
||||||
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
|
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
|
||||||
|
|
||||||
m_waitingToPlayLatch = source;
|
if ( !catchUp )
|
||||||
AudioEngine::instance()->playItem( source->getPlaylistInterface().data(), source->getPlaylistInterface()->nextItem() );
|
{
|
||||||
|
m_waitingToPlayLatch = source;
|
||||||
|
AudioEngine::instance()->playItem( source->getPlaylistInterface().data(), source->getPlaylistInterface()->nextItem() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user