diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2017-07-21 09:45:02 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-07-23 14:59:29 -0400 |
| commit | fd664fe85b4d6e8a849ae47be5e29857fa3a24a5 (patch) | |
| tree | 83383d5a4b5ee738b029c4f6e80d45fb26f0c24b | |
| parent | fe113ebad56e758d635724dc35f2a4e26a6985ee (diff) | |
| download | qmk_firmware-fd664fe85b4d6e8a849ae47be5e29857fa3a24a5.tar.gz qmk_firmware-fd664fe85b4d6e8a849ae47be5e29857fa3a24a5.zip | |
escape song playing in music
| -rw-r--r-- | quantum/process_keycode/process_music.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index c01740a7f..ec2287df1 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c | |||
| @@ -39,14 +39,16 @@ static uint8_t music_sequence_position = 0; | |||
| 39 | static uint16_t music_sequence_timer = 0; | 39 | static uint16_t music_sequence_timer = 0; |
| 40 | static uint16_t music_sequence_interval = 100; | 40 | static uint16_t music_sequence_interval = 100; |
| 41 | 41 | ||
| 42 | #ifndef MUSIC_ON_SONG | 42 | #ifdef AUDIO_ENABLE |
| 43 | #define MUSIC_ON_SONG SONG(MUSIC_ON_SOUND) | 43 | #ifndef MUSIC_ON_SONG |
| 44 | #endif | 44 | #define MUSIC_ON_SONG SONG(MUSIC_ON_SOUND) |
| 45 | #ifndef MUSIC_OFF_SONG | 45 | #endif |
| 46 | #define MUSIC_OFF_SONG SONG(MUSIC_OFF_SOUND) | 46 | #ifndef MUSIC_OFF_SONG |
| 47 | #define MUSIC_OFF_SONG SONG(MUSIC_OFF_SOUND) | ||
| 48 | #endif | ||
| 49 | float music_on_song[][2] = MUSIC_ON_SONG; | ||
| 50 | float music_off_song[][2] = MUSIC_OFF_SONG; | ||
| 47 | #endif | 51 | #endif |
| 48 | float music_on_song[][2] = MUSIC_ON_SONG; | ||
| 49 | float music_off_song[][2] = MUSIC_OFF_SONG; | ||
| 50 | 52 | ||
| 51 | static void music_noteon(uint8_t note) { | 53 | static void music_noteon(uint8_t note) { |
| 52 | #ifdef AUDIO_ENABLE | 54 | #ifdef AUDIO_ENABLE |
| @@ -181,14 +183,18 @@ void music_toggle(void) { | |||
| 181 | 183 | ||
| 182 | void music_on(void) { | 184 | void music_on(void) { |
| 183 | music_activated = 1; | 185 | music_activated = 1; |
| 184 | PLAY_SONG(music_on_song); | 186 | #ifdef AUDIO_ENABLE |
| 187 | PLAY_SONG(music_on_song); | ||
| 188 | #endif | ||
| 185 | music_on_user(); | 189 | music_on_user(); |
| 186 | } | 190 | } |
| 187 | 191 | ||
| 188 | void music_off(void) { | 192 | void music_off(void) { |
| 189 | music_all_notes_off(); | 193 | music_all_notes_off(); |
| 190 | music_activated = 0; | 194 | music_activated = 0; |
| 191 | PLAY_SONG(music_off_song); | 195 | #ifdef AUDIO_ENABLE |
| 196 | PLAY_SONG(music_off_song); | ||
| 197 | #endif | ||
| 192 | } | 198 | } |
| 193 | 199 | ||
| 194 | void matrix_scan_music(void) { | 200 | void matrix_scan_music(void) { |
