Revert "change return type of AutomationControl::actually_set_value() from void to...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 14 Oct 2016 15:16:42 +0000 (11:16 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 14 Oct 2016 15:42:41 +0000 (11:42 -0400)
This reverts commit c104c9d4726f3ba1ecd352d13b88a57f2f964510.

26 files changed:
libs/ardour/ardour/automation_control.h
libs/ardour/ardour/midi_track.h
libs/ardour/ardour/monitor_control.h
libs/ardour/ardour/mute_control.h
libs/ardour/ardour/pan_controllable.h
libs/ardour/ardour/phase_control.h
libs/ardour/ardour/plugin_insert.h
libs/ardour/ardour/record_enable_control.h
libs/ardour/ardour/record_safe_control.h
libs/ardour/ardour/slavable_automation_control.h
libs/ardour/ardour/solo_control.h
libs/ardour/ardour/solo_isolate_control.h
libs/ardour/ardour/solo_safe_control.h
libs/ardour/automation_control.cc
libs/ardour/midi_track.cc
libs/ardour/monitor_control.cc
libs/ardour/mute_control.cc
libs/ardour/pan_controllable.cc
libs/ardour/phase_control.cc
libs/ardour/plugin_insert.cc
libs/ardour/record_enable_control.cc
libs/ardour/record_safe_control.cc
libs/ardour/slavable_automation_control.cc
libs/ardour/solo_control.cc
libs/ardour/solo_isolate_control.cc
libs/ardour/solo_safe_control.cc

index fddb0685ab8ebbb9a7fb7ad54269fe2fbf1cc01d..158996133cdffa23285047855f08792e067cb658 100644 (file)
@@ -105,7 +105,7 @@ class LIBARDOUR_API AutomationControl
         * this is only used by automation playback.
         */
        void set_value_unchecked (double val) {
-               (void) actually_set_value (val, PBD::Controllable::NoGroup);
+               actually_set_value (val, PBD::Controllable::NoGroup);
        }
 
        double lower()   const { return _desc.lower; }
@@ -134,7 +134,7 @@ class LIBARDOUR_API AutomationControl
           Controllable::Changed signal is emitted when necessary.
        */
 
-       virtual bool actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
+       virtual void actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
 
        /* Session needs to call this method before it queues up the real
           change for execution in a realtime context. C++ access control sucks.
index 8a0f8c9f957078a7315b6137c284de5dc8bf62e2..f756812e7142433f4c0a5e1d73ba42720ea22961 100644 (file)
@@ -95,7 +95,7 @@ public:
                MidiTrack* _route;
 
        private:
-               bool actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
+               void actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
        };
 
        virtual void set_parameter_automation_state (Evoral::Parameter param, AutoState);
index 362bcfbc30d7fa51aa23272d38d24430d11da14d..b18517255ee362b82c3221d3b09c6dcbf05e4f99 100644 (file)
@@ -46,7 +46,7 @@ class LIBARDOUR_API MonitorControl : public SlavableAutomationControl
        XMLNode& get_state ();
 
   protected:
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
 
   private:
        Monitorable& _monitorable;
index b324e329087f45e21104cdc12c011b2c6b2c462b..909f0cbf02ab7d394dbffbe9f6a424d3ca1fbc09 100644 (file)
@@ -71,7 +71,7 @@ class LIBARDOUR_API MuteControl : public SlavableAutomationControl
 
   protected:
        void master_changed (bool, PBD::Controllable::GroupControlDisposition, boost::shared_ptr<AutomationControl>);
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
 
        void pre_remove_master (boost::shared_ptr<AutomationControl>);
        void post_add_master (boost::shared_ptr<AutomationControl>);
index 30130e35c868478f3da31a18d176b6afa141ec98..82aa60fe106afd5fdc79aa052970c8a42f2ff6a9 100644 (file)
@@ -51,7 +51,7 @@ class LIBARDOUR_API PanControllable : public AutomationControl
 
   private:
        Pannable* owner;
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
 };
 
 } // namespace
index 489673db2deefa99866c9bc6d8d3b17ea3b9267c..0693c8ee50a9cedf456f0e3bbb116a242ae79f54 100644 (file)
@@ -60,7 +60,7 @@ class LIBARDOUR_API PhaseControl : public AutomationControl
        XMLNode& get_state ();
 
   protected:
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
 
   private:
        boost::dynamic_bitset<> _phase_invert;
index d3936cc7975feb7df66cdc3458d38feafd8c482f..474df73e41d6550bf253f85c51b22e136ed5b07b 100644 (file)
@@ -198,7 +198,7 @@ class LIBARDOUR_API PluginInsert : public Processor
 
        private:
                PluginInsert* _plugin;
-               bool actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
+               void actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
        };
 
        /** A control that manipulates a plugin property (message). */
