diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 3219cdcc8..9ff61bf25 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -73,7 +73,7 @@ public: return( "automationeditor" ); } - void updatePlayPauseIcon(); + void setPauseIcon( bool pause ); public slots: diff --git a/include/bb_editor.h b/include/bb_editor.h index a4bce6253..c1ebd96cd 100644 --- a/include/bb_editor.h +++ b/include/bb_editor.h @@ -48,7 +48,7 @@ public: void removeBBView( int _bb ); - void updatePlayPauseIcon(); + void setPauseIcon( bool pause ); public slots: diff --git a/include/piano_roll.h b/include/piano_roll.h index 162a6723c..05993c27f 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -89,7 +89,7 @@ public: return "pianoroll"; } - void updatePlayPauseIcon(); + void setPauseIcon( bool pause ); protected: diff --git a/include/song_editor.h b/include/song_editor.h index ef53d7d00..e029ff64a 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -59,12 +59,12 @@ public: songEditor( song * _song ); virtual ~songEditor(); + void setPauseIcon( bool pause ); + public slots: void scrolled( int _new_pos ); - void updatePlayPauseIcon(); - private slots: void setHighQuality( bool ); diff --git a/src/core/engine.cpp b/src/core/engine.cpp index e39fdede4..2f2402747 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -148,10 +148,35 @@ void engine::destroy() void engine::updatePlayPauseIcons() { - s_songEditor->updatePlayPauseIcon(); - s_automationEditor->updatePlayPauseIcon(); - s_bbEditor->updatePlayPauseIcon(); - s_pianoRoll->updatePlayPauseIcon(); + s_songEditor->setPauseIcon( false ); + s_automationEditor->setPauseIcon( false ); + s_bbEditor->setPauseIcon( false ); + s_pianoRoll->setPauseIcon( false ); + + if( s_song->isPlaying() ) + { + switch( s_song->playMode() ) + { + case song::Mode_PlaySong: + s_songEditor->setPauseIcon( true ); + break; + + case song::Mode_PlayAutomationPattern: + s_automationEditor->setPauseIcon( true ); + break; + + case song::Mode_PlayBB: + s_bbEditor->setPauseIcon( true ); + break; + + case song::Mode_PlayPattern: + s_pianoRoll->setPauseIcon( true ); + break; + + default: + break; + } + } } diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index 471b4dc7a..2d280bf63 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -489,22 +489,15 @@ void AutomationEditor::loadSettings( const QDomElement & _this ) -void AutomationEditor::updatePlayPauseIcon() +void AutomationEditor::setPauseIcon( bool pause ) { - if( engine::getSong()->playMode() != song::Mode_PlayPattern ) + if( pause == true ) { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); + m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); } else { - if( engine::getSong()->isPlaying() ) - { - m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); - } - else - { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); - } + m_playButton->setIcon( embed::getIconPixmap( "play" ) ); } } diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index 3c60ffd74..4630223f6 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -171,22 +171,15 @@ void bbEditor::removeBBView( int _bb ) -void bbEditor::updatePlayPauseIcon() +void bbEditor::setPauseIcon( bool pause ) { - if( engine::getSong()->playMode() != song::Mode_PlayBB ) + if( pause == true ) { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); + m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); } else { - if( engine::getSong()->isPlaying() ) - { - m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); - } - else - { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); - } + m_playButton->setIcon( embed::getIconPixmap( "play" ) ); } } diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 46b78b2c8..caaf0d7d0 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -798,22 +798,15 @@ void pianoRoll::loadSettings( const QDomElement & _this ) -void pianoRoll::updatePlayPauseIcon() +void pianoRoll::setPauseIcon( bool pause ) { - if( engine::getSong()->playMode() != song::Mode_PlayPattern ) + if( pause == true ) { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); + m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); } else { - if( engine::getSong()->isPlaying() ) - { - m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); - } - else - { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); - } + m_playButton->setIcon( embed::getIconPixmap( "play" ) ); } } diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index ee4d05daf..74b9acc53 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -427,22 +427,15 @@ void songEditor::scrolled( int _new_pos ) -void songEditor::updatePlayPauseIcon() +void songEditor::setPauseIcon( bool pause ) { - if( engine::getSong()->playMode() != song::Mode_PlaySong ) + if( pause == true ) { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); + m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); } else { - if( engine::getSong()->isPlaying() ) - { - m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); - } - else - { - m_playButton->setIcon( embed::getIconPixmap( "play" ) ); - } + m_playButton->setIcon( embed::getIconPixmap( "play" ) ); } }