diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-04-19 15:43:17 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:41 -0400 |
commit | bce617375eeb0429e8f98f19839faf7be8a84a5d (patch) | |
tree | 46d29b812e61d1f32fd59814dae5c4d1cfc9cd86 /libs | |
parent | 9e70384ccfc81adc76910fd5365668a47f70d9c8 (diff) |
fix return type of SlavableAutomationControl::get_boolean_masters() to make it usefl
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/slavable_automation_control.h | 2 | ||||
-rw-r--r-- | libs/ardour/automation_control.cc | 1 | ||||
-rw-r--r-- | libs/ardour/mute_control.cc | 2 | ||||
-rw-r--r-- | libs/ardour/slavable_automation_control.cc | 18 |
4 files changed, 12 insertions, 11 deletions
diff --git a/libs/ardour/ardour/slavable_automation_control.h b/libs/ardour/ardour/slavable_automation_control.h index 1f1847fb03..5e95cba22b 100644 --- a/libs/ardour/ardour/slavable_automation_control.h +++ b/libs/ardour/ardour/slavable_automation_control.h @@ -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 */} diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 8ffbd2d7df..d947a3599f 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -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; } diff --git a/libs/ardour/mute_control.cc b/libs/ardour/mute_control.cc index a345f54203..26280d5cd5 100644 --- a/libs/ardour/mute_control.cc +++ b/libs/ardour/mute_control.cc @@ -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); } } diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc index b9f7602dfc..78a1cc192d 100644 --- a/libs/ardour/slavable_automation_control.cc +++ b/libs/ardour/slavable_automation_control.cc @@ -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 |