mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
* Emit a signal when the currentTrackPlaylist changes in AudioEngine.
This commit is contained in:
parent
e5bf528fa9
commit
357d9b13d5
@ -688,7 +688,7 @@ AudioEngine::loadPreviousTrack()
|
||||
if ( d->playlist.data()->previousResult() )
|
||||
{
|
||||
result = d->playlist.data()->setSiblingResult( -1 );
|
||||
d->currentTrackPlaylist = d->playlist;
|
||||
setCurrentTrackPlaylist( d->playlist );
|
||||
}
|
||||
|
||||
if ( !result.isNull() )
|
||||
@ -731,7 +731,7 @@ AudioEngine::loadNextTrack()
|
||||
if ( d->playlist.data()->nextResult() )
|
||||
{
|
||||
result = d->playlist.data()->setSiblingResult( 1 );
|
||||
d->currentTrackPlaylist = d->playlist;
|
||||
setCurrentTrackPlaylist( d->playlist );
|
||||
}
|
||||
}
|
||||
|
||||
@ -763,9 +763,13 @@ AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk:
|
||||
setPlaylist( playlist );
|
||||
|
||||
if ( playlist.isNull() && !fromQuery.isNull() )
|
||||
d->currentTrackPlaylist = playlistinterface_ptr( new SingleTrackPlaylistInterface( fromQuery ) );
|
||||
{
|
||||
setCurrentTrackPlaylist( playlistinterface_ptr( new SingleTrackPlaylistInterface( fromQuery ) ) );
|
||||
}
|
||||
else
|
||||
d->currentTrackPlaylist = playlist;
|
||||
{
|
||||
setCurrentTrackPlaylist( playlist );
|
||||
}
|
||||
|
||||
if ( !result.isNull() )
|
||||
{
|
||||
@ -1210,3 +1214,16 @@ AudioEngine::onVolumeChanged( qreal volume )
|
||||
{
|
||||
emit volumeChanged( volume * 100 );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::setCurrentTrackPlaylist( const playlistinterface_ptr& playlist )
|
||||
{
|
||||
Q_D( AudioEngine );
|
||||
|
||||
if ( d->currentTrackPlaylist != playlist )
|
||||
{
|
||||
d->currentTrackPlaylist = playlist;
|
||||
emit currentTrackPlaylistChanged( d->currentTrackPlaylist );
|
||||
}
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ signals:
|
||||
void timerPercentage( unsigned int percentage );
|
||||
|
||||
void playlistChanged( Tomahawk::playlistinterface_ptr playlist );
|
||||
void currentTrackPlaylistChanged( Tomahawk::playlistinterface_ptr playlist );
|
||||
|
||||
void error( AudioEngine::AudioErrorCode errorCode );
|
||||
|
||||
@ -143,6 +144,7 @@ private:
|
||||
void checkStateQueue();
|
||||
void queueState( AudioState state );
|
||||
void setState( AudioState state );
|
||||
void setCurrentTrackPlaylist( const Tomahawk::playlistinterface_ptr& playlist );
|
||||
|
||||
Q_DECLARE_PRIVATE( AudioEngine );
|
||||
AudioEnginePrivate* d_ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user