summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/bundle.h
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2017-08-23 20:40:11 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2017-08-23 23:31:28 +0200
commit96a6529e2ef4a75a1232d42a13552599d7fb6e28 (patch)
tree1ae167f65210e2b00eb53c08841209619ef03155 /libs/ardour/ardour/bundle.h
parentcc63df7e8d7e7f1ed255773398ff30c23205153c (diff)
Improve getting a Bundle total channel count
|Bundle::nchannels()| creates a ChanCount on demand, by iterating over the |_channel| member variable. The sum of all |nchannels().n(t)| over all non-NIL DataTypes |t| is thus equal to |_channel.size()|. Consequently, calling |nchannels().n_total()| is a convoluted (and slow) way of getting |_channel.size()|. Add a method |Bundle::n_total()| that directly returns the latter.
Diffstat (limited to 'libs/ardour/ardour/bundle.h')
-rw-r--r--libs/ardour/ardour/bundle.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h
index ef2247f12b..fe0de29c76 100644
--- a/libs/ardour/ardour/bundle.h
+++ b/libs/ardour/ardour/bundle.h
@@ -73,6 +73,7 @@ class LIBARDOUR_API Bundle : public PBD::ScopedConnectionList
/** @return Number of channels that this Bundle has */
ChanCount nchannels () const;
+ uint32_t n_total () const; /* shortcut for nchannels().n_total() */
/** @param Channel index.
* @return Ports associated with this channel.