pub(super) const SEARCH_MIN_CHARS: usize = 2;
#[derive(Debug, Clone, PartialEq)]
pub enum InputMode {
Normal,
Search,
}
#[derive(Debug, Clone, PartialEq)]
pub enum SearchStatus {
WaitingForInput,
Debouncing { query: String },
Searching { query: String },
Ready { query: String },
Empty { query: String },
Error { query: String, message: String },
}
#[derive(Debug, Clone, PartialEq)]
pub enum PlaybackState {
Stopped,
Connecting,
Playing,
Paused,
Error(String),
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum RecordingState {
Off,
Pending,
Active,
}
#[derive(Debug, Clone, Copy, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum LayoutMode {
Split, LeftOnly, RightOnly, }
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SettingRow {
Notifications,
AutoplayLast,
RecordingDir,
KeepSnippets,
MinSongDuration,
Theme,
}
impl SettingRow {
pub const ALL: [Self; 6] = [
Self::Notifications,
Self::AutoplayLast,
Self::RecordingDir,
Self::KeepSnippets,
Self::MinSongDuration,
Self::Theme,
];
pub const COUNT: usize = Self::ALL.len();
pub fn from_index(index: usize) -> Option<Self> {
Self::ALL.get(index).copied()
}
pub fn index(self) -> usize {
match self {
Self::Notifications => 0,
Self::AutoplayLast => 1,
Self::RecordingDir => 2,
Self::KeepSnippets => 3,
Self::MinSongDuration => 4,
Self::Theme => 5,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AppNotice {
Info(String),
Error(String),
}