13
0

Add API to query control-masters

This allows to traverse VCA masters upstream, and potentially
build a graph.
This commit is contained in:
Robin Gareus 2022-05-20 18:45:40 +02:00
parent 9dd4931247
commit 7d6e429001
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 16 additions and 0 deletions

View File

@ -46,6 +46,8 @@ public:
bool slaved_to (boost::shared_ptr<AutomationControl>) const;
bool slaved () const;
std::set<boost::shared_ptr<AutomationControl>> masters () const;
virtual void automation_run (samplepos_t start, pframes_t nframes);
double get_masters_value () const {

View File

@ -615,6 +615,20 @@ SlavableAutomationControl::slaved () const
return !_masters.empty();
}
std::set<boost::shared_ptr<AutomationControl>>
SlavableAutomationControl::masters () const
{
std::set<boost::shared_ptr<AutomationControl>> rv;
Glib::Threads::RWLock::ReaderLock lm (master_lock);
for (auto const& m : _masters) {
boost::shared_ptr<AutomationControl> ac (m.second.master ());
if (ac) {
rv.insert (ac);
}
}
return rv;
}
int
SlavableAutomationControl::MasterRecord::set_state (XMLNode const& n, int)
{