Add operator<< for bundles.
authorCarl Hetherington <carl@carlh.net>
Sat, 29 Jan 2011 12:40:57 +0000 (12:40 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 29 Jan 2011 12:40:57 +0000 (12:40 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8606 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/bundle.h
libs/ardour/bundle.cc

index 369b12ec9ba68c02581026cfa2690df9769efc34..e3d56f22f56c618ff107c7656766d176f45e6650 100644 (file)
@@ -144,8 +144,6 @@ class Bundle : public PBD::ScopedConnectionList
        Change _pending_change;
 };
 
-
-
 struct BundleChannel
 {
        BundleChannel () : channel (-1) {}
@@ -167,4 +165,6 @@ struct BundleChannel
 
 }
 
+std::ostream & operator<< (std::ostream & o, ARDOUR::Bundle const &);
+
 #endif /* __ardour_bundle_h__ */
index 6037bfc7e920a20ff86ff2a0e1f98d8f6fa26e32..e42239a1ea18c58bacfe9d541d4c63de464a8e32 100644 (file)
@@ -496,3 +496,18 @@ Bundle::channel_type (uint32_t c) const
        return _channel[c].type;
 }      
 
+ostream &
+operator<< (ostream& os, Bundle const & b)
+{
+       os << "BUNDLE " << b.nchannels() << " channels: ";
+       for (uint32_t i = 0; i < b.nchannels().n_total(); ++i) {
+               os << "( ";
+               Bundle::PortList const & pl = b.channel_ports (i);
+               for (Bundle::PortList::const_iterator j = pl.begin(); j != pl.end(); ++j) {
+                       os << *j << " ";
+               }
+               os << ") ";
+       }
+
+       return os;
+}