diff options
author | David Robillard <d@drobilla.net> | 2008-09-19 01:16:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-09-19 01:16:44 +0000 |
commit | d8ade6d30595a3a8be343b392e47d422940eac27 (patch) | |
tree | cf51f5f3dffb9fabb4b61f9e5cbaf82142f7825b /libs/ardour/ardour/automation_list.h | |
parent | d357eca668044badcb4bab318e2e74cfffa9a0b0 (diff) |
Tidy.
git-svn-id: svn://localhost/ardour2/branches/3.0@3755 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/automation_list.h')
-rw-r--r-- | libs/ardour/ardour/automation_list.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h new file mode 100644 index 0000000000..ed3379bc15 --- /dev/null +++ b/libs/ardour/ardour/automation_list.h @@ -0,0 +1,105 @@ +/* + Copyright (C) 2002 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_automation_event_h__ +#define __ardour_automation_event_h__ + +#include <stdint.h> +#include <list> +#include <cmath> + +#include <sigc++/signal.h> +#include <glibmm/thread.h> + +#include <boost/pool/pool.hpp> +#include <boost/pool/pool_alloc.hpp> + +#include <pbd/undo.h> +#include <pbd/xml++.h> +#include <pbd/statefuldestructible.h> + +#include <ardour/ardour.h> +#include <ardour/parameter.h> + +#include <evoral/ControlList.hpp> + +using Evoral::ControlEvent; + +namespace ARDOUR { + +class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlList +{ + public: + AutomationList (Parameter id); + AutomationList (const XMLNode&, Parameter id); + ~AutomationList(); + + virtual boost::shared_ptr<Evoral::ControlList> create(Evoral::Parameter id); + + AutomationList (const AutomationList&); + AutomationList (const AutomationList&, double start, double end); + AutomationList& operator= (const AutomationList&); + bool operator== (const AutomationList&); + + void freeze(); + void thaw (); + void mark_dirty () const; + + void set_automation_state (AutoState); + AutoState automation_state() const { return _state; } + sigc::signal<void> automation_state_changed; + + void set_automation_style (AutoStyle m); + AutoStyle automation_style() const { return _style; } + sigc::signal<void> automation_style_changed; + + bool automation_playback() const { + return (_state & Play) || ((_state & Touch) && !_touching); + } + bool automation_write () const { + return (_state & Write) || ((_state & Touch) && _touching); + } + + sigc::signal<void> StateChanged; + + static sigc::signal<void, AutomationList*> AutomationListCreated; + mutable sigc::signal<void> Dirty; + + void start_touch (); + void stop_touch (); + bool touching() const { return _touching; } + + XMLNode& get_state(void); + int set_state (const XMLNode &s); + XMLNode& state (bool full); + XMLNode& serialize_events (); + + private: + int deserialize_events (const XMLNode&); + + void maybe_signal_changed (); + + AutoState _state; + AutoStyle _style; + bool _touching; +}; + +} // namespace + +#endif /* __ardour_automation_event_h__ */ |