com_croftsoft_lib_animation/metronome/
mod.rs

1// =============================================================================
2//! - Metronome trait
3//!
4//! # Metadata
5//! - Copyright: © 2023 [`CroftSoft Inc`]
6//! - Author: [`David Wallace Croft`]
7//! - Created: 2023-02-21
8//! - Updated: 2023-02-22
9//!
10//! [`CroftSoft Inc`]: https://www.croftsoft.com/
11//! [`David Wallace Croft`]: https://www.croftsoft.com/people/david/
12// =============================================================================
13
14pub mod delta;
15pub mod simple;
16pub mod updater;
17
18pub trait Metronome {
19  fn reset(
20    &mut self,
21    current_time_millis: f64,
22  );
23
24  fn set_period_millis(
25    &mut self,
26    period_millis: f64,
27  );
28
29  fn set_time_millis_next_tick(
30    &mut self,
31    time_millis_next_tick: f64,
32  );
33
34  fn tick(
35    &mut self,
36    current_time_millis: f64,
37  ) -> bool;
38}