some tweaks after docs regen
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
stop screaming 2026-02-21 05:19:26 +02:00
parent abf950aea4
commit 817d2a722c
7 changed files with 214 additions and 217 deletions

View file

@ -105,7 +105,22 @@ pub struct JackNotify<T: Fn(JackEvent) + Send>(pub T);
/// Configuration: mode, view, and bind definitions.
///
/// ```
/// let conf = tek::Config::default();
/// let config = tek::Config::default();
/// ```
///
/// ```
/// // Some dizzle.
/// // What indentation to use here lol?
/// let source = stringify!((mode :menu (name Menu)
/// (info Mode selector.) (keys :axis/y :confirm)
/// (view (bg (g 0) (bsp/s :ports/out
/// (bsp/n :ports/in
/// (bg (g 30) (bsp/s (fixed/y 7 :logo)
/// (fill :dialog/menu)))))))));
/// // Add this definition to the config and try to load it.
/// // A "mode" is basically a state machine
/// // with associated input and output definitions.
/// tek::Config::default().add(&source).unwrap().get_mode(":menu").unwrap();
/// ```
#[derive(Default, Debug)] pub struct Config {
/// XDG base directories of running user.
@ -293,9 +308,9 @@ pub struct JackNotify<T: Fn(JackEvent) + Send>(pub T);
/// Audio samples per second
pub sr: SampleRate,
/// MIDI beats per minute
pub bpm: BeatsPerMinute,
pub bpm: Bpm,
/// MIDI ticks per beat
pub ppq: PulsesPerQuaver,
pub ppq: Ppq,
}
/// Iterator that emits subsequent ticks within a range.
@ -387,7 +402,7 @@ pub struct JackNotify<T: Fn(JackEvent) + Send>(pub T);
/// ```
///
/// ```
#[derive(Debug, Default)] pub struct PulsesPerQuaver (pub(crate) AtomicF64);
#[derive(Debug, Default)] pub struct Ppq (pub(crate) AtomicF64);
/// Timestamp in MIDI pulses
///
@ -401,7 +416,7 @@ pub struct JackNotify<T: Fn(JackEvent) + Send>(pub T);
/// ```
///
/// ```
#[derive(Debug, Default)] pub struct BeatsPerMinute (pub(crate) AtomicF64);
#[derive(Debug, Default)] pub struct Bpm (pub(crate) AtomicF64);
/// Quantization setting for launching clips
///
@ -828,7 +843,7 @@ pub struct PoolView<'a>(pub &'a Pool);
/// Recording buffer.
pub buffer: Vec<Vec<f32>>,
/// Samples mapped to MIDI notes.
pub samples: Samples<128>,
pub samples: SampleKit<128>,
/// Samples that are not mapped to MIDI notes.
pub unmapped: Vec<Arc<RwLock<Sample>>>,
/// Sample currently being edited.
@ -861,14 +876,12 @@ pub struct PoolView<'a>(pub &'a Pool);
/// Collection of samples, one per slot, fixed number of slots.
///
/// TODO: Map more than one sample per slot.
///
/// History: Separated to cleanly implement [Default].
///
/// ```
/// let samples = tek::Samples([None, None, None, None]);
/// let samples = tek::SampleKit([None, None, None, None]);
/// ```
#[derive(Debug)] pub struct Samples<const N: usize>(
#[derive(Debug)] pub struct SampleKit<const N: usize>(
pub [Option<Arc<RwLock<Sample>>>;N]
);