diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-07-20 23:57:11 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-07-23 14:59:29 -0400 |
commit | 6a3c66776cb10888b24400526241b46deeb051a8 (patch) | |
tree | 7604aafe7087d9ab40aa0bb6bc603975e31d7e2e /quantum/process_keycode | |
parent | 8edb67b08242f2ab641d7e658a0a7adb579bbae2 (diff) | |
download | firmware-6a3c66776cb10888b24400526241b46deeb051a8.tar.gz firmware-6a3c66776cb10888b24400526241b46deeb051a8.tar.bz2 firmware-6a3c66776cb10888b24400526241b46deeb051a8.zip |
clean-up planck and preonic keymaps, move audio stuff around
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r-- | quantum/process_keycode/process_music.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 217dca280..c01740a7f 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -39,6 +39,15 @@ static uint8_t music_sequence_position = 0; static uint16_t music_sequence_timer = 0; static uint16_t music_sequence_interval = 100; +#ifndef MUSIC_ON_SONG + #define MUSIC_ON_SONG SONG(MUSIC_ON_SOUND) +#endif +#ifndef MUSIC_OFF_SONG + #define MUSIC_OFF_SONG SONG(MUSIC_OFF_SOUND) +#endif +float music_on_song[][2] = MUSIC_ON_SONG; +float music_off_song[][2] = MUSIC_OFF_SONG; + static void music_noteon(uint8_t note) { #ifdef AUDIO_ENABLE process_audio_noteon(note); @@ -79,12 +88,9 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } if (keycode == MU_TOG && record->event.pressed) { - if (music_activated) - { + if (music_activated) { music_off(); - } - else - { + } else { music_on(); } return false; @@ -175,12 +181,14 @@ void music_toggle(void) { void music_on(void) { music_activated = 1; + PLAY_SONG(music_on_song); music_on_user(); } void music_off(void) { - music_activated = 0; music_all_notes_off(); + music_activated = 0; + PLAY_SONG(music_off_song); } void matrix_scan_music(void) { |