summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/port_matrix_types.h')
-rw-r--r--gtk2_ardour/port_matrix_types.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk2_ardour/port_matrix_types.h b/gtk2_ardour/port_matrix_types.h
index 66dcf619b7..16fb440ace 100644
--- a/gtk2_ardour/port_matrix_types.h
+++ b/gtk2_ardour/port_matrix_types.h
@@ -20,6 +20,8 @@
#ifndef __ardour_gtk_port_matrix_types_h__
#define __ardour_gtk_port_matrix_types_h__
+#include "ardour/bundle.h"
+
struct PortMatrixBundleChannel {
PortMatrixBundleChannel () : channel (0) {}
PortMatrixBundleChannel (boost::shared_ptr<ARDOUR::Bundle> b, uint32_t c)
@@ -31,6 +33,17 @@ struct PortMatrixBundleChannel {
bool operator!= (PortMatrixBundleChannel const& other) const {
return bundle != other.bundle || channel != other.channel;
}
+
+ uint32_t nchannels (ARDOUR::BundleList const& bl) const {
+ uint32_t n = 0;
+ ARDOUR::BundleList::const_iterator i = bl.begin();
+ while (i != bl.end() && *i != bundle) {
+ n += (*i)->nchannels ();
+ ++i;
+ }
+ n += channel;
+ return n;
+ }
boost::shared_ptr<ARDOUR::Bundle> bundle;
uint32_t channel;