2 * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include <sys/utime.h>
33 #include "pbd/transmitter.h"
34 #include "pbd/receiver.h"
37 #define NO_OLDNAMES // no backwards compat _pid_t, conflict with w64 pthread/sched
40 #include "ardour/filesystem_paths.h"
42 #include "ardour/linux_vst_support.h"
44 #include "ardour/vst_info_file.h"
46 /* make stupid waf happy.
47 * waf cannot build multiple variants of .o object files from the same
48 * source using different wscripts.. it mingles e.g.
49 * build/libs/ardour/vst_info_file.cc.1.o for
50 * both lib/ardour/wscript and lib/fst/wscript
52 * ...but waf does track include dependencies.
54 #include "../ardour/vst_info_file.cc"
56 #include "../ardour/linux_vst_support.cc"
59 #include "../ardour/mac_vst_support.cc"
61 #include "../ardour/filesystem_paths.cc"
62 #include "../ardour/directory_names.cc"
64 #include "../ardour/vst_state.cc"
68 vstfx_destroy_editor (VSTState* /*vstfx*/) { }
73 class DummyReceiver : public Receiver {
75 void receive (Transmitter::Channel chn, const char * str) {
76 const char *prefix = "";
78 case Transmitter::Error:
81 case Transmitter::Info:
84 case Transmitter::Warning:
85 prefix = "[WARNING]: ";
87 case Transmitter::Fatal:
90 case Transmitter::Throw:
94 std::cerr << prefix << str << std::endl;
96 if (chn == Transmitter::Fatal) {
97 ::exit (EXIT_FAILURE);
102 DummyReceiver dummy_receiver;
104 int main (int argc, char **argv) {
105 char *dllpath = NULL;
106 if (argc == 3 && !strcmp("-f", argv[1])) {
108 const size_t slen = strlen (dllpath);
110 (slen > 3 && 0 == g_ascii_strcasecmp (&dllpath[slen-3], ".so"))
112 (slen > 4 && 0 == g_ascii_strcasecmp (&dllpath[slen-4], ".dll"))
114 vstfx_remove_infofile(dllpath);
115 vstfx_un_blacklist(dllpath);
119 else if (argc != 2) {
120 fprintf(stderr, "usage: %s [-f] <vst>\n", argv[0]);
128 dummy_receiver.listen_to (error);
129 dummy_receiver.listen_to (info);
130 dummy_receiver.listen_to (fatal);
131 dummy_receiver.listen_to (warning);
133 std::vector<VSTInfo *> *infos = 0;
135 const size_t slen = strlen (dllpath);
138 else if (slen > 3 && 0 == g_ascii_strcasecmp (&dllpath[slen-3], ".so")) {
139 infos = vstfx_get_info_lx(dllpath);
143 #ifdef WINDOWS_VST_SUPPORT
144 else if (slen > 4 && 0 == g_ascii_strcasecmp (&dllpath[slen-4], ".dll")) {
145 infos = vstfx_get_info_fst(dllpath);
149 #ifdef MACVST_SUPPORT
150 else if (slen > 4 && 0 == g_ascii_strcasecmp (&dllpath[slen-4], ".vst")) {
151 infos = vstfx_get_info_mac(dllpath);
155 fprintf(stderr, "'%s' is not a supported VST plugin.\n", dllpath);
160 if (!infos || infos->empty()) {