![]() |
:)
|
CLI class on low-priority UI thread. More...
#include <RustyCLI.hpp>
Public Member Functions | |
| RustyCLI (const CLIcallback &cb) | |
| Constructor for RustyCLI. | |
| void | run () |
| Initialises CLI. | |
| void | parser (std::string rawInput) |
| Parses user input from CLI run() | |
| void | commandHandler () |
| Handles parsed commands from parser() | |
| void | listCommand () |
| Prints list of commands. | |
Private Attributes | |
| CLIcallback | _callback |
| CLI callback. | |
| std::vector< std::string > | _inputParsed |
| Vector of input words. | |
| std::vector< std::string > | topLevelCommands {"-ls", "--list", "-p", "--processors", "-m", "--modulators", "-param"} |
| Vector of commands. | |
CLI class on low-priority UI thread.
This class handles user interaction with RustyProcessor instances and RustyModulator instances. Running on a dedicated thread to ensure it doesn't interfere with high priority audio thread.
Definition at line 30 of file RustyCLI.hpp.
|
inline |
Constructor for RustyCLI.
Takes initial parameters for RustyCLI which is just a callback reference to RustyAudioLib. This allows parsing functions inside the CLI to callback to RustyAudioLibAPI which then calls relevant functions in the RustyAudioEngine.
| CLIcallback | Takes reference to function for callback |
Definition at line 44 of file RustyCLI.hpp.
|
inline |
Definition at line 45 of file RustyCLI.hpp.
| void RustyCLI::run | ( | ) |
Initialises CLI.
Initialises CLI by beginning infinite loop that listens for user console input. From here user input is passed to the parser() and then the commandHandler().
Definition at line 3 of file RustyCLI.cpp.
| void RustyCLI::parser | ( | std::string | rawInput | ) |
Parses user input from CLI run()
Parses user input on a char by char basis. Function splits input at whitespaces and places full strings of the command words into a vector of parsed commands.
Definition at line 19 of file RustyCLI.cpp.
| void RustyCLI::commandHandler | ( | ) |
Handles parsed commands from parser()
A series of logic statements that determine whether the user input was a good input or not. If bad there should be a corresponding error message and the commands will be deleted before execution to avoid runtime crashes.
Definition at line 39 of file RustyCLI.cpp.
| void RustyCLI::listCommand | ( | ) |
Prints list of commands.
Separated list command into it's own function to allow formatting of the text easier.
Definition at line 77 of file RustyCLI.cpp.
|
private |
CLI callback.
Definition at line 95 of file RustyCLI.hpp.
|
private |
Vector of input words.
Definition at line 96 of file RustyCLI.hpp.
|
private |
Vector of commands.
Definition at line 97 of file RustyCLI.hpp.