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