summaryrefslogtreecommitdiff
path: root/libs/ardour/test/test_receiver.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-27 01:42:49 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-27 01:42:49 +0000
commit6304261b980419eaafde84bc32ff5e8f1c7aa236 (patch)
tree1261360e5eb22f7539a1a0afcc2d760ea017b7ad /libs/ardour/test/test_receiver.h
parent0082e3364f7682ff41df52305cfff2cf7a861ef3 (diff)
Re-work layering in possibly debatable ways. Sketchy docs in doc/layering.
git-svn-id: svn://localhost/ardour2/branches/3.0@11088 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/test/test_receiver.h')
-rw-r--r--libs/ardour/test/test_receiver.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/ardour/test/test_receiver.h b/libs/ardour/test/test_receiver.h
new file mode 100644
index 0000000000..537bac3cff
--- /dev/null
+++ b/libs/ardour/test/test_receiver.h
@@ -0,0 +1,37 @@
+#include "pbd/receiver.h"
+
+class TestReceiver : public Receiver
+{
+protected:
+ void receive (Transmitter::Channel chn, const char * str) {
+ const char *prefix = "";
+
+ switch (chn) {
+ case Transmitter::Error:
+ prefix = ": [ERROR]: ";
+ break;
+ case Transmitter::Info:
+ /* ignore */
+ return;
+ case Transmitter::Warning:
+ prefix = ": [WARNING]: ";
+ break;
+ case Transmitter::Fatal:
+ prefix = ": [FATAL]: ";
+ break;
+ case Transmitter::Throw:
+ /* this isn't supposed to happen */
+ abort ();
+ }
+
+ /* note: iostreams are already thread-safe: no external
+ lock required.
+ */
+
+ std::cout << prefix << str << std::endl;
+
+ if (chn == Transmitter::Fatal) {
+ exit (9);
+ }
+ }
+};