Skip to main content

maolan_engine/
meter.rs

1use crate::message::SessionSlotState;
2
3#[derive(Clone, Debug, Default)]
4pub struct MeterSnapshot {
5    pub hw_out_db: Vec<f32>,
6    pub track_meters: Vec<(String, Vec<f32>)>,
7}
8
9#[derive(Clone, Debug)]
10pub struct TransportSnapshot {
11    pub sample: usize,
12    pub tempo_bpm: f64,
13    pub playing: bool,
14    pub transport_running: bool,
15    pub tsig_num: u16,
16    pub tsig_denom: u16,
17}
18
19impl Default for TransportSnapshot {
20    fn default() -> Self {
21        Self {
22            sample: 0,
23            tempo_bpm: 120.0,
24            playing: false,
25            transport_running: false,
26            tsig_num: 4,
27            tsig_denom: 4,
28        }
29    }
30}
31
32#[derive(Clone, Debug)]
33pub struct SessionRuntimeSlotSnapshot {
34    pub track_name: String,
35    pub scene_index: usize,
36    pub state: SessionSlotState,
37    pub play_position_samples: usize,
38    pub elapsed_samples: usize,
39}
40
41#[derive(Clone, Debug, Default)]
42pub struct SessionRuntimeSnapshot {
43    pub slots: Vec<SessionRuntimeSlotSnapshot>,
44}