![]() |
Mema
Memory Matrix — multi-channel audio matrix monitor and router
|
Interactive, numbered-menu CLI for configuring Mema when running with –headless. More...
#include <HeadlessCLIMenu.h>
Inheritance diagram for Mema::HeadlessCLIMenu:
Collaboration diagram for Mema::HeadlessCLIMenu:Public Member Functions | |
| HeadlessCLIMenu (MemaProcessor &processor) | |
| Constructs the menu and stores a reference to the processor. | |
| ~HeadlessCLIMenu () override | |
| Destructor — stops the background thread (up to 3 s timeout). | |
| void | run () override |
| Thread entry point — shows the main menu in a loop until the user quits. | |
Interactive, numbered-menu CLI for configuring Mema when running with –headless.
When Mema is launched with the –headless command-line flag, no graphical UI is created. HeadlessCLIMenu fills that gap by offering a plain stdin/stdout menu system that guides the user through all relevant configuration areas without requiring any memorisation of commands.
HeadlessCLIMenu runs on a dedicated background thread (juce::Thread) so that blocking stdin reads never stall the JUCE message loop. All mutations to the processor are dispatched back to the message thread via callOnMessageThread(), which uses a juce::WaitableEvent to block the CLI thread until the mutation completes.
Definition at line 66 of file HeadlessCLIMenu.h.
|
explicit |
Constructs the menu and stores a reference to the processor.
| processor | The MemaProcessor instance whose state the menu will read and modify. The processor must outlive this object. |
Definition at line 42 of file HeadlessCLIMenu.cpp.
|
override |
Destructor — stops the background thread (up to 3 s timeout).
If the thread is currently blocked in a stdin read, the timeout will expire and the thread will be force-terminated by juce::Thread::stopThread().
Definition at line 47 of file HeadlessCLIMenu.cpp.
|
override |
Thread entry point — shows the main menu in a loop until the user quits.
Waits briefly for the processor to finish initialising, then enters the main menu loop. The loop continues until the user presses 'q', stdin closes (EOF), or threadShouldExit() returns true.
Definition at line 56 of file HeadlessCLIMenu.cpp.