mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
* Emit a signal when the currentTrackPlaylist changes in AudioEngine.
This commit is contained in:
@@ -688,7 +688,7 @@ AudioEngine::loadPreviousTrack()
|
|||||||
if ( d->playlist.data()->previousResult() )
|
if ( d->playlist.data()->previousResult() )
|
||||||
{
|
{
|
||||||
result = d->playlist.data()->setSiblingResult( -1 );
|
result = d->playlist.data()->setSiblingResult( -1 );
|
||||||
d->currentTrackPlaylist = d->playlist;
|
setCurrentTrackPlaylist( d->playlist );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !result.isNull() )
|
if ( !result.isNull() )
|
||||||
@@ -731,7 +731,7 @@ AudioEngine::loadNextTrack()
|
|||||||
if ( d->playlist.data()->nextResult() )
|
if ( d->playlist.data()->nextResult() )
|
||||||
{
|
{
|
||||||
result = d->playlist.data()->setSiblingResult( 1 );
|
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 );
|
setPlaylist( playlist );
|
||||||
|
|
||||||
if ( playlist.isNull() && !fromQuery.isNull() )
|
if ( playlist.isNull() && !fromQuery.isNull() )
|
||||||
d->currentTrackPlaylist = playlistinterface_ptr( new SingleTrackPlaylistInterface( fromQuery ) );
|
{
|
||||||
|
setCurrentTrackPlaylist( playlistinterface_ptr( new SingleTrackPlaylistInterface( fromQuery ) ) );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
d->currentTrackPlaylist = playlist;
|
{
|
||||||
|
setCurrentTrackPlaylist( playlist );
|
||||||
|
}
|
||||||
|
|
||||||
if ( !result.isNull() )
|
if ( !result.isNull() )
|
||||||
{
|
{
|
||||||
@@ -1210,3 +1214,16 @@ AudioEngine::onVolumeChanged( qreal volume )
|
|||||||
{
|
{
|
||||||
emit volumeChanged( volume * 100 );
|
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 timerPercentage( unsigned int percentage );
|
||||||
|
|
||||||
void playlistChanged( Tomahawk::playlistinterface_ptr playlist );
|
void playlistChanged( Tomahawk::playlistinterface_ptr playlist );
|
||||||
|
void currentTrackPlaylistChanged( Tomahawk::playlistinterface_ptr playlist );
|
||||||
|
|
||||||
void error( AudioEngine::AudioErrorCode errorCode );
|
void error( AudioEngine::AudioErrorCode errorCode );
|
||||||
|
|
||||||
@@ -143,6 +144,7 @@ private:
|
|||||||
void checkStateQueue();
|
void checkStateQueue();
|
||||||
void queueState( AudioState state );
|
void queueState( AudioState state );
|
||||||
void setState( AudioState state );
|
void setState( AudioState state );
|
||||||
|
void setCurrentTrackPlaylist( const Tomahawk::playlistinterface_ptr& playlist );
|
||||||
|
|
||||||
Q_DECLARE_PRIVATE( AudioEngine );
|
Q_DECLARE_PRIVATE( AudioEngine );
|
||||||
AudioEnginePrivate* d_ptr;
|
AudioEnginePrivate* d_ptr;
|
||||||
|
Reference in New Issue
Block a user