39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct State {
|
|
pub connections: ConnectionState,
|
|
pub metronome: MetronomeState,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct ConnectionState {
|
|
pub midi_in: Vec<String>,
|
|
pub audio_in: Vec<String>,
|
|
pub audio_out: Vec<String>,
|
|
pub click_track_out: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct MetronomeState {
|
|
pub frames_per_beat: usize,
|
|
pub click_volume: f32, // 0.0 to 1.0
|
|
}
|
|
|
|
impl Default for State {
|
|
fn default() -> Self {
|
|
Self {
|
|
connections: ConnectionState {
|
|
midi_in: Vec::new(),
|
|
audio_in: Vec::new(),
|
|
audio_out: Vec::new(),
|
|
click_track_out: Vec::new(),
|
|
},
|
|
metronome: MetronomeState {
|
|
frames_per_beat: 96000, // 120 BPM at 192kHz sample rate
|
|
click_volume: 0.5, // Default 50% volume
|
|
},
|
|
}
|
|
}
|
|
}
|