Work on daw backend
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
pub mod types;
|
||||
|
||||
pub use types::{AudioEvent, Command};
|
||||
@@ -0,0 +1,38 @@
|
||||
use crate::audio::{ClipId, TrackId};
|
||||
|
||||
/// Commands sent from UI/control thread to audio thread
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Command {
|
||||
// Transport commands
|
||||
/// Start playback
|
||||
Play,
|
||||
/// Stop playback and reset to beginning
|
||||
Stop,
|
||||
/// Pause playback (maintains position)
|
||||
Pause,
|
||||
/// Seek to a specific position in seconds
|
||||
Seek(f64),
|
||||
|
||||
// Track management commands
|
||||
/// Set track volume (0.0 = silence, 1.0 = unity gain)
|
||||
SetTrackVolume(TrackId, f32),
|
||||
/// Set track mute state
|
||||
SetTrackMute(TrackId, bool),
|
||||
/// Set track solo state
|
||||
SetTrackSolo(TrackId, bool),
|
||||
|
||||
// Clip management commands
|
||||
/// Move a clip to a new timeline position
|
||||
MoveClip(TrackId, ClipId, f64),
|
||||
}
|
||||
|
||||
/// Events sent from audio thread back to UI/control thread
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum AudioEvent {
|
||||
/// Current playback position in seconds
|
||||
PlaybackPosition(f64),
|
||||
/// Playback has stopped (reached end of audio)
|
||||
PlaybackStopped,
|
||||
/// Audio buffer underrun detected
|
||||
BufferUnderrun,
|
||||
}
|
||||
Reference in New Issue
Block a user