@@ -212,7 +212,7 @@ class LIBARDOUR_API PluginInsert : public Processor
                double get_value (void) const;
                XMLNode& get_state();
         protected:
-               bool actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
+               void actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
 
        private:
                PluginInsert* _plugin;
index a9c4750eea2d474fbefce1b98ee95462c419eb60..c5cb65c597d5b5bbb4951643e76f05026571338d 100644 (file)
@@ -49,7 +49,7 @@ class LIBARDOUR_API RecordEnableControl : public SlavableAutomationControl
        void set_value (double, PBD::Controllable::GroupControlDisposition);
 
   protected:
-       bool  actually_set_value (double val, Controllable::GroupControlDisposition gcd);
+       void actually_set_value (double val, Controllable::GroupControlDisposition gcd);
        void do_pre_realtime_queue_stuff (double value);
 
   private:
index c7432cf3d4d450ecdaf70abe090284fa93f47a51..ef062aa9f0ff4b3354da5754bee1ba98641ebe21 100644 (file)
@@ -39,7 +39,7 @@ class LIBARDOUR_API RecordSafeControl : public SlavableAutomationControl
        ~RecordSafeControl() {}
 
   protected:
-       bool actually_set_value (double val, Controllable::GroupControlDisposition gcd);
+       void actually_set_value (double val, Controllable::GroupControlDisposition gcd);
 
   private:
        Recordable& _recordable;
index c7133df89deb5a37676a329dc87f89d327884614..7e46dd5a74e7995abee60518a399ec09d59497ea 100644 (file)
@@ -102,7 +102,7 @@ class LIBARDOUR_API SlavableAutomationControl : public AutomationControl
 
        void   master_going_away (boost::weak_ptr<AutomationControl>);
        double get_value_locked() const;
-       bool   actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
+       void   actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override);
        void   update_boolean_masters_records (boost::shared_ptr<AutomationControl>);
 
        virtual void   master_changed (bool from_self, GroupControlDisposition gcd, boost::shared_ptr<AutomationControl>);
index 4678ca60493a3af918cad8828cce72c18f687b54..3f0f522fc3589d4bd54778893f5162c49c9fd538 100644 (file)
@@ -96,7 +96,7 @@ class LIBARDOUR_API SoloControl : public SlavableAutomationControl
        XMLNode& get_state ();
 
   protected:
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
        void master_changed (bool from_self, GroupControlDisposition, boost::shared_ptr<AutomationControl> m);
        void pre_remove_master (boost::shared_ptr<AutomationControl>);
        void post_add_master (boost::shared_ptr<AutomationControl>);
index e77591e272d3585fdab7d783213fd96c712e87fc..1e49469067333186907ae496a0a680ba9856a98a 100644 (file)
@@ -74,7 +74,7 @@ class LIBARDOUR_API SoloIsolateControl : public SlavableAutomationControl
 
   protected:
        void master_changed (bool from_self, PBD::Controllable::GroupControlDisposition gcd, boost::shared_ptr<AutomationControl>);
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
 
   private:
        Soloable&      _soloable;
index ba316925897ff4cf832055aca36d8f961f33ec68..e969959e94b251d45ed3c6f11dc3c9e0e0aeb4f3 100644 (file)
@@ -44,7 +44,7 @@ class LIBARDOUR_API SoloSafeControl : public SlavableAutomationControl
        XMLNode& get_state ();
 
   protected:
-       bool actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
+       void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
 
   private:
        bool _solo_safe;
