add some more documentation
This commit is contained in:
parent
898525de95
commit
11cbcd793f
|
@ -43,29 +43,56 @@ public:
|
||||||
ChanCount(const XMLNode& node);
|
ChanCount(const XMLNode& node);
|
||||||
ChanCount() { reset(); }
|
ChanCount() { reset(); }
|
||||||
|
|
||||||
// Convenience constructor for making single-typed streams (stereo, mono, etc)
|
/** Convenience constructor for making single-typed streams (mono, stereo, midi, etc)
|
||||||
ChanCount(DataType type, uint32_t channels) {
|
* @param type data type
|
||||||
|
* @param count number of channels
|
||||||
|
*/
|
||||||
|
ChanCount(DataType type, uint32_t count) {
|
||||||
reset();
|
reset();
|
||||||
set(type, channels);
|
set(type, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** zero count of all data types */
|
||||||
void reset() {
|
void reset() {
|
||||||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||||
_counts[*t] = 0;
|
_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; }
|
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]; }
|
uint32_t get(DataType t) const { assert(t != DataType::NIL); return _counts[t]; }
|
||||||
|
|
||||||
inline uint32_t n (DataType t) const { 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]; }
|
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; }
|
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]; }
|
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; }
|
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 n_total() const {
|
||||||
uint32_t ret = 0;
|
uint32_t ret = 0;
|
||||||
for (uint32_t i=0; i < DataType::num_types; ++i)
|
for (uint32_t i=0; i < DataType::num_types; ++i)
|
||||||
|
|
|
@ -33,6 +33,8 @@ namespace ARDOUR {
|
||||||
|
|
||||||
/** A mapping from one set of channels to another
|
/** A mapping from one set of channels to another
|
||||||
* (e.g. how to 'connect' two BufferSets).
|
* (e.g. how to 'connect' two BufferSets).
|
||||||
|
*
|
||||||
|
* for plugins the form is "pin" -> "buffer"
|
||||||
*/
|
*/
|
||||||
class LIBARDOUR_API ChanMapping {
|
class LIBARDOUR_API ChanMapping {
|
||||||
public:
|
public:
|
||||||
|
@ -41,7 +43,18 @@ public:
|
||||||
ChanMapping(const ChanMapping&);
|
ChanMapping(const ChanMapping&);
|
||||||
|
|
||||||
uint32_t get(DataType t, uint32_t from, bool* valid);
|
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); }
|
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 set(DataType t, uint32_t from, uint32_t to);
|
||||||
void offset_from(DataType t, int32_t delta);
|
void offset_from(DataType t, int32_t delta);
|
||||||
void offset_to(DataType t, int32_t delta);
|
void offset_to(DataType t, int32_t delta);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user