2 Copyright (C) 2016 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_stripable_h__
21 #define __libardour_stripable_h__
26 #include <boost/utility.hpp>
27 #include <boost/shared_ptr.hpp>
28 #include <boost/enable_shared_from_this.hpp>
30 #include "pbd/signals.h"
32 #include "ardour/automatable.h"
33 #include "ardour/presentation_info.h"
34 #include "ardour/session_object.h"
35 #include "ardour/libardour_visibility.h"
37 class StripableColorDialog;
41 class AutomationControl;
42 class ReadOnlyControl;
48 class SoloIsolateControl;
49 class SoloSafeControl;
51 class MonitorProcessor;
52 class RecordEnableControl;
53 class RecordSafeControl;
55 /* This is a virtual base class for any object that needs to be potentially
56 * represented by a control-centric user interface using the general model of a
57 * mixing console "strip" - a collection of controls that determine the state
58 * and behaviour of the object.
61 class LIBARDOUR_API Stripable : public SessionObject,
63 public boost::enable_shared_from_this<Stripable>
66 Stripable (Session& session, std::string const & name, PresentationInfo const &);
67 virtual ~Stripable ();
73 bool is_auditioner() const { return _presentation_info.flags() & PresentationInfo::Auditioner; }
74 bool is_master() const { return _presentation_info.flags() & PresentationInfo::MasterOut; }
75 bool is_monitor() const { return _presentation_info.flags() & PresentationInfo::MonitorOut; }
77 int set_state (XMLNode const&, int);
79 bool is_hidden() const { return _presentation_info.flags() & PresentationInfo::Hidden; }
80 bool is_selected() const;
82 PresentationInfo const & presentation_info () const { return _presentation_info; }
83 PresentationInfo& presentation_info () { return _presentation_info; }
84 PresentationInfo* presentation_info_ptr () { return &_presentation_info; }
86 /* set just the order */
88 void set_presentation_order (PresentationInfo::order_t);
90 struct PresentationOrderSorter {
91 bool operator() (boost::shared_ptr<Stripable> a, boost::shared_ptr<Stripable> b) {
92 return a->presentation_info().order() < b->presentation_info().order();
96 /* gui's call this for their own purposes. */
98 PBD::Signal2<void,std::string,void*> gui_changed;
100 /***************************************************************
101 * Pure interface begins here
102 ***************************************************************/
104 virtual boost::shared_ptr<PeakMeter> peak_meter() = 0;
105 virtual boost::shared_ptr<const PeakMeter> peak_meter() const = 0;
107 virtual boost::shared_ptr<GainControl> gain_control() const = 0;
109 virtual boost::shared_ptr<SoloControl> solo_control() const = 0;
110 virtual boost::shared_ptr<SoloIsolateControl> solo_isolate_control() const = 0;
111 virtual boost::shared_ptr<SoloSafeControl> solo_safe_control() const = 0;
112 virtual boost::shared_ptr<MuteControl> mute_control() const = 0;
114 virtual boost::shared_ptr<PhaseControl> phase_control() const = 0;
115 virtual boost::shared_ptr<GainControl> trim_control() const = 0;
117 virtual boost::shared_ptr<MonitorControl> monitoring_control() const = 0;
119 virtual boost::shared_ptr<AutomationControl> rec_enable_control() const { return boost::shared_ptr<AutomationControl>(); }
120 virtual boost::shared_ptr<AutomationControl> rec_safe_control() const { return boost::shared_ptr<AutomationControl>(); }
122 /* "well-known" controls for panning. Any or all of these may return
125 virtual boost::shared_ptr<AutomationControl> pan_azimuth_control() const = 0;
126 virtual boost::shared_ptr<AutomationControl> pan_elevation_control() const = 0;
127 virtual boost::shared_ptr<AutomationControl> pan_width_control() const = 0;
128 virtual boost::shared_ptr<AutomationControl> pan_frontback_control() const = 0;
129 virtual boost::shared_ptr<AutomationControl> pan_lfe_control() const = 0;
131 /* "well-known" controls for an EQ in this route. Any or all may
132 * be null. eq_band_cnt() must return 0 if there is no EQ present.
133 * Passing an @param band value >= eq_band_cnt() will guarantee the
134 * return of a null ptr (or an empty string for eq_band_name()).
136 virtual uint32_t eq_band_cnt () const = 0;
137 virtual std::string eq_band_name (uint32_t) const = 0;
138 virtual boost::shared_ptr<AutomationControl> eq_gain_controllable (uint32_t band) const = 0;
139 virtual boost::shared_ptr<AutomationControl> eq_freq_controllable (uint32_t band) const = 0;
140 virtual boost::shared_ptr<AutomationControl> eq_q_controllable (uint32_t band) const = 0;
141 virtual boost::shared_ptr<AutomationControl> eq_shape_controllable (uint32_t band) const = 0;
142 virtual boost::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
143 virtual boost::shared_ptr<AutomationControl> eq_hpf_controllable () const = 0;
145 /* "well-known" controls for a compressor in this route. Any or all may
148 virtual boost::shared_ptr<AutomationControl> comp_enable_controllable () const = 0;
149 virtual boost::shared_ptr<AutomationControl> comp_threshold_controllable () const = 0;
150 virtual boost::shared_ptr<AutomationControl> comp_speed_controllable () const = 0;
151 virtual boost::shared_ptr<AutomationControl> comp_mode_controllable () const = 0;
152 virtual boost::shared_ptr<AutomationControl> comp_makeup_controllable () const = 0;
153 virtual boost::shared_ptr<ReadOnlyControl> comp_redux_controllable () const = 0;
155 /* @param mode must be supplied by the comp_mode_controllable(). All other values
156 * result in undefined behaviour
158 virtual std::string comp_mode_name (uint32_t mode) const = 0;
160 /* @param mode - as for comp mode name. This returns the name for the
161 * parameter/control accessed via comp_speed_controllable(), which can
164 virtual std::string comp_speed_name (uint32_t mode) const = 0;
166 /* "well-known" controls for sends to well-known busses in this route. Any or all may
169 * In Mixbus, these are the sends that connect to the mixbusses.
170 * In Ardour, these are user-created sends that connect to user-created
173 virtual boost::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const = 0;
174 virtual boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const = 0;
176 /* for the same value of @param n, this returns the name of the send
177 * associated with the pair of controllables returned by the above two methods.
179 virtual std::string send_name (uint32_t n) const = 0;
181 /* well known control that enables/disables sending to the master bus.
183 * In Ardour, this returns null.
184 * In Mixbus, it will return a suitable control, or null depending on
187 virtual boost::shared_ptr<AutomationControl> master_send_enable_controllable () const = 0;
189 virtual bool muted_by_others_soloing () const = 0;
191 virtual boost::shared_ptr<MonitorProcessor> monitor_control() const = 0;
193 StripableColorDialog* active_color_picker() const { return _active_color_picker; }
194 void set_active_color_picker (StripableColorDialog* d) { _active_color_picker = d; }
197 PresentationInfo _presentation_info;
199 StripableColorDialog* _active_color_picker;
204 #endif /* __libardour_stripable_h__ */