Vital
|
Functions | |
String | getArgumentValue (int argc, const char *argv[], const String &flag, const String &full_flag) |
Retrieves the value of a command-line argument following a given flag. | |
bool | hasFlag (int argc, const char *argv[], const String &flag, const String &full_flag) |
Checks if a particular flag is present in the command-line arguments. | |
float | getRenderLength (int argc, const char *argv[]) |
Retrieves the desired length in seconds for rendering output audio from the command line. | |
std::vector< int > | getRenderMidiNotes (int argc, const char *argv[]) |
Parses the command line for desired MIDI note inputs to render. | |
float | getRenderBpm (int argc, const char *argv[]) |
Retrieves the BPM (Beats Per Minute) from command-line arguments. | |
void | doRenderToFile (HeadlessSynth &headless_synth, int argc, const char *argv[]) |
Renders the loaded synth configuration to an audio file if output is specified. | |
bool | loadFromCommandLine (HeadlessSynth &synth, const String &command_line) |
Attempts to load a file from the command line into the HeadlessSynth. | |
int | main (int argc, const char *argv[]) |
The main entry point for the headless tool. | |
void doRenderToFile | ( | HeadlessSynth & | headless_synth, |
int | argc, | ||
const char * | argv[] ) |
Renders the loaded synth configuration to an audio file if output is specified.
Checks command-line flags for output path, whether to render images, length, BPM, and MIDI notes, and uses HeadlessSynth::renderAudioToFile to produce the result.
headless_synth | The synth to render from. |
argc | The number of arguments. |
argv | The argument vector. |
String getArgumentValue | ( | int | argc, |
const char * | argv[], | ||
const String & | flag, | ||
const String & | full_flag ) |
Retrieves the value of a command-line argument following a given flag.
Searches through the command-line arguments for the specified short or long flag. If found, returns the next argument as the value. Otherwise, returns an empty string.
argc | The number of command-line arguments. |
argv | The array of command-line argument strings. |
flag | The short flag (e.g. "-o"). |
full_flag | The long flag (e.g. "--output"). |
float getRenderBpm | ( | int | argc, |
const char * | argv[] ) |
Retrieves the BPM (Beats Per Minute) from command-line arguments.
Defaults to 120 BPM. Enforces minimum 5.0 BPM and max 900.0 BPM.
argc | The number of arguments. |
argv | The argument vector. |
float getRenderLength | ( | int | argc, |
const char * | argv[] ) |
Retrieves the desired length in seconds for rendering output audio from the command line.
If not specified, defaults to 5.0 seconds. Caps at a maximum of 15.0 seconds.
argc | The number of arguments. |
argv | The argument vector. |
std::vector< int > getRenderMidiNotes | ( | int | argc, |
const char * | argv[] ) |
Parses the command line for desired MIDI note inputs to render.
Uses note names or numeric values. If none provided, defaults to MIDI note 48.
argc | The number of arguments. |
argv | The argument vector. |
bool hasFlag | ( | int | argc, |
const char * | argv[], | ||
const String & | flag, | ||
const String & | full_flag ) |
Checks if a particular flag is present in the command-line arguments.
argc | The number of command-line arguments. |
argv | The array of command-line argument strings. |
flag | The short flag to check. |
full_flag | The long flag to check. |
bool loadFromCommandLine | ( | HeadlessSynth & | synth, |
const String & | command_line ) |
Attempts to load a file from the command line into the HeadlessSynth.
If the argument is a file path, tries to load it as a preset or wavetable. If successful, returns true.
synth | The HeadlessSynth instance. |
command_line | The file path or command. |
int main | ( | int | argc, |
const char * | argv[] ) |
The main entry point for the headless tool.
Processes command-line arguments to optionally load a preset or wavetable and render it to an audio file.
Usage:
argc | The number of arguments. |
argv | The argument vector. |