Ardour  9.0-pre0-384-ga76afae0e9
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  static OSC* instance() { return _instance; }
84 
85  XMLNode& get_state () const;
86  int set_state (const XMLNode&, int version);
87 
89 
90  bool has_editor () const { return true; }
91  void* get_gui () const;
92  void tear_down_gui ();
93 
94  int set_active (bool yn);
95  bool get_active () const;
96 
97  // generic osc send
98  Glib::Threads::Mutex _lo_lock;
99  int float_message (std::string, float value, lo_address addr);
100  int int_message (std::string, int value, lo_address addr);
101  int text_message (std::string path, std::string val, lo_address addr);
102  int float_message_with_id (std::string, uint32_t ssid, float value, bool in_line, lo_address addr);
103  int int_message_with_id (std::string, uint32_t ssid, int value, bool in_line, lo_address addr);
104  int text_message_with_id (std::string path, uint32_t ssid, std::string val, bool in_line, lo_address addr);
105 
106  int send_group_list (lo_address addr);
107 
108  int start ();
109  int stop ();
110 
114  All
115  };
116 
117  enum OSCTempMode {
118  TempOff = 0,
120  VCAOnly = 2,
121  BusOnly = 3
122  };
123 
124  typedef std::vector<std::shared_ptr<ARDOUR::Stripable> > Sorted;
125  Sorted get_sorted_stripables(std::bitset<32> types, bool cue, uint32_t custom, Sorted my_list);
126  typedef std::map<std::shared_ptr<ARDOUR::AutomationControl>, uint32_t> FakeTouchMap;
128 
129 // keep a surface's global setup by remote server url
130  struct OSCSurface {
131  public:
132  //global
133  std::string remote_url; // the url these setting belong to
134  bool no_clear; // don't send osc clear messages on strip change
135  uint32_t jogmode; // current jogmode
136  OSCGlobalObserver* global_obs; // pointer to this surface's global observer
137  uint32_t nstrips; // how many strips are there for strip_types
138  std::bitset<32> feedback; // What is fed back? strips/meters/timecode/bar_beat/global
139  int gainmode; // what kind of faders do we have Gain db or position 0 to 1?
141  Sorted custom_strips; // a sorted list of user selected strips
142  uint32_t custom_mode; // use custom strip list
143  OSCTempMode temp_mode; // use temp strip list
144  Sorted temp_strips; // temp strip list for grouponly, vcaonly, auxonly
145  std::shared_ptr<ARDOUR::Stripable> temp_master; // stripable this surface uses as temp master
146  Sorted strips; // list of stripables for this surface
147  // strips
148  uint32_t bank; // current bank
149  uint32_t bank_size; // size of banks for this surface
150  std::vector<OSCRouteObserver*> observers; // route observers for this surface
151  std::bitset<32> strip_types;// what strip types are a part of this bank
152  //select
153  OSCSelectObserver* sel_obs; // So we can sync select feedback with selected channel
154  uint32_t expand; // Used by /select/select
155  bool expand_enable; // use expand instead of select
156  std::shared_ptr<ARDOUR::Stripable> expand_strip; // stripable this surface uses for expand
157  std::shared_ptr<ARDOUR::Stripable> select; // stripable this surface uses as selected
158  int plug_page; // current plugin page
159  uint32_t plug_page_size; // plugin page size (number of controls)
160  int plugin_id; // id of current plugin
161  std::vector<int> plug_params; // vector to store ports that are controls
162  std::vector<int> plugins; // stores allowable plugins with index (work around MB strip PIs)
163  int send_page; // current send page
164  uint32_t send_page_size; // send page size in channels
165  uint32_t nsends; // number of sends select has
166  PBD::ScopedConnection proc_connection; // for processor signal monitoring
167  // cue
168  bool cue; // is this a cue surface
169  uint32_t aux; // aux index for this cue surface
170  Sorted sends; // list of sends for cue aux
171  OSCCueObserver* cue_obs; // pointer to this surface's cue observer
172  uint32_t linkset; // ID of a set of surfaces used as one
173  uint32_t linkid; // ID of this surface within a linkset
174  };
175  /*
176  * feedback bits:
177  * [0] - Strips - buttons
178  * [1] - Strips - variables (pots/faders)
179  * [2] - Strips - Send SSID as path extension
180  * [3] - Send heart beat to surface
181  * [4] - Send feedback for master/global buttons/variables
182  * [5] - Send Bar and Beat
183  * [6] - Send Time code
184  * [7] - Send metering as dB or positional depending on gainmode
185  * [8] - Send metering as 16 bits (led strip)
186  * [9] - Send signal present (signal greater than -20dB)
187  * [10] - Send Playhead position as samples
188  * [11] - Send Playhead position as minutes seconds
189  * [12] - Send Playhead position like primary/secondary GUI clocks
190  * [13] - Send well known feedback (for /select/command
191  * [14] - use OSC 1.0 only (#reply -> /reply)
192  * [15] - report 8x8 trigger grid status
193  * [16] - report mixer scene status
194  *
195  * Strip_type bits:
196  * [0] - Audio Tracks
197  * [1] - Midi Tracks
198  * [2] - Audio Bus
199  * [3] - Midi Bus
200  * [4] - VCAs
201  * [5] - master
202  * [6] - Monitor
203  * [7] - Listen Bus
204  * [8] - Selected
205  * [9] - Hidden
206  * [10] - Use Groups
207  * [11] - Global Expand
208  */
209 
210 // storage for each surface's settings
211  mutable Glib::Threads::Mutex surfaces_lock;
212  typedef std::vector<OSCSurface> Surface;
214 
215 // linked surfaces
216  struct LinkSet {
217  public:
218  std::vector<std::string> urls; //urls of linked surfaces
219  uint32_t banksize; // linkset banksize
220  uint32_t bank; // linkset current bank
221  bool autobank; // banksize is derived from total
222  uint32_t not_ready; // number of 1st device, 0 = ready
223  Sorted custom_strips; // a sorted list of user selected strips
224  uint32_t custom_mode; // use custom strip list
225  OSCTempMode temp_mode; // use custom strip list
226  Sorted temp_strips; // temp strip list for grouponly, vcaonly, auxonly
227  std::shared_ptr<ARDOUR::Stripable> temp_master; // temp master stripable
228  std::bitset<32> strip_types; // strip_types for this linkset
229  Sorted strips; // list of valid strips in order for this set
230  };
231 
232  std::map<uint32_t, LinkSet> link_sets;
233  // list of linksets
234 
235  struct PortAdd {
236  public:
237  std::string host;
238  std::string port;
239  };
240 
241  std::vector<PortAdd> _ports;
242 
243 // GUI calls
244  std::string get_server_url ();
247  int get_portmode() { return address_only; }
248  void set_portmode (int pm) { address_only = pm; }
249  int get_banksize () { return default_banksize; }
250  void set_banksize (int bs) {default_banksize = bs; }
251  int get_gainmode() { return default_gainmode; }
252  void set_gainmode (int gm) { default_gainmode = gm; }
253  int get_defaultstrip() { return default_strip; }
254  void set_defaultstrip (int st) { default_strip = st; }
256  void set_defaultfeedback (int fb) { default_feedback = fb; }
258  void set_send_size (int ss) { default_send_size = ss; }
260  void set_plugin_size (int ps) { default_plugin_size = ps; }
261  void clear_devices ();
262  void gui_changed ();
263  void get_surfaces ();
264  std::string get_remote_port () { return remote_port; }
265  void set_remote_port (std::string pt) { remote_port = pt; }
266 
268 
269  int trigger_bank_state (lo_address addr);
270  int trigger_grid_state (lo_address addr, bool zero_it = false);
271 
272  int mixer_scene_state (lo_address addr, bool zero_it = false);
273 
274  protected:
275  void thread_init ();
277 
278  GSource* local_server;
279  GSource* remote_server;
280 
281  bool osc_input_handler (Glib::IOCondition, lo_server);
282 
283  private:
284  uint32_t _port;
285  volatile bool _ok;
286  volatile bool _shutdown;
287  lo_server _osc_server;
288  lo_server _osc_unix_server;
290  std::string _osc_url_file;
293  std::string remote_port;
295  uint32_t default_strip;
300  bool tick;
303  float scrub_speed; // Current scrub speed
304  double scrub_place; // place of play head at latest jog/scrub wheel tick
305  int64_t scrub_time; // when did the wheel move last?
307  std::shared_ptr<ARDOUR::Stripable> _select; // which stripable out of /surface/stripables is gui selected
308 
310 
312 
314 
315  // Handlers for "Application Hook" signals
317  void session_exported (std::string, std::string);
318 
319  // end "Application Hook" handles
320 
321  std::string get_unix_server_url ();
322  lo_address get_address (lo_message msg);
323  std::string get_port (std::string host);
324  OSCSurface * get_surface (lo_address addr, bool quiet = false);
325  int check_surface (lo_message msg);
326  uint32_t get_sid (std::shared_ptr<ARDOUR::Stripable> strip, lo_address addr);
327  std::shared_ptr<ARDOUR::Stripable> get_strip (uint32_t ssid, lo_address addr);
329  void strip_feedback (OSCSurface* sur, bool new_bank_size);
331  uint32_t bank_limits_check (uint32_t bank, uint32_t size, uint32_t total);
332  void bank_leds (OSCSurface* sur);
333 
334  void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg);
335  void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg);
336 
337  int current_value (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data);
338 
339  int catchall (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg);
340  static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data);
341 
342  int set_automation (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
343  int touch_detect (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
344  int fake_touch (std::shared_ptr<ARDOUR::AutomationControl> ctrl);
345 
346  int spill (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
347 
348  int route_get_sends (lo_message msg);
349  int route_get_receives(lo_message msg);
350  void routes_list (lo_message msg);
351  int group_list (lo_message msg);
352  void surface_list (lo_message msg);
353  void transport_sample (lo_message msg);
354  void transport_speed (lo_message msg);
355  void record_enabled (lo_message msg);
356 
357  void add_marker_name(const std::string &markername) {
358  add_marker(markername);
359  }
360 
361  // cue
362  Sorted cue_get_sorted_stripables(std::shared_ptr<ARDOUR::Stripable> aux, uint32_t id, lo_address);
363  int cue_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
364  int cue_set (uint32_t aux, lo_message msg);
365  int _cue_set (uint32_t aux, lo_address addr);
366  int cue_new_aux (std::string name, std::string dest_1, std::string dest_2, uint32_t count, lo_message msg);
367  int cue_new_send (std::string rt_name, lo_message msg);
368  int cue_connect_aux (std::string dest, lo_message msg);
369  int cue_next (lo_message msg);
370  int cue_previous (lo_message msg);
371  int cue_send_fader (uint32_t id, float position, lo_message msg);
372  int cue_send_enable (uint32_t id, float state, lo_message msg);
373  int cue_aux_fader (float position, lo_message msg);
374  int cue_aux_mute (float state, lo_message msg);
375  void cue_set_aux (uint32_t aux, lo_message msg);
376  std::shared_ptr<ARDOUR::Send> cue_get_send (uint32_t id, lo_address addr);
377  // end cue
378 
379  // link
380  LinkSet * get_linkset (uint32_t set, lo_address addr);
381  int parse_link (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
382  int link_check (uint32_t linkset);
383  int set_link (uint32_t set, uint32_t id, lo_address addr);
385  void link_strip_types (uint32_t linkset, uint32_t striptypes);
386 
387 #define OSC_DEBUG \
388  if (_debugmode == All) { \
389  debugmsg (dgettext(PACKAGE, "OSC"), path, types, argv, argc); \
390  }
391 
392 #define PATH_CALLBACK_MSG(name) \
393  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
394  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
395  } \
396  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
397  OSC_DEBUG; \
398  if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
399  name (msg); \
400  return 0; \
401  }
402 
417 
418 #define PATH_CALLBACK(name) \
419  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
420  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
421  } \
422  int cb_ ## name (const char *path, const char *types, lo_arg ** argv, int argc, lo_message msg) { \
423  OSC_DEBUG; \
424  check_surface (msg); \
425  if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
426  name (); \
427  return 0; \
428  }
429 
484 
485 #define PATH_CALLBACK1(name,type,optional) \
486  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
487  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
488  } \
489  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
490  OSC_DEBUG; \
491  check_surface (msg); \
492  if (argc > 0) { \
493  name (optional argv[0]->type); \
494  } \
495  return 0; \
496  }
497 
499  PATH_CALLBACK1(trigger_stop_all,i,); //0 = "stop at end of bar" 1 = "stop now"
500 
503 
507 
511 
512 #define PATH_CALLBACK1_MSG(name,arg1type) \
513  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
514  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
515  } \
516  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
517  OSC_DEBUG; \
518  if (argc > 0) { \
519  name (argv[0]->arg1type, msg); \
520  } \
521  return 0; \
522  }
523 
524 #define PATH_CALLBACK1_MSG_s(name,arg1type) \
525  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
526  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
527  } \
528  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
529  OSC_DEBUG; \
530  if (argc > 0) { \
531  name (&argv[0]->arg1type, msg); \
532  } \
533  return 0; \
534  }
535 
538 
567 
568 #define PATH_CALLBACK2(name,arg1type,arg2type) \
569  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
570  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
571  } \
572  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
573  OSC_DEBUG; \
574  check_surface (msg); \
575  if (argc > 1) { \
576  name (argv[0]->arg1type, argv[1]->arg2type); \
577  } \
578  return 0; \
579  }
580 
581 #define PATH_CALLBACK2_MSG(name,arg1type,arg2type) \
582  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
583  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
584  } \
585  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
586  OSC_DEBUG; \
587  if (argc > 1) { \
588  name (argv[0]->arg1type, argv[1]->arg2type, msg); \
589  } \
590  return 0; \
591  }
592 
593 #define PATH_CALLBACK2_MSG_s(name,arg1type,arg2type) \
594  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
595  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
596  } \
597  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
598  OSC_DEBUG; \
599  if (argc > 1) { \
600  name (argv[0]->arg1type, &argv[1]->arg2type, msg); \
601  } \
602  return 0; \
603  }
604 
605 #define PATH_CALLBACK3(name,arg1type,arg2type,arg3type) \
606  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
607  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
608  } \
609  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
610  OSC_DEBUG; \
611  if (argc > 1) { \
612  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type, msg); \
613  } \
614  return 0; \
615  }
616 
617 #define PATH_CALLBACK4(name,arg1type,arg2type,arg3type,arg4type) \
618  static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { \
619  return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, msg); \
620  } \
621  int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg) { \
622  OSC_DEBUG; \
623  if (argc > 1) { \
624  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type,argv[3]->arg4type, msg); \
625  } \
626  return 0; \
627  }
628 
636 
649 
651 
654  PATH_CALLBACK2_MSG(trigger_stop,i,i); /* second arg is 'stop now' */
655 
656  int strip_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
657  int master_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
658  int monitor_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
659  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);
660  int strip_state (const char *path, std::shared_ptr<ARDOUR::Stripable> s, int ssid, lo_message msg);
661  int strip_list (lo_message msg);
662  int _strip_select (std::shared_ptr<ARDOUR::Stripable> s, lo_address addr);
663  int _strip_select2 (std::shared_ptr<ARDOUR::Stripable> s, OSCSurface *sur, lo_address addr);
664 
665  void loop_location (int start, int end);
666 
667  int route_set_send_gain_dB (int rid, int sid, float val, lo_message msg);
668  int route_set_send_fader (int rid, int sid, float val, lo_message msg);
669  int route_set_send_enable (int rid, int sid, float val, lo_message msg);
670  int route_plugin_parameter (int rid, int piid,int par, float val, lo_message msg);
671  int route_plugin_parameter_print (int rid, int piid,int par, lo_message msg);
672  int route_plugin_activate (int rid, int piid, lo_message msg);
673  int route_plugin_deactivate (int rid, int piid, lo_message msg);
674  int route_plugin_list(int ssid, lo_message msg);
675  int route_plugin_descriptor(int ssid, int piid, lo_message msg);
676  int route_plugin_reset(int ssid, int piid, lo_message msg);
677 
678  int trigger_bang(int rid, int stop_now, lo_message msg);
679  int trigger_unbang(int rid, int stop_now, lo_message msg);
680  int trigger_stop(int rid, int row_id, lo_message msg);
681 
682  //banking functions
683  int set_bank (uint32_t bank_start, lo_message msg);
684  int _set_bank (uint32_t bank_start, lo_address addr);
685  int bank_up (lo_message msg);
686  int bank_delta (float delta, lo_message msg);
687  int use_group (float value, lo_message msg);
688  int bank_down (lo_message msg);
689  // surface set up
690  int surface_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
691  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);
692  int set_surface_bank_size (uint32_t bs, lo_message msg);
693  int set_surface_strip_types (uint32_t st, lo_message msg);
694  int set_surface_feedback (uint32_t fb, lo_message msg);
695  int set_surface_gainmode (uint32_t gm, lo_message msg);
696  int set_surface_port (uint32_t po, lo_message msg);
697  int refresh_surface (lo_message msg);
698  int custom_clear (lo_message msg);
699  int custom_mode (float state, lo_message msg);
700  int _custom_mode (uint32_t state, lo_address addr);
701  int name_session (char *n, lo_message msg);
702  // select
703  int select_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
704  int sel_send_pagesize (uint32_t size, lo_message msg);
705  int sel_send_page (int page, lo_message msg);
706  int sel_plug_pagesize (uint32_t size, lo_message msg);
707  int sel_plug_page (int page, lo_message msg);
708  int sel_plugin (int delta, lo_message msg);
709  int _sel_plugin (int id, lo_address addr);
710  int sel_plugin_activate (float state, lo_message msg);
711  int select_plugin_parameter (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
712  void processor_changed (std::string remote_url);
713 
714  int scrub (float delta, lo_message msg);
715  int jog (float delta, lo_message msg);
716  int jog_mode (float mode, lo_message msg);
717  int set_marker (const char* types, lo_arg **argv, int argc, lo_message msg);
718  int click_level (float position);
719  int sel_previous (lo_message msg);
720  int sel_next (lo_message msg);
721  int sel_delta (int delta, lo_message msg);
722  std::shared_ptr<ARDOUR::Send> get_send (std::shared_ptr<ARDOUR::Stripable> st, lo_address addr);
723  int sel_sendgain (int id, float dB, lo_message msg);
724  int sel_sendfader (int id, float pos, lo_message msg);
725  int sel_sendenable (int id, float pos, lo_message msg);
726  int sel_master_send_enable (int state, lo_message msg);
727  int sel_expand (uint32_t state, lo_message msg);
728  int sel_pan_elevation (float val, lo_message msg);
729  int sel_pan_frontback (float val, lo_message msg);
730  int sel_pan_lfe (float val, lo_message msg);
731  int sel_comp_enable (float val, lo_message msg);
732  int sel_comp_threshold (float val, lo_message msg);
733  int sel_comp_mode (float val, lo_message msg);
734  int sel_comp_makeup (float val, lo_message msg);
735  int sel_eq_enable (float val, lo_message msg);
736  int sel_eq_hpf_freq (float val, lo_message msg);
737  int sel_eq_hpf_enable (float val, lo_message msg);
738  int sel_eq_hpf_slope (float val, lo_message msg);
739  int sel_eq_lpf_freq (float val, lo_message msg);
740  int sel_eq_lpf_enable (float val, lo_message msg);
741  int sel_eq_lpf_slope (float val, lo_message msg);
742  int sel_eq_gain (int id, float val, lo_message msg);
743  int sel_eq_freq (int id, float val, lo_message msg);
744  int sel_eq_q (int id, float val, lo_message msg);
745  int sel_eq_shape (int id, float val, lo_message msg);
746  int sel_new_personal_send (char *n, lo_message msg);
747  int set_temp_mode (lo_address addr);
748  int parse_sel_group (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
749  std::shared_ptr<ARDOUR::VCA> get_vca_by_name (std::string vname);
750 
751  void listen_to_route (std::shared_ptr<ARDOUR::Stripable>, lo_address);
752 
753  void route_name_changed (const PBD::PropertyChange&, std::weak_ptr<ARDOUR::Route> r, lo_address addr);
754  void recalcbanks ();
755  void _recalcbanks ();
758 
759  int osc_tbank_step_routes (int step, lo_message msg);
760  int osc_tbank_step_rows (int step, lo_message msg);
761 
763  int osc_toggle_roll (bool ret2strt);
764  bool periodic (void);
765  sigc::connection periodic_connection;
767 
768  void debugmsg (const char *prefix, const char *path, const char* types, lo_arg **argv, int argc);
769 
770  static OSC* _instance;
771 
772  mutable void *gui;
773  void build_gui ();
774 };
775 
776 } // namespace
777 
778 #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:292
double scrub_place
Definition: osc.h:304
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:258
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:289
int use_group(float value, lo_message msg)
GSource * remote_server
Definition: osc.h:279
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:246
bool bank_dirty
Definition: osc.h:301
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:127
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:124
Surface _surface
Definition: osc.h:213
void set_gainmode(int gm)
Definition: osc.h:252
int set_surface_gainmode(uint32_t gm, lo_message msg)
std::vector< PortAdd > _ports
Definition: osc.h:241
int fake_touch(std::shared_ptr< ARDOUR::AutomationControl > ctrl)
std::shared_ptr< ARDOUR::Stripable > _select
Definition: osc.h:307
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:293
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:264
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:278
std::map< uint32_t, LinkSet > link_sets
Definition: osc.h:232
void set_remote_port(std::string pt)
Definition: osc.h:265
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:255
std::map< std::shared_ptr< ARDOUR::AutomationControl >, uint32_t > FakeTouchMap
Definition: osc.h:126
void surface_destroy(OSCSurface *sur)
void add_marker_name(const std::string &markername)
Definition: osc.h:357
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:284
lo_server _osc_unix_server
Definition: osc.h:288
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:766
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:247
void set_defaultstrip(int st)
Definition: osc.h:254
void route_added(ARDOUR::RouteList &)
void stripable_selection_changed()
Definition: osc.h:88
int sel_eq_enable(float val, lo_message msg)
bool observer_busy
Definition: osc.h:302
int64_t scrub_time
Definition: osc.h:305
uint32_t default_strip
Definition: osc.h:295
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:245
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:309
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:285
void build_gui()
Definition: osc_gui.h:156
int bank_down(lo_message msg)
sigc::connection periodic_connection
Definition: osc.h:765
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:291
uint32_t default_gainmode
Definition: osc.h:297
int set_bank(uint32_t bank_start, lo_message msg)
void set_plugin_size(int ps)
Definition: osc.h:260
uint32_t get_sid(std::shared_ptr< ARDOUR::Stripable > strip, lo_address addr)
static OSC * _instance
Definition: osc.h:770
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:212
lo_server _osc_server
Definition: osc.h:287
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:286
static OSC * instance()
Definition: osc.h:83
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:98
uint32_t default_banksize
Definition: osc.h:294
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:290
int get_gainmode()
Definition: osc.h:251
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:303
bool global_init
Definition: osc.h:306
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:256
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:250
int get_send_size()
Definition: osc.h:257
Glib::Threads::Mutex surfaces_lock
Definition: osc.h:211
uint32_t default_plugin_size
Definition: osc.h:299
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:253
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:249
void global_feedback(OSCSurface *sur)
uint32_t default_send_size
Definition: osc.h:298
bool has_editor() const
Definition: osc.h:90
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:772
void set_portmode(int pm)
Definition: osc.h:248
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:259
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:296
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()
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:485
#define PATH_CALLBACK3(name, arg1type, arg2type, arg3type)
Definition: osc.h:605
#define PATH_CALLBACK_MSG(name)
Definition: osc.h:392
#define PATH_CALLBACK(name)
Definition: osc.h:418
#define PATH_CALLBACK2_MSG(name, arg1type, arg2type)
Definition: osc.h:581
#define PATH_CALLBACK1_MSG_s(name, arg1type)
Definition: osc.h:524
#define PATH_CALLBACK2(name, arg1type, arg2type)
Definition: osc.h:568
#define PATH_CALLBACK4(name, arg1type, arg2type, arg3type, arg4type)
Definition: osc.h:617
#define PATH_CALLBACK1_MSG(name, arg1type)
Definition: osc.h:512
OSCTempMode temp_mode
Definition: osc.h:225
std::bitset< 32 > strip_types
Definition: osc.h:228
std::vector< std::string > urls
Definition: osc.h:218
std::shared_ptr< ARDOUR::Stripable > temp_master
Definition: osc.h:227
OSCSelectObserver * sel_obs
Definition: osc.h:153
std::shared_ptr< ARDOUR::Stripable > select
Definition: osc.h:157
std::vector< int > plug_params
Definition: osc.h:161
OSCCueObserver * cue_obs
Definition: osc.h:171
std::bitset< 32 > feedback
Definition: osc.h:138
OSCGlobalObserver * global_obs
Definition: osc.h:136
std::vector< int > plugins
Definition: osc.h:162
PBD::Controllable::GroupControlDisposition usegroup
Definition: osc.h:140
PBD::ScopedConnection proc_connection
Definition: osc.h:166
std::vector< OSCRouteObserver * > observers
Definition: osc.h:150
std::bitset< 32 > strip_types
Definition: osc.h:151
std::shared_ptr< ARDOUR::Stripable > expand_strip
Definition: osc.h:156
std::string remote_url
Definition: osc.h:133
std::shared_ptr< ARDOUR::Stripable > temp_master
Definition: osc.h:145
std::string port
Definition: osc.h:238
std::string host
Definition: osc.h:237