diff options
author | David Robillard <d@drobilla.net> | 2007-06-23 20:13:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-23 20:13:13 +0000 |
commit | 49ee64ada7f7661067a1dde8c02d40a8e2f6ca66 (patch) | |
tree | b1c4472355e6e3c65ca907c5c3e13959fb2e46cf /libs/ardour/ardour/automatable.h | |
parent | 05184ed52ffcdcad3c071d4c99287f832f42b74b (diff) |
Insert/Redirect refactoring, towards better MIDI support in mixer strip, and
http://ardour.org/node/1043 style things.
git-svn-id: svn://localhost/ardour2/trunk@2027 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/automatable.h')
-rw-r--r-- | libs/ardour/ardour/automatable.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h new file mode 100644 index 0000000000..c6621b9780 --- /dev/null +++ b/libs/ardour/ardour/automatable.h @@ -0,0 +1,78 @@ +/* + Copyright (C) 2000,2007 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __ardour_automatable_h__ +#define __ardour_automatable_h__ + +#include <set> +#include <map> +#include <ardour/session_object.h> +#include <ardour/automation_event.h> + +namespace ARDOUR { + +class Session; + +class Automatable : public SessionObject +{ +public: + Automatable(Session&, const std::string& name); + + virtual ~Automatable() {} + + virtual AutomationList& automation_list(uint32_t n); + + virtual void automation_snapshot (nframes_t now) {}; + + virtual bool find_next_event(nframes_t start, nframes_t end, ControlEvent& ev) const; + + virtual string describe_parameter(uint32_t which); + virtual float default_parameter_value(uint32_t which) { return 1.0f; } + + void what_has_automation(std::set<uint32_t>&) const; + void what_has_visible_automation(std::set<uint32_t>&) const; + const std::set<uint32_t>& what_can_be_automated() const { return _can_automate_list; } + + void mark_automation_visible(uint32_t, bool); + +protected: + + void can_automate(uint32_t); + + virtual void automation_list_creation_callback(uint32_t, AutomationList&) {} + + int set_automation_state(const XMLNode&); + XMLNode& get_automation_state(); + + int load_automation (const std::string& path); + int old_set_automation_state(const XMLNode&); + + mutable Glib::Mutex _automation_lock; + + // FIXME: map with int keys is a bit silly. this could be O(1) + std::map<uint32_t,AutomationList*> _parameter_automation; + std::set<uint32_t> _visible_parameter_automation; + std::set<uint32_t> _can_automate_list; + + nframes_t _last_automation_snapshot; +}; + +} // namespace ARDOUR + +#endif /* __ardour_automatable_h__ */ |