Latency debug script: include MIDI ports
[ardour.git] / headless / misc.cc
1 /*
2  * Copyright (C) 2014 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2015 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19
20 #include <iostream>
21 #include <cstdlib>
22
23 #include "misc.h"
24
25 void
26 TestReceiver::receive (Transmitter::Channel chn, const char * str)
27 {
28         const char *prefix = "";
29
30         switch (chn) {
31         case Transmitter::Error:
32                 prefix = ": [ERROR]: ";
33                 break;
34         case Transmitter::Info:
35                 /* ignore */
36                 return;
37         case Transmitter::Warning:
38                 prefix = ": [WARNING]: ";
39                 break;
40         case Transmitter::Fatal:
41                 prefix = ": [FATAL]: ";
42                 break;
43         case Transmitter::Throw:
44                 /* this isn't supposed to happen */
45                 abort ();
46         }
47
48         /* note: iostreams are already thread-safe: no external
49            lock required.
50         */
51
52         std::cout << prefix << str << std::endl;
53
54         if (chn == Transmitter::Fatal) {
55                 ::exit (9);
56         }
57 }
58
59 /* temporarily required due to some code design confusion (Feb 2014) */
60
61 #include "ardour/vst_types.h"
62
63 int vstfx_init (void*) { return 0; }
64 void vstfx_exit () {}
65 void vstfx_destroy_editor (VSTState*) {}