remember meter type with session
[ardour.git] / libs / ardour / ardour / chan_count.h
index 3dc6423607ce625a4e07fa7c7831e1f6e5eb0b5e..c4f3caef6b3fbeb256ebc79dd3211bbda28b4617 100644 (file)
@@ -1,6 +1,6 @@
 /*
     Copyright (C) 2006 Paul Davis
-       Author: Dave Robillard
+    Author: David Robillard
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -54,6 +54,8 @@ public:
        void     set(DataType t, uint32_t count) { assert(t != DataType::NIL); _counts[t] = count; }
        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_audio() const { return _counts[DataType::AUDIO]; }
        inline void set_audio(uint32_t a) { _counts[DataType::AUDIO] = a; }
 
@@ -114,6 +116,13 @@ public:
                return ret;
        }
 
+       ChanCount& operator+=(const ChanCount& other) {
+               for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+                       _counts[*t] += other._counts[*t];
+               }
+               return *this;
+       }
+
        static ChanCount min(const ChanCount& a, const ChanCount& b) {
                ChanCount ret;
                for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {