summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/chan_mapping.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-29 19:12:29 +0200
committerRobin Gareus <robin@gareus.org>2016-03-29 19:49:37 +0200
commite0dbb95b721efee5457a8456aa2838df1ecbe199 (patch)
tree36dd94ce11dc05203b00c37cb3bdba9942c31ffb /libs/ardour/ardour/chan_mapping.h
parent234b06a18cf3e8c07bc44fb4f8c1218e17fb65f1 (diff)
extend channel-map
add tests for identity matrix, monotonic, subset, which are handy to verify if inplace processing is possible. add `unset()` for upcoming GUI work.
Diffstat (limited to 'libs/ardour/ardour/chan_mapping.h')
-rw-r--r--libs/ardour/ardour/chan_mapping.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h
index 6fbf8bc96e..4b0b930b02 100644
--- a/libs/ardour/ardour/chan_mapping.h
+++ b/libs/ardour/ardour/chan_mapping.h
@@ -42,14 +42,14 @@ public:
ChanMapping(ARDOUR::ChanCount identity);
ChanMapping(const ChanMapping&);
- uint32_t get(DataType t, uint32_t from, bool* valid);
+ uint32_t get(DataType t, uint32_t from, bool* valid) const;
/** 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) const { return get (t, from, NULL); }
/** set buffer mapping for given data type
* @param type data type
* @param from pin
@@ -59,6 +59,30 @@ public:
void offset_from(DataType t, int32_t delta);
void offset_to(DataType t, int32_t delta);
+ /** remove mapping
+ * @param type data type
+ * @param from source to remove from mapping
+ */
+ void unset(DataType t, uint32_t from);
+
+ /** Test mapping matrix for identity
+ * @param offset per data-type offset to take into account
+ * @returns true if the mapping is a channel identity map
+ */
+ bool is_identity (ARDOUR::ChanCount offset = ARDOUR::ChanCount()) const;
+
+ /** Test if this mapping is monotonic (useful to see if inplace processing is feasible)
+ * @returns true if the map is a strict monotonic set
+ */
+ 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
+ */
+ bool is_subset (const ChanMapping& superset) const;
+
typedef std::map<uint32_t, uint32_t> TypeMapping;
typedef std::map<DataType, TypeMapping> Mappings;