sfizz/sources/Main.cpp

40 lines
1.5 KiB
C++
Raw Normal View History

2019-07-29 02:13:03 +02:00
#include "Synth.h"
#include <iostream>
#include <absl/flags/parse.h>
#include <absl/types/span.h>
2019-07-29 02:13:03 +02:00
int main(int argc, char** argv)
{
std::ios::sync_with_stdio(false);
auto arguments = absl::ParseCommandLine(argc, argv);
auto filesToParse = absl::MakeConstSpan(arguments).subspan(1);
std::cout << "Positional arguments:";
for (auto& file: filesToParse)
std::cout << " " << file << ',';
std::cout << '\n';
2019-07-29 02:13:03 +02:00
sfz::Synth synth;
std::filesystem::path filename { filesToParse[0] };
synth.loadSfzFile(filename);
std::cout << "==========" << '\n';
std::cout << "Total:" << '\n';
std::cout << "\tMasters: " << synth.getNumMasters() << '\n';
std::cout << "\tGroups: " << synth.getNumGroups() << '\n';
std::cout << "\tRegions: " << synth.getNumRegions() << '\n';
std::cout << "\tCurves: " << synth.getNumCurves() << '\n';
2019-08-04 16:07:09 +02:00
std::cout << "\tPreloadedSamples: " << synth.getNumPreloadedSamples() << '\n';
2019-07-29 02:13:03 +02:00
std::cout << "==========" << '\n';
std::cout << "Included files:" << '\n';
for (auto& file: synth.getIncludedFiles())
2019-08-04 16:07:09 +02:00
std::cout << '\t' << file.string() << '\n';
2019-07-29 02:13:03 +02:00
std::cout << "==========" << '\n';
std::cout << "Defines:" << '\n';
for (auto& define: synth.getDefines())
std::cout << '\t' << define.first << '=' << define.second << '\n';
std::cout << "==========" << '\n';
std::cout << "Unknown opcodes:";
for (auto& opcode: synth.getUnknownOpcodes())
std::cout << opcode << ',';
std::cout << '\n';
2019-07-29 02:13:03 +02:00
return 0;
}