mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 23:26:40 +02:00
Add logic back to audioengine, but simplify in sourcetreeview
This commit is contained in:
@@ -212,7 +212,14 @@ AudioEngine::canGoNext()
|
|||||||
m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkipForwards )
|
m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkipForwards )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
tDebug( LOGEXTRA ) << Q_FUNC_INFO << "playlist has next item? " << m_playlist.data()->hasNextItem();
|
if ( !m_currentTrack.isNull() && !m_playlist.data()->hasNextItem() &&
|
||||||
|
( m_playlist.data()->currentItem().isNull() || ( m_currentTrack->id() == m_playlist.data()->currentItem()->id() ) ) )
|
||||||
|
{
|
||||||
|
//For instance, when doing a catch-up while listening along, but the person
|
||||||
|
//you're following hasn't started a new track yet...don't do anything
|
||||||
|
tDebug( LOGEXTRA ) << Q_FUNC_INFO << "catch up";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return m_playlist.data()->hasNextItem();
|
return m_playlist.data()->hasNextItem();
|
||||||
}
|
}
|
||||||
|
@@ -370,10 +370,8 @@ SourceTreeView::latchOn()
|
|||||||
SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi );
|
SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi );
|
||||||
if ( !sourcepi->source().isNull() && sourcepi->source()->id() == source->id() )
|
if ( !sourcepi->source().isNull() && sourcepi->source()->id() == source->id() )
|
||||||
{
|
{
|
||||||
//it's a catch-up -- if they're trying to catch-up in the same track, don't do anything
|
//it's a catch-up -- logic in audioengine should take care of it
|
||||||
//so that you don't repeat the track and/or cause the retry timer to fire
|
AudioEngine::instance()->next();
|
||||||
if ( !AudioEngine::instance()->currentTrack().isNull() && !sourcepi->hasNextItem() &&
|
|
||||||
AudioEngine::instance()->currentTrack()->id() == sourcepi->currentItem()->id() )
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user