4#include "dependencies/CLI11/CLI11.hpp"
25 app.add_option (
"--data-root-path,-d", m_dataRootPath,
"Data root path");
26 app.add_option (
"--tags,-t", m_tags,
"Test tags");
27 app.add_option (
"--seed,-s", m_seed,
"Random seed")->default_val (0);
32 "Number of displayed decimal places for samples' linear values in test output"
38 "Number of displayed decimal places for values in decidels in test output"
44 "Number of displayed decimal places for values in seconds in test output"
50 "Number of displayed decimal places for values in hertz in test output"
56 "Number of displayed decimal places for values in radians in test output"
62 "Number of displayed decimal places for values in cents in test output"
67 m_defaultBlockSizeFrames,
68 "Default max block size in frames (samples). All tests will run with this block size, unless other value is explicitly set via withBlockSize()."
69 )->default_val (1024);
73 m_defaultNumInputChannels,
74 "Default number of input channels. All tests will run with this number of output channels, unless other value is explicitly selected via withOutputChannels() or a similar modifier."
79 m_defaultNumOutputChannels,
80 "Default number of output channels. All tests will run with this number of input channels, unless other value is explicitly selected via withInputChannels() or a similar modifier."
85 m_defaultSampleRateHz,
86 "Default sample rate in Hz. All tests will run with this sample rate, unless other value is explicitly stated via withSampleRate()."
87 )->default_val (44100.0);
91 m_defaultRenderDurationSeconds,
92 "Default render duration in seconds. All tests will render this amount of audio (excluding optional warm-up time), unless explicitly overridden with withDuration()."
95 app.add_flag (
"--run-generators,-g", m_runGeneratorsNotTests,
"Run generators instead of tests");
96 app.add_flag (
"--shuffle", m_shuffle,
"Shuffle task order. Obeys --seed value.");
137 CLI::App app {
"HART" };
139 std::string m_dataRootPath =
".";
140 std::string m_tags =
"";
141 uint_fast32_t m_seed = 0;
142 bool m_runGeneratorsNotTests =
false;
143 bool m_shuffle =
false;
145 int m_linDecimals = 0;
146 int m_dbDecimals = 0;
147 int m_secDecimals = 0;
148 int m_hzDecimals = 0;
149 int m_radDecimals = 0;
150 int m_centsDecimals = 0;
152 size_t m_defaultBlockSizeFrames = 1024;
153 size_t m_defaultNumInputChannels = 1;
154 size_t m_defaultNumOutputChannels = 1;
155 double m_defaultSampleRateHz = 44100.0;
156 double m_defaultRenderDurationSeconds = 0.1;
158 CLIConfig() =
default;
Holds values set by the user via CLI interface.
double getDefaultRenderDurationSeconds() const
size_t getDefaultNumOutputChannels() const
uint_fast32_t getRandomSeed()
Gets random seed set by a "`--seed`/`-s`" argument.
std::string getDataRootPath()
Get data root path set by a "`--data-root-path`,`-d`" argument.
size_t getDefaultNumInputChannels() const
double getDefaultSampleRateHz() const
size_t getGefaultBlockSizeFrames() const
void initCommandLineArgs()
Inits the CLI arguments.
bool shouldRunGenerators()
bool shouldShuffleTasks()
static CLIConfig & getInstance()
Get the singleton instance.