1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-24 01:39:42 +01:00

* Allow seeking without playlists and emit stopped() only after we actually stopped.

This commit is contained in:
Christian Muehlhaeuser 2012-05-19 10:28:44 +02:00
parent 80fe1f0777
commit 13b74f1c21

View File

@ -162,12 +162,12 @@ AudioEngine::stop()
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
emit stopped();
if ( isStopped() )
return;
setState( Stopped );
m_mediaObject->stop();
emit stopped();
if ( !m_playlist.isNull() )
m_playlist.data()->reset();
@ -180,7 +180,6 @@ AudioEngine::stop()
sendWaitingNotification();
Tomahawk::InfoSystem::InfoPushData pushData( s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowStopped, QVariant(), Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}
@ -255,6 +254,10 @@ AudioEngine::canSeek()
if ( m_mediaObject && m_mediaObject->isValid() )
phononCanSeek = m_mediaObject->isSeekable();
*/
if ( m_playlist.isNull() )
return phononCanSeek;
return !m_playlist.isNull() && ( m_playlist.data()->seekRestrictions() != PlaylistInterface::NoSeek ) && phononCanSeek;
}