Ardour  9.0-pre0-582-g084a23a80d
mackie/strip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2007 John Anderson
3  * Copyright (C) 2012-2015 Paul Davis <paul@linuxaudiosystems.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __ardour_mackie_control_protocol_strip_h__
21 #define __ardour_mackie_control_protocol_strip_h__
22 
23 #include <string>
24 #include <iostream>
25 
26 #include "evoral/Parameter.h"
27 
28 #include "pbd/property_basics.h"
29 #include "pbd/ringbuffer.h"
30 #include "pbd/signals.h"
31 
32 #include "ardour/types.h"
33 #include "control_protocol/types.h"
34 
35 #include "control_group.h"
36 #include "types.h"
38 #include "midi_byte_array.h"
39 #include "device_info.h"
40 
41 namespace ARDOUR {
42  class Stripable;
43  class Bundle;
44  class ChannelCount;
45 }
46 
47 namespace ArdourSurface { namespace MACKIE_NAMESPACE {
48 
49 class Control;
50 class Surface;
51 class Button;
52 class Pot;
53 class Fader;
54 class Meter;
55 class SurfacePort;
56 
58  const char* name;
59  int id;
60  Control* (*factory)(Surface&, int index, const char* name, Group&);
61  const char* group_name;
62 };
63 
67 class Strip : public Group
68 {
69 public:
70  Strip (Surface&, const std::string & name, int index, const std::map<Button::ID,StripButtonInfo>&);
71  ~Strip();
72 
73  std::shared_ptr<ARDOUR::Stripable> stripable() const { return _stripable; }
74 
75  void add (Control & control);
76  int index() const { return _index; } // zero based
77  Surface* surface() const { return _surface; }
78 
79  void set_stripable (std::shared_ptr<ARDOUR::Stripable>, bool with_messages = true);
80 
81  // call all signal handlers manually
82  void notify_all ();
83 
85  void handle_fader (Fader&, float position);
86  void handle_fader_touch (Fader&, bool touch_on);
87  void handle_pot (Pot&, float delta);
88 
89  void periodic (PBD::microseconds_t now_usecs);
90  void redisplay (PBD::microseconds_t now_usecs, bool force = true);
91 
92  MidiByteArray display (uint32_t lcd_number, uint32_t line_number, const std::string&);
93  MidiByteArray blank_display (uint32_t lcd_number, uint32_t line_number);
94 
95  static std::string format_parameter_for_display(
96  ARDOUR::ParameterDescriptor const& desc,
97  float val,
98  std::shared_ptr<ARDOUR::Stripable> stripable_for_non_mixbus_azimuth_automation,
99  bool& overwrite_screen_hold);
100 
101  void zero ();
102 
105 
106  void lock_controls ();
108  bool locked() const { return _controls_locked; }
109 
111 
113 
114  void block_screen_display_for (uint32_t msecs);
115  void block_vpot_mode_display_for (uint32_t msecs);
116 
117 private:
120  Value
121  };
122 
132  int _index;
138  uint32_t _lcd2_label_pitch; // number of label characters including the required space between strips
139  std::string pending_display[2];
140  std::string current_display[2];
141  std::string lcd2_pending_display[2];
142  std::string lcd2_current_display[2];
145  std::shared_ptr<ARDOUR::Stripable> _stripable;
147 
149 
154 
158  void notify_gain_changed (bool force_update = true);
160  void notify_panner_azi_changed (bool force_update = true);
161  void notify_panner_width_changed (bool force_update = true);
163  void notify_processor_changed (bool force_update = true);
165  void update_meter ();
166  std::string vpot_mode_string ();
167 
168  std::shared_ptr<ARDOUR::AutomationControl> mb_pan_controllable;
169 
171  void next_pot_mode ();
172 
173  void do_parameter_display (ARDOUR::ParameterDescriptor const&, float val, bool screen_hold = false);
177 
178  std::vector<ARDOUR::AutomationType> possible_pot_parameters;
179  std::vector<ARDOUR::AutomationType> possible_trim_parameters;
182 
184 
185  bool is_midi_track () const;
186 };
187 
188 }
189 }
190 
191 #endif /* __ardour_mackie_control_protocol_strip_h__ */
void select_event(Button &, ButtonState)
void handle_pot(Pot &, float delta)
void set_vpot_parameter(ARDOUR::AutomationType)
std::vector< ARDOUR::AutomationType > possible_trim_parameters
Definition: mackie/strip.h:179
MidiByteArray blank_display(uint32_t lcd_number, uint32_t line_number)
void notify_panner_azi_changed(bool force_update=true)
ARDOUR::AutomationType _pan_mode
Definition: mackie/strip.h:148
void handle_fader(Fader &, float position)
static std::string format_parameter_for_display(ARDOUR::ParameterDescriptor const &desc, float val, std::shared_ptr< ARDOUR::Stripable > stripable_for_non_mixbus_azimuth_automation, bool &overwrite_screen_hold)
void add(Control &control)
void block_vpot_mode_display_for(uint32_t msecs)
Surface * surface() const
Definition: mackie/strip.h:77
void block_screen_display_for(uint32_t msecs)
void notify_gain_changed(bool force_update=true)
void notify_processor_changed(bool force_update=true)
void set_stripable(std::shared_ptr< ARDOUR::Stripable >, bool with_messages=true)
void notify_property_changed(const PBD::PropertyChange &)
void periodic(PBD::microseconds_t now_usecs)
std::shared_ptr< ARDOUR::Stripable > stripable() const
Definition: mackie/strip.h:73
void notify_panner_width_changed(bool force_update=true)
Strip(Surface &, const std::string &name, int index, const std::map< Button::ID, StripButtonInfo > &)
std::shared_ptr< ARDOUR::AutomationControl > mb_pan_controllable
Definition: mackie/strip.h:168
PBD::microseconds_t return_to_vpot_mode_display_at
Definition: mackie/strip.h:144
std::vector< ARDOUR::AutomationType > possible_pot_parameters
Definition: mackie/strip.h:178
PBD::ScopedConnectionList stripable_connections
Definition: mackie/strip.h:146
std::shared_ptr< ARDOUR::Stripable > _stripable
Definition: mackie/strip.h:145
void fader_touch_event(Button &, ButtonState)
void do_parameter_display(ARDOUR::ParameterDescriptor const &, float val, bool screen_hold=false)
void handle_button(Button &, ButtonState bs)
MidiByteArray display(uint32_t lcd_number, uint32_t line_number, const std::string &)
void vselect_event(Button &, ButtonState)
PBD::microseconds_t _block_screen_redisplay_until
Definition: mackie/strip.h:143
void redisplay(PBD::microseconds_t now_usecs, bool force=true)
void handle_fader_touch(Fader &, bool touch_on)
GtkImageIconNameData name
Definition: gtkimage.h:6
int64_t microseconds_t
Definition: microseconds.h:28
#define MACKIE_NAMESPACE
Definition: lobject.h:100