aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-07-20 23:57:11 -0400
committerJack Humbert <jack.humb@gmail.com>2017-07-23 14:59:29 -0400
commit6a3c66776cb10888b24400526241b46deeb051a8 (patch)
tree7604aafe7087d9ab40aa0bb6bc603975e31d7e2e /quantum/process_keycode
parent8edb67b08242f2ab641d7e658a0a7adb579bbae2 (diff)
downloadqmk_firmware-6a3c66776cb10888b24400526241b46deeb051a8.tar.gz
qmk_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.c20
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;
39static uint16_t music_sequence_timer = 0; 39static uint16_t music_sequence_timer = 0;
40static uint16_t music_sequence_interval = 100; 40static uint16_t music_sequence_interval = 100;
41 41
42#ifndef MUSIC_ON_SONG
43 #define MUSIC_ON_SONG SONG(MUSIC_ON_SOUND)
44#endif
45#ifndef MUSIC_OFF_SONG
46 #define MUSIC_OFF_SONG SONG(MUSIC_OFF_SOUND)
47#endif
48float music_on_song[][2] = MUSIC_ON_SONG;
49float music_off_song[][2] = MUSIC_OFF_SONG;
50
42static void music_noteon(uint8_t note) { 51static void music_noteon(uint8_t note) {
43 #ifdef AUDIO_ENABLE 52 #ifdef AUDIO_ENABLE
44 process_audio_noteon(note); 53 process_audio_noteon(note);
@@ -79,12 +88,9 @@ bool process_music(uint16_t keycode, keyrecord_t *record) {
79 } 88 }
80 89
81 if (keycode == MU_TOG && record->event.pressed) { 90 if (keycode == MU_TOG && record->event.pressed) {
82 if (music_activated) 91 if (music_activated) {
83 {
84 music_off(); 92 music_off();
85 } 93 } else {
86 else
87 {
88 music_on(); 94 music_on();
89 } 95 }
90 return false; 96 return false;
@@ -175,12 +181,14 @@ void music_toggle(void) {
175 181
176void music_on(void) { 182void music_on(void) {
177 music_activated = 1; 183 music_activated = 1;
184 PLAY_SONG(music_on_song);
178 music_on_user(); 185 music_on_user();
179} 186}
180 187
181void music_off(void) { 188void music_off(void) {
182 music_activated = 0;
183 music_all_notes_off(); 189 music_all_notes_off();
190 music_activated = 0;
191 PLAY_SONG(music_off_song);
184} 192}
185 193
186void matrix_scan_music(void) { 194void matrix_scan_music(void) {