clean up comments and commented code
[ardour.git] / libs / ardour / test / test_receiver.h
1 #include "pbd/receiver.h"
2
3 class TestReceiver : public Receiver 
4 {
5 protected:
6         void receive (Transmitter::Channel chn, const char * str) {
7                 const char *prefix = "";
8                 
9                 switch (chn) {
10                 case Transmitter::Error:
11                         prefix = ": [ERROR]: ";
12                         break;
13                 case Transmitter::Info:
14                         /* ignore */
15                         return;
16                 case Transmitter::Warning:
17                         prefix = ": [WARNING]: ";
18                         break;
19                 case Transmitter::Fatal:
20                         prefix = ": [FATAL]: ";
21                         break;
22                 case Transmitter::Throw:
23                         /* this isn't supposed to happen */
24                         abort ();
25                 }
26                 
27                 /* note: iostreams are already thread-safe: no external
28                    lock required.
29                 */
30                 
31                 std::cout << prefix << str << std::endl;
32                 
33                 if (chn == Transmitter::Fatal) {
34                         exit (9);
35                 }
36         }
37 };