2 Copyright (C) 2016 Robin Gareus <robin@gareus.org
3 Copyright (C) 2009-2012 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <gtkmm/box.h>
26 #include <gtkmm/notebook.h>
27 #include <gtkmm/table.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/spinbutton.h>
31 #include <gtkmm/comboboxtext.h>
33 #include "gtkmm2ext/gtk_ui.h"
34 #include "gtkmm2ext/gui_thread.h"
35 #include "gtkmm2ext/utils.h"
41 namespace ArdourSurface {
43 class OSC_GUI : public Gtk::Notebook
51 Gtk::ComboBoxText debug_combo;
52 Gtk::ComboBoxText portmode_combo;
53 Gtk::SpinButton port_entry;
54 Gtk::SpinButton bank_entry;
55 Gtk::SpinButton striptypes_spin;
56 Gtk::SpinButton feedback_spin;
57 Gtk::ComboBoxText gainmode_combo;
58 void debug_changed ();
59 void portmode_changed ();
60 void gainmode_changed ();
64 void strips_changed ();
65 void feedback_changed ();
66 // Strip types calculator
67 void calculate_strip_types ();
68 void push_strip_types ();
69 Gtk::Label current_strip_types;
70 Gtk::CheckButton audio_tracks;
71 Gtk::CheckButton midi_tracks;
72 Gtk::CheckButton audio_buses;
73 Gtk::CheckButton midi_buses;
74 Gtk::CheckButton control_masters;
75 Gtk::CheckButton master_type;
76 Gtk::CheckButton monitor_type;
77 Gtk::CheckButton selected_tracks;
78 Gtk::CheckButton hidden_tracks;
80 // feedback calculator
81 void calculate_feedback ();
82 void push_feedback ();
83 Gtk::Label current_feedback;
84 Gtk::CheckButton strip_buttons_button;
85 Gtk::CheckButton strip_control_button;
86 Gtk::CheckButton ssid_as_path;
87 Gtk::CheckButton heart_beat;
88 Gtk::CheckButton master_fb;
89 Gtk::CheckButton bar_and_beat;
90 Gtk::CheckButton smpte;
91 Gtk::CheckButton meter_float;
92 Gtk::CheckButton meter_led;
93 Gtk::CheckButton signal_present;
94 Gtk::CheckButton hp_samples;
95 Gtk::CheckButton hp_min_sec;
96 Gtk::CheckButton hp_gui;
97 Gtk::CheckButton select_fb;
104 OSC::get_gui () const
107 const_cast<OSC*>(this)->build_gui ();
109 //static_cast<Gtk::VBox*>(gui)->show_all();
110 static_cast<Gtk::Notebook*>(gui)->show_all();
115 OSC::tear_down_gui ()
118 Gtk::Widget *w = static_cast<Gtk::Notebook*>(gui)->get_parent();
124 delete (OSC_GUI*) gui;
131 gui = (void*) new OSC_GUI (*this);
136 ///////////////////////////////////////////////////////////////////////////////
140 using namespace Gtkmm2ext;
141 using namespace ArdourSurface;
143 OSC_GUI::OSC_GUI (OSC& p)
146 int n = 0; // table row
147 uint32_t def_feedback;
149 Table* table = manage (new Table);
154 table->set_row_spacings (10);
155 table->set_col_spacings (6);
156 table->set_border_width (12);
159 label = manage (new Gtk::Label(_("Connection:")));
160 label->set_alignment(1, .5);
161 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
162 label = manage (new Gtk::Label(cp.get_server_url()));
163 table->attach (*label, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
166 // show and set port to auto (default) or manual (one surface only)
167 label = manage (new Gtk::Label(_("Port Mode:")));
168 label->set_alignment(1, .5);
169 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
170 table->attach (portmode_combo, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
171 std::vector<std::string> portmode_options;
172 portmode_options.push_back (_("Auto"));
173 portmode_options.push_back (_("Manual"));
175 set_popdown_strings (portmode_combo, portmode_options);
176 portmode_combo.set_active ((int)cp.get_portmode());
180 label = manage (new Gtk::Label(_("Manual Port:")));
181 label->set_alignment(1, .5);
182 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
183 table->attach (port_entry, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
184 port_entry.set_range(1024, 0xffff);
185 port_entry.set_increments (1, 100);
186 port_entry.set_text(cp.get_remote_port().c_str());
187 if (!cp.get_portmode()) {
188 port_entry.set_sensitive (false);
192 // default banksize setting
193 label = manage (new Gtk::Label(_("Bank Size:")));
194 label->set_alignment(1, .5);
195 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
196 table->attach (bank_entry, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
197 bank_entry.set_range (0, 0xffff);
198 bank_entry.set_increments (1, 8);
199 bank_entry.set_value (cp.get_banksize());
203 // Default strip types
204 label = manage (new Gtk::Label(_("Strip Types:")));
205 label->set_alignment(1, .5);
206 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
207 table->attach (striptypes_spin, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
208 striptypes_spin.set_range (0, 0x3ff);
209 striptypes_spin.set_increments (1, 10);
210 def_strip = cp.get_defaultstrip();
211 striptypes_spin.set_value (def_strip);
215 // default feedback settings
216 label = manage (new Gtk::Label(_("Feedback:")));
217 label->set_alignment(1, .5);
218 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
219 table->attach (feedback_spin, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
220 feedback_spin.set_range (0, 0x3fff);
221 feedback_spin.set_increments (1, 10);
222 def_feedback = cp.get_defaultfeedback();
223 feedback_spin.set_value (def_feedback);
227 label = manage (new Gtk::Label(_("Gain Mode:")));
228 label->set_alignment(1, .5);
229 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
230 table->attach (gainmode_combo, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
231 std::vector<std::string> gainmode_options;
232 gainmode_options.push_back (_("dB"));
233 gainmode_options.push_back (_("Position"));
235 set_popdown_strings (gainmode_combo, gainmode_options);
236 gainmode_combo.set_active ((int)cp.get_gainmode());
240 label = manage (new Gtk::Label(_("Debug:")));
241 label->set_alignment(1, .5);
242 table->attach (*label, 0, 1, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
243 table->attach (debug_combo, 1, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
245 std::vector<std::string> debug_options;
246 debug_options.push_back (_("Off"));
247 debug_options.push_back (_("Log invalid messages"));
248 debug_options.push_back (_("Log all messages"));
250 set_popdown_strings (debug_combo, debug_options);
251 debug_combo.set_active ((int)cp.get_debug_mode());
255 button = manage (new Gtk::Button(_("Clear OSC Devices")));
256 table->attach (*button, 0, 2, n, n+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
259 append_page (*table, _("OSC Setup"));
261 debug_combo.signal_changed().connect (sigc::mem_fun (*this, &OSC_GUI::debug_changed));
262 portmode_combo.signal_changed().connect (sigc::mem_fun (*this, &OSC_GUI::portmode_changed));
263 gainmode_combo.signal_changed().connect (sigc::mem_fun (*this, &OSC_GUI::gainmode_changed));
264 button->signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::clear_device));
265 port_entry.signal_activate().connect (sigc::mem_fun (*this, &OSC_GUI::port_changed));
266 bank_entry.signal_activate().connect (sigc::mem_fun (*this, &OSC_GUI::bank_changed));
267 striptypes_spin.signal_activate().connect (sigc::mem_fun (*this, &OSC_GUI::strips_changed));
268 feedback_spin.signal_activate().connect (sigc::mem_fun (*this, &OSC_GUI::feedback_changed));
271 // Strip Types Calculate Page
272 int stn = 0; // table row
273 Table* sttable = manage (new Table);
274 sttable->set_row_spacings (8);
275 sttable->set_col_spacings (6);
276 sttable->set_border_width (25);
279 label = manage (new Gtk::Label(_("Select Desired Types of Tracks")));
280 sttable->attach (*label, 0, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
283 label = manage (new Gtk::Label(_("Strip Types Value:")));
284 label->set_alignment(1, .5);
285 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
286 calculate_strip_types ();
287 current_strip_types.set_width_chars(10);
288 sttable->attach (current_strip_types, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
291 label = manage (new Gtk::Label(_("Audio Tracks:")));
292 label->set_alignment(1, .5);
293 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
294 sttable->attach (audio_tracks, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
295 audio_tracks.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
296 audio_tracks.set_active(def_strip & 1);
299 label = manage (new Gtk::Label(_("Midi Tracks:")));
300 label->set_alignment(1, .5);
301 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
302 sttable->attach (midi_tracks, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
303 midi_tracks.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
304 midi_tracks.set_active(def_strip & 2);
307 label = manage (new Gtk::Label(_("Audio Buses:")));
308 label->set_alignment(1, .5);
309 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
310 sttable->attach (audio_buses, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
311 audio_buses.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
312 audio_buses.set_active(def_strip & 4);
315 label = manage (new Gtk::Label(_("Midi Buses:")));
316 label->set_alignment(1, .5);
317 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
318 sttable->attach (midi_buses, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
319 midi_buses.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
320 midi_buses.set_active(def_strip & 8);
323 label = manage (new Gtk::Label(_("Control Masters:")));
324 label->set_alignment(1, .5);
325 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
326 sttable->attach (control_masters, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
327 control_masters.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
328 control_masters.set_active(def_strip & 16);
331 label = manage (new Gtk::Label(_("Master (use /master instead):")));
332 label->set_alignment(1, .5);
333 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
334 sttable->attach (master_type, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
335 master_type.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
336 master_type.set_active(def_strip & 32);
339 label = manage (new Gtk::Label(_("Monitor (use /monitor instead):")));
340 label->set_alignment(1, .5);
341 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
342 sttable->attach (monitor_type, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
343 monitor_type.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
344 monitor_type.set_active(def_strip & 64);
347 label = manage (new Gtk::Label(_("Selected Tracks (use for selected tracks only):")));
348 label->set_alignment(1, .5);
349 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
350 sttable->attach (selected_tracks, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
351 selected_tracks.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
352 selected_tracks.set_active(def_strip & 256);
355 label = manage (new Gtk::Label(_("Hidden Tracks:")));
356 label->set_alignment(1, .5);
357 sttable->attach (*label, 0, 1, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
358 sttable->attach (hidden_tracks, 1, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
359 hidden_tracks.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_strip_types));
360 hidden_tracks.set_active(def_strip & 512);
363 stbutton = manage (new Gtk::Button(_("Use Value as Strip Types Default")));
364 sttable->attach (*stbutton, 0, 2, stn, stn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
365 stbutton->signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::push_strip_types));
368 sttable->show_all ();
369 append_page (*sttable, _("Calculate Strip Types"));
372 // Feedback Calculate Page
373 int fn = 0; // table row
374 Table* fbtable = manage (new Table);
375 fbtable->set_row_spacings (4);
376 fbtable->set_col_spacings (6);
377 fbtable->set_border_width (12);
380 label = manage (new Gtk::Label(_("Select Desired Types of Feedback")));
381 fbtable->attach (*label, 0, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
384 label = manage (new Gtk::Label(_("Feedback Value:")));
385 label->set_alignment(1, .5);
386 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
387 calculate_feedback ();
388 current_feedback.set_width_chars(10);
389 fbtable->attach (current_feedback, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
392 label = manage (new Gtk::Label(_("Strip Buttons:")));
393 label->set_alignment(1, .5);
394 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
395 fbtable->attach (strip_buttons_button, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
396 strip_buttons_button.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
397 strip_buttons_button.set_active(def_feedback & 1);
400 label = manage (new Gtk::Label(_("Strip Controls:")));
401 label->set_alignment(1, .5);
402 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
403 fbtable->attach (strip_control_button, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
404 strip_control_button.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
405 strip_control_button.set_active(def_feedback & 2);
408 label = manage (new Gtk::Label(_("Use SSID as Path Extension:")));
409 label->set_alignment(1, .5);
410 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
411 fbtable->attach (ssid_as_path, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
412 ssid_as_path.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
413 ssid_as_path.set_active(def_feedback & 4);
416 label = manage (new Gtk::Label(_("Use Heart Beat:")));
417 label->set_alignment(1, .5);
418 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
419 fbtable->attach (heart_beat, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
420 heart_beat.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
421 heart_beat.set_active(def_feedback & 8);
424 label = manage (new Gtk::Label(_("Master Section:")));
425 label->set_alignment(1, .5);
426 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
427 fbtable->attach (master_fb, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
428 master_fb.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
429 master_fb.set_active(def_feedback & 16);
432 label = manage (new Gtk::Label(_("Play Head Position as Bar and Beat:")));
433 label->set_alignment(1, .5);
434 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
435 fbtable->attach (bar_and_beat, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
436 bar_and_beat.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
437 bar_and_beat.set_active(def_feedback & 32);
440 label = manage (new Gtk::Label(_("Play Head Position as SMPTE Time:")));
441 label->set_alignment(1, .5);
442 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
443 fbtable->attach (smpte, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
444 smpte.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
445 smpte.set_active(def_feedback & 64);
448 label = manage (new Gtk::Label(_("Metering as a Float:")));
449 label->set_alignment(1, .5);
450 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
451 fbtable->attach (meter_float, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
452 meter_float.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
453 meter_float.set_active(def_feedback & 128);
456 label = manage (new Gtk::Label(_("Metering as a LED Strip:")));
457 label->set_alignment(1, .5);
458 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
459 fbtable->attach (meter_led, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
460 meter_led.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
461 meter_led.set_active(def_feedback & 256);
464 label = manage (new Gtk::Label(_("Signal Present:")));
465 label->set_alignment(1, .5);
466 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
467 fbtable->attach (signal_present, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
468 signal_present.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
469 signal_present.set_active(def_feedback & 512);
472 label = manage (new Gtk::Label(_("Play Head Position as Samples:")));
473 label->set_alignment(1, .5);
474 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
475 fbtable->attach (hp_samples, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
476 hp_samples.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
477 hp_samples.set_active(def_feedback & 1024);
480 label = manage (new Gtk::Label(_("Playhead Position as Minutes Seconds:")));
481 label->set_alignment(1, .5);
482 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
483 fbtable->attach (hp_min_sec, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
484 hp_min_sec.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
485 hp_min_sec.set_active(def_feedback & 2048);
488 label = manage (new Gtk::Label(_("Playhead Position as per GUI Clock:")));
489 label->set_alignment(1, .5);
490 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
491 fbtable->attach (hp_gui, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
492 hp_gui.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
493 hp_gui.set_sensitive (false); // we don't have this yet (Mixbus wants)
496 label = manage (new Gtk::Label(_("Extra Select Only Feedback:")));
497 label->set_alignment(1, .5);
498 fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
499 fbtable->attach (select_fb, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
500 select_fb.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::calculate_feedback));
501 select_fb.set_active(def_feedback & 8192);
504 fbbutton = manage (new Gtk::Button(_("Use Value as Feedback Default")));
505 fbtable->attach (*fbbutton, 0, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 15);
506 fbbutton->signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::push_feedback));
509 fbtable->show_all ();
510 append_page (*fbtable, _("Calculate Feedback"));
519 OSC_GUI::debug_changed ()
521 std::string str = debug_combo.get_active_text ();
522 if (str == _("Off")) {
523 cp.set_debug_mode (OSC::Off);
525 else if (str == _("Log invalid messages")) {
526 cp.set_debug_mode (OSC::Unhandled);
528 else if (str == _("Log all messages")) {
529 cp.set_debug_mode (OSC::All);
532 std::cerr << "Invalid OSC Debug Mode\n";
538 OSC_GUI::portmode_changed ()
540 std::string str = portmode_combo.get_active_text ();
541 if (str == _("Auto")) {
543 port_entry.set_sensitive (false);
545 else if (str == _("Manual")) {
547 port_entry.set_sensitive (true);
550 std::cerr << "Invalid OSC Port Mode\n";
556 OSC_GUI::port_changed ()
558 std::string str = port_entry.get_text ();
559 if (port_entry.get_value() == 3819) {
561 port_entry.set_value (8000);
563 cp.set_remote_port (str);
567 OSC_GUI::bank_changed ()
569 uint32_t bsize = bank_entry.get_value ();
570 cp.set_banksize (bsize);
575 OSC_GUI::strips_changed ()
577 uint32_t st = striptypes_spin.get_value ();
578 cp.set_defaultstrip (st);
582 OSC_GUI::feedback_changed ()
584 uint32_t fb = feedback_spin.get_value ();
585 cp.set_defaultfeedback (fb);
589 OSC_GUI::gainmode_changed ()
591 std::string str = gainmode_combo.get_active_text ();
592 if (str == _("dB")) {
595 else if (str == _("Position")) {
599 std::cerr << "Invalid OSC Gain Mode\n";
605 OSC_GUI::clear_device ()
611 OSC_GUI::calculate_feedback ()
614 if (strip_buttons_button.get_active()) {
617 if (strip_control_button.get_active()) {
620 if (ssid_as_path.get_active()) {
623 if (heart_beat.get_active()) {
626 if (master_fb.get_active()) {
629 if (bar_and_beat.get_active()) {
632 if (smpte.get_active()) {
635 if (meter_float.get_active()) {
638 if (meter_led.get_active()) {
641 if (signal_present.get_active()) {
644 if (hp_samples.get_active()) {
647 if (hp_min_sec.get_active()) {
650 if (hp_gui.get_active()) {
653 if (select_fb.get_active()) {
657 current_feedback.set_text(string_compose("%1", fbvalue));
661 OSC_GUI::push_feedback ()
663 feedback_spin.set_value (fbvalue);
668 OSC_GUI::calculate_strip_types ()
671 if (audio_tracks.get_active()) {
674 if (midi_tracks.get_active()) {
677 if (audio_buses.get_active()) {
680 if (midi_buses.get_active()) {
683 if (control_masters.get_active()) {
686 if (master_type.get_active()) {
689 if (monitor_type.get_active()) {
692 /*if (Auditioner_type.get_active()) {
693 stvalue += 128; // this one has no user accessable controls
695 if (selected_tracks.get_active()) {
698 if (hidden_tracks.get_active()) {
702 current_strip_types.set_text(string_compose("%1", stvalue));
706 OSC_GUI::push_strip_types ()
708 striptypes_spin.set_value (stvalue);