diff options
author | David Robillard <d@drobilla.net> | 2008-09-19 00:47:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-09-19 00:47:49 +0000 |
commit | d357eca668044badcb4bab318e2e74cfffa9a0b0 (patch) | |
tree | eab9bf33b194f9e37c20f84375e5caa748ee994a /libs/ardour/ardour/automatable.h | |
parent | 3d976c5b727e4d55ce439b1d7c055a814477fa1a (diff) |
Factor out sequencing related things into an independant new library: "evoral".
Anything related to the storage of events/values over a range of time lives in evoral.
This includes MidiModel (Evoral::Sequence) and automation data (AutomationList (Evoral::ControlList),
Automatable (Evoral::ControlSet), etc).
libs/evoral synced with http://svn.drobilla.net/lad/trunk/evoral r1511.
git-svn-id: svn://localhost/ardour2/branches/3.0@3754 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/automatable.h')
-rw-r--r-- | libs/ardour/ardour/automatable.h | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index a2c1d98ae7..ce31721802 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -27,49 +27,33 @@ #include <ardour/automation_event.h> #include <ardour/automation_control.h> #include <ardour/parameter.h> +#include <evoral/ControlSet.hpp> namespace ARDOUR { class Session; class AutomationControl; -class Automatable : public SessionObject +class Automatable : public SessionObject, virtual public Evoral::ControlSet { public: Automatable(Session&, const std::string& name); virtual ~Automatable() {} - // shorthand for gain, pan, etc - inline boost::shared_ptr<AutomationControl> - control(AutomationType type, bool create_if_missing=false) { - return control(Parameter(type), create_if_missing); - } - - virtual boost::shared_ptr<AutomationControl> control(Parameter id, bool create_if_missing=false); - virtual boost::shared_ptr<const AutomationControl> control(Parameter id) const; + boost::shared_ptr<Evoral::Control> control_factory(boost::shared_ptr<Evoral::ControlList> list) const; + boost::shared_ptr<Evoral::ControlList> control_list_factory(const Evoral::Parameter& param) const; - boost::shared_ptr<AutomationControl> control_factory(boost::shared_ptr<AutomationList> list); + virtual void add_control(boost::shared_ptr<Evoral::Control>); - typedef std::map<Parameter,boost::shared_ptr<AutomationControl> > Controls; - Controls& controls() { return _controls; } - const Controls& controls() const { return _controls; } - - virtual void add_control(boost::shared_ptr<AutomationControl>); - virtual void automation_snapshot(nframes_t now, bool force); bool should_snapshot (nframes_t now) { return (_last_automation_snapshot > now || (now - _last_automation_snapshot) > _automation_interval); } virtual void transport_stopped(nframes_t now); - virtual bool find_next_event(nframes_t start, nframes_t end, ControlEvent& ev) const; - virtual string describe_parameter(Parameter param); - virtual float default_parameter_value(Parameter param) { return 1.0f; } - virtual void clear_automation(); - AutoState get_parameter_automation_state (Parameter param, bool lock = true); virtual void set_parameter_automation_state (Parameter param, AutoState); @@ -78,14 +62,11 @@ public: void protect_automation (); - void what_has_automation(std::set<Parameter>&) const; - void what_has_visible_automation(std::set<Parameter>&) const; + void what_has_visible_data(std::set<Parameter>&) const; const std::set<Parameter>& what_can_be_automated() const { return _can_automate_list; } void mark_automation_visible(Parameter, bool); - Glib::Mutex& automation_lock() const { return _automation_lock; } - static void set_automation_interval (jack_nframes_t frames) { _automation_interval = frames; } @@ -106,9 +87,6 @@ protected: int load_automation (const std::string& path); int old_set_automation_state(const XMLNode&); - mutable Glib::Mutex _automation_lock; - - Controls _controls; std::set<Parameter> _visible_controls; std::set<Parameter> _can_automate_list; |