2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3 * Copyright (C) 2015 Paul Davis
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __ardour_faderport8_gui_h__
21 #define __ardour_faderport8_gui_h__
26 #include <gtkmm/box.h>
27 #include <gtkmm/combobox.h>
28 #include <gtkmm/comboboxtext.h>
29 #include <gtkmm/image.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/treestore.h>
34 class CellRendererCombo;
38 #include "faderport8.h"
40 namespace ArdourSurface {
42 class FP8GUI : public Gtk::VBox
54 /* port connections */
55 Gtk::ComboBox input_combo;
56 Gtk::ComboBox output_combo;
58 void update_port_combos ();
59 void connection_handler ();
60 PBD::ScopedConnection connection_change_connection;
62 struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord {
67 Gtk::TreeModelColumn<std::string> short_name;
68 Gtk::TreeModelColumn<std::string> full_name;
71 MidiPortColumns midi_port_columns;
72 bool ignore_active_change;
74 Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
75 void active_port_changed (Gtk::ComboBox*,bool for_input);
78 Gtk::ComboBoxText clock_combo;
79 Gtk::ComboBoxText scribble_combo;
80 Gtk::CheckButton two_line_text_cb;
81 Gtk::CheckButton auto_pluginui_cb;
83 void build_prefs_combos ();
84 void update_prefs_combos ();
85 void clock_mode_changed ();
86 void scribble_mode_changed ();
87 void twolinetext_toggled ();
88 void auto_pluginui_toggled ();
91 void build_available_action_menu ();
92 void build_action_combo (Gtk::ComboBox& cb, FP8Controls::ButtonId id);
93 void action_changed (Gtk::ComboBox* cb, FP8Controls::ButtonId id);
95 struct ActionColumns : public Gtk::TreeModel::ColumnRecord {
100 Gtk::TreeModelColumn<std::string> name;
101 Gtk::TreeModelColumn<std::string> path;
104 ActionColumns action_columns;
105 Glib::RefPtr<Gtk::TreeStore> available_action_model;
106 std::map<std::string,std::string> action_map; // map from action names to paths
108 bool find_action_in_model (const Gtk::TreeModel::iterator& iter, std::string const & action_path, Gtk::TreeModel::iterator* found);
113 #endif /* __ardour_faderport8_gui_h__ */