2 Copyright (C) 2015 Paul Davis
3 Copyright (C) 2016 W.P. van Paassen
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __ardour_cc121_gui_h__
22 #define __ardour_cc121_gui_h__
27 #include <gtkmm/box.h>
28 #include <gtkmm/combobox.h>
29 #include <gtkmm/image.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/treestore.h>
34 class CellRendererCombo;
40 namespace ArdourSurface {
42 class CC121GUI : public Gtk::VBox
52 Gtk::Table action_table;
53 Gtk::ComboBox input_combo;
54 Gtk::ComboBox output_combo;
57 Gtk::ComboBox foot_combo;
58 Gtk::ComboBox function1_combo;
59 Gtk::ComboBox function2_combo;
60 Gtk::ComboBox function3_combo;
61 Gtk::ComboBox function4_combo;
62 Gtk::ComboBox value_combo;
63 Gtk::ComboBox lock_combo;
64 Gtk::ComboBox eq1_combo;
65 Gtk::ComboBox eq2_combo;
66 Gtk::ComboBox eq3_combo;
67 Gtk::ComboBox eq4_combo;
68 Gtk::ComboBox eqtype_combo;
69 Gtk::ComboBox allbypass_combo;
71 void update_port_combos ();
72 PBD::ScopedConnection connection_change_connection;
73 void connection_handler ();
75 struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord {
80 Gtk::TreeModelColumn<std::string> short_name;
81 Gtk::TreeModelColumn<std::string> full_name;
84 MidiPortColumns midi_port_columns;
85 bool ignore_active_change;
87 Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
88 void active_port_changed (Gtk::ComboBox*,bool for_input);
90 struct ActionColumns : public Gtk::TreeModel::ColumnRecord {
95 Gtk::TreeModelColumn<std::string> name;
96 Gtk::TreeModelColumn<std::string> path;
99 ActionColumns action_columns;
100 Glib::RefPtr<Gtk::TreeStore> available_action_model;
101 std::map<std::string,std::string> action_map; // map from action names to paths
103 void build_action_combo (Gtk::ComboBox& cb, std::vector<std::pair<std::string,std::string> > const & actions, CC121::ButtonID, CC121::ButtonState);
104 void build_user_action_combo (Gtk::ComboBox&, CC121::ButtonState, CC121::ButtonID);
105 void build_foot_action_combo (Gtk::ComboBox&, CC121::ButtonState);
107 void build_available_action_menu ();
108 void action_changed (Gtk::ComboBox*, CC121::ButtonID, CC121::ButtonState);
110 bool find_action_in_model (const Gtk::TreeModel::iterator& iter, std::string const & action_path, Gtk::TreeModel::iterator* found);
116 #endif /* __ardour_cc121_gui_h__ */