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.
20 #include <gtkmm/comboboxtext.h>
21 #include <gtkmm/box.h>
22 #include <gtkmm/spinbutton.h>
23 #include <gtkmm/table.h>
24 #include <gtkmm/treeview.h>
25 #include <gtkmm/liststore.h>
26 #include <gtkmm/notebook.h>
27 #include <gtkmm/scrolledwindow.h>
30 class CellRendererCombo;
33 class MackieControlProtocol;
39 class MackieControlProtocolGUI : public Gtk::Notebook
42 MackieControlProtocolGUI (MackieControlProtocol &);
45 MackieControlProtocol& _cp;
46 Gtk::ComboBoxText _surface_combo;
47 Gtk::ComboBoxText _profile_combo;
49 struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord {
50 AvailableActionColumns() {
54 Gtk::TreeModelColumn<std::string> name;
55 Gtk::TreeModelColumn<std::string> path;
58 struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
59 FunctionKeyColumns() {
69 Gtk::TreeModelColumn<std::string> name;
70 Gtk::TreeModelColumn<Mackie::Button::ID> id;
71 Gtk::TreeModelColumn<std::string> plain;
72 Gtk::TreeModelColumn<std::string> shift;
73 Gtk::TreeModelColumn<std::string> control;
74 Gtk::TreeModelColumn<std::string> option;
75 Gtk::TreeModelColumn<std::string> cmdalt;
76 Gtk::TreeModelColumn<std::string> shiftcontrol;
79 AvailableActionColumns available_action_columns;
80 FunctionKeyColumns function_key_columns;
82 Gtk::ScrolledWindow function_key_scroller;
83 Gtk::TreeView function_key_editor;
84 Glib::RefPtr<Gtk::ListStore> function_key_model;
85 Glib::RefPtr<Gtk::TreeStore> available_action_model;
87 void build_available_action_menu ();
88 void refresh_function_key_editor ();
89 void build_function_key_editor ();
90 void action_changed (const Glib::ustring &sPath, const Glib::ustring &text, Gtk::TreeModelColumnBase);
91 Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr<Gtk::TreeStore> model, Gtk::TreeModelColumnBase);
93 void surface_combo_changed ();
94 void profile_combo_changed ();
96 std::map<std::string,std::string> action_map; // map from action names to paths
98 Gtk::CheckButton relay_click_button;
99 Gtk::CheckButton backlight_button;
100 Gtk::RadioButton absolute_touch_mode_button;
101 Gtk::RadioButton touch_move_mode_button;
102 Gtk::Adjustment touch_sensitivity_adjustment;
103 Gtk::HScale touch_sensitivity_scale;
104 Gtk::Button recalibrate_fader_button;
105 Gtk::Adjustment ipmidi_base_port_adjustment;
106 Gtk::SpinButton ipmidi_base_port_spinner;