mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
Respect Phonon's isSeekable() function before seeking.
This commit is contained in:
@@ -235,11 +235,20 @@ AudioEngine::canGoPrevious()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
AudioEngine::canSeek()
|
||||||
|
{
|
||||||
|
return !m_playlist.isNull() && (m_playlist.data()->seekRestrictions() != PlaylistInterface::NoSeek) && m_mediaObject->isSeekable();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioEngine::seek( qint64 ms )
|
AudioEngine::seek( qint64 ms )
|
||||||
{
|
{
|
||||||
if ( !m_playlist.isNull() && m_playlist.data()->seekRestrictions() == PlaylistInterface::NoSeek )
|
if( !canSeek() )
|
||||||
|
{
|
||||||
|
qDebug() << "Could not seek!";
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( isPlaying() || isPaused() )
|
if( isPlaying() || isPaused() )
|
||||||
{
|
{
|
||||||
|
@@ -83,6 +83,7 @@ public slots:
|
|||||||
|
|
||||||
bool canGoPrevious();
|
bool canGoPrevious();
|
||||||
bool canGoNext();
|
bool canGoNext();
|
||||||
|
bool canSeek();
|
||||||
|
|
||||||
void seek( qint64 ms );
|
void seek( qint64 ms );
|
||||||
void seek( int ms ); // for compatibility with seekbar in audiocontrols
|
void seek( int ms ); // for compatibility with seekbar in audiocontrols
|
||||||
|
Reference in New Issue
Block a user