pub mod action;
pub mod command;
pub mod config;
pub mod dispatch;
pub mod instance;
pub mod media;
pub mod message;
pub mod meter;
pub mod model;
pub mod sampler;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum View {
Library,
Selection,
Playlists,
Sampler,
}
impl View {
pub const ALL: [View; 4] = [
View::Library,
View::Selection,
View::Playlists,
View::Sampler,
];
pub fn title(self) -> &'static str {
match self {
View::Library => "Library",
View::Selection => "Selection",
View::Playlists => "Playlists",
View::Sampler => "Sampler",
}
}
pub fn next(self) -> Self {
match self {
View::Library => View::Selection,
View::Selection => View::Playlists,
View::Playlists => View::Sampler,
View::Sampler => View::Library,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Theme {
System,
Light,
#[default]
Dark,
}
impl Theme {
pub const NAMES: [(&'static str, Theme); 3] = [
("system", Theme::System),
("light", Theme::Light),
("dark", Theme::Dark),
];
pub fn name(self) -> &'static str {
Theme::NAMES
.iter()
.find(|t| t.1 == self)
.expect("every theme")
.0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Display {
#[default]
Envelope,
Decibels,
Braille,
Spectrogram,
}
impl Display {
pub fn name(self) -> &'static str {
match self {
Display::Envelope => "envelope",
Display::Decibels => "db",
Display::Braille => "braille",
Display::Spectrogram => "spectrogram",
}
}
pub fn next(self) -> Display {
match self {
Display::Envelope => Display::Decibels,
Display::Decibels => Display::Spectrogram,
Display::Spectrogram => Display::Braille,
Display::Braille => Display::Envelope,
}
}
}