mirror of
https://github.com/storytold/soundcraft.git
synced 2026-11-09 20:04:53 +00:00
Workspace for SoundCraft, a clean-room pure-Rust Pro Tools-class DAW: timebases and tempo maps, WAV/AIFF/FLAC/symphonia audio IO with peaks, SMF and MIDI ops, 26 original DSP plugins, the session model, the mix engine, ~180 registered commands with undo, a cpal player, and the agent rules (AGENTS.md, ATTRIBUTION.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.6 KiB
Rust
59 lines
1.6 KiB
Rust
//! Memory locations (markers and stored selections) and mix/edit groups.
|
||
|
||
use crate::{GroupId, MarkerId, TrackId};
|
||
use soundcraft_time::Samples;
|
||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, serde::Serialize, serde::Deserialize)]
|
||
pub enum MarkerKind {
|
||
/// A point marker on a ruler.
|
||
#[default]
|
||
Marker,
|
||
/// A stored selection range.
|
||
Selection,
|
||
/// A location that only recalls view settings.
|
||
None,
|
||
}
|
||
|
||
/// A memory location (Window › Memory Locations).
|
||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
||
pub struct MemoryLocation {
|
||
pub id: MarkerId,
|
||
/// User-visible number (1-based, unique).
|
||
pub number: u32,
|
||
pub name: String,
|
||
pub kind: MarkerKind,
|
||
pub start: Samples,
|
||
pub end: Samples,
|
||
#[serde(default)]
|
||
pub comments: String,
|
||
#[serde(default)]
|
||
pub color: Option<[u8; 3]>,
|
||
/// Marker ruler lane 1..5.
|
||
#[serde(default = "one")]
|
||
pub ruler: u8,
|
||
/// Track-lane marker on this track, if any.
|
||
#[serde(default)]
|
||
pub track: Option<TrackId>,
|
||
}
|
||
|
||
fn one() -> u8 {
|
||
1
|
||
}
|
||
|
||
/// A track group (Track › Group…).
|
||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
||
pub struct Group {
|
||
pub id: GroupId,
|
||
pub name: String,
|
||
/// Group letter id shown in the Groups list ("a", "b", …).
|
||
pub letter: char,
|
||
pub members: Vec<TrackId>,
|
||
pub edit: bool,
|
||
pub mix: bool,
|
||
pub active: bool,
|
||
pub color: [u8; 3],
|
||
/// Shared attributes linked by the group (volume, mute, solo, rec, etc.).
|
||
#[serde(default)]
|
||
pub attributes: Vec<String>,
|
||
}
|