3 * Copyright (C) 2016-2020 William Morrow
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 #include "bcsignals.h"
28 #include "pluginlv2client.h"
29 #include "pluginlv2ui.h"
31 int main(int ac, char **av)
33 // to grab this task in the debugger
34 const char *cp = getenv("BUG");
35 static int zbug = !cp ? 0 : atoi(cp); volatile int bug = zbug;
36 while( bug ) usleep(10000);
37 BC_WindowBase::init_resources(1);
39 if( getenv("BC_TRAP_LV2_SEGV") ) {
40 signals.initialize("/tmp/lv2ui_%d.dmp");
41 BC_Signals::set_catch_segv(1);
43 return PluginLV2ChildUI().run(ac, av);
46 int PluginLV2ChildUI::run(int ac, char **av)
52 signal(SIGINT, SIG_IGN);
53 ForkBase::child_fd = atoi(av[1]);
54 ForkBase::parent_fd = atoi(av[2]);
55 ForkBase::ppid = atoi(av[3]);
58 int sample_rate = samplerate, bfrsz = block_length;
59 if( ac > 2 ) sample_rate = atoi(av[2]);
60 if( init_ui(av[1], sample_rate, bfrsz) ) {
61 fprintf(stderr," init_ui failed\n");