From d134cf1f7fc5dcf583edaca619376e6ac2fc9c8a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 12 Feb 2009 03:33:47 +0000 Subject: [PATCH] global playback buttons have better behavior git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@2017 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ TODO | 24 ++++++++++++------------ src/gui/main_window.cpp | 27 ++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7be1b4b6c..284721762 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-11 Andrew Kelley + + * src/gui/main_window.cpp: + * TODO: + global playback buttons have more user friendly behavior + 2009-02-10 Paul Giblock * include/gui: diff --git a/TODO b/TODO index 84972e1c0..3b81df73d 100644 --- a/TODO +++ b/TODO @@ -52,26 +52,26 @@ - add FLAC as export-format? Andrew Kelley's todo: -- pencil tool icon doesn't set right. selection arrow cursor doesn't set right - add a Modulator class and a Humanizer tool to the piano roll -- global playback buttons, like in FL Studio -- when you add VSTi, have it automatically pop the find VST plugin dialog -- make pitch bend range adjustable -- monophonic mode on 3xosc -- add dithering -- add global playback mode to .mmp file format - when a song goes past the end of the song, make it stop or loop -- allow increasing the width of song editor things, it will make the BB repeat - when looking at a piano roll, if the song is playing that pattern, move the position ticker to where it should be -- multiview button - show notes from every instrument in the current beat+bassline with different colors -- undo/redo for piano roll - add a tools menu to piano roll * put some of the tools on there that already have keyboard shortcuts (ctrl+up/down, shift+left/right) * humanizing tool * quick slice * look through FL Studio's tools and implement some of them -- slice tool for piano roll +- slice tool for piano roll, "map audio files to piano roll keys" - when a note is played, show the note as being depressed in the piano roll + +- pencil tool icon doesn't set right. selection arrow cursor doesn't set right +- when you add VSTi, have it automatically pop the find VST plugin dialog +- make pitch bend range adjustable +- monophonic mode on 3xosc +- add dithering +- add global playback mode to .mmp file format +- allow increasing the width of song editor things, it will make the BB repeat +- multiview button - show notes from every instrument in the current beat+bassline with different colors +- undo/redo for piano roll - don't end mouse selection when control is released - mouse cursor isn't updated correctly in selection mode (from resizing note edit area) @@ -89,5 +89,5 @@ Andrew Kelley's todo: - the 'add beat+bassline' button in the beat+bassline editor is misleading - I say we remove it and rely on the song editor to add beat+basslines - make it so that 3xosc notes don't max out - copy-pasted automation patterns have to be manually linked back to their knob for some reason -- fix memory leaks - cloning a pattern in the song editor should copy automation tracks along with notes +- fix memory leaks diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp index b629053e3..81a98ccb6 100644 --- a/src/gui/main_window.cpp +++ b/src/gui/main_window.cpp @@ -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 )