enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h
[ardour.git] / libs / surfaces / osc / osc.h
1 /*
2  * Copyright (C) 2006-2009 Paul Davis
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
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.
17  *
18  */
19
20 #ifndef ardour_osc_h
21 #define ardour_osc_h
22
23 #include <string>
24 #include <vector>
25 #include <bitset>
26
27 #include <sys/time.h>
28 #include <pthread.h>
29
30 #include <boost/shared_ptr.hpp>
31
32 #include <lo/lo.h>
33
34 #include <glibmm/main.h>
35
36 #define ABSTRACT_UI_EXPORTS
37 #include "pbd/abstract_ui.h"
38
39 #include "ardour/types.h"
40 #include "control_protocol/control_protocol.h"
41
42 #include "pbd/i18n.h"
43
44 class OSCControllable;
45 class OSCRouteObserver;
46 class OSCGlobalObserver;
47 class OSCSelectObserver;
48
49 namespace ARDOUR {
50 class Session;
51 class Route;
52 }
53
54 /* this is mostly a placeholder because I suspect that at some
55    point we will want to add more members to accomodate
56    certain types of requests to the OSC UI
57 */
58
59 namespace ArdourSurface {
60
61 struct OSCUIRequest : public BaseUI::BaseRequestObject {
62   public:
63         OSCUIRequest () {}
64         ~OSCUIRequest() {}
65 };
66
67 class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
68 {
69   public:
70         OSC (ARDOUR::Session&, uint32_t port);
71         virtual ~OSC();
72
73         static OSC* instance() { return _instance; }
74
75         XMLNode& get_state ();
76         int set_state (const XMLNode&, int version);
77
78         bool has_editor () const { return true; }
79         void* get_gui () const;
80         void  tear_down_gui ();
81
82         int set_active (bool yn);
83         bool get_active () const;
84         int set_feedback (bool yn);
85         bool get_feedback () const;
86
87
88         int start ();
89         int stop ();
90
91         static void* request_factory (uint32_t);
92
93         enum OSCDebugMode {
94                 Off,
95                 Unhandled,
96                 All
97         };
98
99         typedef std::vector<boost::shared_ptr<ARDOUR::Stripable> > Sorted;
100         Sorted get_sorted_stripables(std::bitset<32> types);
101
102 // keep a surface's global setup by remote server url
103         struct OSCSurface {
104         public:
105                 std::string remote_url;         // the url these setting belong to
106                 uint32_t bank;                          // current bank
107                 uint32_t bank_size;                     // size of banks for this surface
108                 std::bitset<32> strip_types;// what strip types are a part of this bank
109                 uint32_t nstrips;                       // how many strips are there for strip_types
110                 std::bitset<32> feedback;       // What is fed back? strips/meters/timecode/bar_beat/global
111                 int gainmode;                           // what kind of faders do we have Gain db or position 0 to 1023?
112                 uint32_t expand;                        // Used by /select/select
113                 bool expand_enable;                     // use expand instead of select
114                 OSCSelectObserver* sel_obs;     // So we can sync select feedback with selected channel
115                 Sorted strips;                          // list of stripables for this surface
116         };
117                 /*
118                  * feedback bits:
119                  * [0] - Strips - buttons
120                  * [1] - Strips - variables (pots/faders)
121                  * [2] - Strips - Send SSID as path extension
122                  * [3] - Send heart beat to surface
123                  * [4] - Send feedback for master/global buttons/variables
124                  * [5] - Send Bar and Beat
125                  * [6] - Send Time code
126                  * [7] - Send metering as dB or positional depending on gainmode
127                  * [8] - Send metering as 16 bits (led strip)
128                  * [9] - Send signal present (signal greater than -20dB)
129                  * [10] - Send Playhead position as samples
130                  * [11] - Send Playhead position as minutes seconds
131                  * [12] - Send Playhead position like primary/secondary GUI clocks
132                  */
133
134
135 // storage for  each surface's settings
136         typedef std::vector<OSCSurface> Surface;
137         Surface _surface;
138
139         std::string get_server_url ();
140         void set_debug_mode (OSCDebugMode m) { _debugmode = m; }
141         OSCDebugMode get_debug_mode () { return _debugmode; }
142
143   protected:
144         void thread_init ();
145         void do_request (OSCUIRequest*);
146
147         GSource* local_server;
148         GSource* remote_server;
149
150         bool osc_input_handler (Glib::IOCondition, lo_server);
151
152   private:
153         uint32_t _port;
154         volatile bool _ok;
155         volatile bool _shutdown;
156         lo_server _osc_server;
157         lo_server _osc_unix_server;
158         std::string _osc_unix_socket_path;
159         std::string _osc_url_file;
160         bool _send_route_changes;
161         OSCDebugMode _debugmode;
162         bool tick;
163         bool bank_dirty;
164         bool global_init;
165         boost::shared_ptr<ARDOUR::Stripable> _select;   // which stripable out of /surface/stripables is gui selected
166
167         void register_callbacks ();
168
169         void route_added (ARDOUR::RouteList&);
170
171         // Handlers for "Application Hook" signals
172         void session_loaded (ARDOUR::Session&);
173         void session_exported (std::string, std::string);
174
175         // end "Application Hook" handles
176
177         std::string get_unix_server_url ();
178         OSCSurface * get_surface (lo_address addr);
179         uint32_t get_sid (boost::shared_ptr<ARDOUR::Stripable> strip, lo_address addr);
180         boost::shared_ptr<ARDOUR::Stripable> get_strip (uint32_t ssid, lo_address addr);
181         void global_feedback (std::bitset<32> feedback, lo_address addr, uint32_t gainmode);
182
183         void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg);
184         void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg);
185
186         int current_value (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
187
188         int catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data);
189         static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
190
191         void routes_list (lo_message msg);
192         void transport_frame (lo_message msg);
193         void transport_speed (lo_message msg);
194         void record_enabled (lo_message msg);
195
196 #define OSC_DEBUG \
197         if (_debugmode == All) { \
198                 debugmsg (dgettext(PACKAGE, "OSC"), path, types, argv, argc); \
199         }
200
201 #define PATH_CALLBACK_MSG(name)                                 \
202         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
203                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
204         } \
205         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
206                 OSC_DEBUG;              \
207                 if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
208                 name (data);            \
209                 return 0;               \
210         }
211
212         PATH_CALLBACK_MSG(routes_list);
213         PATH_CALLBACK_MSG(transport_frame);
214         PATH_CALLBACK_MSG(transport_speed);
215         PATH_CALLBACK_MSG(record_enabled);
216         PATH_CALLBACK_MSG(bank_up);
217         PATH_CALLBACK_MSG(bank_down);
218
219 #define PATH_CALLBACK(name) \
220         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
221                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
222         } \
223         int cb_ ## name (const char *path, const char *types, lo_arg ** argv, int argc, void *) { \
224                 OSC_DEBUG;              \
225                 if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
226                 name (); \
227                 return 0; \
228         }
229
230         PATH_CALLBACK(add_marker);
231         PATH_CALLBACK(loop_toggle);
232         PATH_CALLBACK(goto_start);
233         PATH_CALLBACK(goto_end);
234         PATH_CALLBACK(rewind);
235         PATH_CALLBACK(ffwd);
236         PATH_CALLBACK(transport_stop);
237         PATH_CALLBACK(transport_play);
238         PATH_CALLBACK(save_state);
239         PATH_CALLBACK(prev_marker);
240         PATH_CALLBACK(next_marker);
241         PATH_CALLBACK(undo);
242         PATH_CALLBACK(redo);
243         PATH_CALLBACK(toggle_punch_in);
244         PATH_CALLBACK(toggle_punch_out);
245         PATH_CALLBACK(rec_enable_toggle);
246         PATH_CALLBACK(toggle_all_rec_enables);
247         PATH_CALLBACK(all_tracks_rec_in);
248         PATH_CALLBACK(all_tracks_rec_out);
249         PATH_CALLBACK(cancel_all_solos);
250         PATH_CALLBACK(remove_marker_at_playhead);
251         PATH_CALLBACK(mark_in);
252         PATH_CALLBACK(mark_out);
253         PATH_CALLBACK(toggle_click);
254         PATH_CALLBACK(midi_panic);
255         PATH_CALLBACK(toggle_roll);
256         PATH_CALLBACK(stop_forget);
257         PATH_CALLBACK(set_punch_range);
258         PATH_CALLBACK(set_loop_range);
259         PATH_CALLBACK(set_session_range);
260         PATH_CALLBACK(toggle_monitor_mute);
261         PATH_CALLBACK(toggle_monitor_dim);
262         PATH_CALLBACK(toggle_monitor_mono);
263         PATH_CALLBACK(quick_snapshot_stay);
264         PATH_CALLBACK(quick_snapshot_switch);
265         PATH_CALLBACK(fit_1_track);
266         PATH_CALLBACK(fit_2_tracks);
267         PATH_CALLBACK(fit_4_tracks);
268         PATH_CALLBACK(fit_8_tracks);
269         PATH_CALLBACK(fit_16_tracks);
270         PATH_CALLBACK(fit_32_tracks);
271         PATH_CALLBACK(fit_all_tracks);
272         PATH_CALLBACK(zoom_100_ms);
273         PATH_CALLBACK(zoom_1_sec);
274         PATH_CALLBACK(zoom_10_sec);
275         PATH_CALLBACK(zoom_1_min);
276         PATH_CALLBACK(zoom_5_min);
277         PATH_CALLBACK(zoom_10_min);
278         PATH_CALLBACK(zoom_to_session);
279         PATH_CALLBACK(temporal_zoom_in);
280         PATH_CALLBACK(temporal_zoom_out);
281         PATH_CALLBACK(scroll_up_1_track);
282         PATH_CALLBACK(scroll_dn_1_track);
283         PATH_CALLBACK(scroll_up_1_page);
284         PATH_CALLBACK(scroll_dn_1_page);
285
286 #define PATH_CALLBACK1(name,type,optional)                                      \
287         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
288                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
289         } \
290         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *) { \
291                 OSC_DEBUG;              \
292                 if (argc > 0) {                                         \
293                         name (optional argv[0]->type);          \
294                 }                                                       \
295                 return 0;                                               \
296         }
297
298         PATH_CALLBACK1(set_transport_speed,f,);
299         PATH_CALLBACK1(access_action,s,&);
300
301         PATH_CALLBACK1(jump_by_bars,f,);
302         PATH_CALLBACK1(jump_by_seconds,f,);
303         PATH_CALLBACK1(master_set_gain,f,);
304         PATH_CALLBACK1(master_set_fader,i,);
305         PATH_CALLBACK1(master_set_trim,f,);
306         PATH_CALLBACK1(master_set_mute,i,);
307         PATH_CALLBACK1(monitor_set_gain,f,);
308         PATH_CALLBACK1(monitor_set_fader,i,);
309
310 #define PATH_CALLBACK1_MSG(name,arg1type)                       \
311         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
312                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
313         } \
314         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
315                 OSC_DEBUG;              \
316                 if (argc > 0) {                                         \
317                         name (argv[0]->arg1type, data); \
318                 }                                                       \
319                 return 0;                                               \
320         }
321
322         // pan position needs message info to send feedback
323         PATH_CALLBACK1_MSG(master_set_pan_stereo_position,f);
324
325         PATH_CALLBACK1_MSG(set_surface_bank_size,i);
326         PATH_CALLBACK1_MSG(set_surface_strip_types,i);
327         PATH_CALLBACK1_MSG(set_surface_feedback,i);
328         PATH_CALLBACK1_MSG(set_surface_gainmode,i);
329         PATH_CALLBACK1_MSG(sel_recenable,i);
330         PATH_CALLBACK1_MSG(sel_recsafe,i);
331         PATH_CALLBACK1_MSG(sel_mute,i);
332         PATH_CALLBACK1_MSG(sel_solo,i);
333         PATH_CALLBACK1_MSG(sel_solo_iso,i);
334         PATH_CALLBACK1_MSG(sel_solo_safe,i);
335         PATH_CALLBACK1_MSG(sel_monitor_input,i);
336         PATH_CALLBACK1_MSG(sel_monitor_disk,i);
337         PATH_CALLBACK1_MSG(sel_phase,i);
338         PATH_CALLBACK1_MSG(sel_gain,f);
339         PATH_CALLBACK1_MSG(sel_fader,f);
340         PATH_CALLBACK1_MSG(sel_trim,f);
341         PATH_CALLBACK1_MSG(sel_pan_position,f);
342         PATH_CALLBACK1_MSG(sel_pan_width,f);
343         PATH_CALLBACK1_MSG(sel_pan_elevation,f);
344         PATH_CALLBACK1_MSG(sel_pan_frontback,f);
345         PATH_CALLBACK1_MSG(sel_pan_lfe,f);
346         PATH_CALLBACK1_MSG(sel_comp_enable,f);
347         PATH_CALLBACK1_MSG(sel_comp_threshold,f);
348         PATH_CALLBACK1_MSG(sel_comp_speed,f);
349         PATH_CALLBACK1_MSG(sel_comp_mode,f);
350         PATH_CALLBACK1_MSG(sel_comp_makeup,f);
351         PATH_CALLBACK1_MSG(sel_eq_enable,f);
352         PATH_CALLBACK1_MSG(sel_eq_hpf,f);
353         PATH_CALLBACK1_MSG(sel_expand,i);
354
355 #define PATH_CALLBACK2(name,arg1type,arg2type)                  \
356         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
357                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
358         } \
359         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *) { \
360                 OSC_DEBUG;              \
361                 if (argc > 1) {                                         \
362                         name (argv[0]->arg1type, argv[1]->arg2type); \
363                 }                                                       \
364                 return 0;                                               \
365         }
366
367 #define PATH_CALLBACK2_MSG(name,arg1type,arg2type)                      \
368         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
369                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
370         } \
371         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
372                 OSC_DEBUG;              \
373                 if (argc > 1) {                                         \
374                         name (argv[0]->arg1type, argv[1]->arg2type, data); \
375                 }                                                       \
376                 return 0;                                               \
377         }
378
379 #define PATH_CALLBACK3(name,arg1type,arg2type,arg3type)                \
380         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
381                return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
382         } \
383         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
384                 OSC_DEBUG;              \
385                 if (argc > 1) {                                                \
386                  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type, data); \
387                 }                                                      \
388                return 0;                                               \
389        }
390
391 #define PATH_CALLBACK4(name,arg1type,arg2type,arg3type,arg4type)               \
392         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
393                return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
394         } \
395         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
396                 OSC_DEBUG;              \
397                 if (argc > 1) {                                                \
398                  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type,argv[3]->arg4type, data); \
399                 }                                                      \
400                return 0;                                               \
401        }
402
403         PATH_CALLBACK2_MSG(sel_sendgain,i,f);
404         PATH_CALLBACK2_MSG(sel_sendfader,i,f);
405         PATH_CALLBACK2_MSG(sel_sendenable,i,f);
406         PATH_CALLBACK2_MSG(sel_eq_gain,i,f);
407         PATH_CALLBACK2_MSG(sel_eq_freq,i,f);
408         PATH_CALLBACK2_MSG(sel_eq_q,i,f);
409         PATH_CALLBACK2_MSG(sel_eq_shape,i,f);
410
411         PATH_CALLBACK4(set_surface,i,i,i,i);
412         PATH_CALLBACK2(locate,i,i);
413         PATH_CALLBACK2(loop_location,i,i);
414         PATH_CALLBACK2_MSG(route_mute,i,i);
415         PATH_CALLBACK2_MSG(route_solo,i,i);
416         PATH_CALLBACK2_MSG(route_solo_iso,i,i);
417         PATH_CALLBACK2_MSG(route_solo_safe,i,i);
418         PATH_CALLBACK2_MSG(route_recenable,i,i);
419         PATH_CALLBACK2_MSG(route_recsafe,i,i);
420         PATH_CALLBACK2_MSG(route_monitor_input,i,i);
421         PATH_CALLBACK2_MSG(route_monitor_disk,i,i);
422         PATH_CALLBACK2_MSG(strip_phase,i,i);
423         PATH_CALLBACK2_MSG(strip_expand,i,i);
424         PATH_CALLBACK2_MSG(strip_gui_select,i,i);
425         PATH_CALLBACK2_MSG(route_set_gain_abs,i,f);
426         PATH_CALLBACK2_MSG(route_set_gain_dB,i,f);
427         PATH_CALLBACK2_MSG(route_set_gain_fader,i,f);
428         PATH_CALLBACK2_MSG(route_set_trim_dB,i,f);
429         PATH_CALLBACK2_MSG(route_set_pan_stereo_position,i,f);
430         PATH_CALLBACK2_MSG(route_set_pan_stereo_width,i,f);
431         PATH_CALLBACK3(route_set_send_gain_abs,i,i,f);
432         PATH_CALLBACK3(route_set_send_gain_dB,i,i,f);
433         PATH_CALLBACK3(route_set_send_fader,i,i,f);
434         PATH_CALLBACK3(route_set_send_enable,i,i,f);
435         PATH_CALLBACK4(route_plugin_parameter,i,i,i,f);
436         PATH_CALLBACK3(route_plugin_parameter_print,i,i,i);
437
438         int route_mute (int rid, int yn, lo_message msg);
439         int route_solo (int rid, int yn, lo_message msg);
440         int route_solo_iso (int rid, int yn, lo_message msg);
441         int route_solo_safe (int rid, int yn, lo_message msg);
442         int route_recenable (int rid, int yn, lo_message msg);
443         int route_recsafe (int ssid, int yn, lo_message msg);
444         int route_monitor_input (int rid, int yn, lo_message msg);
445         int route_monitor_disk (int rid, int yn, lo_message msg);
446         int strip_phase (int rid, int yn, lo_message msg);
447         int strip_expand (int rid, int yn, lo_message msg);
448         int _strip_select (boost::shared_ptr<ARDOUR::Stripable> s, lo_address addr);
449         int strip_gui_select (int rid, int yn, lo_message msg);
450         int route_set_gain_abs (int rid, float level, lo_message msg);
451         int route_set_gain_dB (int rid, float dB, lo_message msg);
452         int route_set_gain_fader (int rid, float pos, lo_message msg);
453         int route_set_trim_abs (int rid, float level, lo_message msg);
454         int route_set_trim_dB (int rid, float dB, lo_message msg);
455         int route_set_pan_stereo_position (int rid, float left_right_fraction, lo_message msg);
456         int route_set_pan_stereo_width (int rid, float percent, lo_message msg);
457         int route_set_send_gain_abs (int rid, int sid, float val, lo_message msg);
458         int route_set_send_gain_dB (int rid, int sid, float val, lo_message msg);
459         int route_set_send_fader (int rid, int sid, float val, lo_message msg);
460         int route_set_send_enable (int rid, int sid, float val, lo_message msg);
461         int route_plugin_parameter (int rid, int piid,int par, float val, lo_message msg);
462         int route_plugin_parameter_print (int rid, int piid,int par, lo_message msg);
463
464         //banking functions
465         int set_bank (uint32_t bank_start, lo_message msg);
466         int _set_bank (uint32_t bank_start, lo_address addr);
467         int bank_up (lo_message msg);
468         int bank_down (lo_message msg);
469         int set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gmode, lo_message msg);
470         int set_surface_bank_size (uint32_t bs, lo_message msg);
471         int set_surface_strip_types (uint32_t st, lo_message msg);
472         int set_surface_feedback (uint32_t fb, lo_message msg);
473         int set_surface_gainmode (uint32_t gm, lo_message msg);
474
475         int master_set_gain (float dB);
476         int master_set_fader (uint32_t position);
477         int master_set_trim (float dB);
478         int master_set_pan_stereo_position (float position, lo_message msg);
479         int master_set_mute (uint32_t state);
480         int monitor_set_gain (float dB);
481         int monitor_set_fader (uint32_t position);
482         int sel_recenable (uint32_t state, lo_message msg);
483         int sel_recsafe (uint32_t state, lo_message msg);
484         int sel_mute (uint32_t state, lo_message msg);
485         int sel_solo (uint32_t state, lo_message msg);
486         int sel_solo_iso (uint32_t state, lo_message msg);
487         int sel_solo_safe (uint32_t state, lo_message msg);
488         int sel_monitor_input (uint32_t state, lo_message msg);
489         int sel_monitor_disk (uint32_t state, lo_message msg);
490         int sel_phase (uint32_t state, lo_message msg);
491         int sel_gain (float state, lo_message msg);
492         int sel_fader (float state, lo_message msg);
493         int sel_trim (float val, lo_message msg);
494         int sel_pan_position (float val, lo_message msg);
495         int sel_pan_width (float val, lo_message msg);
496         int sel_sendgain (int id, float dB, lo_message msg);
497         int sel_sendfader (int id, float pos, lo_message msg);
498         int sel_sendenable (int id, float pos, lo_message msg);
499         int sel_expand (uint32_t state, lo_message msg);
500         int sel_pan_elevation (float val, lo_message msg);
501         int sel_pan_frontback (float val, lo_message msg);
502         int sel_pan_lfe (float val, lo_message msg);
503         int sel_comp_enable (float val, lo_message msg);
504         int sel_comp_threshold (float val, lo_message msg);
505         int sel_comp_speed (float val, lo_message msg);
506         int sel_comp_mode (float val, lo_message msg);
507         int sel_comp_makeup (float val, lo_message msg);
508         int sel_eq_enable (float val, lo_message msg);
509         int sel_eq_hpf (float val, lo_message msg);
510         int sel_eq_gain (int id, float val, lo_message msg);
511         int sel_eq_freq (int id, float val, lo_message msg);
512         int sel_eq_q (int id, float val, lo_message msg);
513         int sel_eq_shape (int id, float val, lo_message msg);
514
515         void listen_to_route (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
516         void end_listen (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
517         void drop_route (boost::weak_ptr<ARDOUR::Stripable>);
518         void route_lost (boost::weak_ptr<ARDOUR::Stripable>);
519         void gui_selection_changed (void);
520
521         void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr);
522         void recalcbanks ();
523         void _recalcbanks ();
524         void notify_routes_added (ARDOUR::RouteList &);
525         void notify_vca_added (ARDOUR::VCAList &);
526
527         void update_clock ();
528         int cancel_all_solos ();
529         bool periodic (void);
530         sigc::connection periodic_connection;
531         PBD::ScopedConnectionList session_connections;
532
533         int route_send_fail (std::string path, uint32_t ssid, float val, lo_address addr);
534         int sel_send_fail (std::string path, uint32_t id, float val, lo_address addr);
535         int sel_fail (std::string path, float val, lo_address addr);
536
537         typedef std::list<OSCRouteObserver*> RouteObservers;
538
539         RouteObservers route_observers;
540
541         typedef std::list<OSCGlobalObserver*> GlobalObservers;
542         GlobalObservers global_observers;
543
544         void debugmsg (const char *prefix, const char *path, const char* types, lo_arg **argv, int argc);
545
546         static OSC* _instance;
547
548         mutable void *gui;
549         void build_gui ();
550 };
551
552 } // namespace
553
554 #endif // ardour_osc_h