From a052488c002f21839ca7babb855a481a86eba648 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 29 Jan 2011 12:40:57 +0000 Subject: Add operator<< for bundles. git-svn-id: svn://localhost/ardour2/branches/3.0@8606 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/bundle.h | 4 ++-- libs/ardour/bundle.cc | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h index 369b12ec9b..e3d56f22f5 100644 --- a/libs/ardour/ardour/bundle.h +++ b/libs/ardour/ardour/bundle.h @@ -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__ */ diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc index 6037bfc7e9..e42239a1ea 100644 --- a/libs/ardour/bundle.cc +++ b/libs/ardour/bundle.cc @@ -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; +} -- cgit v1.2.3