2 Copyright (C) 2015 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 #ifndef __ardour_push2_gui_h__
21 #define __ardour_push2_gui_h__
26 #include <gtkmm/box.h>
27 #include <gtkmm/button.h>
28 #include <gtkmm/combobox.h>
29 #include <gtkmm/image.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/treestore.h>
32 #include <gtkmm/spinbutton.h>
33 #include <gtkmm/notebook.h>
36 class CellRendererCombo;
40 #include "ardour/mode.h"
44 namespace ArdourSurface {
46 class P2GUI : public Gtk::VBox
54 PBD::ScopedConnectionList p2_connections;
57 Gtk::Table action_table;
58 Gtk::ComboBox input_combo;
59 Gtk::ComboBox output_combo;
62 void update_port_combos ();
63 PBD::ScopedConnection connection_change_connection;
64 void connection_handler ();
66 struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord {
71 Gtk::TreeModelColumn<std::string> short_name;
72 Gtk::TreeModelColumn<std::string> full_name;
75 MidiPortColumns midi_port_columns;
76 bool ignore_active_change;
78 Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
79 void active_port_changed (Gtk::ComboBox*,bool for_input);
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 void build_available_action_menu ();
95 bool find_action_in_model (const Gtk::TreeModel::iterator& iter, std::string const & action_path, Gtk::TreeModel::iterator* found);
97 struct PressureModeColumns : public Gtk::TreeModel::ColumnRecord {
98 PressureModeColumns() {
102 Gtk::TreeModelColumn<Push2::PressureMode> mode;
103 Gtk::TreeModelColumn<std::string> name;
105 PressureModeColumns pressure_mode_columns;
106 Glib::RefPtr<Gtk::ListStore> build_pressure_mode_columns ();
107 Gtk::ComboBox pressure_mode_selector;
108 Gtk::Label pressure_mode_label;
110 void reprogram_pressure_mode ();
115 #endif /* __ardour_push2_gui_h__ */