Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ the project file format or the controls.
2 s (`HOLD AGAIN: REMOVE 3`); turning A or B opens PREP on the zone, START and END's one home.
PREP SLICE: push B twice removes the point, CLR goes back. PREP WRITE: CLR goes back, dropping
an OK that waits for its second press. A run of CLRs now walks out to GRID and removes nothing.
- **The FUNC menu has a DO part and a SET part** (the second review, 2026-11-30). The rows OK
runs come first: SAVE, GEN ALL, JAM REC, ARR REC, ARR UNDO, then the file rows; the settings
follow from CLICK. The screen keys jump between the parts. GEN ALL is FUNC + HOME, DOWN, OK
(it was UP), JAM REC two DOWNs, ARR REC three.
- **The track menu's screen keys jump group to group**: GEN, EVOLVE, PLAY, SAMPLE, CAPTURE; the
last line names the group.
- **PROJECTS: RENAME, DELETE and COLLECT are a menu on a held OK.** Pushes B, C and D, where
they sat next to push A's NEXT, say `HOLD OK: MENU`; a tap of OK still opens.

| Was | Is |
| --- | --- |
Expand Down
6 changes: 6 additions & 0 deletions app/app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,12 @@ class Strata : public enaga::App {
int slot_menu_cursor_ = 0;
bool slot_ok_held_ = false; // OK down on a slot: a tap queues, a hold opens the menu
uint32_t slot_ok_down_ms_ = 0;
// PROJECTS' file menu (hold OK on a project): RENAME, DELETE, COLLECT (the second review,
// 2026-11-30, proposal 8: off the pushes, where delete sat next to rename and NEXT).
bool file_menu_ = false;
int file_menu_cursor_ = 0;
bool file_ok_held_ = false;
uint32_t file_ok_down_ms_ = 0;
// The track menu (hold OK in GRID, app/ui_trackmenu.hpp): GEN's knobs and EVOLVE.
bool track_menu_ = false;
Mode track_menu_mode_ = Mode::grid; // GRID or KEYS: the screen it opened over
Expand Down
177 changes: 132 additions & 45 deletions app/ui_browsers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,133 @@
project_cursor_ = at < 0 ? 0 : at;
}

// --- PROJECTS' file menu: hold OK on a project ----------------------------------------
//
// RENAME, DELETE and COLLECT, off the pushes they sat on (the second review, 2026-11-30,
// proposal 8): delete was one knob from rename and from NEXT, the live action. Push A stays
// NEXT. A tap of OK opens the project (twice, as ever): the list waits for a hold of
// kSlotMenuHoldMs, as the pattern menu does, and a tap acts on its release.
static constexpr int kFileMenuRows = 3;
static const char *file_menu_name(int row) {
return row == 0 ? "RENAME" : row == 1 ? "DELETE" : "COLLECT OPEN PROJECT";
}

bool file_ok_target() const {
return mode_ == Mode::project && project_page_ == ProjectPage::files && !shift_ &&
!name_entry_.active() && held_step_ < 0;
}

bool on_file_menu_key(int key, bool down) {
if (file_menu_) {
const bool mine = key == ENAGA_KEY_OK || key == ENAGA_KEY_UP ||
key == ENAGA_KEY_DOWN || key == ENAGA_KEY_CLR;
if (!down || !mine) return mine;
if (key == ENAGA_KEY_CLR) {
file_menu_ = false;
notice("PROJECTS");
return true;
}
if (key != ENAGA_KEY_OK) {
file_menu_cursor_ = (file_menu_cursor_ + (key == ENAGA_KEY_UP ? -1 : 1) +
kFileMenuRows) % kFileMenuRows;
return true;
}
file_menu_ = false;
if (file_menu_cursor_ == 2) project_collect();
else project_rename_or_delete(file_menu_cursor_ == 0);
return true;
}
if (key != ENAGA_KEY_OK || !file_ok_target() || delete_armed_ >= 0) return false;
if (down) {
file_ok_held_ = true;
file_ok_down_ms_ = last_ms_;
} else if (file_ok_held_) {
file_ok_held_ = false;
(void)on_projects_key(ENAGA_KEY_OK); // a tap: what OK always did here
}
return true;
}

