diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-30 16:48:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-30 16:48:58 +0000 |
commit | 74933f58659051f6d4ef52d1103b2b7ba4643883 (patch) | |
tree | 93069fda3163dce2e97b61a845863b68b300200d /libs/ardour/ardour | |
parent | 8a17b0fb9073bb21ef2c718113f9e41359faf4fe (diff) |
restore excess calls to sync-order stuff (for now); allow MIDI controllers to use the same non-linear fader response as the gui; add various flags to PBD::Controllable and remove URI from that class
git-svn-id: svn://localhost/ardour2/branches/3.0@6414 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/amp.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/utils.h | 16 |
3 files changed, 20 insertions, 3 deletions
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index c237479abd..54bd9defe2 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -73,8 +73,9 @@ public: GainControl (std::string name, Session& session, Amp* a, const Evoral::Parameter ¶m, boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>() ) : AutomationControl (session, param, al, name) - , _amp (a) - {} + , _amp (a) { + set_flags (Controllable::Flag (flags() | Controllable::GainLike)); + } void set_value (float val); float get_value (void) const; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index bb02396773..ac945703fd 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -304,7 +304,7 @@ class Route : public SessionObject, public AutomatableControls, public RouteGrou void automation_snapshot (nframes_t now, bool force=false); void protect_automation (); - void set_remote_control_id (uint32_t id); + void set_remote_control_id (uint32_t id, bool notify_class_listeners = true); uint32_t remote_control_id () const; /* for things concerned about *this* route's RID */ diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h index 6c6f754cf9..e68f7a01df 100644 --- a/libs/ardour/ardour/utils.h +++ b/libs/ardour/ardour/utils.h @@ -69,6 +69,22 @@ const char* edit_mode_to_string (ARDOUR::EditMode); ARDOUR::EditMode string_to_edit_mode (std::string); +static inline double +gain_to_slider_position (ARDOUR::gain_t g) +{ + if (g == 0) return 0; + return pow((6.0*log(g)/log(2.0)+192.0)/198.0, 8.0); + +} + +static inline ARDOUR::gain_t +slider_position_to_gain (double pos) +{ + /* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */ + if (pos == 0.0) return 0; + return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-192.0)/6.0); +} + /* I don't really like hard-coding these falloff rates here * Probably should use a map of some kind that could be configured * These rates are db/sec. |