1 /* Copyright 2017 Fred Sundvik
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.
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.
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/>.
17 #ifndef KEYBOARDS_WHITEFOX_SIMPLE_VISUALIZER_H_
18 #define KEYBOARDS_WHITEFOX_SIMPLE_VISUALIZER_H_
20 #include "visualizer.h"
21 #include "visualizer_keyframes.h"
23 #include "default_animations.h"
26 static bool initial_update = true;
28 // Feel free to modify the animations below, or even add new ones if needed
30 void initialize_user_visualizer(visualizer_state_t* state) {
31 // The brightness will be dynamically adjustable in the future
32 // But for now, change it here.
33 initial_update = true;
34 start_keyframe_animation(&default_startup_animation);
38 void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
39 // Add more tests, change the colors and layer texts here
40 // Usually you want to check the high bits (higher layers first)
41 // because that's the order layers are processed for keypresses
42 // You can for check for example:
43 // state->status.layer
44 // state->status.default_layer
45 // state->status.leds (see led.h for available statuses)
47 if (initial_update) { initial_update=false; start_keyframe_animation(&led_test_animation); }
51 void user_visualizer_suspend(visualizer_state_t* state) {
52 start_keyframe_animation(&default_suspend_animation);
55 void user_visualizer_resume(visualizer_state_t* state) {
56 initial_update = true;
57 start_keyframe_animation(&default_startup_animation);
60 #endif /* KEYBOARDS_WHITEFOX_SIMPLE_VISUALIZER_H_ */