index 03871cf07c09616a824d6c2f384762098203bb34..9a6590ebe845bd442a7011d5a0e941c2f97246de 100644 (file)
@@ -116,11 +116,11 @@ AutomationControl::set_value (double val, PBD::Controllable::GroupControlDisposi
  *  (e.g. record if necessary, etc.)
  *  @param value `user' value
  */
-bool
+void
 AutomationControl::actually_set_value (double value, PBD::Controllable::GroupControlDisposition gcd)
 {
        bool to_list = _list && boost::dynamic_pointer_cast<AutomationList>(_list)->automation_write();
-       const double old_value = get_value ();
+       //const double old_value = Control::user_double ();
 
        Control::set_double (value, _session.transport_frame(), to_list);
 
@@ -128,12 +128,7 @@ AutomationControl::actually_set_value (double value, PBD::Controllable::GroupCon
        //std::cerr << "++++ Changed (" << enum_2_string (at) << ", " << enum_2_string (gcd) << ") = " << value
        //<< " (was " << old_value << ") @ " << this << std::endl;
 
-       if (old_value != value) {
-               Changed (true, gcd);
-               return true;
-       }
-
-       return false;
+       Changed (true, gcd);
 }
 
 void
index ac5cfc098a375f8f2951886f1b5e0ca1d40139de..f1344e7697640eac1d85cf604d8ada3f00a7f584 100644 (file)
@@ -712,7 +712,7 @@ MidiTrack::set_parameter_automation_state (Evoral::Parameter param, AutoState st
        }
 }
 
-bool
+void
 MidiTrack::MidiControl::actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override)
 {
        const Evoral::Parameter &parameter = _list ? _list->parameter() : Control::parameter();
@@ -732,7 +732,7 @@ MidiTrack::MidiControl::actually_set_value (double val, PBD::Controllable::Group
        }
 
        if (!valid) {
-               return false;
+               return;
        }
 
        assert(val <= desc.upper);
@@ -776,7 +776,7 @@ MidiTrack::MidiControl::actually_set_value (double val, PBD::Controllable::Group
                _route->write_immediate_event(size,  ev);
        }
 
-       return AutomationControl::actually_set_value(val, group_override);
+       AutomationControl::actually_set_value(val, group_override);
 }
 
 void
index a5907f769fb544d3866424ec453b17e8b4fcc7f4..907a7473d7e56e6c07b13a7d2ef927809a6a1368 100644 (file)
@@ -36,7 +36,7 @@ MonitorControl::MonitorControl (Session& session, std::string const & name, Moni
        set_flags (Controllable::Flag (flags() | Controllable::RealTime));
 }
 
-bool
+void
 MonitorControl::actually_set_value (double val, Controllable::GroupControlDisposition gcd)
 {
        int v = (int) val;
@@ -48,11 +48,11 @@ MonitorControl::actually_set_value (double val, Controllable::GroupControlDispos
                break;
        default:
                /* illegal value */
-               return false;
+               return;
        }
 
        _monitoring = MonitorChoice (v);
-       return AutomationControl::actually_set_value (val, gcd);
+       AutomationControl::actually_set_value (val, gcd);
 }
 
 XMLNode&
index 1b7f0f08f84741a157079429e37b44cec24fd1db..5b38547366778081b9a479abf216780f1d869fca 100644 (file)
@@ -74,7 +74,7 @@ MuteControl::pre_remove_master (boost::shared_ptr<AutomationControl> m)
        }
 }
 
-bool
+void
 MuteControl::actually_set_value (double val, Controllable::GroupControlDisposition gcd)
 {
        if (muted_by_self() != bool (val)) {
@@ -86,7 +86,7 @@ MuteControl::actually_set_value (double val, Controllable::GroupControlDispositi
                _muteable.act_on_mute ();
        }
 
-       return SlavableAutomationControl::actually_set_value (val, gcd);
+       SlavableAutomationControl::actually_set_value (val, gcd);
 }
 
 void
index e4ad360910bb7acef46cc307b5bd85b951b39cd2..89842b124b26be5c8a1dc2321ca82e9c49160fb7 100644 (file)
@@ -34,14 +34,15 @@ PanControllable::lower () const
         }
 }
 
-bool
+void
 PanControllable::actually_set_value (double v, Controllable::GroupControlDisposition group_override)
 {
        boost::shared_ptr<Panner> p = owner->panner();
 
         if (!p) {
                 /* no panner: just do it */
-               return AutomationControl::actually_set_value (v, group_override);
+               AutomationControl::actually_set_value (v, group_override);
+                return;
         }
 
         bool can_set = false;
@@ -61,10 +62,8 @@ PanControllable::actually_set_value (double v, Controllable::GroupControlDisposi
         }
 
         if (can_set) {
-               return AutomationControl::actually_set_value (v, group_override);
+               AutomationControl::actually_set_value (v, group_override);
         }
-
-        return false;
 }
 
 std::string
index 96d0d375b6b7aca65854affa2fa1c2a661c56139..9757c104b92a95b05159167afc03b8c7ed2c935b 100644 (file)
@@ -32,12 +32,12 @@ PhaseControl::PhaseControl (Session& session, std::string const & name)
 {
 }
 
-bool
+void
 PhaseControl::actually_set_value (double val, Controllable::GroupControlDisposition gcd)
 {
        _phase_invert = boost::dynamic_bitset<> (std::numeric_limits<double>::digits, (unsigned long) val);
 
-       return AutomationControl::actually_set_value (val, gcd);
+       AutomationControl::actually_set_value (val, gcd);
 }
 
 /** @param c Audio channel index.
@@ -48,7 +48,7 @@ PhaseControl::set_phase_invert (uint32_t c, bool yn)
 {
        if (_phase_invert[c] != yn) {
                _phase_invert[c] = yn;
-               (void) AutomationControl::actually_set_value (_phase_invert.to_ulong(), Controllable::NoGroup);
+               AutomationControl::actually_set_value (_phase_invert.to_ulong(), Controllable::NoGroup);
                _session.set_dirty ();
        }
 }
@@ -58,7 +58,7 @@ PhaseControl::set_phase_invert (boost::dynamic_bitset<> p)
 {
        if (_phase_invert != p) {
                _phase_invert = p;
-               (void) AutomationControl::actually_set_value (_phase_invert.to_ulong(), Controllable::NoGroup);
+               AutomationControl::actually_set_value (_phase_invert.to_ulong(), Controllable::NoGroup);
                Changed (true, Controllable::NoGroup); /* EMIT SIGNAL */
                _session.set_dirty ();
        }
index a8348c1df39b25d1b8888fee127e550b63d22e9d..2283f99e4bf0a4cf045e8590808277ae1efdfd02 100644 (file)
@@ -2767,7 +2767,7 @@ PluginInsert::PluginControl::PluginControl (PluginInsert*                     p,
 
 /** @param val `user' value */
 
-bool
+void
 PluginInsert::PluginControl::actually_set_value (double user_val, PBD::Controllable::GroupControlDisposition group_override)
 {
        /* FIXME: probably should be taking out some lock here.. */
@@ -2781,13 +2781,13 @@ PluginInsert::PluginControl::actually_set_value (double user_val, PBD::Controlla
                iasp->set_parameter (_list->parameter().id(), user_val);
        }
 
-       return AutomationControl::actually_set_value (user_val, group_override);
+       AutomationControl::actually_set_value (user_val, group_override);
 }
 
 void
 PluginInsert::PluginControl::catch_up_with_external_value (double user_val)
 {
-       (void) AutomationControl::actually_set_value (user_val, Controllable::NoGroup);
+       AutomationControl::actually_set_value (user_val, Controllable::NoGroup);
 }
 
 XMLNode&
@@ -2834,7 +2834,7 @@ PluginInsert::PluginPropertyControl::PluginPropertyControl (PluginInsert*
        }
 }
 
