Display the list of available import formats
This commit is contained in:
parent
704b06a730
commit
61e73fd1a1
2 changed files with 10 additions and 1 deletions
|
|
@ -3,14 +3,18 @@
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
const sfz::InstrumentFormatRegistry& formatRegistry = sfz::InstrumentFormatRegistry::getInstance();
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
std::cerr << "Usage: sfizz_importer <foreign-instrument>\n";
|
std::cerr << "Usage: sfizz_importer <foreign-instrument>\n";
|
||||||
|
std::cerr << "--\n" "Supported formats:\n";
|
||||||
|
for (const sfz::InstrumentFormat* format : formatRegistry.getAllFormats())
|
||||||
|
std::cerr << " * " << format->name() << '\n';
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fs::path foreignPath = fs::u8path(argv[1]);
|
const fs::path foreignPath = fs::u8path(argv[1]);
|
||||||
|
|
||||||
const sfz::InstrumentFormatRegistry& formatRegistry = sfz::InstrumentFormatRegistry::getInstance();
|
|
||||||
const sfz::InstrumentFormat* format = formatRegistry.getMatchingFormat(foreignPath);
|
const sfz::InstrumentFormat* format = formatRegistry.getMatchingFormat(foreignPath);
|
||||||
|
|
||||||
if (!format) {
|
if (!format) {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,11 @@ public:
|
||||||
*/
|
*/
|
||||||
const InstrumentFormat* getMatchingFormat(const fs::path& path) const;
|
const InstrumentFormat* getMatchingFormat(const fs::path& path) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the list of registered formats.
|
||||||
|
*/
|
||||||
|
const std::vector<const InstrumentFormat*>& getAllFormats() const noexcept { return formats_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<const InstrumentFormat*> formats_;
|
std::vector<const InstrumentFormat*> formats_;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue