Add API to expand/flatten AC groups
authorRobin Gareus <robin@gareus.org>
Sat, 8 Jul 2017 13:35:30 +0000 (15:35 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 8 Jul 2017 13:35:30 +0000 (15:35 +0200)
libs/ardour/ardour/automation_control.h
libs/ardour/ardour/types.h
libs/ardour/automation_control.cc

index 6787abd87a8c09df91857ed22d35f816d40b4d9a..6fe88ca52d53808189cf55d9c33c8fe1bfecd3b5 100644 (file)
@@ -119,6 +119,8 @@ public:
        const ARDOUR::Session& session() const { return _session; }
        void commit_transaction (bool did_write);
 
+       ControlList grouped_controls () const;
+
 protected:
        ARDOUR::Session& _session;
        boost::shared_ptr<ControlGroup> _group;
index 3adfaf5c942bc49672170cc36133d463236d92dd..7a0c5762b720d2de593033c8b5b0178e56609a69 100644 (file)
@@ -23,6 +23,7 @@
 #include <istream>
 #include <vector>
 #include <map>
+#include <set>
 #include <boost/shared_ptr.hpp>
 #include <sys/types.h>
 #include <stdint.h>
@@ -570,6 +571,7 @@ namespace ARDOUR {
        typedef std::list<boost::weak_ptr  <Stripable> > WeakStripableList;
        typedef std::list<boost::shared_ptr<AutomationControl> > ControlList;
        typedef std::list<boost::shared_ptr<SlavableAutomationControl> > SlavableControlList;
+       typedef std::set <boost::shared_ptr<AutomationControl> > AutomationControlSet;
 
        typedef std::list<boost::shared_ptr<VCA> > VCAList;
 
index 30eb19fd5a54fa015fffbb72aa7d9c4a07203ccf..acd4c7a760c25512eef9091ef31de99814251d3c 100644 (file)
@@ -136,6 +136,16 @@ AutomationControl::set_value (double val, PBD::Controllable::GroupControlDisposi
        }
 }
 
+ControlList
+AutomationControl::grouped_controls () const
+{
+       if (_group && _group->use_me (PBD::Controllable::UseGroup)) {
+               return _group->controls ();
+       } else {
+               return ControlList ();
+       }
+}
+
 /** Set the value and do the right thing based on automation state
  *  (e.g. record if necessary, etc.)
  *  @param value `user' value