-bool
+void
 PluginInsert::PluginPropertyControl::actually_set_value (double user_val, Controllable::GroupControlDisposition gcd)
 {
        /* Old numeric set_value(), coerce to appropriate datatype if possible.
@@ -2843,7 +2843,7 @@ PluginInsert::PluginPropertyControl::actually_set_value (double user_val, Contro
        const Variant value(_desc.datatype, user_val);
        if (value.type() == Variant::NOTHING) {
                error << "set_value(double) called for non-numeric property" << endmsg;
-               return false;
+               return;
        }
 
        for (Plugins::iterator i = _plugin->_plugins.begin(); i != _plugin->_plugins.end(); ++i) {
@@ -2852,7 +2852,7 @@ PluginInsert::PluginPropertyControl::actually_set_value (double user_val, Contro
 
        _value = value;
 
-       return AutomationControl::actually_set_value (user_val, gcd);
+       AutomationControl::actually_set_value (user_val, gcd);
 }
 
 XMLNode&
index c83c0d186ddab004b5297d9dae3526e740c592ac..f3512c3204dcc15bde71b44f196fd06347514c5c 100644 (file)
@@ -45,15 +45,15 @@ RecordEnableControl::set_value (double val, Controllable::GroupControlDispositio
        SlavableAutomationControl::set_value (val, gcd);
 }
 
-bool
+void
 RecordEnableControl::actually_set_value (double val, Controllable::GroupControlDisposition gcd)
 {
        if (val && !_recordable.can_be_record_enabled()) {
                std::cerr << "rec-enable not allowed\n";
-               return false;
+               return;
        }
 
-       return SlavableAutomationControl::actually_set_value (val, gcd);
+       SlavableAutomationControl::actually_set_value (val, gcd);
 }
 
 void
index d9c698cbdb672dbec647b4d557373be32507da8d..f3036e04ea3e735d5c99b6517140844139dce551 100644 (file)
@@ -36,14 +36,14 @@ RecordSafeControl::RecordSafeControl (Session& session, std::string const & name
        set_flags (Controllable::Flag (flags() | Controllable::RealTime));
 }
 
-bool
+void
 RecordSafeControl::actually_set_value (double val, Controllable::GroupControlDisposition gcd)
 {
        if (val && !_recordable.can_be_record_safe()) {
                std::cerr << "rec-enable not allowed\n";
-               return false;
+               return;
        }
 
-       return SlavableAutomationControl::actually_set_value (val, gcd);
+       SlavableAutomationControl::actually_set_value (val, gcd);
 }
 
index 2f67946705fc1e73a7fce3d973a477b92ba84444..a80598439d3710100c9711a9ebac7df1bc2f83d6 100644 (file)
@@ -96,7 +96,7 @@ SlavableAutomationControl::get_value() const
        }
 }
 
-bool
+void
 SlavableAutomationControl::actually_set_value (double val, Controllable::GroupControlDisposition group_override)
 {
        val = std::max (std::min (val, (double)_desc.upper), (double)_desc.lower);
@@ -112,12 +112,9 @@ SlavableAutomationControl::actually_set_value (double val, Controllable::GroupCo
        /* this sets the Evoral::Control::_user_value for us, which will
           be retrieved by AutomationControl::get_value ()
        */
-       if (AutomationControl::actually_set_value (val, group_override)) {
-               _session.set_dirty ();
-               return true;
-       }
+       AutomationControl::actually_set_value (val, group_override);
 
-       return false;
+       _session.set_dirty ();
 }
 
 void
