Files
soundcraft/crates/model/src/markers.rs
T
Brandon ThomasandClaude Opus 5.5 755f02fc85 Foundation: time, audio-io, midi, dsp, model, mix, engine, playback crates
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>
2026-10-05 22:27:29 -04:00

59 lines
1.6 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! 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>,
}