move operator << into midi++ from mackie
authorJohn Anderson <ardour@semiosix.com>
Fri, 20 Jul 2007 19:53:11 +0000 (19:53 +0000)
committerJohn Anderson <ardour@semiosix.com>
Fri, 20 Jul 2007 19:53:11 +0000 (19:53 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2166 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/midi++2/midi++/port.h
libs/midi++2/midiport.cc

index 0b5e72d81b6b1e4cea6c09cb21459dbf4ecfe211..e095ce0c6417f131712eb7121811470307c9cbec 100644 (file)
@@ -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__
index a4b28ce461fcccacd4e0900e1394e681cffc031a..f881e3ed23d2fa05a554562d239c71ccec01dd6b 100644 (file)
@@ -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;
+}
+