diff --git a/ChangeLog b/ChangeLog index b577d87f0..5964cfbcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-02-02 Andrew Kelley + + * include/main_window.h: + * src/gui/main_window.cpp: + - fixed bug: piano roll was still recording when not in record + mode + - use the key L to cycle through playback modes. (this is + consistent with FL Studio) + 2009-02-01 Andrew Kelley * include/piano_roll.h: diff --git a/include/main_window.h b/include/main_window.h index 73c869276..2bd032cae 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -224,11 +224,14 @@ private slots: void playbackSongClicked( bool ); void playbackBBClicked( bool ); void playbackPianoRollClicked( bool ); - void spacePressed( void ); + + void shortcutSpacePressed( void ); + void shortcutLPressed( void ); void play( void ); void record( void ); void playAndRecord( void ); + void stop( void ); signals: void periodicUpdate( void ); diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp index 1336c9f20..03e0fd3ff 100644 --- a/src/gui/main_window.cpp +++ b/src/gui/main_window.cpp @@ -682,7 +682,7 @@ void mainWindow::finalize( void ) new toolButton( embed::getIconPixmap( "stop" ), tr( "Stop playing whatever is playing" ), - engine::getSong(), + this, SLOT( stop() ), btns ); @@ -752,8 +752,11 @@ void mainWindow::finalize( void ) m_radpSong->click(); // global keyboard shortcuts - QShortcut * space = new QShortcut(QKeySequence(Qt::Key_Space), this); - connect(space, SIGNAL(activated()), SLOT(spacePressed())); + QShortcut * qs_space = new QShortcut(QKeySequence(Qt::Key_Space), this); + connect(qs_space, SIGNAL(activated()), SLOT(shortcutSpacePressed())); + QShortcut * qs_L = new QShortcut(QKeySequence(Qt::Key_L), this); + connect(qs_L, SIGNAL(activated()), SLOT(shortcutLPressed())); + // setup-dialog opened before? if( !configManager::inst()->value( "app", "configured" ).toInt() ) @@ -1212,11 +1215,28 @@ void mainWindow::keyPressEvent( QKeyEvent * _ke ) } } -void mainWindow::spacePressed( void ) +void mainWindow::shortcutSpacePressed( void ) { play(); } +void mainWindow::shortcutLPressed( void ) +{ + // cycle through global playback mode + if( m_playbackMode == PPM_BB ) + { + m_radpPianoRoll->click(); + } + else if( m_playbackMode == PPM_PianoRoll ) + { + m_radpSong->click(); + } + else + { + m_radpBB->click(); + } +} + void mainWindow::play( void ) { if( m_playbackMode == PPM_BB ) @@ -1233,6 +1253,23 @@ void mainWindow::play( void ) } } +void mainWindow::stop( void ) +{ + if( m_playbackMode == PPM_BB ) + { + engine::getBBEditor()->stop(); + } + else if( m_playbackMode == PPM_PianoRoll ) + { + engine::getPianoRoll()->stop(); + } + else + { + engine::getSongEditor()->stop(); + } +} + + void mainWindow::record( void ) { if( m_playbackMode == PPM_BB )