summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/chan_count.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-27 22:39:10 +0200
committerRobin Gareus <robin@gareus.org>2016-03-27 22:39:10 +0200
commit11cbcd793f602f03904ba084292d4b5305d62672 (patch)
tree70f3ef2c6acd468bb2825b2028457e9efadc8bd0 /libs/ardour/ardour/chan_count.h
parent898525de95cab49e2af590ca8bb4aa2a34445f0c (diff)
add some more documentation
Diffstat (limited to 'libs/ardour/ardour/chan_count.h')
-rw-r--r--libs/ardour/ardour/chan_count.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h
index fc76734817..ba4a2f17bb 100644
--- a/libs/ardour/ardour/chan_count.h
+++ b/libs/ardour/ardour/chan_count.h
@@ -43,29 +43,56 @@ public:
ChanCount(const XMLNode& node);
ChanCount() { reset(); }
- // Convenience constructor for making single-typed streams (stereo, mono, etc)
- ChanCount(DataType type, uint32_t channels) {
+ /** Convenience constructor for making single-typed streams (mono, stereo, midi, etc)
+ * @param type data type
+ * @param count number of channels
+ */
+ ChanCount(DataType type, uint32_t count) {
reset();
- set(type, channels);
+ set(type, count);
}
+ /** zero count of all data types */
void reset() {
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
_counts[*t] = 0;
}
}
+ /** set channel count for given type
+ * @param type data type
+ * @param count number of channels
+ */
void set(DataType t, uint32_t count) { assert(t != DataType::NIL); _counts[t] = count; }
+ /** query channel count for given type
+ * @param type data type
+ * @returns channel count for given type
+ */
uint32_t get(DataType t) const { assert(t != DataType::NIL); return _counts[t]; }
inline uint32_t n (DataType t) const { return _counts[t]; }
+ /** query number of audio channels
+ * @returns number of audio channels
+ */
inline uint32_t n_audio() const { return _counts[DataType::AUDIO]; }
+ /** set number of audio channels
+ * @param a number of audio channels
+ */
inline void set_audio(uint32_t a) { _counts[DataType::AUDIO] = a; }
+ /** query number of midi channels
+ * @returns number of midi channels
+ */
inline uint32_t n_midi() const { return _counts[DataType::MIDI]; }
+ /** set number of audio channels
+ * @param m number of midi channels
+ */
inline void set_midi(uint32_t m) { _counts[DataType::MIDI] = m; }
+ /** query total channel count of all data types
+ * @returns total channel count (audio + midi)
+ */
uint32_t n_total() const {
uint32_t ret = 0;
for (uint32_t i=0; i < DataType::num_types; ++i)