@@ -45,6 +45,38 @@ PROJECTM_EXPORT void projectm_set_texture_search_paths(projectm_handle instance,
4545 const char * * texture_search_paths ,
4646 size_t count );
4747
48+ /**
49+ * @brief Sets a user-specified frame time in fractional seconds.
50+ *
51+ * Setting this to any value equal to or larger than zero will make projectM use this time value for
52+ * animations instead of the system clock. Any value less than zero will use the system time instead,
53+ * which is the default behavior.
54+ *
55+ * This method can be used to render visualizations at non-realtime frame rates, e.g. encoding a video
56+ * as fast as projectM can render frames.
57+ *
58+ * While switching back and forth between system and user time values is possible, it will cause
59+ * visual artifacts in the rendering as the time value will make large jumps between frames. Thus,
60+ * it is recommended to stay with one type of timing value.
61+ *
62+ * If using this feature, it is further recommended to set the time to 0.0 on the first frame.
63+ *
64+ * @param instance The projectM instance handle.
65+ * @param seconds_since_first_frame Any value >= 0 to use user-specified timestamps, values < 0 will use the system clock.
66+ */
67+ PROJECTM_EXPORT void projectm_set_frame_time (projectm_handle instance , double seconds_since_first_frame );
68+
69+ /**
70+ * @brief Returns the fractional seconds time value used rendering the last frame.
71+ * @note This will not return the value set with projectm_set_frame_time, but the actual time
72+ * used to render the last frame. If a user-specified frame time was set, this value is
73+ * returned. Otherwise, the frame time measured via the system clock will be returned.
74+ * @param instance The projectM instance handle.
75+ * @return Time elapsed since projectM was started, or the value of the user-specified time value used
76+ * to render the last frame.
77+ */
78+ PROJECTM_EXPORT double projectm_get_last_frame_time (projectm_handle instance );
79+
4880/**
4981 * @brief Sets the beat sensitivity.
5082 *
0 commit comments