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.
29 static const char* const preset_dir_name = "osc";
30 static const char* const preset_suffix = ".preset";
31 static const char * const preset_env_variable_name = "ARDOUR_OSC_PATH";
33 namespace ArdourSurface {
35 class OSC_GUI : public Gtk::Notebook
44 Gtk::ComboBoxText debug_combo;
45 Gtk::ComboBoxText portmode_combo;
46 Gtk::SpinButton port_entry;
47 Gtk::SpinButton bank_entry;
48 Gtk::SpinButton send_page_entry;
49 Gtk::SpinButton plugin_page_entry;
50 Gtk::ComboBoxText gainmode_combo;
51 Gtk::ComboBoxText preset_combo;
52 std::vector<std::string> preset_options;
53 std::map<std::string,std::string> preset_files;
56 void restore_sesn_values ();
57 uint32_t sesn_portmode;
58 std::string sesn_port;
63 uint32_t sesn_feedback;
64 uint32_t sesn_gainmode;
66 void scan_preset_files ();
67 void load_preset (std::string preset);
69 void debug_changed ();
70 void portmode_changed ();
71 void gainmode_changed ();
73 void factory_reset ();
74 void reshow_values ();
76 bool port_focus_out (GdkEventFocus*);
78 void send_page_changed ();
79 void plugin_page_changed ();
80 void strips_changed ();
81 void feedback_changed ();
82 void preset_changed ();
83 // Strip types calculator
85 void calculate_strip_types ();
86 Gtk::Label current_strip_types;
87 Gtk::CheckButton audio_tracks;
88 Gtk::CheckButton midi_tracks;
89 Gtk::CheckButton audio_buses;
90 Gtk::CheckButton audio_auxes;
91 Gtk::CheckButton midi_buses;
92 Gtk::CheckButton control_masters;
93 Gtk::CheckButton master_type;
94 Gtk::CheckButton monitor_type;
95 Gtk::CheckButton selected_tracks;
96 Gtk::CheckButton hidden_tracks;
97 Gtk::CheckButton usegroups;
99 // feedback calculator
100 uint32_t def_feedback;
101 void calculate_feedback ();
102 Gtk::Label current_feedback;
103 Gtk::CheckButton strip_buttons_button;
104 Gtk::CheckButton strip_control_button;
105 Gtk::CheckButton ssid_as_path;
106 Gtk::CheckButton heart_beat;
107 Gtk::CheckButton master_fb;
108 Gtk::CheckButton bar_and_beat;
109 Gtk::CheckButton smpte;
110 Gtk::CheckButton meter_float;
111 Gtk::CheckButton meter_led;
112 Gtk::CheckButton signal_present;
113 Gtk::CheckButton hp_samples;
114 Gtk::CheckButton hp_min_sec;
115 Gtk::CheckButton hp_gui;
116 Gtk::CheckButton select_fb;
117 Gtk::CheckButton use_osc10;
128 OSC::get_gui () const
131 const_cast<OSC*>(this)->build_gui ();
133 static_cast<Gtk::Notebook*>(gui)->show_all();
138 OSC::tear_down_gui ()
141 Gtk::Widget *w = static_cast<Gtk::Notebook*>(gui)->get_parent();
147 delete (OSC_GUI*) gui;
154 gui = (void*) new OSC_GUI (*this);