MCU: show warning message for empty views

If the user attempted to access a view with no tracks in it, it would
show all blank screens. Now, it will show a temporary warning message and return
to the previous view.
This commit is contained in:
Franke Burgarino 2025-10-07 16:46:50 -05:00
parent fb6e4b75ab
commit 2b2021d5e0

View file

@ -1860,6 +1860,12 @@ MackieControlProtocol::set_view_mode (ViewMode m)
_view_mode = m;
_last_bank[old_view_mode] = _current_initial_bank;
if (Sorted sorted = get_sorted_stripables(); sorted.empty()) {
surfaces.front()->display_message_for ("This view is empty", 1000);
_view_mode = old_view_mode;
return;
}
if (switch_banks(_last_bank[m], true)) {
_view_mode = old_view_mode;
return;