Feat: saving screen during perfs

This commit is contained in:
2026-02-21 15:56:52 +01:00
parent 4526156c37
commit 7207a5fefe
17 changed files with 117 additions and 223 deletions

View File

@@ -11,6 +11,7 @@ pub enum OptionsFocus {
ShowSpectrum,
ShowCompletion,
ShowPreview,
PerformanceMode,
Font,
ZoomFactor,
WindowSize,
@@ -38,6 +39,7 @@ impl CyclicEnum for OptionsFocus {
Self::ShowSpectrum,
Self::ShowCompletion,
Self::ShowPreview,
Self::PerformanceMode,
Self::Font,
Self::ZoomFactor,
Self::WindowSize,
@@ -90,26 +92,27 @@ const FULL_LAYOUT: &[(OptionsFocus, usize)] = &[
(OptionsFocus::ShowSpectrum, 7),
(OptionsFocus::ShowCompletion, 8),
(OptionsFocus::ShowPreview, 9),
(OptionsFocus::Font, 10),
(OptionsFocus::ZoomFactor, 11),
(OptionsFocus::WindowSize, 12),
// blank=13, ABLETON LINK header=14, divider=15
(OptionsFocus::LinkEnabled, 16),
(OptionsFocus::StartStopSync, 17),
(OptionsFocus::Quantum, 18),
// blank=19, SESSION header=20, divider=21, Tempo=22, Beat=23, Phase=24
// blank=25, MIDI OUTPUTS header=26, divider=27
(OptionsFocus::MidiOutput0, 28),
(OptionsFocus::MidiOutput1, 29),
(OptionsFocus::MidiOutput2, 30),
(OptionsFocus::MidiOutput3, 31),
// blank=32, MIDI INPUTS header=33, divider=34
(OptionsFocus::MidiInput0, 35),
(OptionsFocus::MidiInput1, 36),
(OptionsFocus::MidiInput2, 37),
(OptionsFocus::MidiInput3, 38),
// blank=39, ONBOARDING header=40, divider=41
(OptionsFocus::ResetOnboarding, 42),
(OptionsFocus::PerformanceMode, 10),
(OptionsFocus::Font, 11),
(OptionsFocus::ZoomFactor, 12),
(OptionsFocus::WindowSize, 13),
// blank=14, ABLETON LINK header=15, divider=16
(OptionsFocus::LinkEnabled, 17),
(OptionsFocus::StartStopSync, 18),
(OptionsFocus::Quantum, 19),
// blank=20, SESSION header=21, divider=22, Tempo=23, Beat=24, Phase=25
// blank=26, MIDI OUTPUTS header=27, divider=28
(OptionsFocus::MidiOutput0, 29),
(OptionsFocus::MidiOutput1, 30),
(OptionsFocus::MidiOutput2, 31),
(OptionsFocus::MidiOutput3, 32),
// blank=33, MIDI INPUTS header=34, divider=35
(OptionsFocus::MidiInput0, 36),
(OptionsFocus::MidiInput1, 37),
(OptionsFocus::MidiInput2, 38),
(OptionsFocus::MidiInput3, 39),
// blank=40, ONBOARDING header=41, divider=42
(OptionsFocus::ResetOnboarding, 43),
];
impl OptionsFocus {
@@ -165,17 +168,14 @@ fn visible_layout(plugin_mode: bool) -> Vec<(OptionsFocus, usize)> {
// based on which sections are hidden.
let mut offset: usize = 0;
// Font/Zoom/Window lines (10,11,12) hidden when !plugin_mode
// Font/Zoom/Window lines (11,12,13) hidden when !plugin_mode
if !plugin_mode {
offset += 3; // 3 lines for Font, ZoomFactor, WindowSize
}
// Link + Session + MIDI sections hidden when plugin_mode
// These span from blank(13) through MidiInput3(38) = 26 lines
// These span from blank(14) through MidiInput3(39) = 26 lines
if plugin_mode {
// blank + LINK header + divider + 3 options + blank + SESSION header + divider + 3 readonlys
// + blank + MIDI OUT header + divider + 4 options + blank + MIDI IN header + divider + 4 options
// = 26 lines (indices 13..=38)
let link_section_lines = 26;
offset += link_section_lines;
}
@@ -185,10 +185,10 @@ fn visible_layout(plugin_mode: bool) -> Vec<(OptionsFocus, usize)> {
if !focus.is_visible(plugin_mode) {
continue;
}
// Lines at or below index 9 (ShowPreview) are never shifted
let adjusted = if raw_line <= 9 {
// Lines at or below index 10 (PerformanceMode) are never shifted
let adjusted = if raw_line <= 10 {
raw_line
} else if !plugin_mode && raw_line <= 12 {
} else if !plugin_mode && raw_line <= 13 {
// Font/Zoom/Window — these are hidden, skip
continue;
} else {