index ca41ee7aac3cf93ca54012acbc4db0ff13bb57da..087e5d04ab069d3861d182b78142e91b2ade4057 100644 (file)
@@ -157,11 +157,11 @@ SoloControl::mod_solo_by_others_upstream (int32_t delta)
        Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */
 }
 
-bool
+void
 SoloControl::actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override)
 {
        if (_soloable.is_safe() || !_soloable.can_solo()) {
-               return false;
+               return;
        }
 
        set_self_solo (val == 1.0);
@@ -170,7 +170,7 @@ SoloControl::actually_set_value (double val, PBD::Controllable::GroupControlDisp
           be retrieved by AutomationControl::get_value (), and emits Changed
        */
 
-       return SlavableAutomationControl::actually_set_value (val, group_override);
+       SlavableAutomationControl::actually_set_value (val, group_override);
 }
 
 double
index ebd046fba684cab0d51b0fc394ffbeb5de3f1a24..7964f7eb6669636a9656094a14987f9b3694fd17 100644 (file)
@@ -88,11 +88,11 @@ SoloIsolateControl::mod_solo_isolated_by_upstream (int32_t delta)
        }
 }
 
-bool
+void
 SoloIsolateControl::actually_set_value (double val, PBD::Controllable::GroupControlDisposition gcd)
 {
        if (!_soloable.can_solo()) {
-               return false;
+               return;
        }
 
        set_solo_isolated (val, gcd);
@@ -101,12 +101,8 @@ SoloIsolateControl::actually_set_value (double val, PBD::Controllable::GroupCont
           be retrieved by AutomationControl::get_value (), and emits Changed
        */
 
-       if (AutomationControl::actually_set_value (val, gcd)) {
-               _session.set_dirty ();
-               return true;
-       }
-
-       return false;
+       AutomationControl::actually_set_value (val, gcd);
+       _session.set_dirty ();
 }
 
 void
index 7e8de603a7b65c2779f450e8896f42487acd19e7..01d56ddf58eed536a5c54e66d1d687a3eb97684b 100644 (file)
@@ -36,7 +36,7 @@ SoloSafeControl::SoloSafeControl (Session& session, std::string const & name)
        _list->set_interpolation(Evoral::ControlList::Discrete);
 }
 
-bool
+void
 SoloSafeControl::actually_set_value (double val, PBD::Controllable::GroupControlDisposition gcd)
 {
        _solo_safe = (val ? true : false);
@@ -45,12 +45,8 @@ SoloSafeControl::actually_set_value (double val, PBD::Controllable::GroupControl
           be retrieved by AutomationControl::get_value (), and emits Changed
        */
 
-       if (AutomationControl::actually_set_value (val, gcd)) {
-           _session.set_dirty ();
-           return true;
-       }
-
-       return false;
+       AutomationControl::actually_set_value (val, gcd);
+       _session.set_dirty ();
 }
 
 double