Ardour  8.7-14-g57a6773833
osc_select_observer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2018 Len Ovens <len@ovenwerks.net>
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 __osc_oscselectobserver_h__
20 #define __osc_oscselectobserver_h__
21 
22 #include <bitset>
23 #include <memory>
24 #include <string>
25 
26 #include <sigc++/sigc++.h>
27 #include <lo/lo.h>
28 
29 #include "pbd/controllable.h"
30 #include "pbd/stateful.h"
31 #include "ardour/types.h"
32 #include "ardour/processor.h"
33 
34 #include "osc.h"
35 
37 {
38 
39  public:
42 
43  std::shared_ptr<ARDOUR::Stripable> strip () const { return _strip; }
44  lo_address address() const { return addr; };
45  void tick (void);
46  void renew_sends (void);
47  void renew_plugin (void);
48  void eq_restart (int);
49  void clear_observer (void);
50  void refresh_strip (std::shared_ptr<ARDOUR::Stripable> new_strip, uint32_t nsends, uint32_t g_mode, bool force);
51  void set_expand (uint32_t expand);
52  void set_send_page (uint32_t page);
53  void set_send_size (uint32_t size);
54  void set_plugin_id (int id, uint32_t page);
55  void set_plugin_page (uint32_t page);
56  void set_plugin_size (uint32_t size);
57  void set_feedback (std::bitset<32> fb);
58 
59  private:
60  std::shared_ptr<ARDOUR::Stripable> _strip;
62 
64  // pans, sends, plugins and eq need their own
69 
70  lo_address addr;
71  std::string path;
72  uint32_t gainmode;
73  std::bitset<32> feedback;
74  bool in_line;
76  std::vector<int> send_timeout;
77  uint32_t gain_timeout;
78  float _last_meter;
79  uint32_t nsends;
80  float _last_gain;
81  float _last_trim;
82  std::vector<float> _last_send;
83  bool _init;
84  float _comp_redux;
86  uint32_t send_page_size;
87  uint32_t send_size;
88  uint32_t send_page;
89 
90  uint32_t nplug_params;
91  uint32_t plug_page_size;
92  uint32_t plug_page;
93  int plug_id;
94  uint32_t plug_size;
95  std::vector<int> plug_params;
96  int eq_bands;
97  uint32_t _expand;
98  std::bitset<16> _group_sharing;
99  bool _tick_busy;
101 
102  void name_changed (const PBD::PropertyChange& what_changed);
103  void panner_changed ();
104  void group_name ();
108  void change_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
109  void enable_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
110  void comp_mode (void);
111  void change_message_with_id (std::string path, uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
112  void enable_message_with_id (std::string path, uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
113  void monitor_status (std::shared_ptr<PBD::Controllable> controllable);
114  void gain_message ();
116  void send_automation (std::string path, std::shared_ptr<PBD::Controllable> control);
117  void trim_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
118  // sends stuff
119  void send_init (void);
120  void send_end (void);
121  void plugin_init (void);
122  void plugin_end (void);
123  void plugin_parameter_changed (int pid, bool swtch, std::shared_ptr<PBD::Controllable> controllable);
124  void send_gain (uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
125  void send_enable (std::string path, uint32_t id, std::shared_ptr<ARDOUR::Processor> proc);
126  void plug_enable (std::string path, std::shared_ptr<ARDOUR::Processor> proc);
127  void eq_init (void);
128  void eq_end (void);
129  void no_strip ();
130  void slaved_changed (std::shared_ptr<ARDOUR::VCA> vca, bool state);
131 };
132 
133 #endif /* __osc_oscselectobserver_h__ */
std::bitset< 16 > _group_sharing
void name_changed(const PBD::PropertyChange &what_changed)
void refresh_strip(std::shared_ptr< ARDOUR::Stripable > new_strip, uint32_t nsends, uint32_t g_mode, bool force)
void plugin_parameter_changed(int pid, bool swtch, std::shared_ptr< PBD::Controllable > controllable)
void send_end(void)
void plug_enable(std::string path, std::shared_ptr< ARDOUR::Processor > proc)
void comp_mode(void)
std::vector< int > send_timeout
void set_send_page(uint32_t page)
ARDOUR::Session * session
void eq_restart(int)
void eq_end(void)
void enable_message_with_id(std::string path, uint32_t id, std::shared_ptr< PBD::Controllable > controllable)
void eq_init(void)
void set_plugin_page(uint32_t page)
lo_address address() const
void send_gain(uint32_t id, std::shared_ptr< PBD::Controllable > controllable)
PBD::ScopedConnectionList eq_connections
std::vector< int > plug_params
PBD::ScopedConnectionList send_connections
void change_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
ArdourSurface::OSC::OSCSurface * sur
void monitor_status(std::shared_ptr< PBD::Controllable > controllable)
void slaved_changed(std::shared_ptr< ARDOUR::VCA > vca, bool state)
void plugin_init(void)
void set_feedback(std::bitset< 32 > fb)
void plugin_end(void)
std::bitset< 32 > feedback
void set_plugin_id(int id, uint32_t page)
std::shared_ptr< ARDOUR::Stripable > strip() const
void change_message_with_id(std::string path, uint32_t id, std::shared_ptr< PBD::Controllable > controllable)
void renew_sends(void)
void set_expand(uint32_t expand)
void send_automation(std::string path, std::shared_ptr< PBD::Controllable > control)
std::vector< float > _last_send
void send_enable(std::string path, uint32_t id, std::shared_ptr< ARDOUR::Processor > proc)
PBD::ScopedConnectionList strip_connections
void group_sharing(ARDOUR::RouteGroup *rg_c)
ArdourSurface::OSC & _osc
ARDOUR::AutoState as
void set_send_size(uint32_t size)
std::shared_ptr< ARDOUR::Stripable > _strip
PBD::ScopedConnectionList plugin_connections
void enable_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
void send_init(void)
void pi_changed(PBD::PropertyChange const &)
void renew_plugin(void)
void set_plugin_size(uint32_t size)
OSCSelectObserver(ArdourSurface::OSC &o, ARDOUR::Session &s, ArdourSurface::OSC::OSCSurface *sur)
void trim_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
void clear_observer(void)
PBD::ScopedConnectionList pan_connections