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/image.h>
29 #include <gtkmm/table.h>
30 #include <gtkmm/treestore.h>
33 class CellRendererCombo;
37 #include "faderport8.h"
39 namespace ArdourSurface {
41 class FP8GUI : public Gtk::VBox
53 /* port connections */
54 Gtk::ComboBox input_combo;
55 Gtk::ComboBox output_combo;
57 void update_port_combos ();
58 void connection_handler ();
59 PBD::ScopedConnection connection_change_connection;
61 struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord {
66 Gtk::TreeModelColumn<std::string> short_name;
67 Gtk::TreeModelColumn<std::string> full_name;
70 MidiPortColumns midi_port_columns;
71 bool ignore_active_change;
73 Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
74 void active_port_changed (Gtk::ComboBox*,bool for_input);
77 void build_available_action_menu ();
78 void build_action_combo (Gtk::ComboBox& cb, FP8Controls::ButtonId id);
79 void action_changed (Gtk::ComboBox* cb, FP8Controls::ButtonId id);
81 struct ActionColumns : public Gtk::TreeModel::ColumnRecord {
86 Gtk::TreeModelColumn<std::string> name;
87 Gtk::TreeModelColumn<std::string> path;
90 ActionColumns action_columns;
91 Glib::RefPtr<Gtk::TreeStore> available_action_model;
92 std::map<std::string,std::string> action_map; // map from action names to paths
94 bool find_action_in_model (const Gtk::TreeModel::iterator& iter, std::string const & action_path, Gtk::TreeModel::iterator* found);
99 #endif /* __ardour_faderport8_gui_h__ */