1 #define _POSIX_C_SOURCE 200809L
10 #include "pbd/transmitter.h"
11 #include "pbd/receiver.h"
14 #define NO_OLDNAMES // no backwards compat _pid_t, conflict with w64 pthread/sched
17 #include "ardour/filesystem_paths.h"
19 #include "ardour/linux_vst_support.h"
21 #include "ardour/vst_info_file.h"
23 /* make stupid waf happy.
24 * waf cannot build multiple variants of .o object files from the same
25 * source using different wscripts.. it mingles e.g.
26 * build/libs/ardour/vst_info_file.cc.1.o for
27 * both lib/ardour/wscript and lib/fst/wscript
29 * ...but waf does track include dependencies.
31 #include "../ardour/vst_info_file.cc"
33 #include "../ardour/linux_vst_support.cc"
36 #include "../ardour/mac_vst_support.cc"
38 #include "../ardour/filesystem_paths.cc"
39 #include "../ardour/directory_names.cc"
41 #include "../ardour/vst_state.cc"
45 vstfx_destroy_editor (VSTState* /*vstfx*/) { }
50 class DummyReceiver : public Receiver {
52 void receive (Transmitter::Channel chn, const char * str) {
53 const char *prefix = "";
55 case Transmitter::Error:
58 case Transmitter::Info:
61 case Transmitter::Warning:
62 prefix = "[WARNING]: ";
64 case Transmitter::Fatal:
67 case Transmitter::Throw:
71 std::cerr << prefix << str << std::endl;
73 if (chn == Transmitter::Fatal) {
79 DummyReceiver dummy_receiver;
81 int main (int argc, char **argv) {
83 if (argc == 3 && !strcmp("-f", argv[1])) {
85 const size_t slen = strlen (dllpath);
87 (slen > 3 && 0 == g_ascii_strcasecmp (&dllpath[slen-3], ".so"))
89 (slen > 4 && 0 == g_ascii_strcasecmp (&dllpath[slen-4], ".dll"))
91 vstfx_remove_infofile(dllpath);
92 vstfx_un_blacklist(dllpath);
97 fprintf(stderr, "usage: %s [-f] <vst>\n", argv[0]);
105 dummy_receiver.listen_to (error);
106 dummy_receiver.listen_to (info);
107 dummy_receiver.listen_to (fatal);
108 dummy_receiver.listen_to (warning);
110 std::vector<VSTInfo *> *infos = 0;
112 const size_t slen = strlen (dllpath);
115 else if (slen > 3 && 0 == g_ascii_strcasecmp (&dllpath[slen-3], ".so")) {
116 infos = vstfx_get_info_lx(dllpath);
120 #ifdef WINDOWS_VST_SUPPORT
121 else if (slen > 4 && 0 == g_ascii_strcasecmp (&dllpath[slen-4], ".dll")) {
122 infos = vstfx_get_info_fst(dllpath);
126 #ifdef MACVST_SUPPORT
127 else if (slen > 4 && 0 == g_ascii_strcasecmp (&dllpath[slen-4], ".vst")) {
128 infos = vstfx_get_info_mac(dllpath);
132 fprintf(stderr, "'%s' is not a supported VST plugin.\n", dllpath);
137 if (!infos || infos->empty()) {