Ardour  9.0-pre0-582-g084a23a80d
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 
32 #include "ardour/processor.h"
33 #include "ardour/route_group.h"
34 #include "ardour/types.h"
35 
36 #include "osc.h"
37 
39 {
40 
41  public:
44 
45  std::shared_ptr<ARDOUR::Stripable> strip () const { return _strip; }
46  lo_address address() const { return addr; };
47  void tick (void);
48  void renew_sends (void);
49  void renew_plugin (void);
50  void eq_restart (int);
51  void clear_observer (void);
52  void refresh_strip (std::shared_ptr<ARDOUR::Stripable> new_strip, uint32_t nsends, uint32_t g_mode, bool force);
53  void set_expand (uint32_t expand);
54  void set_send_page (uint32_t page);
55  void set_send_size (uint32_t size);
56  void set_plugin_id (int id, uint32_t page);
57  void set_plugin_page (uint32_t page);
58  void set_plugin_size (uint32_t size);
59  void set_feedback (std::bitset<32> fb);
60 
61  private:
62  std::shared_ptr<ARDOUR::Stripable> _strip;
64 
66  // pans, sends, plugins and eq need their own
71 
72  lo_address addr;
73  std::string path;
74  uint32_t gainmode;
75  std::bitset<32> feedback;
76  bool in_line;
78  std::vector<int> send_timeout;
79  uint32_t gain_timeout;
80  float _last_meter;
81  uint32_t nsends;
82  float _last_gain;
83  float _last_trim;
84  std::vector<float> _last_send;
85  bool _init;
86  float _comp_redux;
88  uint32_t send_page_size;
89  uint32_t send_size;
90  uint32_t send_page;
91 
92  uint32_t nplug_params;
93  uint32_t plug_page_size;
94  uint32_t plug_page;
95  int plug_id;
96  uint32_t plug_size;
97  std::vector<int> plug_params;
98  int eq_bands;
99  uint32_t _expand;
100  std::bitset<16> _group_sharing;
103 
104  void name_changed (const PBD::PropertyChange& what_changed);
105  void panner_changed ();
106  void group_name ();
110  void change_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
111  void enable_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
112  void comp_mode (void);
113  void change_message_with_id (std::string path, uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
114  void enable_message_with_id (std::string path, uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
115  void monitor_status (std::shared_ptr<PBD::Controllable> controllable);
116  void gain_message ();
118  void send_automation (std::string path, std::shared_ptr<PBD::Controllable> control);
119  void trim_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
120  // sends stuff
121  void send_init (void);
122  void send_end (void);
123  void plugin_init (void);
124  void plugin_end (void);
125  void plugin_parameter_changed (int pid, bool swtch, std::shared_ptr<PBD::Controllable> controllable);
126  void send_gain (uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
127  void send_enable (std::string path, uint32_t id, std::shared_ptr<ARDOUR::Processor> proc);
128  void plug_enable (std::string path, std::shared_ptr<ARDOUR::Processor> proc);
129  void eq_init (void);
130  void eq_end (void);
131  void no_strip ();
132  void slaved_changed (std::shared_ptr<ARDOUR::VCA> vca, bool state);
133 };
134 
135 #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