2 Copyright (C) 2011 Paul Davis
3 Copyright (C) 2011 Tim Mayberry
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 by the Free
7 Software Foundation; either version 2 of the License, or (at your option)
10 This program is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef ARDOUR_TEST_RECEIVER_H
21 #define ARDOUR_TEST_RECEIVER_H
25 #include "pbd/textreceiver.h"
27 class TestReceiver : public Receiver
30 void receive (Transmitter::Channel chn, const char * str) {
31 const char *prefix = "";
34 case Transmitter::Error:
35 prefix = ": [ERROR]: ";
37 case Transmitter::Info:
40 case Transmitter::Warning:
41 prefix = ": [WARNING]: ";
43 case Transmitter::Fatal:
44 prefix = ": [FATAL]: ";
46 case Transmitter::Throw:
47 /* this isn't supposed to happen */
51 /* note: iostreams are already thread-safe: no external
55 std::cout << prefix << str << std::endl;
57 if (chn == Transmitter::Fatal) {
63 #endif // ARDOUR_TEST_RECEIVER_H