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) diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h index 2659c556a2..6fbf8bc96e 100644 --- a/libs/ardour/ardour/chan_mapping.h +++ b/libs/ardour/ardour/chan_mapping.h @@ -33,6 +33,8 @@ namespace ARDOUR { /** A mapping from one set of channels to another * (e.g. how to 'connect' two BufferSets). + * + * for plugins the form is "pin" -> "buffer" */ class LIBARDOUR_API ChanMapping { public: @@ -41,7 +43,18 @@ public: ChanMapping(const ChanMapping&); uint32_t get(DataType t, uint32_t from, bool* valid); + + /** get buffer mapping for given data type and pin + * @param type data type + * @param from pin + * @returns mapped buffer number (or ChanMapping::Invalid) + */ uint32_t get(DataType t, uint32_t from) { return get (t, from, NULL); } + /** set buffer mapping for given data type + * @param type data type + * @param from pin + * @param to buffer + */ void set(DataType t, uint32_t from, uint32_t to); void offset_from(DataType t, int32_t delta); void offset_to(DataType t, int32_t delta);