summaryrefslogtreecommitdiff
path: root/libs/surfaces/faderport/gui.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-11-30 12:51:18 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-11-30 12:51:18 -0500
commit682e152aafbc49b5a7908fcd4b2734aed3b872e6 (patch)
tree4a031d962644148582123f7950730dfee1459e08 /libs/surfaces/faderport/gui.h
parent149f6795bb3272aa31cf3dc5276667fb7454e7e3 (diff)
faderport: some code cleanups, add timing for button presses, add new comboboxes to GUI to allow more button programming, save button state
Diffstat (limited to 'libs/surfaces/faderport/gui.h')
-rw-r--r--libs/surfaces/faderport/gui.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/libs/surfaces/faderport/gui.h b/libs/surfaces/faderport/gui.h
new file mode 100644
index 0000000000..5c2ce4334e
--- /dev/null
+++ b/libs/surfaces/faderport/gui.h
@@ -0,0 +1,106 @@
+/*
+ Copyright (C) 2015 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_faderport_gui_h__
+#define __ardour_faderport_gui_h__
+
+#include <vector>
+#include <string>
+
+#include <gtkmm/box.h>
+#include <gtkmm/combobox.h>
+#include <gtkmm/table.h>
+#include <gtkmm/treestore.h>
+
+namespace Gtk {
+ class CellRendererCombo;
+ class ListStore;
+}
+
+#include "faderport.h"
+
+namespace ArdourSurface {
+
+class FPGUI : public Gtk::VBox
+{
+public:
+ FPGUI (FaderPort&);
+ ~FPGUI ();
+
+private:
+ FaderPort& fp;
+ Gtk::Table table;
+ Gtk::Table action_table;
+ Gtk::ComboBox input_combo;
+ Gtk::ComboBox output_combo;
+
+ /* the mix, proj, trns and user buttons have no obvious semantics for
+ * ardour, mixbus etc., so we allow the user to define their
+ * functionality from a small, curated set of options.
+ */
+
+ Gtk::ComboBox mix_combo[4];
+ Gtk::ComboBox proj_combo[4];
+ Gtk::ComboBox trns_combo[4];
+ Gtk::ComboBox user_combo[4];
+
+ void update_port_combos ();
+ PBD::ScopedConnection connection_change_connection;
+ void connection_handler ();
+
+ struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord {
+ MidiPortColumns() {
+ add (short_name);
+ add (full_name);
+ }
+ Gtk::TreeModelColumn<std::string> short_name;
+ Gtk::TreeModelColumn<std::string> full_name;
+ };
+
+ MidiPortColumns midi_port_columns;
+ bool ignore_active_change;
+
+ Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
+ void active_port_changed (Gtk::ComboBox*,bool for_input);
+
+ struct ActionColumns : public Gtk::TreeModel::ColumnRecord {
+ ActionColumns() {
+ add (name);
+ add (path);
+ }
+ Gtk::TreeModelColumn<std::string> name;
+ Gtk::TreeModelColumn<std::string> path;
+ };
+
+ ActionColumns action_columns;
+ Glib::RefPtr<Gtk::TreeStore> available_action_model;
+ std::map<std::string,std::string> action_map; // map from action names to paths
+
+ void build_action_combo (Gtk::ComboBox& cb, std::vector<std::pair<std::string,std::string> > const & actions, FaderPort::ButtonID, FaderPort::ButtonState);
+ void build_mix_action_combo (Gtk::ComboBox&, FaderPort::ButtonState);
+ void build_proj_action_combo (Gtk::ComboBox&, FaderPort::ButtonState);
+ void build_trns_action_combo (Gtk::ComboBox&, FaderPort::ButtonState);
+
+ void build_available_action_menu ();
+ void action_changed (Gtk::ComboBox*, FaderPort::ButtonID);
+};
+
+}
+
+#endif /* __ardour_faderport_gui_h__ */