diff options
author | Carl Hetherington <carl@carlh.net> | 2009-01-27 17:37:07 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-01-27 17:37:07 +0000 |
commit | b2e163a410a62a20e982b3baac0cf65e611acbce (patch) | |
tree | 1e404d3f4f9b33ddde56580d7b4fb02d1432b331 /gtk2_ardour/port_matrix_types.h | |
parent | 9cc7b452ebb8fe8f348ad6aad18054703700da18 (diff) |
A few cleanups. Also make port matrix notice when routes or processors change.
git-svn-id: svn://localhost/ardour2/branches/3.0@4447 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_types.h')
-rw-r--r-- | gtk2_ardour/port_matrix_types.h | 13 |
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; |