summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/midi++2/midi++/port.h3
-rw-r--r--libs/midi++2/midiport.cc18
2 files changed, 21 insertions, 0 deletions
diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h
index 0b5e72d81b..e095ce0c64 100644
--- a/libs/midi++2/midi++/port.h
+++ b/libs/midi++2/midi++/port.h
@@ -20,6 +20,7 @@
#define __libmidi_port_h__
#include <string>
+#include <iostream>
#include <sigc++/sigc++.h>
@@ -143,6 +144,8 @@ class Port : public sigc::trackable {
static size_t nports;
};
+std::ostream & operator << ( std::ostream & os, const Port & port );
+
} // namespace MIDI
#endif // __libmidi_port_h__
diff --git a/libs/midi++2/midiport.cc b/libs/midi++2/midiport.cc
index a4b28ce461..f881e3ed23 100644
--- a/libs/midi++2/midiport.cc
+++ b/libs/midi++2/midiport.cc
@@ -145,3 +145,21 @@ Port::write_callback (byte *msg, unsigned int len, void *ptr)
((Port *)ptr)->write (msg, len);
}
+std::ostream & MIDI::operator << ( std::ostream & os, const MIDI::Port & port )
+{
+ using namespace std;
+ os << "MIDI::Port { ";
+ os << "device: " << port.device();
+ os << "; ";
+ os << "name: " << port.name();
+ os << "; ";
+ os << "type: " << port.type();
+ os << "; ";
+ os << "mode: " << port.mode();
+ os << "; ";
+ os << "ok: " << port.ok();
+ os << "; ";
+ os << " }";
+ return os;
+}
+