2 Copyright (C) 2002 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_automation_event_h__
21 #define __ardour_automation_event_h__
27 #include <glibmm/thread.h>
30 #include "pbd/xml++.h"
31 #include "pbd/statefuldestructible.h"
33 #include "ardour/ardour.h"
35 #include "evoral/ControlList.hpp"
39 class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlList
42 AutomationList (Evoral::Parameter id);
43 AutomationList (const XMLNode&, Evoral::Parameter id);
44 AutomationList (const AutomationList&);
45 AutomationList (const AutomationList&, double start, double end);
48 virtual boost::shared_ptr<Evoral::ControlList> create(Evoral::Parameter id);
50 AutomationList& operator= (const AutomationList&);
51 bool operator== (const AutomationList&);
55 void mark_dirty () const;
57 void set_automation_state (AutoState);
58 AutoState automation_state() const { return _state; }
59 PBD::Signal0<void> automation_state_changed;
61 void set_automation_style (AutoStyle m);
62 AutoStyle automation_style() const { return _style; }
63 PBD::Signal0<void> automation_style_changed;
65 bool automation_playback() const {
66 return (_state & Play) || ((_state & Touch) && !_touching);
68 bool automation_write () const {
69 return (_state & Write) || ((_state & Touch) && _touching);
72 PBD::Signal0<void> StateChanged;
74 static PBD::Signal1<void,AutomationList*> AutomationListCreated;
75 mutable PBD::Signal0<void> Dirty;
79 bool touching() const { return _touching; }
81 XMLNode& get_state ();
82 int set_state (const XMLNode &, int version);
83 XMLNode& state (bool full);
84 XMLNode& serialize_events ();
87 void create_curve_if_necessary ();
88 int deserialize_events (const XMLNode&);
90 void maybe_signal_changed ();
99 #endif /* __ardour_automation_event_h__ */