2 Copyright (C) 2011 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 __libardour_pannable_h__
21 #define __libardour_pannable_h__
25 #include <boost/shared_ptr.hpp>
27 #include "evoral/Parameter.hpp"
29 #include "ardour/automatable.h"
30 #include "ardour/session_handle.h"
35 class AutomationControl;
37 struct Pannable : public Automatable, public SessionHandleRef {
38 Pannable (Session& s);
40 boost::shared_ptr<AutomationControl> pan_azimuth_control;
41 boost::shared_ptr<AutomationControl> pan_elevation_control;
42 boost::shared_ptr<AutomationControl> pan_width_control;
43 boost::shared_ptr<AutomationControl> pan_frontback_control;
44 boost::shared_ptr<AutomationControl> pan_lfe_control;
46 Session& session() { return _session; }
48 void set_automation_state (AutoState);
49 AutoState automation_state() const { return _auto_state; }
50 PBD::Signal1<void, AutoState> automation_state_changed;
52 void set_automation_style (AutoStyle m);
53 AutoStyle automation_style() const { return _auto_style; }
54 PBD::Signal0<void> automation_style_changed;
56 bool automation_playback() const {
57 return (_auto_state & Play) || ((_auto_state & Touch) && !touching());
59 bool automation_write () const {
60 return ((_auto_state & Write) || ((_auto_state & Touch) && touching()));
63 void start_touch (double when);
64 void stop_touch (bool mark, double when);
65 bool touching() const { return g_atomic_int_get (&_touching); }
66 bool writing() const { return _auto_state == Write; }
67 bool touch_enabled() const { return _auto_state == Touch; }
70 AutoState _auto_state;
71 AutoStyle _auto_style;
77 #endif /* __libardour_pannable_h__ */