mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 01:39:42 +01:00
Add logic back to audioengine, but simplify in sourcetreeview
This commit is contained in:
parent
36486d10d1
commit
f479fd4e7c
@ -212,8 +212,15 @@ AudioEngine::canGoNext()
|
||||
m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkipForwards )
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -370,11 +370,9 @@ SourceTreeView::latchOn()
|
||||
SourcePlaylistInterface* sourcepi = dynamic_cast< SourcePlaylistInterface* >( pi );
|
||||
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
|
||||
//so that you don't repeat the track and/or cause the retry timer to fire
|
||||
if ( !AudioEngine::instance()->currentTrack().isNull() && !sourcepi->hasNextItem() &&
|
||||
AudioEngine::instance()->currentTrack()->id() == sourcepi->currentItem()->id() )
|
||||
return;
|
||||
//it's a catch-up -- logic in audioengine should take care of it
|
||||
AudioEngine::instance()->next();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user