// update(): a held OK opens the file menu.
void service_file_menu() {
if (file_menu_ && (mode_ != Mode::project || project_page_ != ProjectPage::files)) {
file_menu_ = false;
}
if (!file_ok_held_) return;
if (!file_ok_target()) {
file_ok_held_ = false;
return;
}
if (uint32_t(last_ms_ - file_ok_down_ms_) < kSlotMenuHoldMs) return;
file_ok_held_ = false;
const SampleList &list = storage_.browse_list();
if (storage_.browsing() || list.count() == 0) return;
file_menu_ = true;
file_menu_cursor_ = 0;
open_armed_ = -1;
notice("PROJECT MENU");
}

void draw_file_menu(enaga::Canvas &canvas) {
const SampleList &list = storage_.browse_list();
char line[24];
char *out = line;
const char *name = list.count() > 0 ? list.name(project_cursor_) : "";
for (int i = 0; name[i] != '\0' && i < 20; i++) *out++ = name[i];
*out = 0;
paint::small_text(canvas.data(), 0, 19, line, 15);
for (int row = 0; row < kFileMenuRows; row++) {
const bool here = row == file_menu_cursor_;
out = line;
*out++ = here ? '>' : ' ';
append(out, file_menu_name(row));
*out = 0;
list_row(canvas, 0, 29 + row * 9, line, here, 9);
}
paint::small_text(canvas.data(), 0, 105, "OK: RUN CLR: BACK", 10);
}

void project_collect() {
if (!storage_.card_usable()) {
notice("NO CARD");
return;
}
storage_.request_collect();
projects_reread_ = true;
notice("COLLECTING");
}

// RENAME or DELETE on the project under the cursor; DELETE asks OK twice (on_projects_key).
void project_rename_or_delete(bool rename) {
const SampleList &list = storage_.browse_list();
if (storage_.browsing() || list.count() == 0) return;
const char *name = list.name(project_cursor_);
if (!storage_.card_usable()) {
notice("NO CARD");
} else if (!list.is_folder(project_cursor_)) {
notice("NOT A PROJECT");
} else if (!Storage::valid_name(name)) {
notice("NAME NOT USABLE");
} else if (storage_.project_op_pending()) {
notice("CARD BUSY");
} else if (rename) {
int n = 0;
for (; name[n] != '\0' && n < Storage::kNameBytes - 1; n++) rename_from_[n] = name[n];
rename_from_[n] = '\0';
entry_for_ = EntryFor::rename;
name_entry_.open("RENAME", name);
} else if (SampleList::same_name(name, storage_.project_name())) {
// Deleting what is in RAM would leave a project whose files are gone, and the next
// save would bring them back.
notice("PROJECT IS OPEN");
} else {
delete_armed_ = project_cursor_;
delete_oks_ = 0;
open_armed_ = -1;
notice("OK TWICE: DELETE");
}
}

