2 Copyright (C) 2010-2012 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.
19 #include <gtkmm/comboboxtext.h>
20 #include <gtkmm/box.h>
21 #include <gtkmm/spinbutton.h>
22 #include <gtkmm/table.h>
23 #include <gtkmm/treeview.h>
24 #include <gtkmm/liststore.h>
25 #include <gtkmm/notebook.h>
26 #include <gtkmm/scrolledwindow.h>
29 class CellRendererCombo;
36 namespace ArdourSurface {
38 class MackieControlProtocol;
40 class MackieControlProtocolGUI : public Gtk::Notebook
43 MackieControlProtocolGUI (MackieControlProtocol &);
46 MackieControlProtocol& _cp;
47 Gtk::ComboBoxText _surface_combo;
48 Gtk::ComboBoxText _profile_combo;
49 Gtk::ComboBoxText _input_port_combo;
50 Gtk::ComboBoxText _output_port_combo;
52 struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord {
53 AvailableActionColumns() {
57 Gtk::TreeModelColumn<std::string> name;
58 Gtk::TreeModelColumn<std::string> path;
61 struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
62 FunctionKeyColumns() {
72 Gtk::TreeModelColumn<std::string> name;
73 Gtk::TreeModelColumn<Mackie::Button::ID> id;
74 Gtk::TreeModelColumn<std::string> plain;
75 Gtk::TreeModelColumn<std::string> shift;
76 Gtk::TreeModelColumn<std::string> control;
77 Gtk::TreeModelColumn<std::string> option;
78 Gtk::TreeModelColumn<std::string> cmdalt;
79 Gtk::TreeModelColumn<std::string> shiftcontrol;
82 AvailableActionColumns available_action_columns;
83 FunctionKeyColumns function_key_columns;
85 Gtk::ScrolledWindow function_key_scroller;
86 Gtk::TreeView function_key_editor;
87 Glib::RefPtr<Gtk::ListStore> function_key_model;
88 Glib::RefPtr<Gtk::TreeStore> available_action_model;
90 void build_available_action_menu ();
91 void refresh_function_key_editor ();
92 void build_function_key_editor ();
93 void action_changed (const Glib::ustring &sPath, const Glib::ustring &text, Gtk::TreeModelColumnBase);
94 Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr<Gtk::TreeStore> model, Gtk::TreeModelColumnBase);
96 void surface_combo_changed ();
97 void profile_combo_changed ();
98 void ipmidi_spinner_changed ();
100 std::map<std::string,std::string> action_map; // map from action names to paths
102 Gtk::CheckButton relay_click_button;
103 Gtk::CheckButton backlight_button;
104 Gtk::RadioButton absolute_touch_mode_button;
105 Gtk::RadioButton touch_move_mode_button;
106 Gtk::Adjustment touch_sensitivity_adjustment;
107 Gtk::HScale touch_sensitivity_scale;
108 Gtk::Button recalibrate_fader_button;
109 Gtk::Adjustment ipmidi_base_port_adjustment;
110 Gtk::SpinButton ipmidi_base_port_spinner;
111 Gtk::Button discover_button;
113 void discover_clicked ();
114 void recalibrate_faders ();
115 void toggle_backlight ();
116 void touch_sensitive_change ();