2 * Copyright (C) 2006-2009 Paul Davis
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include <boost/shared_ptr.hpp>
34 #include <glibmm/main.h>
36 #define ABSTRACT_UI_EXPORTS
37 #include "pbd/abstract_ui.h"
39 #include "ardour/types.h"
40 #include "ardour/send.h"
41 #include "ardour/plugin.h"
42 #include "control_protocol/control_protocol.h"
46 class OSCControllable;
47 class OSCRouteObserver;
48 class OSCGlobalObserver;
49 class OSCSelectObserver;
57 /* this is mostly a placeholder because I suspect that at some
58 point we will want to add more members to accomodate
59 certain types of requests to the OSC UI
62 namespace ArdourSurface {
64 struct OSCUIRequest : public BaseUI::BaseRequestObject {
70 class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
73 OSC (ARDOUR::Session&, uint32_t port);
76 static OSC* instance() { return _instance; }
78 XMLNode& get_state ();
79 int set_state (const XMLNode&, int version);
81 void stripable_selection_changed () {}
83 bool has_editor () const { return true; }
84 void* get_gui () const;
85 void tear_down_gui ();
87 int set_active (bool yn);
88 bool get_active () const;
92 int float_message (std::string, float value, lo_address addr);
93 int int_message (std::string, int value, lo_address addr);
94 int text_message (std::string path, std::string val, lo_address addr);
95 int float_message_with_id (std::string, uint32_t ssid, float value, bool in_line, lo_address addr);
96 int int_message_with_id (std::string, uint32_t ssid, int value, bool in_line, lo_address addr);
97 int text_message_with_id (std::string path, uint32_t ssid, std::string val, bool in_line, lo_address addr);
102 static void* request_factory (uint32_t);
121 typedef std::vector<boost::shared_ptr<ARDOUR::Stripable> > Sorted;
122 Sorted get_sorted_stripables(std::bitset<32> types, bool cue, uint32_t custom, Sorted my_list);
123 typedef std::map<boost::shared_ptr<ARDOUR::AutomationControl>, uint32_t> FakeTouchMap;
124 FakeTouchMap _touch_timeout;
126 // keep a surface's global setup by remote server url
130 std::string remote_url; // the url these setting belong to
131 bool no_clear; // don't send osc clear messages on strip change
132 JogMode jogmode; // current jogmode
133 OSCGlobalObserver* global_obs; // pointer to this surface's global observer
134 uint32_t nstrips; // how many strips are there for strip_types
135 std::bitset<32> feedback; // What is fed back? strips/meters/timecode/bar_beat/global
136 int gainmode; // what kind of faders do we have Gain db or position 0 to 1?
137 PBD::Controllable::GroupControlDisposition usegroup; // current group disposition
138 Sorted custom_strips; // a sorted list of user selected strips
139 uint32_t custom_mode; // use custom strip list
140 Sorted strips; // list of stripables for this surface
142 uint32_t bank; // current bank
143 uint32_t bank_size; // size of banks for this surface
144 std::vector<OSCRouteObserver*> observers; // route observers for this surface
145 std::bitset<32> strip_types;// what strip types are a part of this bank
147 OSCSelectObserver* sel_obs; // So we can sync select feedback with selected channel
148 uint32_t expand; // Used by /select/select
149 bool expand_enable; // use expand instead of select
150 boost::shared_ptr<ARDOUR::Stripable> select; // stripable this surface uses (maybe expand strip)
151 int plug_page; // current plugin page
152 uint32_t plug_page_size; // plugin page size (number of controls)
153 int plugin_id; // id of current plugin
154 std::vector<int> plug_params; // vector to store ports that are controls
155 std::vector<int> plugins; // stores allowable plugins with index (work around MB strip PIs)
156 int send_page; // current send page
157 uint32_t send_page_size; // send page size in channels
158 uint32_t nsends; // number of sends select has
159 PBD::ScopedConnection proc_connection; // for processor signal monitoring
161 bool cue; // is this a cue surface
162 uint32_t aux; // aux index for this cue surface
163 Sorted sends; // list of sends for cue aux
164 OSCCueObserver* cue_obs; // pointer to this surface's cue observer
165 uint32_t linkset; // ID of a set of surfaces used as one
166 uint32_t linkid; // ID of this surface within a linkset
170 * [0] - Strips - buttons
171 * [1] - Strips - variables (pots/faders)
172 * [2] - Strips - Send SSID as path extension
173 * [3] - Send heart beat to surface
174 * [4] - Send feedback for master/global buttons/variables
175 * [5] - Send Bar and Beat
176 * [6] - Send Time code
177 * [7] - Send metering as dB or positional depending on gainmode
178 * [8] - Send metering as 16 bits (led strip)
179 * [9] - Send signal present (signal greater than -20dB)
180 * [10] - Send Playhead position as samples
181 * [11] - Send Playhead position as minutes seconds
182 * [12] - Send Playhead position like primary/secondary GUI clocks
183 * [13] - Send well known feedback (for /select/command
184 * [14] - use OSC 1.0 only (#reply -> /reply)
188 // storage for each surface's settings
189 mutable Glib::Threads::Mutex surfaces_lock;
190 typedef std::vector<OSCSurface> Surface;
196 std::vector<std::string> urls; //urls of linked surfaces
197 uint32_t banksize; // linkset banksize
198 uint32_t bank; // linkset current bank
199 bool autobank; // banksize is derived from total
200 uint32_t not_ready; // number of 1st device, 0 = ready
201 Sorted custom_strips; // a sorted list of user selected strips
202 uint32_t custom_mode; // use custom strip list
203 std::bitset<32> strip_types; // strip_types for this linkset
204 Sorted strips; // list of valid strips in order for this set
207 std::map<uint32_t, LinkSet> link_sets;
216 std::vector<PortAdd> _ports;
219 std::string get_server_url ();
220 void set_debug_mode (OSCDebugMode m) { _debugmode = m; }
221 OSCDebugMode get_debug_mode () { return _debugmode; }
222 int get_portmode() { return address_only; }
223 void set_portmode (int pm) { address_only = pm; }
224 int get_banksize () { return default_banksize; }
225 void set_banksize (int bs) {default_banksize = bs; }
226 int get_gainmode() { return default_gainmode; }
227 void set_gainmode (int gm) { default_gainmode = gm; }
228 int get_defaultstrip() { return default_strip; }
229 void set_defaultstrip (int st) { default_strip = st; }
230 int get_defaultfeedback() { return default_feedback; }
231 void set_defaultfeedback (int fb) { default_feedback = fb; }
232 int get_send_size() { return default_send_size; }
233 void set_send_size (int ss) { default_send_size = ss; }
234 int get_plugin_size() { return default_plugin_size; }
235 void set_plugin_size (int ps) { default_plugin_size = ps; }
236 void clear_devices ();
238 void get_surfaces ();
239 std::string get_remote_port () { return remote_port; }
240 void set_remote_port (std::string pt) { remote_port = pt; }
244 void do_request (OSCUIRequest*);
246 GSource* local_server;
247 GSource* remote_server;
249 bool osc_input_handler (Glib::IOCondition, lo_server);
254 volatile bool _shutdown;
255 lo_server _osc_server;
256 lo_server _osc_unix_server;
257 std::string _osc_unix_socket_path;
258 std::string _osc_url_file;
259 OSCDebugMode _debugmode;
261 std::string remote_port;
262 uint32_t default_banksize;
263 uint32_t default_strip;
264 uint32_t default_feedback;
265 uint32_t default_gainmode;
266 uint32_t default_send_size;
267 uint32_t default_plugin_size;
271 float scrub_speed; // Current scrub speed
272 double scrub_place; // place of play head at latest jog/scrub wheel tick
273 int64_t scrub_time; // when did the wheel move last?
275 boost::shared_ptr<ARDOUR::Stripable> _select; // which stripable out of /surface/stripables is gui selected
277 void register_callbacks ();
279 void route_added (ARDOUR::RouteList&);
281 // Handlers for "Application Hook" signals
282 void session_loaded (ARDOUR::Session&);
283 void session_exported (std::string, std::string);
285 // end "Application Hook" handles
287 std::string get_unix_server_url ();
288 lo_address get_address (lo_message msg);
289 std::string get_port (std::string host);
290 OSCSurface * get_surface (lo_address addr, bool quiet = false);
291 int check_surface (lo_message msg);
292 uint32_t get_sid (boost::shared_ptr<ARDOUR::Stripable> strip, lo_address addr);
293 boost::shared_ptr<ARDOUR::Stripable> get_strip (uint32_t ssid, lo_address addr);
294 void global_feedback (OSCSurface* sur);
295 void strip_feedback (OSCSurface* sur, bool new_bank_size);
296 void surface_destroy (OSCSurface* sur);
297 uint32_t bank_limits_check (uint32_t bank, uint32_t size, uint32_t total);
298 void bank_leds (OSCSurface* sur);
300 void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg);
301 void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg);
303 int current_value (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
305 int catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data);
306 static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
308 int set_automation (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
309 int touch_detect (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
310 int fake_touch (boost::shared_ptr<ARDOUR::AutomationControl> ctrl);
312 int route_get_sends (lo_message msg);
313 int route_get_receives(lo_message msg);
314 void routes_list (lo_message msg);
315 void surface_list (lo_message msg);
316 void transport_sample (lo_message msg);
317 void transport_speed (lo_message msg);
318 void record_enabled (lo_message msg);
321 Sorted cue_get_sorted_stripables(boost::shared_ptr<ARDOUR::Stripable> aux, uint32_t id, lo_message msg);
322 int cue_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
323 int cue_set (uint32_t aux, lo_message msg);
324 int _cue_set (uint32_t aux, lo_address addr);
325 int cue_next (lo_message msg);
326 int cue_previous (lo_message msg);
327 int cue_send_fader (uint32_t id, float position, lo_message msg);
328 int cue_send_enable (uint32_t id, float state, lo_message msg);
329 int cue_aux_fader (float position, lo_message msg);
330 int cue_aux_mute (float state, lo_message msg);
331 void cue_set_aux (uint32_t aux, lo_message msg);
332 boost::shared_ptr<ARDOUR::Send> cue_get_send (uint32_t id, lo_address addr);
336 LinkSet * get_linkset (uint32_t set, lo_address addr);
337 int parse_link (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
338 int link_check (uint32_t linkset);
339 int set_link (uint32_t set, uint32_t id, lo_address addr);
340 void surface_link_state (LinkSet * set);
341 void link_strip_types (uint32_t linkset, uint32_t striptypes);
344 if (_debugmode == All) { \
345 debugmsg (dgettext(PACKAGE, "OSC"), path, types, argv, argc); \
348 #define PATH_CALLBACK_MSG(name) \
349 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
350 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
352 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
354 if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
359 PATH_CALLBACK_MSG(route_get_sends);
360 PATH_CALLBACK_MSG(route_get_receives);
361 PATH_CALLBACK_MSG(routes_list);
362 PATH_CALLBACK_MSG(surface_list);
363 PATH_CALLBACK_MSG(transport_sample);
364 PATH_CALLBACK_MSG(transport_speed);
365 PATH_CALLBACK_MSG(record_enabled);
366 PATH_CALLBACK_MSG(refresh_surface);
367 PATH_CALLBACK_MSG(bank_up);
368 PATH_CALLBACK_MSG(bank_down);
369 PATH_CALLBACK_MSG(master_select);
370 PATH_CALLBACK_MSG(custom_clear);
372 #define PATH_CALLBACK(name) \
373 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
374 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
376 int cb_ ## name (const char *path, const char *types, lo_arg ** argv, int argc, void *data) { \
378 check_surface (data); \
379 if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
384 PATH_CALLBACK(add_marker);
385 PATH_CALLBACK(loop_toggle);
386 PATH_CALLBACK(goto_start);
387 PATH_CALLBACK(goto_end);
388 PATH_CALLBACK(rewind);
390 PATH_CALLBACK(transport_stop);
391 PATH_CALLBACK(transport_play);
392 PATH_CALLBACK(save_state);
393 PATH_CALLBACK(prev_marker);
394 PATH_CALLBACK(next_marker);
397 PATH_CALLBACK(toggle_punch_in);
398 PATH_CALLBACK(toggle_punch_out);
399 PATH_CALLBACK(rec_enable_toggle);
400 PATH_CALLBACK(toggle_all_rec_enables);
401 PATH_CALLBACK(all_tracks_rec_in);
402 PATH_CALLBACK(all_tracks_rec_out);
403 PATH_CALLBACK(cancel_all_solos);
404 PATH_CALLBACK(remove_marker_at_playhead);
405 PATH_CALLBACK(mark_in);
406 PATH_CALLBACK(mark_out);
407 PATH_CALLBACK(toggle_click);
408 PATH_CALLBACK(midi_panic);
409 PATH_CALLBACK(toggle_roll);
410 PATH_CALLBACK(stop_forget);
411 PATH_CALLBACK(set_punch_range);
412 PATH_CALLBACK(set_loop_range);
413 PATH_CALLBACK(set_session_range);
414 PATH_CALLBACK(toggle_monitor_mute);
415 PATH_CALLBACK(toggle_monitor_dim);
416 PATH_CALLBACK(toggle_monitor_mono);
417 PATH_CALLBACK(quick_snapshot_stay);
418 PATH_CALLBACK(quick_snapshot_switch);
419 PATH_CALLBACK(fit_1_track);
420 PATH_CALLBACK(fit_2_tracks);
421 PATH_CALLBACK(fit_4_tracks);
422 PATH_CALLBACK(fit_8_tracks);
423 PATH_CALLBACK(fit_16_tracks);
424 PATH_CALLBACK(fit_32_tracks);
425 PATH_CALLBACK(fit_all_tracks);
426 PATH_CALLBACK(zoom_100_ms);
427 PATH_CALLBACK(zoom_1_sec);
428 PATH_CALLBACK(zoom_10_sec);
429 PATH_CALLBACK(zoom_1_min);
430 PATH_CALLBACK(zoom_5_min);
431 PATH_CALLBACK(zoom_10_min);
432 PATH_CALLBACK(zoom_to_session);
433 PATH_CALLBACK(temporal_zoom_in);
434 PATH_CALLBACK(temporal_zoom_out);
435 PATH_CALLBACK(scroll_up_1_track);
436 PATH_CALLBACK(scroll_dn_1_track);
437 PATH_CALLBACK(scroll_up_1_page);
438 PATH_CALLBACK(scroll_dn_1_page);
440 #define PATH_CALLBACK1(name,type,optional) \
441 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
442 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
444 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
446 check_surface (data); \
448 name (optional argv[0]->type); \
453 PATH_CALLBACK1(set_transport_speed,f,);
454 PATH_CALLBACK1(access_action,s,&);
456 PATH_CALLBACK1(jump_by_bars,f,);
457 PATH_CALLBACK1(jump_by_seconds,f,);
458 PATH_CALLBACK1(master_set_gain,f,);
459 PATH_CALLBACK1(master_set_fader,f,);
460 PATH_CALLBACK1(master_delta_gain,f,);
461 PATH_CALLBACK1(master_set_trim,f,);
462 PATH_CALLBACK1(master_set_mute,i,);
463 PATH_CALLBACK1(monitor_set_gain,f,);
464 PATH_CALLBACK1(monitor_set_fader,f,);
465 PATH_CALLBACK1(monitor_delta_gain,f,);
466 PATH_CALLBACK1(monitor_set_mute,i,);
467 PATH_CALLBACK1(monitor_set_dim,i,);
468 PATH_CALLBACK1(monitor_set_mono,i,);
469 PATH_CALLBACK1(click_level,f,);
471 #define PATH_CALLBACK1_MSG(name,arg1type) \
472 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
473 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
475 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
478 name (argv[0]->arg1type, data); \
483 // pan position needs message info to send feedback
484 PATH_CALLBACK1_MSG(master_set_pan_stereo_position,f);
486 PATH_CALLBACK1_MSG(scrub,f);
487 PATH_CALLBACK1_MSG(jog,f);
488 PATH_CALLBACK1_MSG(jog_mode,f);
489 PATH_CALLBACK1_MSG(bank_delta,f);
490 PATH_CALLBACK1_MSG(use_group,f);
491 PATH_CALLBACK1_MSG(sel_recenable,i);
492 PATH_CALLBACK1_MSG(sel_recsafe,i);
493 PATH_CALLBACK1_MSG(sel_mute,i);
494 PATH_CALLBACK1_MSG(sel_master_send_enable,i);
495 PATH_CALLBACK1_MSG(sel_solo,i);
496 PATH_CALLBACK1_MSG(sel_solo_iso,i);
497 PATH_CALLBACK1_MSG(sel_solo_safe,i);
498 PATH_CALLBACK1_MSG(sel_monitor_input,i);
499 PATH_CALLBACK1_MSG(sel_monitor_disk,i);
500 PATH_CALLBACK1_MSG(sel_phase,i);
501 PATH_CALLBACK1_MSG(sel_gain,f);
502 PATH_CALLBACK1_MSG(sel_fader,f);
503 PATH_CALLBACK1_MSG(sel_dB_delta,f);
504 PATH_CALLBACK1_MSG(sel_trim,f);
505 PATH_CALLBACK1_MSG(sel_hide,i);
506 PATH_CALLBACK1_MSG(sel_pan_position,f);
507 PATH_CALLBACK1_MSG(sel_pan_width,f);
508 PATH_CALLBACK1_MSG(sel_pan_elevation,f);
509 PATH_CALLBACK1_MSG(sel_pan_frontback,f);
510 PATH_CALLBACK1_MSG(sel_pan_lfe,f);
511 PATH_CALLBACK1_MSG(sel_send_page,f);
512 PATH_CALLBACK1_MSG(sel_plug_page,f);
513 PATH_CALLBACK1_MSG(sel_plugin,f);
514 PATH_CALLBACK1_MSG(sel_plugin_activate,f);
515 PATH_CALLBACK1_MSG(sel_comp_enable,f);
516 PATH_CALLBACK1_MSG(sel_comp_threshold,f);
517 PATH_CALLBACK1_MSG(sel_comp_speed,f);
518 PATH_CALLBACK1_MSG(sel_comp_mode,f);
519 PATH_CALLBACK1_MSG(sel_comp_makeup,f);
520 PATH_CALLBACK1_MSG(sel_eq_enable,f);
521 PATH_CALLBACK1_MSG(sel_eq_hpf_freq,f);
522 PATH_CALLBACK1_MSG(sel_eq_hpf_enable,f);
523 PATH_CALLBACK1_MSG(sel_eq_hpf_slope,f);
524 PATH_CALLBACK1_MSG(sel_eq_lpf_freq,f);
525 PATH_CALLBACK1_MSG(sel_eq_lpf_enable,f);
526 PATH_CALLBACK1_MSG(sel_eq_lpf_slope,f);
527 PATH_CALLBACK1_MSG(sel_expand,i);
528 PATH_CALLBACK1_MSG(custom_mode,f);
530 #define PATH_CALLBACK2(name,arg1type,arg2type) \
531 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
532 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
534 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
536 check_surface (data); \
538 name (argv[0]->arg1type, argv[1]->arg2type); \
543 #define PATH_CALLBACK2_MSG(name,arg1type,arg2type) \
544 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
545 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
547 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
550 name (argv[0]->arg1type, argv[1]->arg2type, data); \
555 #define PATH_CALLBACK2_MSG_s(name,arg1type,arg2type) \
556 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
557 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
559 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
562 name (argv[0]->arg1type, &argv[1]->arg2type, data); \
567 #define PATH_CALLBACK3(name,arg1type,arg2type,arg3type) \
568 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
569 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
571 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
574 name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type, data); \
579 #define PATH_CALLBACK4(name,arg1type,arg2type,arg3type,arg4type) \
580 static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
581 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
583 int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
586 name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type,argv[3]->arg4type, data); \
591 PATH_CALLBACK2_MSG(sel_sendgain,i,f);
592 PATH_CALLBACK2_MSG(sel_sendfader,i,f);
593 PATH_CALLBACK2_MSG(sel_sendenable,i,f);
594 PATH_CALLBACK2_MSG(sel_eq_gain,i,f);
595 PATH_CALLBACK2_MSG(sel_eq_freq,i,f);
596 PATH_CALLBACK2_MSG(sel_eq_q,i,f);
597 PATH_CALLBACK2_MSG(sel_eq_shape,i,f);
599 PATH_CALLBACK2(locate,i,i);
600 PATH_CALLBACK2(loop_location,i,i);
601 PATH_CALLBACK2_MSG_s(route_rename,i,s);
602 PATH_CALLBACK2_MSG(route_mute,i,i);
603 PATH_CALLBACK2_MSG(route_solo,i,i);
604 PATH_CALLBACK2_MSG(route_solo_iso,i,i);
605 PATH_CALLBACK2_MSG(route_solo_safe,i,i);
606 PATH_CALLBACK2_MSG(route_recenable,i,i);
607 PATH_CALLBACK2_MSG(route_recsafe,i,i);
608 PATH_CALLBACK2_MSG(route_monitor_input,i,i);
609 PATH_CALLBACK2_MSG(route_monitor_disk,i,i);
610 PATH_CALLBACK2_MSG(strip_phase,i,i);
611 PATH_CALLBACK2_MSG(strip_expand,i,i);
612 PATH_CALLBACK2_MSG(strip_hide,i,i);
613 PATH_CALLBACK2_MSG(strip_gui_select,i,i);
614 PATH_CALLBACK2_MSG(route_set_gain_dB,i,f);
615 PATH_CALLBACK2_MSG(route_set_gain_fader,i,f);
616 PATH_CALLBACK2_MSG(route_set_trim_dB,i,f);
617 PATH_CALLBACK2_MSG(route_set_pan_stereo_position,i,f);
618 PATH_CALLBACK2_MSG(route_set_pan_stereo_width,i,f);
619 PATH_CALLBACK3(route_set_send_gain_dB,i,i,f);
620 PATH_CALLBACK3(route_set_send_fader,i,i,f);
621 PATH_CALLBACK3(route_set_send_enable,i,i,f);
622 PATH_CALLBACK4(route_plugin_parameter,i,i,i,f);
623 PATH_CALLBACK3(route_plugin_parameter_print,i,i,i);
624 PATH_CALLBACK2_MSG(route_plugin_activate,i,i);
625 PATH_CALLBACK2_MSG(route_plugin_deactivate,i,i);
626 PATH_CALLBACK1_MSG(route_plugin_list,i);
627 PATH_CALLBACK2_MSG(route_plugin_descriptor,i,i);
628 PATH_CALLBACK2_MSG(route_plugin_reset,i,i);
630 int route_rename (int rid, char *s, lo_message msg);
631 int route_mute (int rid, int yn, lo_message msg);
632 int route_solo (int rid, int yn, lo_message msg);
633 int route_solo_iso (int rid, int yn, lo_message msg);
634 int route_solo_safe (int rid, int yn, lo_message msg);
635 int route_recenable (int rid, int yn, lo_message msg);
636 int route_recsafe (int ssid, int yn, lo_message msg);
637 int route_monitor_input (int rid, int yn, lo_message msg);
638 int route_monitor_disk (int rid, int yn, lo_message msg);
639 int strip_phase (int rid, int yn, lo_message msg);
640 int strip_expand (int rid, int yn, lo_message msg);
641 int strip_hide (int ssid, int yn, lo_message msg);
642 int _strip_select (boost::shared_ptr<ARDOUR::Stripable> s, lo_address addr);
643 int strip_gui_select (int rid, int yn, lo_message msg);
644 int route_set_gain_dB (int rid, float dB, lo_message msg);
645 int route_set_gain_fader (int rid, float pos, lo_message msg);
646 int strip_db_delta (int ssid, float delta, lo_message msg);
647 int route_set_trim_abs (int rid, float level, lo_message msg);
648 int route_set_trim_dB (int rid, float dB, lo_message msg);
649 int route_set_pan_stereo_position (int rid, float left_right_fraction, lo_message msg);
650 int route_set_pan_stereo_width (int rid, float percent, lo_message msg);
651 int route_set_send_gain_dB (int rid, int sid, float val, lo_message msg);
652 int route_set_send_fader (int rid, int sid, float val, lo_message msg);
653 int route_set_send_enable (int rid, int sid, float val, lo_message msg);
654 int route_plugin_parameter (int rid, int piid,int par, float val, lo_message msg);
655 int route_plugin_parameter_print (int rid, int piid,int par, lo_message msg);
656 int route_plugin_activate (int rid, int piid, lo_message msg);
657 int route_plugin_deactivate (int rid, int piid, lo_message msg);
658 int route_plugin_list(int ssid, lo_message msg);
659 int route_plugin_descriptor(int ssid, int piid, lo_message msg);
660 int route_plugin_reset(int ssid, int piid, lo_message msg);
663 int set_bank (uint32_t bank_start, lo_message msg);
664 int _set_bank (uint32_t bank_start, lo_address addr);
665 int bank_up (lo_message msg);
666 int bank_delta (float delta, lo_message msg);
667 int use_group (float value, lo_message msg);
668 int bank_down (lo_message msg);
670 int surface_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
671 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);
672 int set_surface_bank_size (uint32_t bs, lo_message msg);
673 int set_surface_strip_types (uint32_t st, lo_message msg);
674 int set_surface_feedback (uint32_t fb, lo_message msg);
675 int set_surface_gainmode (uint32_t gm, lo_message msg);
676 int set_surface_port (uint32_t po, lo_message msg);
677 int refresh_surface (lo_message msg);
678 int custom_clear (lo_message msg);
679 int custom_mode (float state, lo_message msg);
681 int sel_send_pagesize (uint32_t size, lo_message msg);
682 int sel_send_page (int page, lo_message msg);
683 int sel_plug_pagesize (uint32_t size, lo_message msg);
684 int sel_plug_page (int page, lo_message msg);
685 int sel_plugin (int delta, lo_message msg);
686 int _sel_plugin (int id, lo_address addr);
687 int sel_plugin_activate (float state, lo_message msg);
688 int select_plugin_parameter (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg);
689 void processor_changed (std::string remote_url);
691 int scrub (float delta, lo_message msg);
692 int jog (float delta, lo_message msg);
693 int jog_mode (float mode, lo_message msg);
694 int set_marker (const char* types, lo_arg **argv, int argc, lo_message msg);
695 int click_level (float position);
696 int master_set_gain (float dB);
697 int master_set_fader (float position);
698 int master_delta_gain (float delta);
699 int master_set_trim (float dB);
700 int master_set_pan_stereo_position (float position, lo_message msg);
701 int master_set_mute (uint32_t state);
702 int master_select (lo_message msg);
703 int monitor_set_gain (float dB);
704 int monitor_set_fader (float position);
705 int monitor_delta_gain (float delta);
706 int monitor_set_mute (uint32_t state);
707 int monitor_set_dim (uint32_t state);
708 int monitor_set_mono (uint32_t state);
709 int sel_recenable (uint32_t state, lo_message msg);
710 int sel_recsafe (uint32_t state, lo_message msg);
711 int sel_mute (uint32_t state, lo_message msg);
712 int sel_solo (uint32_t state, lo_message msg);
713 int sel_solo_iso (uint32_t state, lo_message msg);
714 int sel_solo_safe (uint32_t state, lo_message msg);
715 int sel_monitor_input (uint32_t state, lo_message msg);
716 int sel_monitor_disk (uint32_t state, lo_message msg);
717 int sel_phase (uint32_t state, lo_message msg);
718 int sel_gain (float state, lo_message msg);
719 int sel_fader (float state, lo_message msg);
720 int sel_dB_delta (float delta, lo_message msg);
721 int sel_trim (float val, lo_message msg);
722 int sel_hide (uint32_t state, lo_message msg);
723 int sel_pan_position (float val, lo_message msg);
724 int sel_pan_width (float val, lo_message msg);
725 int sel_sendgain (int id, float dB, lo_message msg);
726 int sel_sendfader (int id, float pos, lo_message msg);
727 int sel_sendenable (int id, float pos, lo_message msg);
728 int sel_master_send_enable (int state, lo_message msg);
729 int sel_expand (uint32_t state, lo_message msg);
730 int sel_pan_elevation (float val, lo_message msg);
731 int sel_pan_frontback (float val, lo_message msg);
732 int sel_pan_lfe (float val, lo_message msg);
733 int sel_comp_enable (float val, lo_message msg);
734 int sel_comp_threshold (float val, lo_message msg);
735 int sel_comp_speed (float val, lo_message msg);
736 int sel_comp_mode (float val, lo_message msg);
737 int sel_comp_makeup (float val, lo_message msg);
738 int sel_eq_enable (float val, lo_message msg);
739 int sel_eq_hpf_freq (float val, lo_message msg);
740 int sel_eq_hpf_enable (float val, lo_message msg);
741 int sel_eq_hpf_slope (float val, lo_message msg);
742 int sel_eq_lpf_freq (float val, lo_message msg);
743 int sel_eq_lpf_enable (float val, lo_message msg);
744 int sel_eq_lpf_slope (float val, lo_message msg);
745 int sel_eq_gain (int id, float val, lo_message msg);
746 int sel_eq_freq (int id, float val, lo_message msg);
747 int sel_eq_q (int id, float val, lo_message msg);
748 int sel_eq_shape (int id, float val, lo_message msg);
750 void listen_to_route (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
752 void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr);
754 void _recalcbanks ();
755 void notify_routes_added (ARDOUR::RouteList &);
756 void notify_vca_added (ARDOUR::VCAList &);
758 int cancel_all_solos ();
759 bool periodic (void);
760 sigc::connection periodic_connection;
761 PBD::ScopedConnectionList session_connections;
763 void debugmsg (const char *prefix, const char *path, const char* types, lo_arg **argv, int argc);
765 static OSC* _instance;
773 #endif // ardour_osc_h