bool on_projects_key(int key) {
if (held_step_ >= 0) return false;
const SampleList &list = storage_.browse_list();
Expand Down Expand Up @@ -1015,53 +1142,13 @@
if (shift_) return false;
queue_next_song();
return true;
case ENAGA_KEY_PUSH_D:
// Push D collects the OPEN project's samples into its folder and saves it, for a
// project from before collecting existed (SAVE AS collects on its own).
if (shift_) return false; // FUNC + push D: kill all bands
if (!storage_.card_usable()) {
notice("NO CARD");
return true;
}
storage_.request_collect();
projects_reread_ = true;
notice("COLLECTING");
return true;
case ENAGA_KEY_PUSH_B:
case ENAGA_KEY_PUSH_C: {
// Push B renames and push C deletes the project under the cursor: the two card
// actions a list of projects needs, on the knobs the page leaves free.
if (storage_.browsing() || list.count() == 0) return true;
const char *name = list.name(project_cursor_);
const bool rename = key == ENAGA_KEY_PUSH_B;
if (!storage_.card_usable()) {
notice("NO CARD");
} else if (!list.is_folder(project_cursor_)) {
notice("NOT A PROJECT");
} else if (!Storage::valid_name(name)) {
notice("NAME NOT USABLE");
} else if (storage_.project_op_pending()) {
notice("CARD BUSY");
} else if (rename) {
int n = 0;
for (; name[n] != '\0' && n < Storage::kNameBytes - 1; n++) {
rename_from_[n] = name[n];
}
rename_from_[n] = '\0';
entry_for_ = EntryFor::rename;
name_entry_.open("RENAME", name);
} else if (SampleList::same_name(name, storage_.project_name())) {
// Deleting what is in RAM would leave a project whose files are gone, and
// the next save would bring them back.
notice("PROJECT IS OPEN");
} else {
delete_armed_ = project_cursor_;
delete_oks_ = 0;
open_armed_ = -1;
notice("OK TWICE: DELETE");
}
case ENAGA_KEY_PUSH_C:
case ENAGA_KEY_PUSH_D:
// RENAME, DELETE and COLLECT are in the file menu, on a held OK (above).
if (shift_) return false; // FUNC + a push: the kill switches
notice("HOLD OK: MENU");
return true;
}
case ENAGA_KEY_OK: {
if (shift_) return false; // F1 + OK is redo
if (storage_.browsing() || list.count() == 0) return true;
Expand Down
2 changes: 2 additions & 0 deletions app/ui_input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@

// PROJECT's slots: a held OK opens the pattern menu, which then takes its keys.
if (on_slot_menu_key(key, down)) return;
// PROJECTS: a held OK opens the file menu (RENAME, DELETE, COLLECT); a tap opens, twice.
if (on_file_menu_key(key, down)) return;
// GRID and KEYS: a held OK opens the track menu (GEN and EVOLVE), which then takes its keys.
if (on_track_menu_key(key, down)) return;
// PROJECT held: the STEP keys queue a pattern, on any screen.
Expand Down
1 change: 1 addition & 0 deletions app/ui_lights.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
last_ms_ = ms;

service_slot_menu();
service_file_menu();
service_track_menu();
service_launch();
service_section();
Expand Down
30 changes: 20 additions & 10 deletions app/ui_perfmix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
// change a setting row, CLR or FUNC + HOME closes it and returns to the screen it opened
// over. The cursor always starts on SAVE, so FUNC + HOME, OK saves.

// Project-wide rows only, ordered by how often a jam reaches for them: the live toggles
// first, the file actions at the bottom, and GEN ALL last of all, which the wrap makes one
// UP from SAVE (FUNC + HOME, UP, OK) without moving JAM REC and ARR REC off their DOWNs. The selected track's rows (SPEED, PLAY, FREEZE,
// RELOAD SAMPLE) are in GRID's track menu (app/ui_trackmenu.hpp).
enum class MenuItem : uint8_t { save, jam, arr, click, count_in, rec_mode, quantize,
autofill, glide, transpose, loop_len, chain, song, arr_undo,
prog_out, tempo_guard, save_as, open, kits, fresh, reload, clear, demo, gen_all,
// Project-wide rows only, in two parts (the second review, 2026-11-30, proposal 8): DO, the
// actions, the most used first (SAVE, then GEN ALL, so FUNC + HOME, DOWN, OK is GEN ALL),
// the file actions after them; then SET, the settings. The screen keys jump between the two
// (LEFT: SAVE, RIGHT: CLICK), so no row is more than a few presses from where the list
// opens. The selected track's rows are in GRID's track menu (app/ui_trackmenu.hpp).
enum class MenuItem : uint8_t { save, gen_all, jam, arr, arr_undo, save_as, open, kits, fresh,
reload, clear, demo,
click, count_in, rec_mode, quantize, autofill, glide,
transpose, loop_len, chain, song, prog_out, tempo_guard,
count };
static constexpr int kMenuItems = int(MenuItem::count);
static constexpr int kMenuSetFirst = int(MenuItem::click); // where SET begins
static constexpr int kMenuRows = 9;

static const char *menu_item_name(MenuItem item) {
Expand Down Expand Up @@ -1005,9 +1008,15 @@
return true;
case ENAGA_KEY_SELECT_LEFT:
case ENAGA_KEY_SELECT_RIGHT:
if (shift_) return false; // FUNC + a screen key is TRANSPOSE
// DO and SET: the screen keys jump to the first row of each.
menu_cursor_ = key == ENAGA_KEY_SELECT_LEFT ? 0 : kMenuSetFirst;
card_armed_ = CardAction::none;
notice(key == ENAGA_KEY_SELECT_LEFT ? "DO" : "SET");
return true;
case ENAGA_KEY_OCTAVE_LEFT:
case ENAGA_KEY_OCTAVE_RIGHT:
return true; // one page; no steps behind it
return true; // no steps behind it
default:
return false;
}
Expand All @@ -1034,8 +1043,9 @@
while (value[length] != '\0') length++;
if (length > 0) canvas.text(kFrameMeterX - length * 6, y, value, here ? 0 : 9); // on the row's bar
}
paint::small_text(canvas.data(), 0, 105, "OK: RUN CLR: BACK", 10);
paint::small_text(canvas.data(), 0, 113, "LEFT/RIGHT: CHANGE", 10);
const bool set = menu_cursor_ >= kMenuSetFirst;
paint::small_text(canvas.data(), 0, 105, set ? "SET LEFT/RIGHT: CHANGE" : "DO OK: RUN", 10);
paint::small_text(canvas.data(), 0, 113, set ? "SCREEN KEY LEFT: DO" : "SCREEN KEY RIGHT: SET", 10);
}

void open_kits() {
Expand Down
3 changes: 2 additions & 1 deletion app/ui_project.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@
return;
}
if (project_page_ == ProjectPage::files) {
draw_projects(canvas);
if (file_menu_) draw_file_menu(canvas);
else draw_projects(canvas);
return;
}
if (project_page_ == ProjectPage::launch) {
Expand Down
37 changes: 35 additions & 2 deletions app/ui_trackmenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@
}
}

// The rows in groups (the second review, 2026-11-30, proposal 8): the screen keys jump to the
// first row of the group before or after, round, so no row is more than a few presses away.
struct TrackGroup { TrackRow first; const char *name; };
static constexpr TrackGroup kTrackGroups[] = {
{TrackRow::generate, "GEN"}, {TrackRow::evolve, "EVOLVE"}, {TrackRow::speed, "PLAY"},
{TrackRow::sample, "SAMPLE"}, {TrackRow::capture, "CAPTURE"}};
static constexpr int kTrackGroupCount = int(sizeof kTrackGroups / sizeof kTrackGroups[0]);

static int track_group_of(int row) {
int group = 0;
for (int g = 0; g < kTrackGroupCount; g++)
if (row >= int(kTrackGroups[g].first)) group = g;
return group;
}

// LEFT: the start of this group, or of the one before when already there; RIGHT: the next.
void track_group_jump(int delta) {
int group = track_group_of(track_menu_cursor_);
if (delta > 0 || track_menu_cursor_ == int(kTrackGroups[group].first))
group = (group + delta + kTrackGroupCount) % kTrackGroupCount;
track_menu_cursor_ = int(kTrackGroups[group].first);
notice(kTrackGroups[group].name);
}

// The screens the menu opens over, and draws in place of.
bool track_menu_screen() const {
return (mode_ == Mode::grid || mode_ == Mode::keys) && !step_page_;
Expand Down Expand Up @@ -326,10 +350,15 @@
if (track_menu_) {
const bool mine = key == ENAGA_KEY_OK || key == ENAGA_KEY_UP ||
key == ENAGA_KEY_DOWN || key == ENAGA_KEY_CLR ||
key == ENAGA_KEY_LEFT || key == ENAGA_KEY_RIGHT;
key == ENAGA_KEY_LEFT || key == ENAGA_KEY_RIGHT ||
key == ENAGA_KEY_SELECT_LEFT || key == ENAGA_KEY_SELECT_RIGHT;
if (!mine || shift_) return false; // F1 + OK / CLR stay redo and undo
if (!down) return true;
switch (key) {
case ENAGA_KEY_SELECT_LEFT:
case ENAGA_KEY_SELECT_RIGHT:
track_group_jump(key == ENAGA_KEY_SELECT_LEFT ? -1 : 1);
break;
case ENAGA_KEY_CLR:
track_menu_ = false;
close_prep();
Expand Down Expand Up @@ -429,5 +458,9 @@
append(out, " OK: RUN CLR: BACK");
*out = 0;
paint::small_text(canvas.data(), 0, 105, line, 10);
paint::small_text(canvas.data(), 0, 113, "LEFT/RIGHT: CHANGE", 10);
out = line;
append(out, kTrackGroups[track_group_of(track_menu_cursor_)].name);
append(out, " SCREEN KEYS: GROUP");
*out = 0;
paint::small_text(canvas.data(), 0, 113, line, 10);
}
Loading