29 <<
"Test utility to tag files either the SoundForge or the MuseHub way."
32 <<
"(SoundForge prioritizes number-of-beats over tempo, and the other way round for MuseHub.)"
36 <<
"Usage: " <<
argv[0]
37 <<
" <outputFile> <duration (s)> [ MuseHub [ one-shot | <tempo (bpm)> ] | SoundForge [ one-shot | loop <num. beats> ] ]"
40 std::cout <<
"Examples:" << std::endl << std::endl;
43 <<
"Create a 10-second file and add 60 BPM information (MuseHub style):"
45 std::cout <<
"riff-test-util output.wav 10.0 MuseHub 60.0" << std::endl
49 <<
"Create a 10-second file and specify 16 beats (SoundForge style):"
51 std::cout <<
"riff-test-util output.wav 10.0 SoundForge 16.0" << std::endl
54 std::cout <<
"Create a 3-second one-shot file:" << std::endl;
55 std::cout <<
"riff-test-util output.wav 3.0 SoundForge one-shot" << std::endl
70 const std::string inputFile =
argv[1];
74 duration = std::stod(
argv[2]);
76 catch (std::invalid_argument& e)
78 std::cout <<
"Invalid duration: " <<
argv[2] << std::endl;
86 std::cout <<
"Failed to open file: " << inputFile << std::endl;
96 const Mode mode = std::string {
"MuseHub" } ==
argv[3] ? Mode::MuseHub :
97 std::string {
"SoundForge" } ==
argv[3] ?
100 if (mode == Mode::Unknown)
102 std::cout <<
"Unknown mode: " <<
argv[3] << std::endl;
107 const auto isOneShot =
argc >= 5 && std::string {
"one-shot" } ==
argv[4];
109 tagger.AddAcidizerTags(Test::AcidizerTags::OneShot {});
110 else if (mode == Mode::MuseHub)
113 const auto bpm = std::stod(
argv[4]);
114 tagger.AddAcidizerTags(Test::AcidizerTags::Loop { bpm });
115 tagger.AddDistributorInfo(
"Muse Hub");
117 catch (std::invalid_argument& e)
119 std::cout <<
"Invalid BPM: " <<
argv[4] << std::endl;
126 const auto numBeats = std::stoi(
argv[4]);
129 catch (std::invalid_argument& e)
131 std::cout <<
"Invalid number of beats: " <<
argv[5] << std::endl;
int main(int argc, char *const *argv)
When adding tags, the allocated memory must be preserved until the file is closed....
UTILITY_API const char *const * argv
A copy of argv; responsibility of application startup to assign it.
UTILITY_API int argc
A copy of argc; responsibility of application startup to assign it.
void PrintHelp(const char *const *argv)