diff options
Diffstat (limited to 'quantum/process_keycode/process_sequencer.c')
-rw-r--r-- | quantum/process_keycode/process_sequencer.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_sequencer.c b/quantum/process_keycode/process_sequencer.c new file mode 100644 index 000000000..334b4c009 --- /dev/null +++ b/quantum/process_keycode/process_sequencer.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* Copyright 2020 Rodolphe Belouin | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include "process_sequencer.h" | ||
18 | |||
19 | bool process_sequencer(uint16_t keycode, keyrecord_t *record) { | ||
20 | if (record->event.pressed) { | ||
21 | switch (keycode) { | ||
22 | case SQ_ON: | ||
23 | sequencer_on(); | ||
24 | return false; | ||
25 | case SQ_OFF: | ||
26 | sequencer_off(); | ||
27 | return false; | ||
28 | case SQ_TOG: | ||
29 | sequencer_toggle(); | ||
30 | return false; | ||
31 | case SQ_TMPD: | ||
32 | sequencer_decrease_tempo(); | ||
33 | return false; | ||
34 | case SQ_TMPU: | ||
35 | sequencer_increase_tempo(); | ||
36 | return false; | ||
37 | case SEQUENCER_RESOLUTION_MIN ... SEQUENCER_RESOLUTION_MAX: | ||
38 | sequencer_set_resolution(keycode - SEQUENCER_RESOLUTION_MIN); | ||
39 | return false; | ||
40 | case SQ_RESD: | ||
41 | sequencer_decrease_resolution(); | ||
42 | return false; | ||
43 | case SQ_RESU: | ||
44 | sequencer_increase_resolution(); | ||
45 | return false; | ||
46 | case SQ_SALL: | ||
47 | sequencer_set_all_steps_on(); | ||
48 | return false; | ||
49 | case SQ_SCLR: | ||
50 | sequencer_set_all_steps_off(); | ||
51 | return false; | ||
52 | case SEQUENCER_STEP_MIN ... SEQUENCER_STEP_MAX: | ||
53 | sequencer_toggle_step(keycode - SEQUENCER_STEP_MIN); | ||
54 | return false; | ||
55 | case SEQUENCER_TRACK_MIN ... SEQUENCER_TRACK_MAX: | ||
56 | sequencer_toggle_single_active_track(keycode - SEQUENCER_TRACK_MIN); | ||
57 | return false; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | return true; | ||
62 | } | ||