2 Copyright (C) 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., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "boost/lambda/lambda.hpp"
23 #include "ardour/session.h"
24 #include "ardour/track.h"
25 #include "ardour/monitor_control.h"
26 #include "ardour/dB.h"
27 #include "ardour/meter.h"
28 #include "ardour/phase_control.h"
29 #include "ardour/solo_isolate_control.h"
30 #include "ardour/solo_safe_control.h"
31 #include "ardour/route.h"
32 #include "ardour/send.h"
33 #include "ardour/processor.h"
36 #include "osc_select_observer.h"
44 using namespace ARDOUR;
45 using namespace ArdourSurface;
47 OSCSelectObserver::OSCSelectObserver (boost::shared_ptr<Stripable> s, lo_address a, uint32_t gm, std::bitset<32> fb)
54 addr = lo_address_new (lo_address_get_hostname(a) , lo_address_get_port(a));
55 as = ARDOUR::AutoState::Off;
57 if (feedback[0]) { // buttons are separate feedback
58 _strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::name_changed, this, boost::lambda::_1), OSC::instance());
59 name_changed (ARDOUR::Properties::name);
61 _strip->mute_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/mute"), _strip->mute_control()), OSC::instance());
62 change_message ("/select/mute", _strip->mute_control());
64 _strip->solo_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/solo"), _strip->solo_control()), OSC::instance());
65 change_message ("/select/solo", _strip->solo_control());
67 if (_strip->solo_isolate_control()) {
68 _strip->solo_isolate_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/solo_iso"), _strip->solo_isolate_control()), OSC::instance());
69 change_message ("/select/solo_iso", _strip->solo_isolate_control());
72 if (_strip->solo_safe_control()) {
73 _strip->solo_safe_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/solo_safe"), _strip->solo_safe_control()), OSC::instance());
74 change_message ("/select/solo_safe", _strip->solo_safe_control());
77 boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (_strip);
79 track->monitoring_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::monitor_status, this, track->monitoring_control()), OSC::instance());
80 monitor_status (track->monitoring_control());
83 boost::shared_ptr<AutomationControl> rec_controllable = _strip->rec_enable_control ();
84 if (rec_controllable) {
85 rec_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/recenable"), _strip->rec_enable_control()), OSC::instance());
86 change_message ("/select/recenable", _strip->rec_enable_control());
89 boost::shared_ptr<AutomationControl> recsafe_controllable = _strip->rec_safe_control ();
90 if (recsafe_controllable) {
91 recsafe_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/record_safe"), _strip->rec_safe_control()), OSC::instance());
92 change_message ("/select/record_safe", _strip->rec_safe_control());
95 boost::shared_ptr<AutomationControl> phase_controllable = _strip->phase_control ();
96 if (phase_controllable) {
97 phase_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/polarity"), _strip->phase_control()), OSC::instance());
98 change_message ("/select/polarity", _strip->phase_control());
103 if (feedback[1]) { // level controls
104 boost::shared_ptr<GainControl> gain_cont = _strip->gain_control();
106 gain_cont->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCSelectObserver::gain_automation, this, X_("/select/fader")), OSC::instance());
107 gain_cont->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::gain_message, this, X_("/select/fader"), gain_cont), OSC::instance());
108 gain_automation ("/select/fader");
110 gain_cont->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCSelectObserver::gain_automation, this, X_("/select/gain")), OSC::instance());
111 gain_cont->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::gain_message, this, X_("/select/gain"), _strip->gain_control()), OSC::instance());
112 gain_automation ("/strip/gain");
115 boost::shared_ptr<Controllable> trim_controllable = boost::dynamic_pointer_cast<Controllable>(_strip->trim_control());
116 if (trim_controllable) {
117 trim_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::trim_message, this, X_("/select/trimdB"), _strip->trim_control()), OSC::instance());
118 trim_message ("/select/trimdB", _strip->trim_control());
121 boost::shared_ptr<Controllable> pan_controllable = boost::dynamic_pointer_cast<Controllable>(_strip->pan_azimuth_control());
122 if (pan_controllable) {
123 pan_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_stereo_position"), _strip->pan_azimuth_control()), OSC::instance());
124 change_message ("/select/pan_stereo_position", _strip->pan_azimuth_control());
127 boost::shared_ptr<Controllable> width_controllable = boost::dynamic_pointer_cast<Controllable>(_strip->pan_width_control());
128 if (width_controllable) {
129 width_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_stereo_width"), _strip->pan_width_control()), OSC::instance());
130 change_message ("/select/pan_stereo_width", _strip->pan_width_control());
134 if (feedback[13]) { // Well known controls
135 // Rest of possible pan controls... Untested because I can't find a way to get them in the GUI :)
136 if (_strip->pan_elevation_control ()) {
137 _strip->pan_elevation_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_elevation_position"), _strip->pan_elevation_control()), OSC::instance());
138 change_message ("/select/pan_elevation_position", _strip->pan_elevation_control());
140 if (_strip->pan_frontback_control ()) {
141 _strip->pan_frontback_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_frontback_position"), _strip->pan_frontback_control()), OSC::instance());
142 change_message ("/select/pan_frontback_position", _strip->pan_frontback_control());
144 if (_strip->pan_lfe_control ()) {
145 _strip->pan_lfe_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_lfe_control"), _strip->pan_lfe_control()), OSC::instance());
146 change_message ("/select/pan_lfe_control", _strip->pan_lfe_control());
150 // detecting processor changes requires cast to route
151 boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route>(_strip);
153 r->processors_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_restart, this, -1), OSC::instance());
159 if (_strip->comp_enable_controllable ()) {
160 _strip->comp_enable_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/comp_enable"), _strip->comp_enable_controllable()), OSC::instance());
161 enable_message ("/select/comp_enable", _strip->comp_enable_controllable());
163 if (_strip->comp_threshold_controllable ()) {
164 _strip->comp_threshold_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_threshold"), _strip->comp_threshold_controllable()), OSC::instance());
165 change_message ("/select/comp_threshold", _strip->comp_threshold_controllable());
167 if (_strip->comp_speed_controllable ()) {
168 _strip->comp_speed_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_speed"), _strip->comp_speed_controllable()), OSC::instance());
169 change_message ("/select/comp_speed", _strip->comp_speed_controllable());
171 if (_strip->comp_mode_controllable ()) {
172 _strip->comp_mode_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::comp_mode, this), OSC::instance());
175 if (_strip->comp_makeup_controllable ()) {
176 _strip->comp_makeup_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_makeup"), _strip->comp_makeup_controllable()), OSC::instance());
177 change_message ("/select/comp_makeup", _strip->comp_makeup_controllable());
185 OSCSelectObserver::~OSCSelectObserver ()
187 strip_connections.drop_connections ();
188 // all strip buttons should be off and faders 0 and etc.
189 if (feedback[0]) { // buttons are separate feedback
190 clear_strip ("/select/expand", 0);
191 text_message ("/select/name", " ");
192 text_message ("/select/comment", " ");
193 clear_strip ("/select/mute", 0);
194 clear_strip ("/select/solo", 0);
195 clear_strip ("/select/recenable", 0);
196 clear_strip ("/select/record_safe", 0);
197 clear_strip ("/select/monitor_input", 0);
198 clear_strip ("/select/monitor_disk", 0);
199 clear_strip ("/select/polarity", 0);
200 clear_strip ("/select/n_inputs", 0);
201 clear_strip ("/select/n_outputs", 0);
203 if (feedback[1]) { // level controls
205 clear_strip ("/select/fader", 0);
207 clear_strip ("/select/gain", -193);
209 clear_strip ("/select/trimdB", 0);
210 clear_strip ("/select/pan_stereo_position", 0.5);
211 clear_strip ("/select/pan_stereo_width", 1);
214 clear_strip ("/select/signal", 0);
218 clear_strip ("/select/meter", 0);
220 clear_strip ("/select/meter", -193);
222 }else if (feedback[8]) {
223 clear_strip ("/select/meter", 0);
225 if (feedback[13]) { // Well known controls
226 clear_strip ("/select/pan_elevation_position", 0);
227 clear_strip ("/select/pan_frontback_position", .5);
228 clear_strip ("/select/pan_lfe_control", 0);
229 clear_strip ("/select/comp_enable", 0);
230 clear_strip ("/select/comp_threshold", 0);
231 clear_strip ("/select/comp_speed", 0);
232 clear_strip ("/select/comp_mode", 0);
233 text_message ("/select/comp_mode_name", " ");
234 text_message ("/select/comp_speed_name", " ");
235 clear_strip ("/select/comp_makeup", 0);
240 lo_address_free (addr);
244 OSCSelectObserver::send_init()
246 // we don't know how many there are, so find out.
250 if (_strip->send_level_controllable (nsends)) {
251 _strip->send_level_controllable(nsends)->Changed.connect (send_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_gain, this, nsends, _strip->send_level_controllable(nsends)), OSC::instance());
252 send_timeout.push_back (0);
253 send_gain (nsends, _strip->send_level_controllable(nsends));
257 if (_strip->send_enable_controllable (nsends)) {
258 _strip->send_enable_controllable(nsends)->Changed.connect (send_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message_with_id, this, X_("/select/send_enable"), nsends + 1, _strip->send_enable_controllable(nsends)), OSC::instance());
259 enable_message_with_id ("/select/send_enable", nsends + 1, _strip->send_enable_controllable(nsends));
262 boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (_strip);
264 // should never get here
265 clear_strip_with_id ("/select/send_enable", nsends + 1, 0);
267 boost::shared_ptr<Send> snd = boost::dynamic_pointer_cast<Send> (r->nth_send(nsends));
269 boost::shared_ptr<Processor> proc = boost::dynamic_pointer_cast<Processor> (snd);
270 proc->ActiveChanged.connect (send_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_enable, this, X_("/select/send_enable"), nsends + 1, proc), OSC::instance());
271 clear_strip_with_id ("/select/send_enable", nsends + 1, proc->enabled());
274 // this should get signalled by the route the send goes to, (TODO)
275 if (!gainmode && sends) { // if the gain control is there, this is too
276 text_with_id ("/select/send_name", nsends + 1, _strip->send_name(nsends));
278 // Send numbers are 0 based, OSC is 1 based so this gets incremented at the end
286 OSCSelectObserver::send_end ()
288 send_connections.drop_connections ();
289 for (uint32_t i = 1; i <= nsends; i++) {
291 clear_strip_with_id ("/select/send_fader", i, 0);
293 clear_strip_with_id ("/select/send_gain", i, -193);
296 clear_strip_with_id ("/select/send_enable", i, 0);
298 text_with_id ("/select/send_name", i, " ");
304 OSCSelectObserver::send_restart(int x)
311 OSCSelectObserver::tick ()
313 if (feedback[7] || feedback[8] || feedback[9]) { // meters enabled
315 if (_strip->peak_meter()) {
316 now_meter = _strip->peak_meter()->meter_level(0, MeterMCP);
320 if (now_meter < -144) now_meter = -193;
321 if (_last_meter != now_meter) {
322 if (feedback[7] || feedback[8]) {
323 string path = "/select/meter";
324 lo_message msg = lo_message_new ();
325 if (gainmode && feedback[7]) {
326 lo_message_add_float (msg, ((now_meter + 94) / 100));
327 lo_send_message (addr, path.c_str(), msg);
328 } else if ((!gainmode) && feedback[7]) {
329 lo_message_add_float (msg, now_meter);
330 lo_send_message (addr, path.c_str(), msg);
331 } else if (feedback[8]) {
332 uint32_t ledlvl = (uint32_t)(((now_meter + 54) / 3.75)-1);
333 uint16_t ledbits = ~(0xfff<<ledlvl);
334 lo_message_add_int32 (msg, ledbits);
335 lo_send_message (addr, path.c_str(), msg);
337 lo_message_free (msg);
340 string path = "/select/signal";
341 lo_message msg = lo_message_new ();
343 if (now_meter < -40) {
348 lo_message_add_float (msg, signal);
349 lo_send_message (addr, path.c_str(), msg);
350 lo_message_free (msg);
353 _last_meter = now_meter;
358 if (gain_timeout == 1) {
359 text_message ("/select/name", _strip->name());
365 for (uint32_t i = 0; i < send_timeout.size(); i++) {
366 if (send_timeout[i]) {
367 if (send_timeout[i] == 1) {
368 text_with_id ("/select/send_name", i + 1, _strip->send_name(i));
375 if (as != ARDOUR::AutoState::Off) {
376 if(_last_gain != _strip->gain_control()->get_value()) {
377 _last_gain = _strip->gain_control()->get_value();
379 gain_message ("/select/fader", _strip->gain_control());
381 gain_message ("/select/fader", _strip->gain_control());
390 OSCSelectObserver::name_changed (const PBD::PropertyChange& what_changed)
392 if (!what_changed.contains (ARDOUR::Properties::name)) {
400 text_message ("/select/name", _strip->name());
401 boost::shared_ptr<Route> route = boost::dynamic_pointer_cast<Route> (_strip);
403 //spit out the comment at the same time
404 text_message ("/select/comment", route->comment());
405 // lets tell the surface how many inputs this strip has
406 clear_strip ("/select/n_inputs", (float) route->n_inputs().n_total());
407 // lets tell the surface how many outputs this strip has
408 clear_strip ("/select/n_outputs", (float) route->n_outputs().n_total());
413 OSCSelectObserver::change_message (string path, boost::shared_ptr<Controllable> controllable)
415 lo_message msg = lo_message_new ();
416 float val = controllable->get_value();
418 lo_message_add_float (msg, (float) controllable->internal_to_interface (val));
420 lo_send_message (addr, path.c_str(), msg);
421 lo_message_free (msg);
425 OSCSelectObserver::enable_message (string path, boost::shared_ptr<Controllable> controllable)
427 float val = controllable->get_value();
429 clear_strip (path, 1);
431 clear_strip (path, 0);
437 OSCSelectObserver::change_message_with_id (string path, uint32_t id, boost::shared_ptr<Controllable> controllable)
439 lo_message msg = lo_message_new ();
440 float val = controllable->get_value();
442 path = set_path (path, id);
444 lo_message_add_int32 (msg, id);
447 lo_message_add_float (msg, (float) controllable->internal_to_interface (val));
449 lo_send_message (addr, path.c_str(), msg);
450 lo_message_free (msg);
454 OSCSelectObserver::enable_message_with_id (string path, uint32_t id, boost::shared_ptr<Controllable> controllable)
456 float val = controllable->get_value();
458 clear_strip_with_id (path, id, 1);
460 clear_strip_with_id (path, id, 0);
465 OSCSelectObserver::text_message (string path, std::string text)
467 lo_message msg = lo_message_new ();
469 lo_message_add_string (msg, text.c_str());
471 lo_send_message (addr, path.c_str(), msg);
472 lo_message_free (msg);
476 OSCSelectObserver::monitor_status (boost::shared_ptr<Controllable> controllable)
479 float val = controllable->get_value();
494 clear_strip ("/select/monitor_input", (float) input);
495 clear_strip ("/select/monitor_disk", (float) disk);
499 OSCSelectObserver::trim_message (string path, boost::shared_ptr<Controllable> controllable)
501 lo_message msg = lo_message_new ();
503 lo_message_add_float (msg, (float) accurate_coefficient_to_dB (controllable->get_value()));
505 lo_send_message (addr, path.c_str(), msg);
506 lo_message_free (msg);
510 OSCSelectObserver::gain_message (string path, boost::shared_ptr<Controllable> controllable)
512 lo_message msg = lo_message_new ();
515 lo_message_add_float (msg, gain_to_slider_position (controllable->get_value()));
516 text_message ("/select/name", string_compose ("%1%2%3", std::fixed, std::setprecision(2), accurate_coefficient_to_dB (controllable->get_value())));
519 if (controllable->get_value() < 1e-15) {
520 lo_message_add_float (msg, -200);
522 lo_message_add_float (msg, accurate_coefficient_to_dB (controllable->get_value()));
526 lo_send_message (addr, path.c_str(), msg);
527 lo_message_free (msg);
531 OSCSelectObserver::gain_automation (string path)
533 lo_message msg = lo_message_new ();
534 string apath = string_compose ("%1/automation", path);
536 boost::shared_ptr<GainControl> control = _strip->gain_control();
537 as = control->alist()->automation_state();
538 lo_message_add_float (msg, as);
539 gain_message (path, control);
540 lo_send_message (addr, apath.c_str(), msg);
541 lo_message_free (msg);
545 OSCSelectObserver::send_gain (uint32_t id, boost::shared_ptr<PBD::Controllable> controllable)
547 lo_message msg = lo_message_new ();
552 db = controllable->get_value();
554 if (controllable->get_value() < 1e-15) {
557 db = accurate_coefficient_to_dB (controllable->get_value());
562 path = "/select/send_fader";
564 value = controllable->internal_to_interface (controllable->get_value());
566 value = gain_to_slider_position (controllable->get_value());
568 text_with_id ("/select/send_name" , id + 1, string_compose ("%1%2%3", std::fixed, std::setprecision(2), db));
569 if (send_timeout.size() > id) {
570 send_timeout[id] = 8;
573 path = "/select/send_gain";
578 path = set_path (path, id + 1);
580 lo_message_add_int32 (msg, id + 1);
583 lo_message_add_float (msg, value);
584 lo_send_message (addr, path.c_str(), msg);
585 lo_message_free (msg);
589 OSCSelectObserver::send_enable (string path, uint32_t id, boost::shared_ptr<Processor> proc)
591 // with no delay value is wrong
594 clear_strip_with_id ("/select/send_enable", id, proc->enabled());
598 OSCSelectObserver::text_with_id (string path, uint32_t id, string name)
600 lo_message msg = lo_message_new ();
602 path = set_path (path, id);
604 lo_message_add_int32 (msg, id);
607 lo_message_add_string (msg, name.c_str());
609 lo_send_message (addr, path.c_str(), msg);
610 lo_message_free (msg);
614 OSCSelectObserver::comp_mode ()
616 change_message ("/select/comp_mode", _strip->comp_mode_controllable());
617 text_message ("/select/comp_mode_name", _strip->comp_mode_name(_strip->comp_mode_controllable()->get_value()));
618 text_message ("/select/comp_speed_name", _strip->comp_speed_name(_strip->comp_mode_controllable()->get_value()));
622 OSCSelectObserver::eq_init()
624 // HPF and enable are special case, rest are in bands
625 if (_strip->eq_hpf_controllable ()) {
626 _strip->eq_hpf_controllable ()->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf"), _strip->eq_hpf_controllable()), OSC::instance());
627 change_message ("/select/eq_hpf", _strip->eq_hpf_controllable());
629 if (_strip->eq_enable_controllable ()) {
630 _strip->eq_enable_controllable ()->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/eq_enable"), _strip->eq_enable_controllable()), OSC::instance());
631 enable_message ("/select/eq_enable", _strip->eq_enable_controllable());
634 uint32_t eq_bands = _strip->eq_band_cnt ();
639 for (uint32_t i = 0; i < eq_bands; i++) {
640 if (_strip->eq_band_name(i).size()) {
641 text_with_id ("/select/eq_band_name", i + 1, _strip->eq_band_name (i));
643 if (_strip->eq_gain_controllable (i)) {
644 _strip->eq_gain_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_gain"), i + 1, _strip->eq_gain_controllable(i)), OSC::instance());
645 change_message_with_id ("/select/eq_gain", i + 1, _strip->eq_gain_controllable(i));
647 if (_strip->eq_freq_controllable (i)) {
648 _strip->eq_freq_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_freq"), i + 1, _strip->eq_freq_controllable(i)), OSC::instance());
649 change_message_with_id ("/select/eq_freq", i + 1, _strip->eq_freq_controllable(i));
651 if (_strip->eq_q_controllable (i)) {
652 _strip->eq_q_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_q"), i + 1, _strip->eq_q_controllable(i)), OSC::instance());
653 change_message_with_id ("/select/eq_q", i + 1, _strip->eq_q_controllable(i));
655 if (_strip->eq_shape_controllable (i)) {
656 _strip->eq_shape_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_shape"), i + 1, _strip->eq_shape_controllable(i)), OSC::instance());
657 change_message_with_id ("/select/eq_shape", i + 1, _strip->eq_shape_controllable(i));
663 OSCSelectObserver::eq_end ()
665 //need to check feedback for [13]
666 eq_connections.drop_connections ();
667 if (_strip->eq_hpf_controllable ()) {
668 clear_strip ("/select/eq_hpf", 0);
670 if (_strip->eq_enable_controllable ()) {
671 clear_strip ("/select/eq_enable", 0);
674 for (uint32_t i = 1; i <= _strip->eq_band_cnt (); i++) {
675 text_with_id ("/select/eq_band_name", i, " ");
676 clear_strip_with_id ("/select/eq_gain", i, 0);
677 clear_strip_with_id ("/select/eq_freq", i, 0);
678 clear_strip_with_id ("/select/eq_q", i, 0);
679 clear_strip_with_id ("/select/eq_shape", i, 0);
686 OSCSelectObserver::eq_restart(int x)
693 OSCSelectObserver::set_path (string path, uint32_t id)
696 path = string_compose ("%1/%2", path, id);
702 OSCSelectObserver::clear_strip (string path, float val)
704 lo_message msg = lo_message_new ();
705 lo_message_add_float (msg, val);
707 lo_send_message (addr, path.c_str(), msg);
708 lo_message_free (msg);
713 OSCSelectObserver::clear_strip_with_id (string path, uint32_t id, float val)
715 lo_message msg = lo_message_new ();
717 path = set_path (path, id);
719 lo_message_add_int32 (msg, id);
722 lo_message_add_float (msg, val);
724 lo_send_message (addr, path.c_str(), msg);
725 lo_message_free (msg);