mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
* Added shuffle & repeat mode slots & signals to AudioEngine.
This commit is contained in:
@@ -865,6 +865,8 @@ AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
|
||||
{
|
||||
disconnect( m_playlist.data(), SIGNAL( previousTrackAvailable( bool ) ) );
|
||||
disconnect( m_playlist.data(), SIGNAL( nextTrackAvailable( bool ) ) );
|
||||
disconnect( m_playlist.data(), SIGNAL( shuffleModeChanged( bool ) ) );
|
||||
disconnect( m_playlist.data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ) );
|
||||
}
|
||||
|
||||
m_playlist.data()->reset();
|
||||
@@ -886,12 +888,38 @@ AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
|
||||
|
||||
connect( m_playlist.data(), SIGNAL( previousTrackAvailable( bool ) ), SIGNAL( controlStateChanged() ) );
|
||||
connect( m_playlist.data(), SIGNAL( nextTrackAvailable( bool ) ), SIGNAL( controlStateChanged() ) );
|
||||
|
||||
connect( m_playlist.data(), SIGNAL( shuffleModeChanged( bool ) ), SIGNAL( shuffleModeChanged( bool ) ) );
|
||||
connect( m_playlist.data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode ) ), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode ) ) );
|
||||
|
||||
emit shuffleModeChanged( m_playlist.data()->shuffled() );
|
||||
emit repeatModeChanged( m_playlist.data()->repeatMode() );
|
||||
}
|
||||
|
||||
emit playlistChanged( playlist );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode )
|
||||
{
|
||||
if ( !m_playlist.isNull() )
|
||||
{
|
||||
m_playlist.data()->setRepeatMode( mode );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::setShuffled( bool enabled )
|
||||
{
|
||||
if ( !m_playlist.isNull() )
|
||||
{
|
||||
m_playlist.data()->setShuffled( enabled );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::setStopAfterTrack( const query_ptr& query )
|
||||
{
|
||||
|
@@ -98,6 +98,9 @@ public slots:
|
||||
|
||||
void setStopAfterTrack( const Tomahawk::query_ptr& query );
|
||||
|
||||
void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode );
|
||||
void setShuffled( bool enabled );
|
||||
|
||||
signals:
|
||||
void loading( const Tomahawk::result_ptr& track );
|
||||
void started( const Tomahawk::result_ptr& track );
|
||||
@@ -110,6 +113,8 @@ signals:
|
||||
|
||||
void seeked( qint64 ms );
|
||||
|
||||
void shuffleModeChanged( bool enabled );
|
||||
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
|
||||
void controlStateChanged();
|
||||
void stateChanged( AudioState newState, AudioState oldState );
|
||||
void volumeChanged( int volume /* in percent */ );
|
||||
|
Reference in New Issue
Block a user