Ardour  8.7-14-g57a6773833
us2400/strip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Ben Loftis <ben@harrisonconsoles.com>
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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_us2400_control_protocol_strip_h__
20 #define __ardour_us2400_control_protocol_strip_h__
21 
22 #include <string>
23 #include <iostream>
24 
25 #include "evoral/Parameter.h"
26 
27 #include "pbd/property_basics.h"
28 #include "pbd/ringbuffer.h"
29 #include "pbd/signals.h"
30 
31 #include "ardour/types.h"
32 #include "control_protocol/types.h"
33 
34 #include "control_group.h"
35 #include "types.h"
37 #include "midi_byte_array.h"
38 #include "device_info.h"
39 
40 namespace ARDOUR {
41  class Stripable;
42  class Bundle;
43  class ChannelCount;
44 }
45 
46 namespace ArdourSurface {
47 
48 namespace US2400 {
49 
50 class Control;
51 class Surface;
52 class Button;
53 class Pot;
54 class Fader;
55 class Meter;
56 class SurfacePort;
57 
59  const char* name;
60  int id;
61  Control* (*factory)(Surface&, int index, const char* name, Group&);
62  const char* group_name;
63 };
64 
68 class Strip : public Group
69 {
70 public:
71  Strip (Surface&, const std::string & name, int index, const std::map<Button::ID,StripButtonInfo>&);
72  ~Strip();
73 
74  std::shared_ptr<ARDOUR::Stripable> stripable() const { return _stripable; }
75 
76  void add (Control & control);
77  int index() const { return _index; } // zero based
78  Surface* surface() const { return _surface; }
79 
80  void set_stripable (std::shared_ptr<ARDOUR::Stripable>, bool with_messages = true);
81  void reset_stripable ();
82 
83  // call all signal handlers manually
84  void notify_all ();
85 
87  void handle_fader (Fader&, float position);
88  void handle_fader_touch (Fader&, bool touch_on);
89  void handle_pot (Pot&, float delta);
90 
91  void periodic (PBD::microseconds_t now_usecs);
92  void redisplay (PBD::microseconds_t now_usecs, bool force = true);
93 
94  void zero ();
95 
97 
98  void lock_controls ();
99  void unlock_controls ();
100  bool locked() const { return _controls_locked; }
101 
103 
105 
106  void set_global_index( int g ) { _global_index = g; }
107  int global_index() { return _global_index; }
108 
109 private:
112  Value
113  };
114 
122  int _index;
128  std::shared_ptr<ARDOUR::Stripable> _stripable;
132 
134 
136 
140  void notify_gain_changed (bool force_update = true);
142  void notify_panner_azi_changed (bool force_update = true);
143  void notify_panner_width_changed (bool force_update = true);
145  void notify_processor_changed (bool force_update = true);
147  void update_meter ();
148  std::string vpot_mode_string ();
149 
150  void next_pot_mode ();
151 
155 
156  std::vector<ARDOUR::AutomationType> possible_pot_parameters;
157  std::vector<ARDOUR::AutomationType> possible_trim_parameters;
160 
161  void mark_dirty ();
162 
163  bool is_midi_track () const;
164 
166 
167  void setup_eq_vpot (std::shared_ptr<ARDOUR::Stripable>);//
168  void setup_dyn_vpot (std::shared_ptr<ARDOUR::Stripable>);//
169  void setup_sends_vpot (std::shared_ptr<ARDOUR::Stripable>);//
170 
171  void setup_trackview_vpot (std::shared_ptr<ARDOUR::Stripable>);
172 };
173 
174 }
175 }
176 
177 #endif /* __ardour_us2400_control_protocol_strip_h__ */
PBD::ScopedConnectionList stripable_connections
Definition: us2400/strip.h:129
void handle_button(Button &, ButtonState bs)
Surface * surface() const
Definition: us2400/strip.h:78
void set_stripable(std::shared_ptr< ARDOUR::Stripable >, bool with_messages=true)
void notify_panner_azi_changed(bool force_update=true)
PBD::ScopedConnectionList subview_connections
Definition: us2400/strip.h:130
std::shared_ptr< ARDOUR::Stripable > stripable() const
Definition: us2400/strip.h:74
void add(Control &control)
void notify_panner_width_changed(bool force_update=true)
std::vector< ARDOUR::AutomationType > possible_trim_parameters
Definition: us2400/strip.h:157
void setup_sends_vpot(std::shared_ptr< ARDOUR::Stripable >)
void periodic(PBD::microseconds_t now_usecs)
std::vector< ARDOUR::AutomationType > possible_pot_parameters
Definition: us2400/strip.h:156
void vselect_event(Button &, ButtonState)
void set_vpot_parameter(ARDOUR::AutomationType)
ARDOUR::AutomationType _pan_mode
Definition: us2400/strip.h:135
std::shared_ptr< ARDOUR::Stripable > _stripable
Definition: us2400/strip.h:128
PBD::ScopedConnectionList send_connections
Definition: us2400/strip.h:131
void notify_property_changed(const PBD::PropertyChange &)
void fader_touch_event(Button &, ButtonState)
void handle_fader_touch(Fader &, bool touch_on)
Strip(Surface &, const std::string &name, int index, const std::map< Button::ID, StripButtonInfo > &)
void redisplay(PBD::microseconds_t now_usecs, bool force=true)
void setup_dyn_vpot(std::shared_ptr< ARDOUR::Stripable >)
void setup_trackview_vpot(std::shared_ptr< ARDOUR::Stripable >)
void notify_gain_changed(bool force_update=true)
void select_event(Button &, ButtonState)
void handle_pot(Pot &, float delta)
void notify_processor_changed(bool force_update=true)
void setup_eq_vpot(std::shared_ptr< ARDOUR::Stripable >)
void handle_fader(Fader &, float position)
DebugBits US2400
int64_t microseconds_t
Definition: microseconds.h:29
Definition: lobject.h:100