aboutsummaryrefslogtreecommitdiff
path: root/quantum/visualizer/visualizer.h
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-04-05 10:08:25 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-04-09 18:34:59 +0300
commit64d63ab42281318d891434fbc00277043298dd70 (patch)
tree03747a21a2a5a30df3e120e117bdd51ce99346e6 /quantum/visualizer/visualizer.h
parent1e7585e76771e1a2d8ca733fc09c19f9fa0e903c (diff)
downloadqmk_firmware-64d63ab42281318d891434fbc00277043298dd70.tar.gz
qmk_firmware-64d63ab42281318d891434fbc00277043298dd70.zip
Remove the need to manually enable the visualizer
Diffstat (limited to 'quantum/visualizer/visualizer.h')
-rw-r--r--quantum/visualizer/visualizer.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h
index f37ce8416..463934849 100644
--- a/quantum/visualizer/visualizer.h
+++ b/quantum/visualizer/visualizer.h
@@ -130,20 +130,22 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat
130// Does nothing, useful for adding delays 130// Does nothing, useful for adding delays
131bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); 131bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state);
132 132
133// Call this once, when the initial animation has finished, alternatively you can call it
134// directly from the initalize_user_visualizer function (the animation can be null)
135bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state);
136
137// The master can set userdata which will be transferred to the slave 133// The master can set userdata which will be transferred to the slave
138#ifdef VISUALIZER_USER_DATA_SIZE 134#ifdef VISUALIZER_USER_DATA_SIZE
139void visualizer_set_user_data(void* user_data); 135void visualizer_set_user_data(void* user_data);
140#endif 136#endif
141 137
142// These functions have to be implemented by the user 138// These functions have to be implemented by the user
143void initialize_user_visualizer(visualizer_state_t* state); 139// Called regularly each time the state has changed (but not every scan loop)
144void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status); 140void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status);
141// Called when the computer goes to suspend, will also stop calling update_user_visualizer_state
145void user_visualizer_suspend(visualizer_state_t* state); 142void user_visualizer_suspend(visualizer_state_t* state);
143// You have to start at least one animation as a response to the following two functions
144// When the animation has finished the visualizer will resume normal operation and start calling the
145// update_user_visualizer_state again
146// Called when the keyboard boots up
147void initialize_user_visualizer(visualizer_state_t* state);
148// Called when the computer resumes from a suspend
146void user_visualizer_resume(visualizer_state_t* state); 149void user_visualizer_resume(visualizer_state_t* state);
147 150
148
149#endif /* VISUALIZER_H */ 151#endif /* VISUALIZER_H */