Ardour  9.0-pre0-2168-g0459902b9a
osc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2009 David Robillard <d@drobilla.net>
5  * Copyright (C) 2013-2016 Robin Gareus <robin@gareus.org>
6  * Copyright (C) 2015 Johannes Mueller <github@johannes-mueller.org>
7  * Copyright (C) 2016-2018 Len Ovens <len@ovenwerks.net>
8  * Copyright (C) 2016 Ben Loftis <ben@harrisonconsoles.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 #ifndef ardour_osc_h
26 #define ardour_osc_h
27 
28 #include <bitset>
29 #include <memory>
30 #include <string>
31 #include <vector>
32 
33 #include <sys/time.h>
34 #include <pthread.h>
35 
36 
37 #include <lo/lo.h>
38 
39 #include <glibmm/main.h>
40 
41 #define ABSTRACT_UI_EXPORTS
42 #include "pbd/abstract_ui.h"
43 
44 #include "ardour/types.h"
45 #include "ardour/send.h"
46 #include "ardour/plugin.h"
48 
49 #include "pbd/i18n.h"
50 
51 
52 class OSCControllable;
53 class OSCRouteObserver;
54 class OSCGlobalObserver;
55 class OSCSelectObserver;
56 class OSCCueObserver;
57 
58 namespace ARDOUR {
59 class Session;
60 class Route;
61 class ZeroConf;
62 }
63 
64 /* this is mostly a placeholder because I suspect that at some
65  point we will want to add more members to accommodate
66  certain types of requests to the OSC UI
67 */
68 
69 namespace ArdourSurface {
70 
71 struct OSCUIRequest : public BaseUI::BaseRequestObject {
72  public:
75 };
76 
77 class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
78 {
79  public:
80  OSC (ARDOUR::Session&, uint32_t port);
81  virtual ~OSC();
82 
83  XMLNode& get_state () const;
84  int set_state (const XMLNode&, int version);
85 
87 
88  bool has_editor () const { return true; }
89  void* get_gui () const;
90  void tear_down_gui ();
91 
92  int set_active (bool yn);
93  bool get_active () const;
94 
95  // generic osc send
96  Glib::Threads::Mutex _lo_lock;
97  int float_message (std::string, float value, lo_address addr);
98  int int_message (std::string, int value, lo_address addr);
99  int text_message (std::string path, std::string val, lo_address addr);
100  int float_message_with_id (std::string, uint32_t ssid, float value, bool in_line, lo_address addr);
101  int int_message_with_id (std::string, uint32_t ssid, int value, bool in_line, lo_address addr);
102  int text_message_with_id (std::string path, uint32_t ssid, std::string val, bool in_line, lo_address addr);
103 
104  int send_group_list (lo_address addr);
105 
106  int start ();
107  int stop ();
108 
112  All
113  };
114 
115  enum OSCTempMode {
116  TempOff = 0,
118  VCAOnly = 2,
119  BusOnly = 3
120  };
121 
122  typedef std::vector<std::shared_ptr<ARDOUR::Stripable> > Sorted;
123  Sorted get_sorted_stripables(std::bitset<32> types, bool cue, uint32_t custom, Sorted my_list);
124  typedef std::map<std::shared_ptr<ARDOUR::AutomationControl>, uint32_t> FakeTouchMap;
126 
127 // keep a surface's global setup by remote server url
128  struct OSCSurface {
129  public:
130  //global
131  std::string remote_url; // the url these setting belong to
132  bool no_clear; // don't send osc clear messages on strip change
133  uint32_t jogmode; // current jogmode
134  OSCGlobalObserver* global_obs; // pointer to this surface's global observer
135  uint32_t nstrips; // how many strips are there for strip_types
136  std::bitset<32> feedback; // What is fed back? strips/meters/timecode/bar_beat/global
137  int gainmode; // what kind of faders do we have Gain db or position 0 to 1?
139  Sorted custom_strips; // a sorted list of user selected strips
140  uint32_t custom_mode; // use custom strip list
141  OSCTempMode temp_mode; // use temp strip list
142  Sorted temp_strips; // temp strip list for grouponly, vcaonly, auxonly
143  std::shared_ptr<ARDOUR::Stripable> temp_master; // stripable this surface uses as temp master
144  Sorted strips; // list of stripables for this surface
145  // strips
146  uint32_t bank; // current bank
147  uint32_t bank_size; // size of banks for this surface
148  std::vector<OSCRouteObserver*> observers; // route observers for this surface
149  std::bitset<32> strip_types;// what strip types are a part of this bank
150  //select
151  OSCSelectObserver* sel_obs; // So we can sync select feedback with selected channel
152  uint32_t expand; // Used by /select/select
153  bool expand_enable; // use expand instead of select
154  std::shared_ptr<ARDOUR::Stripable> expand_strip; // stripable this surface uses for expand
155  std::shared_ptr<ARDOUR::Stripable> select; // stripable this surface uses as selected
156  int plug_page; // current plugin page
157  uint32_t plug_page_size; // plugin page size (number of controls)
158  int plugin_id; // id of current plugin
159  std::vector<int> plug_params; // vector to store ports that are controls
160  std::vector<int> plugins; // stores allowable plugins with index (work around MB strip PIs)
161  int send_page; // current send page
162  uint32_t send_page_size; // send page size in channels
163  uint32_t nsends; // number of sends select has
164  PBD::ScopedConnection proc_connection; // for processor signal monitoring
165  // cue
166  bool cue; // is this a cue surface
167  uint32_t aux; // aux index for this cue surface
168  Sorted sends; // list of sends for cue aux
169  OSCCueObserver* cue_obs; // pointer to this surface's cue observer
170  uint32_t linkset; // ID of a set of surfaces used as one
171  uint32_t linkid; // ID of this surface within a linkset
172  };
173  /*
174  * feedback bits:
175  * [0] - Strips - buttons
176  * [1] - Strips - variables (pots/faders)
177  * [2] - Strips - Send SSID as path extension
178  * [3] - Send heart beat to surface
179  * [4] - Send feedback for master/global buttons/variables
180  * [5] - Send Bar and Beat
181  * [6] - Send Time code
182  * [7] - Send metering as dB or positional depending on gainmode
183  * [8] - Send metering as 16 bits (led strip)
184  * [9] - Send signal present (signal greater than -20dB)
185  * [10] - Send Playhead position as samples
186  * [11] - Send Playhead position as minutes seconds
187  * [12] - Send Playhead position like primary/secondary GUI clocks
188  * [13] - Send well known feedback (for /select/command
189  * [14] - use OSC 1.0 only (#reply -> /reply)
190  * [15] - report 8x8 trigger grid status
191  * [16] - report mixer scene status
192  *
193  * Strip_type bits:
194  * [0] - Audio Tracks
195  * [1] - Midi Tracks
196  * [2] - Audio Bus
197  * [3] - Midi Bus
198  * [4] - VCAs
199  * [5] - master
200  * [6] - Monitor
201  * [7] - Listen Bus
202  * [8] - Selected
203  * [9] - Hidden
204  * [10] - Use Groups
205  * [11] - Global Expand
206  */
207 
208 // storage for each surface's settings
209  mutable Glib::Threads::Mutex surfaces_lock;
210  typedef std::vector<OSCSurface> Surface;
212 
213 // linked surfaces
214  struct LinkSet {
215  public:
216  std::vector<std::string> urls; //urls of linked surfaces
217  uint32_t banksize; // linkset banksize
218  uint32_t bank; // linkset current bank
219  bool autobank; // banksize is derived from total
220  uint32_t not_ready; // number of 1st device, 0 = ready
221  Sorted custom_strips; // a sorted list of user selected strips
222  uint32_t custom_mode; // use custom strip list
223  OSCTempMode temp_mode; // use custom strip list
224  Sorted temp_strips; // temp strip list for grouponly, vcaonly, auxonly
225  std::shared_ptr<ARDOUR::Stripable> temp_master; // temp master stripable
226  std::bitset<32> strip_types; // strip_types for this linkset
227  Sorted strips; // list of valid strips in order for this set
228  };
229 
230  std::map<uint32_t, LinkSet> link_sets;
231  // list of linksets
232 
233  struct PortAdd {
234  public:
235  std::string host;
236  std::string port;
237  };
238 
239  std::vector<PortAdd> _ports;
240 
241 // GUI calls
242  std::string get_server_url ();
245  int get_portmode() { return address_only; }
246  void set_portmode (int pm) { address_only = pm; }
247  int get_banksize () { return default_banksize; }
248  void set_banksize (int bs) {default_banksize = bs; }
249  int get_gainmode() { return default_gainmode; }
250  void set_gainmode (int gm) { default_gainmode = gm; }
251  int get_defaultstrip() { return default_strip; }
252  void set_defaultstrip (int st) { default_strip = st; }
254  void set_defaultfeedback (int fb) { default_feedback = fb; }
256  void set_send_size (int ss) { default_send_size = ss; }
258  void set_plugin_size (int ps) { default_plugin_size = ps; }
259  void clear_devices ();
260  void gui_changed ();
261  void get_surfaces ();
262  std::string get_remote_port () { return remote_port; }
263  void set_remote_port (std::string pt) { remote_port = pt; }
264 
266 
267  int trigger_bank_state (lo_address addr);
268  int trigger_grid_state (lo_address addr, bool zero_it = false);
269 
270  int mixer_scene_state (lo_address addr, bool zero_it = false);
271 
272  protected:
273  void thread_init ();
275 
276  GSource* local_server;
277  GSource* remote_server;
278 
279  bool osc_input_handler (Glib::IOCondition, lo_server);
280 
281  private:
282  uint32_t _port;
283  volatile bool _ok;
284  volatile bool _shutdown;
285  lo_server _osc_server;
286  lo_server _osc_unix_server;
288  std::string _osc_url_file;
291  std::string remote_port;
293  uint32_t default_strip;
298  bool tick;
301  float scrub_speed; // Current scrub speed
302  double scrub_place; // place of play head at latest jog/scrub wheel tick
303  int64_t scrub_time; // when did the wheel move last?
305  std::shared_ptr<ARDOUR::Stripable> _select; // which stripable out of /surface/stripables is gui selected
306 
308 
310 
312 
313  // Handlers for "Application Hook" signals
315  void session_exported (std::string, std::string);
316 
317  // end "Application Hook" handles
318 
319  std::string get_unix_server_url ();
320  lo_address get_address (lo_message msg);
321  std::string get_port (std::string host);
322  OSCSurface * get_surface (lo_address addr, bool quiet = false);
323  int check_surface (lo_message msg);
324  uint32_t get_sid (std::shared_ptr<ARDOUR::Stripable> strip, lo_address addr);
325  std::shared_ptr<ARDOUR::Stripable> get_strip (uint32_t ssid, lo_address addr);
327  void strip_feedback (OSCSurface* sur, bool new_bank_size);
329  uint32_t bank_limits_check (uint32_t bank, uint32_t size, uint32_t total);
330  void bank_leds (OSCSurface* sur);
331 
332  void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg);
333  void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg);
334 
335  int current_value (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data);
336 
337  int catchall (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg);
338  static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data);
339 
340  int set_automation (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
341  int touch_detect (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
342  int fake_touch (std::shared_ptr<ARDOUR::AutomationControl> ctrl);
343 
344  int spill (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
345 
346  int route_get_sends (lo_message msg);
347  int route_get_receives(lo_message msg);
348  void routes_list (lo_message msg);
349  int group_list (lo_message msg);
350  void surface_list (lo_message msg);
351  void transport_sample (lo_message msg);
352  void transport_speed (lo_message msg);
353  void record_enabled (lo_message msg);
354 
355  void add_marker_name(const std::string &markername) {
356  add_marker(markername);
357  }
358 
359  // cue
360  Sorted cue_get_sorted_stripables(std::shared_ptr<ARDOUR::Stripable> aux, uint32_t id, lo_address);
361  int cue_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
362  int cue_set (uint32_t aux, lo_message msg);
363  int _cue_set (uint32_t aux, lo_address addr);
364  int cue_new_aux (std::string name, std::string dest_1, std::string dest_2, uint32_t count, lo_message msg);
365  int cue_new_send (std::string rt_name, lo_message msg);
366  int cue_connect_aux (std::string dest, lo_message msg);
367  int cue_next (lo_message msg);
368  int cue_previous (lo_message msg);
369  int cue_send_fader (uint32_t id, float position, lo_message msg);
370  int cue_send_enable (uint32_t id, float state, lo_message msg);
371  int cue_aux_fader (float position, lo_message msg);
372  int cue_aux_mute (float state, lo_message msg);
373  void cue_set_aux (uint32_t aux, lo_message msg);
374  std::shared_ptr<ARDOUR::Send> cue_get_send (uint32_t id, lo_address addr);
375  // end cue
376 
377  // link
378  LinkSet * get_linkset (uint32_t set, lo_address addr);
379  int parse_link (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
380  int link_check (uint32_t linkset);
381  int set_link (uint32_t set, uint32_t id, lo_address addr);
383  void link_strip_types (uint32_t linkset, uint32_t striptypes);
384 
385 #define OSC_DEBUG \
386  if (_debugmode == All) { \
387  debugmsg (dgettext(PACKAGE, "OSC"), path, types, argv, argc); \
388  }
389 
390 #define PATH_CALLBACK_MSG(name) \
391  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
392  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
393  } \
394  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
395  OSC_DEBUG; \
396  if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
397  name (msg); \
398  return 0; \
399  }
400 
415 
416 #define PATH_CALLBACK(name) \
417  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
418  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
419  } \
420  int cb_ ## name (const char *path, const char *types, lo_arg ** argv, int argc, lo_message msg) { \
421  OSC_DEBUG; \
422  check_surface (msg); \
423  if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
424  name (); \
425  return 0; \
426  }
427 
482 
483 #define PATH_CALLBACK1(name,type,optional) \
484  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
485  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
486  } \
487  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
488  OSC_DEBUG; \
489  check_surface (msg); \
490  if (argc > 0) { \
491  name (optional argv[0]->type); \
492  } \
493  return 0; \
494  }
495 
497  PATH_CALLBACK1(trigger_stop_all,i,); //0 = "stop at end of bar" 1 = "stop now"
498 
501 
505 
509 
510 #define PATH_CALLBACK1_MSG(name,arg1type) \
511  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
512  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
513  } \
514  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
515  OSC_DEBUG; \
516  if (argc > 0) { \
517  name (argv[0]->arg1type, msg); \
518  } \
519  return 0; \
520  }
521 
522 #define PATH_CALLBACK1_MSG_s(name,arg1type) \
523  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
524  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
525  } \
526  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
527  OSC_DEBUG; \
528  if (argc > 0) { \
529  name (&argv[0]->arg1type, msg); \
530  } \
531  return 0; \
532  }
533 
536 
565 
566 #define PATH_CALLBACK2(name,arg1type,arg2type) \
567  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
568  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
569  } \
570  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
571  OSC_DEBUG; \
572  check_surface (msg); \
573  if (argc > 1) { \
574  name (argv[0]->arg1type, argv[1]->arg2type); \
575  } \
576  return 0; \
577  }
578 
579 #define PATH_CALLBACK2_MSG(name,arg1type,arg2type) \
580  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
581  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
582  } \
583  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
584  OSC_DEBUG; \
585  if (argc > 1) { \
586  name (argv[0]->arg1type, argv[1]->arg2type, msg); \
587  } \
588  return 0; \
589  }
590 
591 #define PATH_CALLBACK2_MSG_s(name,arg1type,arg2type) \
592  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
593  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
594  } \
595  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
596  OSC_DEBUG; \
597  if (argc > 1) { \
598  name (argv[0]->arg1type, &argv[1]->arg2type, msg); \
599  } \
600  return 0; \
601  }
602 
603 #define PATH_CALLBACK3(name,arg1type,arg2type,arg3type) \
604  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
605  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
606  } \
607  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
608  OSC_DEBUG; \
609  if (argc > 1) { \
610  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type, msg); \
611  } \
612  return 0; \
613  }
614 
615 #define PATH_CALLBACK4(name,arg1type,arg2type,arg3type,arg4type) \
616  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
617  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
618  } \
619  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
620  OSC_DEBUG; \
621  if (argc > 1) { \
622  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type,argv[3]->arg4type, msg); \
623  } \
624  return 0; \
625  }
626 
634 
647 
649 
652  PATH_CALLBACK2_MSG(trigger_stop,i,i); /* second arg is 'stop now' */
653 
654  int strip_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
655  int master_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
656  int monitor_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
657  int _strip_parse (const char *path, const char *sub_path, const char* types, lo_arg **argv, int argc, std::shared_ptr<ARDOUR::Stripable> s, int param_1, bool strp, lo_message msg);
658  int strip_state (const char *path, std::shared_ptr<ARDOUR::Stripable> s, int ssid, lo_message msg);
659  int strip_list (lo_message msg);
660  int _strip_select (std::shared_ptr<ARDOUR::Stripable> s, lo_address addr);
661  int _strip_select2 (std::shared_ptr<ARDOUR::Stripable> s, OSCSurface *sur, lo_address addr);
662 
663  void loop_location (int start, int end);
664 
665  int route_set_send_gain_dB (int rid, int sid, float val, lo_message msg);
666  int route_set_send_fader (int rid, int sid, float val, lo_message msg);
667  int route_set_send_enable (int rid, int sid, float val, lo_message msg);
668  int route_plugin_parameter (int rid, int piid,int par, float val, lo_message msg);
669  int route_plugin_parameter_print (int rid, int piid,int par, lo_message msg);
670  int route_plugin_activate (int rid, int piid, lo_message msg);
671  int route_plugin_deactivate (int rid, int piid, lo_message msg);
672  int route_plugin_list(int ssid, lo_message msg);
673  int route_plugin_descriptor(int ssid, int piid, lo_message msg);
674  int route_plugin_reset(int ssid, int piid, lo_message msg);
675 
676  int trigger_bang(int rid, int stop_now, lo_message msg);
677  int trigger_unbang(int rid, int stop_now, lo_message msg);
678  int trigger_stop(int rid, int row_id, lo_message msg);
679 
680  //banking functions
681  int set_bank (uint32_t bank_start, lo_message msg);
682  int _set_bank (uint32_t bank_start, lo_address addr);
683  int bank_up (lo_message msg);
684  int bank_delta (float delta, lo_message msg);
685  int use_group (float value, lo_message msg);
686  int bank_down (lo_message msg);
687  // surface set up
688  int surface_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
689  int set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gmode, uint32_t se_size, uint32_t pi_size, lo_message msg);
690  int set_surface_bank_size (uint32_t bs, lo_message msg);
691  int set_surface_strip_types (uint32_t st, lo_message msg);
692  int set_surface_feedback (uint32_t fb, lo_message msg);
693  int set_surface_gainmode (uint32_t gm, lo_message msg);
694  int set_surface_port (uint32_t po, lo_message msg);
695  int refresh_surface (lo_message msg);
696  int custom_clear (lo_message msg);
697  int custom_mode (float state, lo_message msg);
698  int _custom_mode (uint32_t state, lo_address addr);
699  int name_session (char *n, lo_message msg);
700  // select
701  int select_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
702  int sel_send_pagesize (uint32_t size, lo_message msg);
703  int sel_send_page (int page, lo_message msg);
704  int sel_plug_pagesize (uint32_t size, lo_message msg);
705  int sel_plug_page (int page, lo_message msg);
706  int sel_plugin (int delta, lo_message msg);
707  int _sel_plugin (int id, lo_address addr);
708  int sel_plugin_activate (float state, lo_message msg);
709  int select_plugin_parameter (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
710  void processor_changed (std::string remote_url);
711 
712  int scrub (float delta, lo_message msg);
713  int jog (float delta, lo_message msg);
714  int jog_mode (float mode, lo_message msg);
715  int set_marker (const char* types, lo_arg **argv, int argc, lo_message msg);
716  int click_level (float position);
717  int sel_previous (lo_message msg);
718  int sel_next (lo_message msg);
719  int sel_delta (int delta, lo_message msg);
720  std::shared_ptr<ARDOUR::Send> get_send (std::shared_ptr<ARDOUR::Stripable> st, lo_address addr);
721  int sel_sendgain (int id, float dB, lo_message msg);
722  int sel_sendfader (int id, float pos, lo_message msg);
723  int sel_sendenable (int id, float pos, lo_message msg);
724  int sel_master_send_enable (int state, lo_message msg);
725  int sel_expand (uint32_t state, lo_message msg);
726  int sel_pan_elevation (float val, lo_message msg);
727  int sel_pan_frontback (float val, lo_message msg);
728  int sel_pan_lfe (float val, lo_message msg);
729  int sel_comp_enable (float val, lo_message msg);
730  int sel_comp_threshold (float val, lo_message msg);
731  int sel_comp_mode (float val, lo_message msg);
732  int sel_comp_makeup (float val, lo_message msg);
733  int sel_eq_enable (float val, lo_message msg);
734  int sel_eq_hpf_freq (float val, lo_message msg);
735  int sel_eq_hpf_enable (float val, lo_message msg);
736  int sel_eq_hpf_slope (float val, lo_message msg);
737  int sel_eq_lpf_freq (float val, lo_message msg);
738  int sel_eq_lpf_enable (float val, lo_message msg);
739  int sel_eq_lpf_slope (float val, lo_message msg);
740  int sel_eq_gain (int id, float val, lo_message msg);
741  int sel_eq_freq (int id, float val, lo_message msg);
742  int sel_eq_q (int id, float val, lo_message msg);
743  int sel_eq_shape (int id, float val, lo_message msg);
744  int sel_new_personal_send (char *n, lo_message msg);
745  int set_temp_mode (lo_address addr);
746  int parse_sel_group (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
747  std::shared_ptr<ARDOUR::VCA> get_vca_by_name (std::string vname);
748 
749  void listen_to_route (std::shared_ptr<ARDOUR::Stripable>, lo_address);
750 
751  void route_name_changed (const PBD::PropertyChange&, std::weak_ptr<ARDOUR::Route> r, lo_address addr);
752  void recalcbanks ();
753  void _recalcbanks ();
756 
757  int osc_tbank_step_routes (int step, lo_message msg);
758  int osc_tbank_step_rows (int step, lo_message msg);
759 
761  int osc_toggle_roll (bool ret2strt);
762  bool periodic (void);
763  sigc::connection periodic_connection;
765 
766  void debugmsg (const char *prefix, const char *path, const char* types, lo_arg **argv, int argc);
767 
768  mutable void *gui;
769  void build_gui ();
770 };
771 
772 } // namespace
773 
774 #endif // ardour_osc_h
virtual std::string name() const
bool periodic(void)
int custom_mode(float state, lo_message msg)
int route_plugin_descriptor(int ssid, int piid, lo_message msg)
int spill(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
uint32_t bank_limits_check(uint32_t bank, uint32_t size, uint32_t total)
void transport_sample(lo_message msg)
int sel_sendenable(int id, float pos, lo_message msg)
int jog_mode(float mode, lo_message msg)
int current_value(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
int monitor_parse(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
bool address_only
Definition: osc.h:290
double scrub_place
Definition: osc.h:302
int name_session(char *n, lo_message msg)
void notify_routes_added(ARDOUR::RouteList &)
void notify_vca_added(ARDOUR::VCAList &)
int mixer_scene_state(lo_address addr, bool zero_it=false)
int sel_previous(lo_message msg)
int cue_new_send(std::string rt_name, lo_message msg)
void set_send_size(int ss)
Definition: osc.h:256
int sel_comp_makeup(float val, lo_message msg)
void processor_changed(std::string remote_url)
std::string _osc_unix_socket_path
Definition: osc.h:287
int use_group(float value, lo_message msg)
GSource * remote_server
Definition: osc.h:277
int set_automation(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
std::shared_ptr< ARDOUR::Stripable > get_strip(uint32_t ssid, lo_address addr)
void surface_link_state(LinkSet *set)
OSCDebugMode get_debug_mode()
Definition: osc.h:244
bool bank_dirty
Definition: osc.h:299
int click_level(float position)
int set_surface(uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gmode, uint32_t se_size, uint32_t pi_size, lo_message msg)
FakeTouchMap _touch_timeout
Definition: osc.h:125
int cue_new_aux(std::string name, std::string dest_1, std::string dest_2, uint32_t count, lo_message msg)
int _custom_mode(uint32_t state, lo_address addr)
int route_plugin_deactivate(int rid, int piid, lo_message msg)
int sel_next(lo_message msg)
int int_message_with_id(std::string, uint32_t ssid, int value, bool in_line, lo_address addr)
int _strip_parse(const char *path, const char *sub_path, const char *types, lo_arg **argv, int argc, std::shared_ptr< ARDOUR::Stripable > s, int param_1, bool strp, lo_message msg)
void do_request(OSCUIRequest *)
int send_group_list(lo_address addr)
Sorted get_sorted_stripables(std::bitset< 32 > types, bool cue, uint32_t custom, Sorted my_list)
int cue_parse(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
std::vector< std::shared_ptr< ARDOUR::Stripable > > Sorted
Definition: osc.h:122
Surface _surface
Definition: osc.h:211
void set_gainmode(int gm)
Definition: osc.h:250
int set_surface_gainmode(uint32_t gm, lo_message msg)
std::vector< PortAdd > _ports
Definition: osc.h:239
int fake_touch(std::shared_ptr< ARDOUR::AutomationControl > ctrl)
std::shared_ptr< ARDOUR::Stripable > _select
Definition: osc.h:305
int set_surface_strip_types(uint32_t st, lo_message msg)
int sel_comp_mode(float val, lo_message msg)
int set_link(uint32_t set, uint32_t id, lo_address addr)
int trigger_grid_state(lo_address addr, bool zero_it=false)
int sel_master_send_enable(int state, lo_message msg)
int route_set_send_enable(int rid, int sid, float val, lo_message msg)
int sel_expand(uint32_t state, lo_message msg)
int sel_send_pagesize(uint32_t size, lo_message msg)
std::string remote_port
Definition: osc.h:291
void route_name_changed(const PBD::PropertyChange &, std::weak_ptr< ARDOUR::Route > r, lo_address addr)
int sel_eq_lpf_enable(float val, lo_message msg)
int strip_state(const char *path, std::shared_ptr< ARDOUR::Stripable > s, int ssid, lo_message msg)
int sel_eq_gain(int id, float val, lo_message msg)
int route_set_send_fader(int rid, int sid, float val, lo_message msg)
int strip_list(lo_message msg)
int route_plugin_parameter(int rid, int piid, int par, float val, lo_message msg)
int _strip_select2(std::shared_ptr< ARDOUR::Stripable > s, OSCSurface *sur, lo_address addr)
int cue_aux_mute(float state, lo_message msg)
int sel_comp_threshold(float val, lo_message msg)
int parse_sel_group(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
std::string get_remote_port()
Definition: osc.h:262
int text_message_with_id(std::string path, uint32_t ssid, std::string val, bool in_line, lo_address addr)
void current_value_query(const char *path, size_t len, lo_arg **argv, int argc, lo_message msg)
int int_message(std::string, int value, lo_address addr)
GSource * local_server
Definition: osc.h:276
std::map< uint32_t, LinkSet > link_sets
Definition: osc.h:230
void set_remote_port(std::string pt)
Definition: osc.h:263
int sel_plug_page(int page, lo_message msg)
Sorted cue_get_sorted_stripables(std::shared_ptr< ARDOUR::Stripable > aux, uint32_t id, lo_address)
int get_defaultfeedback()
Definition: osc.h:253
std::map< std::shared_ptr< ARDOUR::AutomationControl >, uint32_t > FakeTouchMap
Definition: osc.h:124
void surface_destroy(OSCSurface *sur)
void add_marker_name(const std::string &markername)
Definition: osc.h:355
void loop_location(int start, int end)
int custom_clear(lo_message msg)
int route_plugin_parameter_print(int rid, int piid, int par, lo_message msg)
int trigger_stop(int rid, int row_id, lo_message msg)
void cue_set_aux(uint32_t aux, lo_message msg)
int catchall(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
std::string get_unix_server_url()
int float_message(std::string, float value, lo_address addr)
uint32_t _port
Definition: osc.h:282
lo_server _osc_unix_server
Definition: osc.h:286
int sel_send_page(int page, lo_message msg)
int sel_eq_lpf_slope(float val, lo_message msg)
int sel_eq_hpf_slope(float val, lo_message msg)
int check_surface(lo_message msg)
std::string get_port(std::string host)
int sel_plugin_activate(float state, lo_message msg)
int sel_pan_frontback(float val, lo_message msg)
void link_strip_types(uint32_t linkset, uint32_t striptypes)
PBD::ScopedConnectionList session_connections
Definition: osc.h:764
int set_temp_mode(lo_address addr)
void session_exported(std::string, std::string)
int sel_plugin(int delta, lo_message msg)
int get_portmode()
Definition: osc.h:245
void set_defaultstrip(int st)
Definition: osc.h:252
void route_added(ARDOUR::RouteList &)
void stripable_selection_changed()
Definition: osc.h:86
int sel_eq_enable(float val, lo_message msg)
bool observer_busy
Definition: osc.h:300
int64_t scrub_time
Definition: osc.h:303
uint32_t default_strip
Definition: osc.h:293
int cue_set(uint32_t aux, lo_message msg)
OSC(ARDOUR::Session &, uint32_t port)
int sel_plug_pagesize(uint32_t size, lo_message msg)
void set_debug_mode(OSCDebugMode m)
Definition: osc.h:243
int master_parse(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
int trigger_unbang(int rid, int stop_now, lo_message msg)
ARDOUR::ZeroConf * _zeroconf
Definition: osc.h:307
std::string get_server_url()
int sel_sendfader(int id, float pos, lo_message msg)
lo_address get_address(lo_message msg)
volatile bool _ok
Definition: osc.h:283
void build_gui()
Definition: osc_gui.h:156
int bank_down(lo_message msg)
sigc::connection periodic_connection
Definition: osc.h:763
int route_plugin_activate(int rid, int piid, lo_message msg)
int link_check(uint32_t linkset)
int sel_delta(int delta, lo_message msg)
void transport_speed(lo_message msg)
OSCSurface * get_surface(lo_address addr, bool quiet=false)
OSCDebugMode _debugmode
Definition: osc.h:289
uint32_t default_gainmode
Definition: osc.h:295
int set_bank(uint32_t bank_start, lo_message msg)
void set_plugin_size(int ps)
Definition: osc.h:258
uint32_t get_sid(std::shared_ptr< ARDOUR::Stripable > strip, lo_address addr)
int route_plugin_list(int ssid, lo_message msg)
int sel_eq_shape(int id, float val, lo_message msg)
LinkSet * get_linkset(uint32_t set, lo_address addr)
void send_current_value(const char *path, lo_arg **argv, int argc, lo_message msg)
int select_plugin_parameter(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
void routes_list(lo_message msg)
void tear_down_gui()
Definition: osc_gui.h:142
void * get_gui() const
Definition: osc_gui.h:132
int set_surface_feedback(uint32_t fb, lo_message msg)
std::vector< OSCSurface > Surface
Definition: osc.h:210
lo_server _osc_server
Definition: osc.h:285
void session_loaded(ARDOUR::Session &)
int cue_next(lo_message msg)
int cue_connect_aux(std::string dest, lo_message msg)
volatile bool _shutdown
Definition: osc.h:284
int route_get_sends(lo_message msg)
int scrub(float delta, lo_message msg)
int sel_new_personal_send(char *n, lo_message msg)
Glib::Threads::Mutex _lo_lock
Definition: osc.h:96
uint32_t default_banksize
Definition: osc.h:292
int cue_send_enable(uint32_t id, float state, lo_message msg)
int strip_parse(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
int sel_eq_freq(int id, float val, lo_message msg)
int set_surface_port(uint32_t po, lo_message msg)
int trigger_bang(int rid, int stop_now, lo_message msg)
int _cue_set(uint32_t aux, lo_address addr)
int group_list(lo_message msg)
int set_state(const XMLNode &, int version)
int sel_eq_hpf_enable(float val, lo_message msg)
int refresh_surface(lo_message msg)
int route_set_send_gain_dB(int rid, int sid, float val, lo_message msg)
int cue_aux_fader(float position, lo_message msg)
int set_marker(const char *types, lo_arg **argv, int argc, lo_message msg)
std::string _osc_url_file
Definition: osc.h:288
int get_gainmode()
Definition: osc.h:249
int sel_eq_hpf_freq(float val, lo_message msg)
int sel_pan_elevation(float val, lo_message msg)
int _strip_select(std::shared_ptr< ARDOUR::Stripable > s, lo_address addr)
int parse_link(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
int float_message_with_id(std::string, uint32_t ssid, float value, bool in_line, lo_address addr)
int touch_detect(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
int route_plugin_reset(int ssid, int piid, lo_message msg)
void surface_list(lo_message msg)
int trigger_bank_state(lo_address addr)
bool get_active() const
int surface_parse(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
static int _catchall(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
int text_message(std::string path, std::string val, lo_address addr)
float scrub_speed
Definition: osc.h:301
bool global_init
Definition: osc.h:304
void debugmsg(const char *prefix, const char *path, const char *types, lo_arg **argv, int argc)
int sel_sendgain(int id, float dB, lo_message msg)
void set_defaultfeedback(int fb)
Definition: osc.h:254
void record_enabled(lo_message msg)
int cue_send_fader(uint32_t id, float position, lo_message msg)
void set_banksize(int bs)
Definition: osc.h:248
int get_send_size()
Definition: osc.h:255
Glib::Threads::Mutex surfaces_lock
Definition: osc.h:209
uint32_t default_plugin_size
Definition: osc.h:297
int route_get_receives(lo_message msg)
int jog(float delta, lo_message msg)
int _sel_plugin(int id, lo_address addr)
std::shared_ptr< ARDOUR::VCA > get_vca_by_name(std::string vname)
int get_defaultstrip()
Definition: osc.h:251
int osc_tbank_step_rows(int step, lo_message msg)
CONTROL_PROTOCOL_THREADS_NEED_TEMPO_MAP_DECL()
std::shared_ptr< ARDOUR::Send > get_send(std::shared_ptr< ARDOUR::Stripable > st, lo_address addr)
int sel_eq_q(int id, float val, lo_message msg)
void listen_to_route(std::shared_ptr< ARDOUR::Stripable >, lo_address)
int get_banksize()
Definition: osc.h:247
void global_feedback(OSCSurface *sur)
uint32_t default_send_size
Definition: osc.h:296
bool has_editor() const
Definition: osc.h:88
bool osc_input_handler(Glib::IOCondition, lo_server)
int sel_pan_lfe(float val, lo_message msg)
int cue_previous(lo_message msg)
void bank_leds(OSCSurface *sur)
void * gui
Definition: osc.h:768
void set_portmode(int pm)
Definition: osc.h:246
int bank_delta(float delta, lo_message msg)
int sel_eq_lpf_freq(float val, lo_message msg)
int _set_bank(uint32_t bank_start, lo_address addr)
int osc_toggle_roll(bool ret2strt)
int get_plugin_size()
Definition: osc.h:257
int set_active(bool yn)
int bank_up(lo_message msg)
int sel_comp_enable(float val, lo_message msg)
int select_parse(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg)
uint32_t default_feedback
Definition: osc.h:294
int set_surface_bank_size(uint32_t bs, lo_message msg)
std::shared_ptr< ARDOUR::Send > cue_get_send(uint32_t id, lo_address addr)
XMLNode & get_state() const
void strip_feedback(OSCSurface *sur, bool new_bank_size)
int osc_tbank_step_routes(int step, lo_message msg)
void ffwd()
void temporal_zoom_in()
void fit_16_tracks()
void mark_out()
void save_state()
void apply_mixer_scene(int scn)
void transport_stop()
void locate(ARDOUR::samplepos_t sample, ARDOUR::LocateTransportDisposition ltd)
void remove_marker_at_playhead()
void midi_panic()
void trigger_cue_row(int cue)
void goto_end()
void add_marker(const std::string &=std::string())
void rec_enable_toggle()
void scroll_up_1_page()
void store_mixer_scene(int scn)
void quick_snapshot_stay()
void scroll_up_1_track()
void fit_2_tracks()
void redo()
void all_tracks_rec_in()
void next_marker()
void scroll_dn_1_page()
void loop_toggle()
void set_punch_range()
void access_action(std::string action_path)
void goto_start(bool and_roll=false)
void prev_marker()
void zoom_1_sec()
void scroll_dn_1_track()
void toggle_punch_out()
void fit_1_track()
void tbank_set_size(int route_width, int row_height)
void trigger_stop_all(bool stop_now=false)
void zoom_100_ms()
void zoom_5_min()
void stop_forget()
void zoom_to_session()
void undo()
void fit_4_tracks()
void zoom_10_min()
void toggle_click()
void quick_snapshot_switch()
void zoom_1_min()
void toggle_all_rec_enables()
void jump_by_bars(int bars, ARDOUR::LocateTransportDisposition ltd=ARDOUR::RollIfAppropriate)
void rewind()
ARDOUR::samplepos_t transport_sample()
void zoom_10_sec()
void fit_32_tracks()
void jump_by_seconds(double sec, ARDOUR::LocateTransportDisposition ltd=ARDOUR::RollIfAppropriate)
void set_loop_range()
void set_transport_speed(double speed)
void mark_in()
void transport_play(bool jump_back=false)
void toggle_monitor_mono()
void temporal_zoom_out()
void fit_8_tracks()
void toggle_punch_in()
void fit_all_tracks()
void all_tracks_rec_out()
void toggle_monitor_dim()
void set_session_range()
void toggle_monitor_mute()
std::list< ScopedConnectionList * >::size_type size() const
Definition: signals.h:295
Definition: xml++.h:114
std::list< std::shared_ptr< VCA > > VCAList
std::list< std::shared_ptr< Route > > RouteList
#define PATH_CALLBACK1(name, type, optional)
Definition: osc.h:483
#define PATH_CALLBACK3(name, arg1type, arg2type, arg3type)
Definition: osc.h:603
#define PATH_CALLBACK_MSG(name)
Definition: osc.h:390
#define PATH_CALLBACK(name)
Definition: osc.h:416
#define PATH_CALLBACK2_MSG(name, arg1type, arg2type)
Definition: osc.h:579
#define PATH_CALLBACK1_MSG_s(name, arg1type)
Definition: osc.h:522
#define PATH_CALLBACK2(name, arg1type, arg2type)
Definition: osc.h:566
#define PATH_CALLBACK4(name, arg1type, arg2type, arg3type, arg4type)
Definition: osc.h:615
#define PATH_CALLBACK1_MSG(name, arg1type)
Definition: osc.h:510
OSCTempMode temp_mode
Definition: osc.h:223
std::bitset< 32 > strip_types
Definition: osc.h:226
std::vector< std::string > urls
Definition: osc.h:216
std::shared_ptr< ARDOUR::Stripable > temp_master
Definition: osc.h:225
OSCSelectObserver * sel_obs
Definition: osc.h:151
std::shared_ptr< ARDOUR::Stripable > select
Definition: osc.h:155
std::vector< int > plug_params
Definition: osc.h:159
OSCCueObserver * cue_obs
Definition: osc.h:169
std::bitset< 32 > feedback
Definition: osc.h:136
OSCGlobalObserver * global_obs
Definition: osc.h:134
std::vector< int > plugins
Definition: osc.h:160
PBD::Controllable::GroupControlDisposition usegroup
Definition: osc.h:138
PBD::ScopedConnection proc_connection
Definition: osc.h:164
std::vector< OSCRouteObserver * > observers
Definition: osc.h:148
std::bitset< 32 > strip_types
Definition: osc.h:149
std::shared_ptr< ARDOUR::Stripable > expand_strip
Definition: osc.h:154
std::string remote_url
Definition: osc.h:131
std::shared_ptr< ARDOUR::Stripable > temp_master
Definition: osc.h:143
std::string port
Definition: osc.h:236
std::string host
Definition: osc.h:235