Merge pull request #290 from M374LX/stable-0.4
Better way to update play button icons
This commit is contained in:
@@ -73,7 +73,7 @@ public:
|
||||
return( "automationeditor" );
|
||||
}
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
void setPauseIcon( bool pause );
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
void removeBBView( int _bb );
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
void setPauseIcon( bool pause );
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
return "pianoroll";
|
||||
}
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
void setPauseIcon( bool pause );
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user