global playback buttons have better behavior

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@2017 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Andrew Kelley
2009-02-12 03:33:47 +00:00
parent 78a1c1f802
commit d134cf1f7f
3 changed files with 44 additions and 13 deletions

View File

@@ -1245,7 +1245,32 @@ void mainWindow::keyPressEvent( QKeyEvent * _ke )
void mainWindow::shortcutSpacePressed( void )
{
play();
if( engine::getSong()->isPlaying() )
{
if(
( engine::getSong()->playMode() == song::Mode_PlaySong &&
m_playbackMode == PPM_Song ) ||
( engine::getSong()->playMode() == song::Mode_PlayBB &&
m_playbackMode == PPM_BB ) ||
( engine::getSong()->playMode() == song::Mode_PlayPattern &&
m_playbackMode == PPM_PianoRoll ) )
{
// we should stop playback because the user did not
// change which mode to playback
stop();
}
else
{
// stop playback and then play it again with the
// current selected playback mode
stop();
play();
}
}
else
{
play();
}
}
void mainWindow::shortcutLPressed( void )