fix return type of SlavableAutomationControl::get_boolean_masters() to make it usefl

This commit is contained in:
Paul Davis 2016-04-19 15:43:17 -04:00
parent 9e70384ccf
commit bce617375e
4 changed files with 12 additions and 11 deletions

View file

@ -96,7 +96,7 @@ class SlavableAutomationControl : public AutomationControl
double get_value_locked() const;
void actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
void update_boolean_masters_records (boost::shared_ptr<AutomationControl>);
bool get_boolean_masters () const;
int32_t get_boolean_masters () const;
virtual void master_changed (bool from_self, GroupControlDisposition gcd, boost::shared_ptr<AutomationControl>);
virtual void recompute_masters_ratios (double val) { /* do nothing by default */}

View file

@ -284,7 +284,6 @@ AutomationControl::check_rt (double val, Controllable::GroupControlDisposition g
{
if (!_session.loading() && (flags() & Controllable::RealTime) && !AudioEngine::instance()->in_process_thread()) {
/* queue change in RT context */
std::cerr << "::set_value (" << val << ", " << enum_2_string (gcd) << ") called for " << enum_2_string ((AutomationType) _parameter.type()) << ", queueing in RT context\n";
_session.set_control (shared_from_this(), val, gcd);
return true;
}

View file

@ -67,7 +67,7 @@ MuteControl::pre_remove_master (boost::shared_ptr<AutomationControl> m)
}
if (m->get_value()) {
if (!muted_by_self() && (muted_by_others() == 1)) {
if (!muted_by_self() && (get_boolean_masters() == 1)) {
Changed (false, Controllable::NoGroup);
}
}

View file

@ -163,19 +163,21 @@ SlavableAutomationControl::add_master (boost::shared_ptr<AutomationControl> m)
update_boolean_masters_records (m);
}
bool
int32_t
SlavableAutomationControl::get_boolean_masters () const
{
if (!_desc.toggled) {
return false;
}
int32_t n = 0;
Glib::Threads::RWLock::ReaderLock lm (master_lock);
for (Masters::const_iterator mr = _masters.begin(); mr != _masters.end(); ++mr) {
if (mr->second.yn()) {
return true;
if (_desc.toggled) {
Glib::Threads::RWLock::ReaderLock lm (master_lock);
for (Masters::const_iterator mr = _masters.begin(); mr != _masters.end(); ++mr) {
if (mr->second.yn()) {
++n;
}
}
}
return n;
}
void