Replace ::user_double() with ::get_double() 1/2

This commit is contained in:
Robin Gareus 2022-06-29 01:17:03 +02:00
parent a4a241c738
commit 3623b39168
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
6 changed files with 14 additions and 13 deletions

View file

@ -102,14 +102,14 @@ AutomationControl::get_value() const
* (possibly ahead of time, according to latency compensation), * (possibly ahead of time, according to latency compensation),
* and actually_set_value() will have set the user-value accordingly. * and actually_set_value() will have set the user-value accordingly.
*/ */
return Control::user_double(); return Control::get_double();
} }
double double
AutomationControl::get_save_value() const AutomationControl::get_save_value() const
{ {
/* save user-value, not incl masters */ /* save user-value, not incl masters */
return Control::user_double (); return Control::get_double ();
} }
void void
@ -210,7 +210,7 @@ AutomationControl::actually_set_value (double value, PBD::Controllable::GroupCon
anything has changed) is the one derived from the automation event anything has changed) is the one derived from the automation event
list. list.
*/ */
float old_value = Control::user_double(); float old_value = Control::get_double();
if (al && al->automation_write ()) { if (al && al->automation_write ()) {
to_list = true; to_list = true;

View file

@ -172,7 +172,7 @@ AutomationWatch::timer ()
if (time > _last_time) { //we only write automation in the forward direction; this fixes automation-recording in a loop if (time > _last_time) { //we only write automation in the forward direction; this fixes automation-recording in a loop
for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) { for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {
if ((*aw)->alist()->automation_write()) { if ((*aw)->alist()->automation_write()) {
double val = (*aw)->user_double(); double val = (*aw)->get_double();
boost::shared_ptr<SlavableAutomationControl> sc = boost::dynamic_pointer_cast<SlavableAutomationControl> (*aw); boost::shared_ptr<SlavableAutomationControl> sc = boost::dynamic_pointer_cast<SlavableAutomationControl> (*aw);
if (sc) { if (sc) {
val = sc->reduce_by_masters (val, true); val = sc->reduce_by_masters (val, true);

View file

@ -373,7 +373,7 @@ MidiTrack::update_controls (BufferSet const& bufs)
const Evoral::Parameter param = midi_parameter(ev.buffer(), ev.size()); const Evoral::Parameter param = midi_parameter(ev.buffer(), ev.size());
const boost::shared_ptr<AutomationControl> control = automation_control (param); const boost::shared_ptr<AutomationControl> control = automation_control (param);
if (control) { if (control) {
double old = control->user_double (); double old = control->get_double ();
control->set_double (ev.value(), timepos_t::zero (false), false); control->set_double (ev.value(), timepos_t::zero (false), false);
if (old != ev.value()) { if (old != ev.value()) {
control->Changed (false, Controllable::NoGroup); control->Changed (false, Controllable::NoGroup);

View file

@ -105,7 +105,7 @@ MixerScene::recurse_to_master (boost::shared_ptr<PBD::Controllable> c, std::set
return false; return false;
} }
double old_value = ac ? ac->user_double () : c->get_value (); double old_value = ac ? ac->get_double () : c->get_value ();
if (sc && sc->slaved ()) { if (sc && sc->slaved ()) {
double x = sc->reduce_by_masters (1.0); double x = sc->reduce_by_masters (1.0);

View file

@ -86,7 +86,7 @@ SlavableAutomationControl::get_value_locked() const
/* read or write masters lock must be held */ /* read or write masters lock must be held */
if (_masters.empty()) { if (_masters.empty()) {
return Control::user_double (); return Control::get_double ();
} }
if (_desc.toggled) { if (_desc.toggled) {
@ -94,12 +94,12 @@ SlavableAutomationControl::get_value_locked() const
* enabled, this slave is enabled. So check our own value * enabled, this slave is enabled. So check our own value
* first, because if we are enabled, we can return immediately. * first, because if we are enabled, we can return immediately.
*/ */
if (Control::user_double ()) { if (Control::get_double ()) {
return _desc.upper; return _desc.upper;
} }
} }
return Control::user_double () * get_masters_value_locked (); return Control::get_double () * get_masters_value_locked ();
} }
/** Get the current effective `user' value based on automation state */ /** Get the current effective `user' value based on automation state */
@ -109,7 +109,7 @@ SlavableAutomationControl::get_value() const
Glib::Threads::RWLock::ReaderLock lm (master_lock); Glib::Threads::RWLock::ReaderLock lm (master_lock);
if (!_masters.empty() && automation_write ()) { if (!_masters.empty() && automation_write ()) {
/* writing automation takes the fader value as-is, factor out the master */ /* writing automation takes the fader value as-is, factor out the master */
return Control::user_double (); return Control::get_double ();
} }
return get_value_locked (); return get_value_locked ();
} }
@ -137,7 +137,7 @@ SlavableAutomationControl::masters_curve_multiply (timepos_t const & start, time
vec[i] *= scratch[i]; vec[i] *= scratch[i];
} }
} else { } else {
apply_gain_to_buffer (vec, veclen, Control::user_double ()); apply_gain_to_buffer (vec, veclen, Control::get_double ());
} }
if (_masters.empty()) { if (_masters.empty()) {
return rv; return rv;
@ -332,7 +332,7 @@ SlavableAutomationControl::remove_master (boost::shared_ptr<AutomationControl> m
pre_remove_master (m); pre_remove_master (m);
const double old_val = AutomationControl::user_double(); const double old_val = AutomationControl::get_double ();
bool update_value = false; bool update_value = false;
double master_ratio = 0; double master_ratio = 0;
@ -400,7 +400,7 @@ SlavableAutomationControl::clear_masters ()
return; return;
} }
const double old_val = AutomationControl::user_double (); const double old_val = AutomationControl::get_double ();
ControlList masters; ControlList masters;
bool update_value = false; bool update_value = false;

View file

@ -63,6 +63,7 @@ public:
* and adding it to the ControlList. * and adding it to the ControlList.
*/ */
double user_double() const { return _user_value; } double user_double() const { return _user_value; }
virtual double get_double () const { return _user_value; }
void set_list(boost::shared_ptr<ControlList>); void set_list(boost::shared_ptr<ControlList>);