Skip to main content

record_player/
command.rs

1use crate::{DeckId, SurfaceRegion};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5#[serde(tag = "type", rename_all = "snake_case")]
6pub enum HostCommand {
7    SetMotor { deck: DeckId, running: bool },
8    SetPacketGain { deck: DeckId, gain: f32, ramp_ms: u32 },
9    StartPacketPlayback { deck: DeckId, offset_seconds: f64, rate: f32, platter_handoff: bool },
10    StopPacketPlayback { deck: DeckId, platter_handoff: bool },
11    SeekPacketPlayback { deck: DeckId, offset_seconds: f64 },
12    SetScratchTransport { deck: DeckId, hand_contact: bool, motor_rate: f32 },
13    SetScratchTarget { deck: DeckId, position_frames: f64, rate: f32, impulse: f32 },
14    SetScratchPosition { deck: DeckId, position_frames: f64, impulse: f32 },
15    StartSurfaceRegion { region: SurfaceRegion, duration_seconds: f64 },
16    StopSurfaceRegion { region: SurfaceRegion },
17    StopClipLoop,
18    SetMixerTrackGain { track: u8, gain: f32, ramp_ms: u32 },
19    CaptureScratchStart { deck: DeckId, start_seconds: f64, rotation_degrees: f64 },
20    CaptureScratchFinish { deck: DeckId, end_seconds: f64, rotation_degrees: f64, save_sample: bool },
21    PublishTransportIntent,
22    RefreshView,
23}