65 lines
1.6 KiB
Rust
65 lines
1.6 KiB
Rust
|
|
use {
|
|
std::time::Duration,
|
|
crate::waveform::Waveform
|
|
};
|
|
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct Inputs {
|
|
pub t: Duration,
|
|
pub transition_time: Duration,
|
|
|
|
pub scene_select: usize,
|
|
pub cycle_len: Duration,
|
|
pub wave_peak: f32,
|
|
|
|
pub master_wave: Option< Waveform >,
|
|
pub master_subdivision: i32,
|
|
pub master_intensity: f32,
|
|
pub wheel: i32,
|
|
pub wheel2: i32,
|
|
pub wheel3: i32,
|
|
|
|
pub active: bool,
|
|
}
|
|
|
|
impl Default for Inputs {
|
|
fn default() -> Inputs {
|
|
Inputs {
|
|
t: Duration::from_millis(0),
|
|
transition_time: Duration::from_millis(0),
|
|
cycle_len: Duration::from_millis(300),
|
|
wave_peak: 0.5,
|
|
|
|
scene_select: 0,
|
|
|
|
master_wave: None,
|
|
master_subdivision: 0,
|
|
master_intensity: 1.0,
|
|
wheel: 0,
|
|
wheel2: 0,
|
|
wheel3: 0,
|
|
|
|
active: false,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Inputs {
|
|
pub fn display(&self) {
|
|
let cycle_bpm = (60000.0 / self.cycle_len.as_millis() as f32);
|
|
|
|
eprintln!("transition: {:?}", self.transition_time);
|
|
eprintln!("cycle [tap X]: {:?} | {} bpm", self.cycle_len, cycle_bpm);
|
|
eprintln!("wave peak: {:?}", self.wave_peak);
|
|
eprintln!("master wave [tap K]: {:?}", self.master_wave);
|
|
eprintln!("master subdivision: {}", self.master_subdivision);
|
|
eprintln!("master intensity: {}", self.master_intensity);
|
|
eprintln!("wheel-0 [G +/- B]: {}", self.wheel);
|
|
eprintln!("wheel-1 [F +/- V]: {}", self.wheel2);
|
|
eprintln!("wheel-2 [S +/- D]: {}", self.wheel3);
|
|
}
|
|
}
|
|
|
|
|