diff options
Diffstat (limited to 'layouts/community/ergodox/drashna/visualizer.c')
-rw-r--r-- | layouts/community/ergodox/drashna/visualizer.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/layouts/community/ergodox/drashna/visualizer.c b/layouts/community/ergodox/drashna/visualizer.c new file mode 100644 index 000000000..6b1c3ff49 --- /dev/null +++ b/layouts/community/ergodox/drashna/visualizer.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | Copyright 2017 Fred Sundvik | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #include "./simple_visualizer.h" | ||
19 | #include "util.h" | ||
20 | #include "drashna.h" | ||
21 | #include "rgblight_list.h" | ||
22 | |||
23 | #define LCD_COLOR_wrapper(...) LCD_COLOR(__VA_ARGS__) | ||
24 | // This function should be implemented by the keymap visualizer | ||
25 | // Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing | ||
26 | // that the simple_visualizer assumes that you are updating | ||
27 | // Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is | ||
28 | // stopped. This can be done by either double buffering it or by using constant strings | ||
29 | static void get_visualizer_layer_and_color(visualizer_state_t* state) { | ||
30 | |||
31 | switch(get_highest_layer(state->status.layer|default_layer_state)) { | ||
32 | case _LOWER: | ||
33 | state->layer_text = "Lower"; | ||
34 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_GREEN); | ||
35 | break; | ||
36 | case _RAISE: | ||
37 | state->layer_text = "Raise"; | ||
38 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_YELLOW); | ||
39 | break; | ||
40 | case _ADJUST: | ||
41 | state->layer_text = "Adjust"; | ||
42 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); | ||
43 | break; | ||
44 | case _MACROS: | ||
45 | state->layer_text = "Macros"; | ||
46 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); | ||
47 | break; | ||
48 | case _MEDIA: | ||
49 | state->layer_text = "Media"; | ||
50 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_CHARTREUSE); | ||
51 | break; | ||
52 | case _GAMEPAD: | ||
53 | state->layer_text = "Game"; | ||
54 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); | ||
55 | break; | ||
56 | case _QWERTY: | ||
57 | state->layer_text = "QWERTY"; | ||
58 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_CYAN); | ||
59 | break; | ||
60 | case _WORKMAN: | ||
61 | state->layer_text = "Workman"; | ||
62 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_GOLDENROD); | ||
63 | break; | ||
64 | case _DVORAK: | ||
65 | state->layer_text = "Dvorak"; | ||
66 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_SPRINGGREEN); | ||
67 | break; | ||
68 | case _COLEMAK: | ||
69 | state->layer_text = "Colemak"; | ||
70 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_MAGENTA); | ||
71 | break; break; | ||
72 | default: | ||
73 | state->layer_text = "NONE"; | ||
74 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); | ||
75 | break; | ||
76 | } | ||
77 | } | ||