76 lines
3.1 KiB
Rust
76 lines
3.1 KiB
Rust
#[derive(Clone, Copy, PartialEq, Eq, Default)]
|
|
pub enum OptionsFocus {
|
|
#[default]
|
|
ColorScheme,
|
|
RefreshRate,
|
|
RuntimeHighlight,
|
|
ShowScope,
|
|
ShowSpectrum,
|
|
ShowCompletion,
|
|
FlashBrightness,
|
|
LinkEnabled,
|
|
StartStopSync,
|
|
Quantum,
|
|
MidiOutput0,
|
|
MidiOutput1,
|
|
MidiOutput2,
|
|
MidiOutput3,
|
|
MidiInput0,
|
|
MidiInput1,
|
|
MidiInput2,
|
|
MidiInput3,
|
|
}
|
|
|
|
#[derive(Default)]
|
|
pub struct OptionsState {
|
|
pub focus: OptionsFocus,
|
|
}
|
|
|
|
impl OptionsState {
|
|
pub fn next_focus(&mut self) {
|
|
self.focus = match self.focus {
|
|
OptionsFocus::ColorScheme => OptionsFocus::RefreshRate,
|
|
OptionsFocus::RefreshRate => OptionsFocus::RuntimeHighlight,
|
|
OptionsFocus::RuntimeHighlight => OptionsFocus::ShowScope,
|
|
OptionsFocus::ShowScope => OptionsFocus::ShowSpectrum,
|
|
OptionsFocus::ShowSpectrum => OptionsFocus::ShowCompletion,
|
|
OptionsFocus::ShowCompletion => OptionsFocus::FlashBrightness,
|
|
OptionsFocus::FlashBrightness => OptionsFocus::LinkEnabled,
|
|
OptionsFocus::LinkEnabled => OptionsFocus::StartStopSync,
|
|
OptionsFocus::StartStopSync => OptionsFocus::Quantum,
|
|
OptionsFocus::Quantum => OptionsFocus::MidiOutput0,
|
|
OptionsFocus::MidiOutput0 => OptionsFocus::MidiOutput1,
|
|
OptionsFocus::MidiOutput1 => OptionsFocus::MidiOutput2,
|
|
OptionsFocus::MidiOutput2 => OptionsFocus::MidiOutput3,
|
|
OptionsFocus::MidiOutput3 => OptionsFocus::MidiInput0,
|
|
OptionsFocus::MidiInput0 => OptionsFocus::MidiInput1,
|
|
OptionsFocus::MidiInput1 => OptionsFocus::MidiInput2,
|
|
OptionsFocus::MidiInput2 => OptionsFocus::MidiInput3,
|
|
OptionsFocus::MidiInput3 => OptionsFocus::ColorScheme,
|
|
};
|
|
}
|
|
|
|
pub fn prev_focus(&mut self) {
|
|
self.focus = match self.focus {
|
|
OptionsFocus::ColorScheme => OptionsFocus::MidiInput3,
|
|
OptionsFocus::RefreshRate => OptionsFocus::ColorScheme,
|
|
OptionsFocus::RuntimeHighlight => OptionsFocus::RefreshRate,
|
|
OptionsFocus::ShowScope => OptionsFocus::RuntimeHighlight,
|
|
OptionsFocus::ShowSpectrum => OptionsFocus::ShowScope,
|
|
OptionsFocus::ShowCompletion => OptionsFocus::ShowSpectrum,
|
|
OptionsFocus::FlashBrightness => OptionsFocus::ShowCompletion,
|
|
OptionsFocus::LinkEnabled => OptionsFocus::FlashBrightness,
|
|
OptionsFocus::StartStopSync => OptionsFocus::LinkEnabled,
|
|
OptionsFocus::Quantum => OptionsFocus::StartStopSync,
|
|
OptionsFocus::MidiOutput0 => OptionsFocus::Quantum,
|
|
OptionsFocus::MidiOutput1 => OptionsFocus::MidiOutput0,
|
|
OptionsFocus::MidiOutput2 => OptionsFocus::MidiOutput1,
|
|
OptionsFocus::MidiOutput3 => OptionsFocus::MidiOutput2,
|
|
OptionsFocus::MidiInput0 => OptionsFocus::MidiOutput3,
|
|
OptionsFocus::MidiInput1 => OptionsFocus::MidiInput0,
|
|
OptionsFocus::MidiInput2 => OptionsFocus::MidiInput1,
|
|
OptionsFocus::MidiInput3 => OptionsFocus::MidiInput2,
|
|
};
|
|
}
|
|
}
|