From 5a3fe4aa206232bd242e71a1b8c3edee9ff343a1 Mon Sep 17 00:00:00 2001 From: "W.P. van Paassen" Date: Tue, 11 Oct 2016 19:21:21 +0200 Subject: Inital support for Steinberg's CC121 control surface --- libs/surfaces/cc121/gui.h | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 libs/surfaces/cc121/gui.h (limited to 'libs/surfaces/cc121/gui.h') diff --git a/libs/surfaces/cc121/gui.h b/libs/surfaces/cc121/gui.h new file mode 100644 index 0000000000..107a81ed32 --- /dev/null +++ b/libs/surfaces/cc121/gui.h @@ -0,0 +1,116 @@ +/* + Copyright (C) 2015 Paul Davis + Copyright (C) 2016 W.P. van Paassen + + 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_cc121_gui_h__ +#define __ardour_cc121_gui_h__ + +#include +#include + +#include +#include +#include +#include +#include + +namespace Gtk { + class CellRendererCombo; + class ListStore; +} + +#include "cc121.h" + +namespace ArdourSurface { + +class CC121GUI : public Gtk::VBox +{ +public: + CC121GUI (CC121&); + ~CC121GUI (); + +private: + CC121& fp; + Gtk::HBox hpacker; + Gtk::Table table; + Gtk::Table action_table; + Gtk::ComboBox input_combo; + Gtk::ComboBox output_combo; + Gtk::Image image; + + Gtk::ComboBox foot_combo; + Gtk::ComboBox function1_combo; + Gtk::ComboBox function2_combo; + Gtk::ComboBox function3_combo; + Gtk::ComboBox function4_combo; + Gtk::ComboBox value_combo; + Gtk::ComboBox lock_combo; + Gtk::ComboBox eq1_combo; + Gtk::ComboBox eq2_combo; + Gtk::ComboBox eq3_combo; + Gtk::ComboBox eq4_combo; + Gtk::ComboBox eqtype_combo; + Gtk::ComboBox allbypass_combo; + + 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 short_name; + Gtk::TreeModelColumn full_name; + }; + + MidiPortColumns midi_port_columns; + bool ignore_active_change; + + Glib::RefPtr build_midi_port_list (std::vector 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 name; + Gtk::TreeModelColumn path; + }; + + ActionColumns action_columns; + Glib::RefPtr available_action_model; + std::map action_map; // map from action names to paths + + void build_action_combo (Gtk::ComboBox& cb, std::vector > const & actions, CC121::ButtonID, CC121::ButtonState); + void build_user_action_combo (Gtk::ComboBox&, CC121::ButtonState, CC121::ButtonID); + void build_foot_action_combo (Gtk::ComboBox&, CC121::ButtonState); + + void build_available_action_menu (); + void action_changed (Gtk::ComboBox*, CC121::ButtonID, CC121::ButtonState); + + bool find_action_in_model (const Gtk::TreeModel::iterator& iter, std::string const & action_path, Gtk::TreeModel::iterator* found); + +}; + +} + +#endif /* __ardour_cc121_gui_h__ */ -- cgit v1.2.3