diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2016-07-06 20:30:58 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2016-07-06 20:30:58 +0300 |
| commit | 6c296557909501b71fe344ce379e74094cf77c8e (patch) | |
| tree | e02fdb7bb85a16de027c6c1946817e96d5304ab3 /quantum/visualizer/visualizer.h | |
| parent | f727801bc69b3db28f84b7b8986756193bbfd21e (diff) | |
| parent | 73d890a2c9c34b905cd5e74e7146fdd4578dcb96 (diff) | |
| download | qmk_firmware-6c296557909501b71fe344ce379e74094cf77c8e.tar.gz qmk_firmware-6c296557909501b71fe344ce379e74094cf77c8e.zip | |
Merge commit '73d890a2c9c34b905cd5e74e7146fdd4578dcb96' into add_visualizer
Diffstat (limited to 'quantum/visualizer/visualizer.h')
| -rw-r--r-- | quantum/visualizer/visualizer.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 22798cda6..45cfa9aa9 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h | |||
| @@ -45,8 +45,18 @@ void visualizer_suspend(void); | |||
| 45 | // This should be called when the keyboard wakes up from suspend state | 45 | // This should be called when the keyboard wakes up from suspend state |
| 46 | void visualizer_resume(void); | 46 | void visualizer_resume(void); |
| 47 | 47 | ||
| 48 | // If you need support for more than 8 keyframes per animation, you can change this | 48 | // These functions are week, so they can be overridden by the keyboard |
| 49 | #define MAX_VISUALIZER_KEY_FRAMES 8 | 49 | // if needed |
| 50 | GDisplay* get_lcd_display(void); | ||
| 51 | GDisplay* get_led_display(void); | ||
| 52 | |||
| 53 | // For emulator builds, this function need to be implemented | ||
| 54 | #ifdef EMULATOR | ||
| 55 | void draw_emulator(void); | ||
| 56 | #endif | ||
| 57 | |||
| 58 | // If you need support for more than 16 keyframes per animation, you can change this | ||
| 59 | #define MAX_VISUALIZER_KEY_FRAMES 16 | ||
| 50 | 60 | ||
| 51 | struct keyframe_animation_t; | 61 | struct keyframe_animation_t; |
| 52 | 62 | ||
| @@ -95,12 +105,20 @@ typedef struct keyframe_animation_t { | |||
| 95 | // keyframe update functions | 105 | // keyframe update functions |
| 96 | int current_frame; | 106 | int current_frame; |
| 97 | int time_left_in_frame; | 107 | int time_left_in_frame; |
| 108 | bool first_update_of_frame; | ||
| 109 | bool last_update_of_frame; | ||
| 98 | bool need_update; | 110 | bool need_update; |
| 99 | 111 | ||
| 100 | } keyframe_animation_t; | 112 | } keyframe_animation_t; |
| 101 | 113 | ||
| 114 | extern GDisplay* LCD_DISPLAY; | ||
| 115 | extern GDisplay* LED_DISPLAY; | ||
| 116 | |||
| 102 | void start_keyframe_animation(keyframe_animation_t* animation); | 117 | void start_keyframe_animation(keyframe_animation_t* animation); |
| 103 | void stop_keyframe_animation(keyframe_animation_t* animation); | 118 | void stop_keyframe_animation(keyframe_animation_t* animation); |
| 119 | // This runs the next keyframe, but does not update the animation state | ||
| 120 | // Useful for crossfades for example | ||
| 121 | void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); | ||
| 104 | 122 | ||
| 105 | // Some predefined keyframe functions that can be used by the user code | 123 | // Some predefined keyframe functions that can be used by the user code |
| 106 | // Does nothing, useful for adding delays | 124 | // Does nothing, useful for adding delays |
| @@ -121,7 +139,7 @@ bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualiz | |||
| 121 | // directly from the initalize_user_visualizer function (the animation can be null) | 139 | // directly from the initalize_user_visualizer function (the animation can be null) |
| 122 | bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); | 140 | bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); |
| 123 | 141 | ||
| 124 | // These two functions have to be implemented by the user | 142 | // These functions have to be implemented by the user |
| 125 | void initialize_user_visualizer(visualizer_state_t* state); | 143 | void initialize_user_visualizer(visualizer_state_t* state); |
| 126 | void update_user_visualizer_state(visualizer_state_t* state); | 144 | void update_user_visualizer_state(visualizer_state_t* state); |
| 127 | void user_visualizer_suspend(visualizer_state_t* state); | 145 | void user_visualizer_suspend(visualizer_state_t* state); |
