OSC: Added EQ control, use interface_to_internal to normalize control range
[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 "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         boost::shared_ptr<ARDOUR::Stripable> _select;   // which stripable out of /surface/stripables is gui selected
165
166         void register_callbacks ();
167
168         void route_added (ARDOUR::RouteList&);
169
170         // Handlers for "Application Hook" signals
171         void session_loaded (ARDOUR::Session&);
172         void session_exported (std::string, std::string);
173
174         // end "Application Hook" handles
175
176         std::string get_unix_server_url ();
177         OSCSurface * get_surface (lo_address addr);
178         uint32_t get_sid (boost::shared_ptr<ARDOUR::Stripable> strip, lo_address addr);
179         boost::shared_ptr<ARDOUR::Stripable> get_strip (uint32_t ssid, lo_address addr);
180         void global_feedback (std::bitset<32> feedback, lo_address msg, uint32_t gainmode);
181
182         void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg);
183         void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg);
184
185         int current_value (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
186
187         int catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data);
188         static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
189
190         void routes_list (lo_message msg);
191         void transport_frame (lo_message msg);
192         void transport_speed (lo_message msg);
193         void record_enabled (lo_message msg);
194
195 #define OSC_DEBUG \
196         if (_debugmode == All) { \
197                 debugmsg (dgettext(PACKAGE, "OSC"), path, types, argv, argc); \
198         }
199
200 #define PATH_CALLBACK_MSG(name)                                 \
201         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
202                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
203         } \
204         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
205                 OSC_DEBUG;              \
206                 if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
207                 name (data);            \
208                 return 0;               \
209         }
210
211         PATH_CALLBACK_MSG(routes_list);
212         PATH_CALLBACK_MSG(transport_frame);
213         PATH_CALLBACK_MSG(transport_speed);
214         PATH_CALLBACK_MSG(record_enabled);
215         PATH_CALLBACK_MSG(bank_up);
216         PATH_CALLBACK_MSG(bank_down);
217
218 #define PATH_CALLBACK(name) \
219         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
220                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
221         } \
222         int cb_ ## name (const char *path, const char *types, lo_arg ** argv, int argc, void *) { \
223                 OSC_DEBUG;              \
224                 if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
225                 name (); \
226                 return 0; \
227         }
228
229         PATH_CALLBACK(add_marker);
230         PATH_CALLBACK(loop_toggle);
231         PATH_CALLBACK(goto_start);
232         PATH_CALLBACK(goto_end);
233         PATH_CALLBACK(rewind);
234         PATH_CALLBACK(ffwd);
235         PATH_CALLBACK(transport_stop);
236         PATH_CALLBACK(transport_play);
237         PATH_CALLBACK(save_state);
238         PATH_CALLBACK(prev_marker);
239         PATH_CALLBACK(next_marker);
240         PATH_CALLBACK(undo);
241         PATH_CALLBACK(redo);
242         PATH_CALLBACK(toggle_punch_in);
243         PATH_CALLBACK(toggle_punch_out);
244         PATH_CALLBACK(rec_enable_toggle);
245         PATH_CALLBACK(toggle_all_rec_enables);
246         PATH_CALLBACK(all_tracks_rec_in);
247         PATH_CALLBACK(all_tracks_rec_out);
248         PATH_CALLBACK(remove_marker_at_playhead);
249         PATH_CALLBACK(mark_in);
250         PATH_CALLBACK(mark_out);
251         PATH_CALLBACK(toggle_click);
252         PATH_CALLBACK(midi_panic);
253         PATH_CALLBACK(toggle_roll);
254         PATH_CALLBACK(stop_forget);
255         PATH_CALLBACK(set_punch_range);
256         PATH_CALLBACK(set_loop_range);
257         PATH_CALLBACK(set_session_range);
258         PATH_CALLBACK(toggle_monitor_mute);
259         PATH_CALLBACK(toggle_monitor_dim);
260         PATH_CALLBACK(toggle_monitor_mono);
261         PATH_CALLBACK(quick_snapshot_stay);
262         PATH_CALLBACK(quick_snapshot_switch);
263         PATH_CALLBACK(fit_1_track);
264         PATH_CALLBACK(fit_2_tracks);
265         PATH_CALLBACK(fit_4_tracks);
266         PATH_CALLBACK(fit_8_tracks);
267         PATH_CALLBACK(fit_16_tracks);
268         PATH_CALLBACK(fit_32_tracks);
269         PATH_CALLBACK(fit_all_tracks);
270         PATH_CALLBACK(zoom_100_ms);
271         PATH_CALLBACK(zoom_1_sec);
272         PATH_CALLBACK(zoom_10_sec);
273         PATH_CALLBACK(zoom_1_min);
274         PATH_CALLBACK(zoom_5_min);
275         PATH_CALLBACK(zoom_10_min);
276         PATH_CALLBACK(zoom_to_session);
277         PATH_CALLBACK(temporal_zoom_in);
278         PATH_CALLBACK(temporal_zoom_out);
279         PATH_CALLBACK(scroll_up_1_track);
280         PATH_CALLBACK(scroll_dn_1_track);
281         PATH_CALLBACK(scroll_up_1_page);
282         PATH_CALLBACK(scroll_dn_1_page);
283
284 #define PATH_CALLBACK1(name,type,optional)                                      \
285         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
286                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
287         } \
288         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *) { \
289                 OSC_DEBUG;              \
290                 if (argc > 0) {                                         \
291                         name (optional argv[0]->type);          \
292                 }                                                       \
293                 return 0;                                               \
294         }
295
296         PATH_CALLBACK1(set_transport_speed,f,);
297         PATH_CALLBACK1(access_action,s,&);
298
299         PATH_CALLBACK1(jump_by_bars,f,);
300         PATH_CALLBACK1(jump_by_seconds,f,);
301         PATH_CALLBACK1(master_set_gain,f,);
302         PATH_CALLBACK1(master_set_fader,i,);
303         PATH_CALLBACK1(master_set_trim,f,);
304         PATH_CALLBACK1(master_set_mute,i,);
305         PATH_CALLBACK1(monitor_set_gain,f,);
306         PATH_CALLBACK1(monitor_set_fader,i,);
307
308 #define PATH_CALLBACK1_MSG(name,arg1type)                       \
309         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
310                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
311         } \
312         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
313                 OSC_DEBUG;              \
314                 if (argc > 0) {                                         \
315                         name (argv[0]->arg1type, data); \
316                 }                                                       \
317                 return 0;                                               \
318         }
319
320         // pan position needs message info to send feedback
321         PATH_CALLBACK1_MSG(master_set_pan_stereo_position,f);
322
323         PATH_CALLBACK1_MSG(set_surface_bank_size,i);
324         PATH_CALLBACK1_MSG(set_surface_strip_types,i);
325         PATH_CALLBACK1_MSG(set_surface_feedback,i);
326         PATH_CALLBACK1_MSG(set_surface_gainmode,i);
327         PATH_CALLBACK1_MSG(sel_recenable,i);
328         PATH_CALLBACK1_MSG(sel_recsafe,i);
329         PATH_CALLBACK1_MSG(sel_mute,i);
330         PATH_CALLBACK1_MSG(sel_solo,i);
331         PATH_CALLBACK1_MSG(sel_solo_iso,i);
332         PATH_CALLBACK1_MSG(sel_solo_safe,i);
333         PATH_CALLBACK1_MSG(sel_monitor_input,i);
334         PATH_CALLBACK1_MSG(sel_monitor_disk,i);
335         PATH_CALLBACK1_MSG(sel_phase,i);
336         PATH_CALLBACK1_MSG(sel_gain,f);
337         PATH_CALLBACK1_MSG(sel_fader,f);
338         PATH_CALLBACK1_MSG(sel_trim,f);
339         PATH_CALLBACK1_MSG(sel_pan_position,f);
340         PATH_CALLBACK1_MSG(sel_pan_width,f);
341         PATH_CALLBACK1_MSG(sel_pan_elevation,f);
342         PATH_CALLBACK1_MSG(sel_pan_frontback,f);
343         PATH_CALLBACK1_MSG(sel_pan_lfe,f);
344         PATH_CALLBACK1_MSG(sel_comp_enable,f);
345         PATH_CALLBACK1_MSG(sel_comp_threshold,f);
346         PATH_CALLBACK1_MSG(sel_comp_speed,f);
347         PATH_CALLBACK1_MSG(sel_comp_mode,f);
348         PATH_CALLBACK1_MSG(sel_comp_makeup,f);
349         PATH_CALLBACK1_MSG(sel_eq_enable,f);
350         PATH_CALLBACK1_MSG(sel_eq_hpf,f);
351         PATH_CALLBACK1_MSG(sel_expand,i);
352
353 #define PATH_CALLBACK2(name,arg1type,arg2type)                  \
354         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
355                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
356         } \
357         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *) { \
358                 OSC_DEBUG;              \
359                 if (argc > 1) {                                         \
360                         name (argv[0]->arg1type, argv[1]->arg2type); \
361                 }                                                       \
362                 return 0;                                               \
363         }
364
365 #define PATH_CALLBACK2_MSG(name,arg1type,arg2type)                      \
366         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
367                 return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
368         } \
369         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
370                 OSC_DEBUG;              \
371                 if (argc > 1) {                                         \
372                         name (argv[0]->arg1type, argv[1]->arg2type, data); \
373                 }                                                       \
374                 return 0;                                               \
375         }
376
377 #define PATH_CALLBACK3(name,arg1type,arg2type,arg3type)                \
378         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
379                return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
380         } \
381         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
382                 OSC_DEBUG;              \
383                 if (argc > 1) {                                                \
384                  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type, data); \
385                 }                                                      \
386                return 0;                                               \
387        }
388
389 #define PATH_CALLBACK4(name,arg1type,arg2type,arg3type,arg4type)               \
390         static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
391                return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
392         } \
393         int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \
394                 OSC_DEBUG;              \
395                 if (argc > 1) {                                                \
396                  name (argv[0]->arg1type, argv[1]->arg2type,argv[2]->arg3type,argv[3]->arg4type, data); \
397                 }                                                      \
398                return 0;                                               \
399        }
400
401         PATH_CALLBACK2_MSG(sel_sendgain,i,f);
402         PATH_CALLBACK2_MSG(sel_sendfader,i,f);
403         PATH_CALLBACK2_MSG(sel_sendenable,i,f);
404         PATH_CALLBACK2_MSG(sel_eq_gain,i,f);
405         PATH_CALLBACK2_MSG(sel_eq_freq,i,f);
406         PATH_CALLBACK2_MSG(sel_eq_q,i,f);
407         PATH_CALLBACK2_MSG(sel_eq_shape,i,f);
408
409         PATH_CALLBACK4(set_surface,i,i,i,i);
410         PATH_CALLBACK2(locate,i,i);
411         PATH_CALLBACK2(loop_location,i,i);
412         PATH_CALLBACK2_MSG(route_mute,i,i);
413         PATH_CALLBACK2_MSG(route_solo,i,i);
414         PATH_CALLBACK2_MSG(route_solo_iso,i,i);
415         PATH_CALLBACK2_MSG(route_solo_safe,i,i);
416         PATH_CALLBACK2_MSG(route_recenable,i,i);
417         PATH_CALLBACK2_MSG(route_recsafe,i,i);
418         PATH_CALLBACK2_MSG(route_monitor_input,i,i);
419         PATH_CALLBACK2_MSG(route_monitor_disk,i,i);
420         PATH_CALLBACK2_MSG(strip_phase,i,i);
421         PATH_CALLBACK2_MSG(strip_expand,i,i);
422         PATH_CALLBACK2_MSG(strip_gui_select,i,i);
423         PATH_CALLBACK2_MSG(route_set_gain_abs,i,f);
424         PATH_CALLBACK2_MSG(route_set_gain_dB,i,f);
425         PATH_CALLBACK2_MSG(route_set_gain_fader,i,f);
426         PATH_CALLBACK2_MSG(route_set_trim_dB,i,f);
427         PATH_CALLBACK2_MSG(route_set_pan_stereo_position,i,f);
428         PATH_CALLBACK2_MSG(route_set_pan_stereo_width,i,f);
429         PATH_CALLBACK3(route_set_send_gain_abs,i,i,f);
430         PATH_CALLBACK3(route_set_send_gain_dB,i,i,f);
431         PATH_CALLBACK3(route_set_send_fader,i,i,f);
432         PATH_CALLBACK3(route_set_send_enable,i,i,f);
433         PATH_CALLBACK4(route_plugin_parameter,i,i,i,f);
434         PATH_CALLBACK3(route_plugin_parameter_print,i,i,i);
435
436         int route_mute (int rid, int yn, lo_message msg);
437         int route_solo (int rid, int yn, lo_message msg);
438         int route_solo_iso (int rid, int yn, lo_message msg);
439         int route_solo_safe (int rid, int yn, lo_message msg);
440         int route_recenable (int rid, int yn, lo_message msg);
441         int route_recsafe (int ssid, int yn, lo_message msg);
442         int route_monitor_input (int rid, int yn, lo_message msg);
443         int route_monitor_disk (int rid, int yn, lo_message msg);
444         int strip_phase (int rid, int yn, lo_message msg);
445         int strip_expand (int rid, int yn, lo_message msg);
446         int _strip_select (boost::shared_ptr<ARDOUR::Stripable> s, lo_address addr);
447         int strip_gui_select (int rid, int yn, lo_message msg);
448         int route_set_gain_abs (int rid, float level, lo_message msg);
449         int route_set_gain_dB (int rid, float dB, lo_message msg);
450         int route_set_gain_fader (int rid, float pos, lo_message msg);
451         int route_set_trim_abs (int rid, float level, lo_message msg);
452         int route_set_trim_dB (int rid, float dB, lo_message msg);
453         int route_set_pan_stereo_position (int rid, float left_right_fraction, lo_message msg);
454         int route_set_pan_stereo_width (int rid, float percent, lo_message msg);
455         int route_set_send_gain_abs (int rid, int sid, float val, lo_message msg);
456         int route_set_send_gain_dB (int rid, int sid, float val, lo_message msg);
457         int route_set_send_fader (int rid, int sid, float val, lo_message msg);
458         int route_set_send_enable (int rid, int sid, float val, lo_message msg);
459         int route_plugin_parameter (int rid, int piid,int par, float val, lo_message msg);
460         int route_plugin_parameter_print (int rid, int piid,int par, lo_message msg);
461
462         //banking functions
463         int set_bank (uint32_t bank_start, lo_message msg);
464         int _set_bank (uint32_t bank_start, lo_address addr);
465         int bank_up (lo_message msg);
466         int bank_down (lo_message msg);
467         int set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gmode, lo_message msg);
468         int set_surface_bank_size (uint32_t bs, lo_message msg);
469         int set_surface_strip_types (uint32_t st, lo_message msg);
470         int set_surface_feedback (uint32_t fb, lo_message msg);
471         int set_surface_gainmode (uint32_t gm, lo_message msg);
472
473         int master_set_gain (float dB);
474         int master_set_fader (uint32_t position);
475         int master_set_trim (float dB);
476         int master_set_pan_stereo_position (float position, lo_message msg);
477         int master_set_mute (uint32_t state);
478         int monitor_set_gain (float dB);
479         int monitor_set_fader (uint32_t position);
480         int sel_recenable (uint32_t state, lo_message msg);
481         int sel_recsafe (uint32_t state, lo_message msg);
482         int sel_mute (uint32_t state, lo_message msg);
483         int sel_solo (uint32_t state, lo_message msg);
484         int sel_solo_iso (uint32_t state, lo_message msg);
485         int sel_solo_safe (uint32_t state, lo_message msg);
486         int sel_monitor_input (uint32_t state, lo_message msg);
487         int sel_monitor_disk (uint32_t state, lo_message msg);
488         int sel_phase (uint32_t state, lo_message msg);
489         int sel_gain (float state, lo_message msg);
490         int sel_fader (float state, lo_message msg);
491         int sel_trim (float val, lo_message msg);
492         int sel_pan_position (float val, lo_message msg);
493         int sel_pan_width (float val, lo_message msg);
494         int sel_sendgain (int id, float dB, lo_message msg);
495         int sel_sendfader (int id, float pos, lo_message msg);
496         int sel_sendenable (int id, float pos, lo_message msg);
497         int sel_expand (uint32_t state, lo_message msg);
498         int sel_pan_elevation (float val, lo_message msg);
499         int sel_pan_frontback (float val, lo_message msg);
500         int sel_pan_lfe (float val, lo_message msg);
501         int sel_comp_enable (float val, lo_message msg);
502         int sel_comp_threshold (float val, lo_message msg);
503         int sel_comp_speed (float val, lo_message msg);
504         int sel_comp_mode (float val, lo_message msg);
505         int sel_comp_makeup (float val, lo_message msg);
506         int sel_eq_enable (float val, lo_message msg);
507         int sel_eq_hpf (float val, lo_message msg);
508         int sel_eq_gain (int id, float val, lo_message msg);
509         int sel_eq_freq (int id, float val, lo_message msg);
510         int sel_eq_q (int id, float val, lo_message msg);
511         int sel_eq_shape (int id, float val, lo_message msg);
512
513         void listen_to_route (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
514         void end_listen (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
515         void drop_route (boost::weak_ptr<ARDOUR::Stripable>);
516         void route_lost (boost::weak_ptr<ARDOUR::Stripable>);
517         void gui_selection_changed (void);
518
519         void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr);
520         void recalcbanks ();
521         void _recalcbanks ();
522         void notify_routes_added (ARDOUR::RouteList &);
523         void notify_vca_added (ARDOUR::VCAList &);
524
525         void update_clock ();
526         bool periodic (void);
527         sigc::connection periodic_connection;
528         PBD::ScopedConnectionList session_connections;
529
530         int route_send_fail (std::string path, uint32_t ssid, float val, lo_address addr);
531         int sel_send_fail (std::string path, uint32_t id, float val, lo_address addr);
532         int sel_fail (std::string path, float val, lo_address addr);
533
534         typedef std::list<OSCRouteObserver*> RouteObservers;
535
536         RouteObservers route_observers;
537
538         typedef std::list<OSCGlobalObserver*> GlobalObservers;
539         GlobalObservers global_observers;
540
541         void debugmsg (const char *prefix, const char *path, const char* types, lo_arg **argv, int argc);
542
543         static OSC* _instance;
544
545         mutable void *gui;
546         void build_gui ();
547 };
548
549 } // namespace
550
551 #endif // ardour_osc_h