Skip to content

Commit

Permalink
vst-dump: Add option to print parameter details
Browse files Browse the repository at this point in the history
  • Loading branch information
juniorrantila committed Jan 3, 2025
1 parent e5e82e6 commit 2fc7c74
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions Tools/vst-dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

#include <stdio.h>

namespace Main {

ErrorOr<int> main(int argc, char const* argv[])
ErrorOr<int> Main::main(int argc, char const* argv[])
{
auto argument_parser = CLI::ArgumentParser();

Expand All @@ -20,6 +18,11 @@ ErrorOr<int> main(int argc, char const* argv[])
plugin_path = arg;
}));

bool print_parameters = false;
TRY(argument_parser.add_flag("--print-parameters", "-pp", "print parameters", [&]{
print_parameters = true;
}));

if (auto result = argument_parser.run(argc, argv); result.is_error()) {
TRY(result.error().show());
return 1;
Expand Down Expand Up @@ -71,9 +74,17 @@ ErrorOr<int> main(int argc, char const* argv[])
};
printf(" %.*s: %.*s\n", feature.name().size(), feature.name().data(), result.name().size(), result.name().data());
}
printf("\n------------------------------------\n\n");

if (print_parameters && plugin.number_of_parameters() > 0) {
printf("\n\n-------------Parameters-------------\n\n");
for (u32 i = 0; i < plugin.number_of_parameters(); i++) {
char buf[1024];
printf("%d:\n", i);
printf(" - name: %s\n", plugin.parameter_name(buf, i));
printf(" - display: %s\n", plugin.parameter_display(buf, i));
printf(" - label: %s\n", plugin.parameter_label(buf, i));
printf(" - can be automated: %s\n", plugin.parameter_can_be_automated(i) ? "yes" : "no");
}
}
printf("------------------------------------\n\n");
return 0;
}

}

0 comments on commit 2fc7c74

Please sign in to comment.