mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-14 04:51:53 +02:00
Respect Phonon's isSeekable() function before seeking.
This commit is contained in:
parent
b74cefd72f
commit
79356b9da8
@ -235,13 +235,22 @@ AudioEngine::canGoPrevious()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AudioEngine::canSeek()
|
||||
{
|
||||
return !m_playlist.isNull() && (m_playlist.data()->seekRestrictions() != PlaylistInterface::NoSeek) && m_mediaObject->isSeekable();
|
||||
}
|
||||
|
||||
void
|
||||
AudioEngine::seek( qint64 ms )
|
||||
{
|
||||
if ( !m_playlist.isNull() && m_playlist.data()->seekRestrictions() == PlaylistInterface::NoSeek )
|
||||
if( !canSeek() )
|
||||
{
|
||||
qDebug() << "Could not seek!";
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isPlaying() || isPaused() )
|
||||
if( isPlaying() || isPaused() )
|
||||
{
|
||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << ms;
|
||||
m_mediaObject->seek( ms );
|
||||
|
@ -83,6 +83,7 @@ public slots:
|
||||
|
||||
bool canGoPrevious();
|
||||
bool canGoNext();
|
||||
bool canSeek();
|
||||
|
||||
void seek( qint64 ms );
|
||||
void seek( int ms ); // for compatibility with seekbar in audiocontrols
|
||||
|
Loading…
x
Reference in New Issue
Block a user