add some more documentation
authorRobin Gareus <robin@gareus.org>
Sun, 27 Mar 2016 20:39:10 +0000 (22:39 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 27 Mar 2016 20:39:10 +0000 (22:39 +0200)
libs/ardour/ardour/chan_count.h
libs/ardour/ardour/chan_mapping.h

index fc76734817ce1b6f52fbc34f686bf900ddccdaf1..ba4a2f17bbe2ea0a6be05738e55fd76ba83d6f57 100644 (file)
@@ -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)
index 2659c556a2480ef87b4499a903077b457e79547a..6fbf8bc96e420b72d2f4369ea5f3e75d81ef6707 100644 (file)
@@ -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);