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;
50 struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord {
51 AvailableActionColumns() {
55 Gtk::TreeModelColumn<std::string> name;
56 Gtk::TreeModelColumn<std::string> path;
59 struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
60 FunctionKeyColumns() {
70 Gtk::TreeModelColumn<std::string> name;
71 Gtk::TreeModelColumn<Mackie::Button::ID> id;
72 Gtk::TreeModelColumn<std::string> plain;
73 Gtk::TreeModelColumn<std::string> shift;
74 Gtk::TreeModelColumn<std::string> control;
75 Gtk::TreeModelColumn<std::string> option;
76 Gtk::TreeModelColumn<std::string> cmdalt;
77 Gtk::TreeModelColumn<std::string> shiftcontrol;
80 AvailableActionColumns available_action_columns;
81 FunctionKeyColumns function_key_columns;
83 Gtk::ScrolledWindow function_key_scroller;
84 Gtk::TreeView function_key_editor;
85 Glib::RefPtr<Gtk::ListStore> function_key_model;
86 Glib::RefPtr<Gtk::TreeStore> available_action_model;
88 void build_available_action_menu ();
89 void refresh_function_key_editor ();
90 void build_function_key_editor ();
91 void action_changed (const Glib::ustring &sPath, const Glib::ustring &text, Gtk::TreeModelColumnBase);
92 Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr<Gtk::TreeStore> model, Gtk::TreeModelColumnBase);
94 void surface_combo_changed ();
95 void profile_combo_changed ();
96 void ipmidi_spinner_changed ();
98 std::map<std::string,std::string> action_map; // map from action names to paths
100 Gtk::CheckButton relay_click_button;
101 Gtk::CheckButton backlight_button;
102 Gtk::RadioButton absolute_touch_mode_button;
103 Gtk::RadioButton touch_move_mode_button;
104 Gtk::Adjustment touch_sensitivity_adjustment;
105 Gtk::HScale touch_sensitivity_scale;
106 Gtk::Button recalibrate_fader_button;
107 Gtk::Adjustment ipmidi_base_port_adjustment;
108 Gtk::SpinButton ipmidi_base_port_spinner;
109 Gtk::Button discover_button;
111 void discover_clicked ();
112 void recalibrate_faders ();
113 void toggle_backlight ();
114 void touch_sensitive_change ();