summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/chan_count.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour/chan_count.h')
-rw-r--r--libs/ardour/ardour/chan_count.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h
index ff70be6bb6..fb4b1999ca 100644
--- a/libs/ardour/ardour/chan_count.h
+++ b/libs/ardour/ardour/chan_count.h
@@ -20,10 +20,10 @@
#ifndef __ardour_chan_count_h__
#define __ardour_chan_count_h__
+#include <cassert>
#include <ostream>
#include "ardour/data_type.h"
-#include <cassert>
namespace ARDOUR {
@@ -103,6 +103,14 @@ public:
bool operator>=(const ChanCount& other) const {
return ( (*this > other) || (*this == other) );
}
+
+ static ChanCount max(const ChanCount& a, const ChanCount& b) {
+ ChanCount ret;
+ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+ ret.set(*t, std::max(a.get(*t), b.get(*t)));
+ }
+ return ret;
+ }
static const ChanCount INFINITE;
static const ChanCount ZERO;