summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/chan_mapping.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-31 20:28:48 +0200
committerRobin Gareus <robin@gareus.org>2016-03-31 20:28:48 +0200
commit884cb355230d293233e599bdfebae7f67684a48e (patch)
tree8ff73fb9c2e28fef6cc80f0e23abfce8ca645580 /libs/ardour/ardour/chan_mapping.h
parent3ec33cccbeb1be58724b9a5ca522fdfd70038db8 (diff)
plugin-pin-map:
* fix MIDI-bypass * prepare combined channel-map report (for GUI) * fix route failed config return
Diffstat (limited to 'libs/ardour/ardour/chan_mapping.h')
-rw-r--r--libs/ardour/ardour/chan_mapping.h39
1 files changed, 17 insertions, 22 deletions
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h
index 730ecadc72..f73408baec 100644
--- a/libs/ardour/ardour/chan_mapping.h
+++ b/libs/ardour/ardour/chan_mapping.h
@@ -31,10 +31,11 @@
namespace ARDOUR {
-/** A mapping from one set of channels to another
- * (e.g. how to 'connect' two BufferSets).
+/** A mapping from one set of channels to another.
+ * The general form is 1 source (from), many sinks (to).
+ * numeric IDs are used to identify sources and sinks.
*
- * for plugins the form is "pin" -> "buffer"
+ * for plugins this is used to map "plugin-pin" to "audio-buffer"
*/
class LIBARDOUR_API ChanMapping {
public:
@@ -44,15 +45,24 @@ public:
uint32_t get(DataType t, uint32_t from, bool* valid) const;
+ /** reverse lookup
+ * @param type data type
+ * @param to pin
+ * @param valid pointer to a boolean. If not NULL it is set to true if the mapping is found, and false otherwise.
+ * @returns first "from" that matches given "to"
+ */
+ uint32_t get_src(DataType t, uint32_t to, bool* valid) const;
+
/** get buffer mapping for given data type and pin
* @param type data type
- * @param from pin
+ * @param from numeric source id
* @returns mapped buffer number (or ChanMapping::Invalid)
*/
- uint32_t get(DataType t, uint32_t from) const { return get (t, from, NULL); }
+ uint32_t get (DataType t, uint32_t from) const { return get (t, from, NULL); }
+
/** set buffer mapping for given data type
* @param type data type
- * @param from pin
+ * @param from numeric source id
* @param to buffer
*/
void set(DataType t, uint32_t from, uint32_t to);
@@ -61,7 +71,7 @@ public:
/** remove mapping
* @param type data type
- * @param from source to remove from mapping
+ * @param from numeric source to remove from mapping
*/
void unset(DataType t, uint32_t from);
@@ -76,7 +86,6 @@ public:
*/
bool is_monotonic () const;
-
/** Test if this mapping is a subset
* @param superset to test against
* @returns true if all mapping are also present in the superset
@@ -97,20 +106,6 @@ public:
return ! (*this == other);
}
- ChanMapping operator+=(const ChanMapping& other) {
- const ChanMapping::Mappings& mp (other.mappings());
- for (Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
- for (TypeMapping::const_iterator i = tm->second.begin(); i != tm->second.end(); ++i) {
-#if 0
- bool valid; uint32_t x = get (tm->first, i->first, &valid);
- assert (!valid || x == i->second);
-#endif
- set (tm->first, i->first, i->second);
- }
- }
- return *this;
- }
-
private:
Mappings _mappings;
};