Control play/pause buttons in slot of MainWindow via signal in Song class

The engine class as the component instance manager is the wrong place to
control the play/pause buttons. Instead emit a signal in the Song class
and update the buttons in a slot in MainWindow. This fixes problems with
GUI/pixmap operations happening outside the GUI thread when exporting a
project.

Closes #435.
This commit is contained in:
Tobias Doerffel
2014-03-18 20:39:52 +01:00
parent b45c0c5f02
commit 41c154dc95
6 changed files with 48 additions and 49 deletions

View File

@@ -146,42 +146,6 @@ void engine::destroy()
void engine::updatePlayPauseIcons()
{
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;
}
}
}
void engine::updateFramesPerTick()
{
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /