Skip to main content

phosphor_app/
actions.rs

1//! Action map — every possible user action in Phosphor.
2//!
3//! This is the single source of truth for what the user can do.
4//! The key handler maps keys → actions. Tests map scenarios → action sequences.
5//! No key codes in business logic, no business logic in key handling.
6
7/// Every discrete action a user can perform in the application.
8#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub enum Action {
10    // ── Global ──
11    Quit,
12    OpenSpaceMenu,
13    CloseSpaceMenu,
14    NextPane,
15    PrevPane,
16
17    // ── Space menu ──
18    SpaceMenuUp,
19    SpaceMenuDown,
20    SpaceMenuSelect,
21    SpaceMenuSwitchTab,
22    SpaceMenuKey(char),
23
24    // ── Transport (via space menu) ──
25    PlayPause,
26    ToggleRecord,
27    ToggleMetronome,
28    Panic,
29    Save,
30
31    // ── Loop editor ──
32    FocusLoopEditor,
33    LoopToggleEnabled,
34    LoopStartLeft,
35    LoopStartRight,
36    LoopEndLeft,
37    LoopEndRight,
38    LoopUnfocus,
39
40    // ── Track navigation ──
41    MoveUp,
42    MoveDown,
43    MoveLeft,
44    MoveRight,
45    Select,
46    Back,
47
48    // ── Track controls ──
49    ToggleMute,
50    ToggleSolo,
51    ToggleArm,
52    ToggleLoopRecord,
53
54    // ── Instrument ──
55    AddInstrument,
56    InstrumentSelect,
57    InstrumentCancel,
58
59    // ── Clip view ──
60    CycleTab,
61
62    // ── Synth params (when in clip view synth panel) ──
63    ParamUp,
64    ParamDown,
65    ParamDecrease,
66    ParamIncrease,
67
68    // ── No-op ──
69    None,
70}