cee6075a51d03f1cb8e1e7bf51b4bebdbdd92e06
[ardour.git] / libs / ardour / ardour / stripable.h
1 /*
2   Copyright (C) 2016 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __libardour_stripable_h__
21 #define __libardour_stripable_h__
22
23 #include <stdint.h>
24
25 #include <string>
26 #include <boost/utility.hpp>
27 #include <boost/shared_ptr.hpp>
28
29 #include "ardour/session_object.h"
30
31 namespace ARDOUR {
32
33 class AutomationControl;
34 class GainControl;
35 class PeakMeter;
36 class SoloControl;
37 class MuteControl;
38 class PhaseControl;
39 class SoloIsolateControl;
40 class SoloSafeControl;
41 class MonitorControl;
42
43 /* This is a virtual base class for any object that needs to be potentially
44  * represented by a control-centric user interface using the general model of a
45  * mixing console "strip" - a collection of controls that determine the state
46  * and behaviour of the object.
47  */
48
49 class Stripable : public SessionObject {
50    public:
51         Stripable (Session& session, const std::string& name)
52                 : SessionObject (session, name) {}
53
54         /* XXX
55            midi on/off
56            selected status
57            visible/hidden
58          */
59
60         virtual uint32_t remote_control_id () const = 0;
61
62         virtual boost::shared_ptr<PeakMeter>       peak_meter() = 0;
63         virtual boost::shared_ptr<const PeakMeter> peak_meter() const = 0;
64
65         virtual boost::shared_ptr<GainControl> gain_control() const = 0;
66
67         virtual boost::shared_ptr<SoloControl> solo_control() const = 0;
68         virtual boost::shared_ptr<MuteControl> mute_control() const = 0;
69
70         virtual boost::shared_ptr<PhaseControl> phase_control() const = 0;
71         virtual boost::shared_ptr<GainControl> trim_control() const = 0;
72
73         virtual boost::shared_ptr<MonitorControl> monitoring_control() const = 0;
74         virtual boost::shared_ptr<AutomationControl> recenable_control() const { return boost::shared_ptr<AutomationControl>(); }
75
76         /* "well-known" controls for panning. Any or all of these may return
77          * null.
78          */
79
80         virtual boost::shared_ptr<AutomationControl> pan_azimuth_control() const = 0;
81         virtual boost::shared_ptr<AutomationControl> pan_elevation_control() const = 0;
82         virtual boost::shared_ptr<AutomationControl> pan_width_control() const = 0;
83         virtual boost::shared_ptr<AutomationControl> pan_frontback_control() const = 0;
84         virtual boost::shared_ptr<AutomationControl> pan_lfe_control() const = 0;
85
86         /* "well-known" controls for an EQ in this route. Any or all may
87          * be null. eq_band_cnt() must return 0 if there is no EQ present.
88          * Passing an @param band value >= eq_band_cnt() will guarantee the
89          * return of a null ptr (or an empty string for eq_band_name()).
90          */
91         virtual uint32_t eq_band_cnt () const = 0;
92         virtual std::string eq_band_name (uint32_t) const = 0;
93         virtual boost::shared_ptr<AutomationControl> eq_gain_controllable (uint32_t band) const = 0;
94         virtual boost::shared_ptr<AutomationControl> eq_freq_controllable (uint32_t band) const = 0;
95         virtual boost::shared_ptr<AutomationControl> eq_q_controllable (uint32_t band) const = 0;
96         virtual boost::shared_ptr<AutomationControl> eq_shape_controllable (uint32_t band) const = 0;
97         virtual boost::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
98         virtual boost::shared_ptr<AutomationControl> eq_hpf_controllable () const = 0;
99
100         /* "well-known" controls for a compressor in this route. Any or all may
101          * be null.
102          */
103         virtual boost::shared_ptr<AutomationControl> comp_enable_controllable () const = 0;
104         virtual boost::shared_ptr<AutomationControl> comp_threshold_controllable () const = 0;
105         virtual boost::shared_ptr<AutomationControl> comp_speed_controllable () const = 0;
106         virtual boost::shared_ptr<AutomationControl> comp_mode_controllable () const = 0;
107         virtual boost::shared_ptr<AutomationControl> comp_makeup_controllable () const = 0;
108         virtual boost::shared_ptr<AutomationControl> comp_redux_controllable () const = 0;
109
110         /* @param mode must be supplied by the comp_mode_controllable(). All other values
111          * result in undefined behaviour
112          */
113         virtual std::string comp_mode_name (uint32_t mode) const = 0;
114         /* @param mode - as for comp mode name. This returns the name for the
115          * parameter/control accessed via comp_speed_controllable(), which can
116          * be mode dependent.
117          */
118         virtual std::string comp_speed_name (uint32_t mode) const = 0;
119
120         /* "well-known" controls for sends to well-known busses in this route. Any or all may
121          * be null.
122          *
123          * In Mixbus, these are the sends that connect to the mixbusses.
124          * In Ardour, these are user-created sends that connect to user-created
125          * Aux busses.
126          */
127         virtual boost::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const = 0;
128         virtual boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const = 0;
129         /* for the same value of @param n, this returns the name of the send
130          * associated with the pair of controllables returned by the above two methods.
131          */
132         virtual std::string send_name (uint32_t n) const = 0;
133
134         /* well known control that enables/disables sending to the master bus.
135          *
136          * In Ardour, this returns null.
137          * In Mixbus, it will return a suitable control, or null depending on
138          * the route.
139          */
140         virtual boost::shared_ptr<AutomationControl> master_send_enable_controllable () const = 0;
141
142         virtual bool muted_by_others_soloing () const = 0;
143 };
144
145
146 }
147
148 #endif /* __libardour_stripable_h__ */