diff options
author | Jason Janse van Rensburg <l33tjas.0n@gmail.com> | 2016-07-25 22:55:28 +0200 |
---|---|---|
committer | Jason Janse van Rensburg <l33tjas.0n@gmail.com> | 2016-07-25 22:55:28 +0200 |
commit | 27d27b179b8892d54c1072012f716ad4fce81901 (patch) | |
tree | 60e7a70e60173a99d41f25ccfe3df5d75aa9bedb /quantum/process_keycode/process_music.c | |
parent | 3e462fac3101955ad3561a104c24ca6125e85acd (diff) | |
parent | f9aadd17e8fce17fe1e135cf8022e71a35ae5adf (diff) |
Merged branch master into bone2planck
Diffstat (limited to 'quantum/process_keycode/process_music.c')
-rw-r--r-- | quantum/process_keycode/process_music.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index c8f3ddb900..2d52e47a72 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -6,6 +6,7 @@ int offset = 7; // music sequencer static bool music_sequence_recording = false; +static bool music_sequence_recorded = false; static bool music_sequence_playing = false; static float music_sequence[16] = {0}; static uint8_t music_sequence_count = 0; @@ -77,6 +78,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { if (keycode == KC_LCTL && record->event.pressed) { // Start recording stop_all_notes(); music_sequence_recording = true; + music_sequence_recorded = false; music_sequence_playing = false; music_sequence_count = 0; return false; @@ -84,12 +86,15 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { if (keycode == KC_LALT && record->event.pressed) { // Stop recording/playing stop_all_notes(); + if (music_sequence_recording) { // was recording + music_sequence_recorded = true; + } music_sequence_recording = false; music_sequence_playing = false; return false; } - if (keycode == KC_LGUI && record->event.pressed) { // Start playing + if (keycode == KC_LGUI && record->event.pressed && music_sequence_recorded) { // Start playing stop_all_notes(); music_sequence_recording = false; music_sequence_playing = true; |