2 Copyright (C) 2000,2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_automatable_h__
21 #define __ardour_automatable_h__
25 #include <ardour/session_object.h>
26 #include <ardour/automation_event.h>
32 class Automatable : public SessionObject
35 Automatable(Session&, const std::string& name);
37 virtual ~Automatable() {}
39 virtual AutomationList& automation_list(uint32_t n);
41 virtual void automation_snapshot (nframes_t now) {};
43 virtual bool find_next_event(nframes_t start, nframes_t end, ControlEvent& ev) const;
45 virtual string describe_parameter(uint32_t which);
46 virtual float default_parameter_value(uint32_t which) { return 1.0f; }
48 void what_has_automation(std::set<uint32_t>&) const;
49 void what_has_visible_automation(std::set<uint32_t>&) const;
50 const std::set<uint32_t>& what_can_be_automated() const { return _can_automate_list; }
52 void mark_automation_visible(uint32_t, bool);
56 void can_automate(uint32_t);
58 virtual void automation_list_creation_callback(uint32_t, AutomationList&) {}
60 int set_automation_state(const XMLNode&);
61 XMLNode& get_automation_state();
63 int load_automation (const std::string& path);
64 int old_set_automation_state(const XMLNode&);
66 mutable Glib::Mutex _automation_lock;
68 // FIXME: map with int keys is a bit silly. this could be O(1)
69 std::map<uint32_t,AutomationList*> _parameter_automation;
70 std::set<uint32_t> _visible_parameter_automation;
71 std::set<uint32_t> _can_automate_list;
73 nframes_t _last_automation_snapshot;
78 #endif /* __ardour_automatable_h__ */