summaryrefslogtreecommitdiffstats
path: root/quantum/visualizer/visualizer.h
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-07-06 19:30:58 +0200
committerFred Sundvik <fsundvik@gmail.com>2016-07-06 19:30:58 +0200
commit6c296557909501b71fe344ce379e74094cf77c8e (patch)
treee02fdb7bb85a16de027c6c1946817e96d5304ab3 /quantum/visualizer/visualizer.h
parentf727801bc69b3db28f84b7b8986756193bbfd21e (diff)
parent73d890a2c9c34b905cd5e74e7146fdd4578dcb96 (diff)
downloadqmk_firmware-6c296557909501b71fe344ce379e74094cf77c8e.tar.gz
qmk_firmware-6c296557909501b71fe344ce379e74094cf77c8e.tar.xz
Merge commit '73d890a2c9c34b905cd5e74e7146fdd4578dcb96' into add_visualizer
Diffstat (limited to 'quantum/visualizer/visualizer.h')
-rw-r--r--quantum/visualizer/visualizer.h24
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);
// This should be called when the keyboard wakes up from suspend state
void visualizer_resume(void);
-// If you need support for more than 8 keyframes per animation, you can change this
-#define MAX_VISUALIZER_KEY_FRAMES 8
+// These functions are week, so they can be overridden by the keyboard
+// if needed
+GDisplay* get_lcd_display(void);
+GDisplay* get_led_display(void);
+
+// For emulator builds, this function need to be implemented
+#ifdef EMULATOR
+void draw_emulator(void);
+#endif
+
+// If you need support for more than 16 keyframes per animation, you can change this
+#define MAX_VISUALIZER_KEY_FRAMES 16
struct keyframe_animation_t;
@@ -95,12 +105,20 @@ typedef struct keyframe_animation_t {
// keyframe update functions
int current_frame;
int time_left_in_frame;
+ bool first_update_of_frame;
+ bool last_update_of_frame;
bool need_update;
} keyframe_animation_t;
+extern GDisplay* LCD_DISPLAY;
+extern GDisplay* LED_DISPLAY;
+
void start_keyframe_animation(keyframe_animation_t* animation);
void stop_keyframe_animation(keyframe_animation_t* animation);
+// This runs the next keyframe, but does not update the animation state
+// Useful for crossfades for example
+void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state);
// Some predefined keyframe functions that can be used by the user code
// Does nothing, useful for adding delays
@@ -121,7 +139,7 @@ bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualiz
// directly from the initalize_user_visualizer function (the animation can be null)
bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state);
-// These two functions have to be implemented by the user
+// These functions have to be implemented by the user
void initialize_user_visualizer(visualizer_state_t* state);
void update_user_visualizer_state(visualizer_state_t* state);
void user_visualizer_suspend(visualizer_state_t* state);