2012-04-13 13:06:35 -04:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2006-2007 John Anderson
|
|
|
|
* Copyright (C) 2012-2016 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2012-04-13 13:06:35 -04:00
|
|
|
|
2015-10-08 21:55:31 -04:00
|
|
|
#include <vector>
|
|
|
|
|
2023-08-23 07:27:21 -04:00
|
|
|
#include <gtkmm/comboboxtext.h>
|
2012-04-13 13:06:35 -04:00
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/table.h>
|
2023-08-23 07:27:21 -04:00
|
|
|
#include <gtkmm/image.h>
|
2012-04-13 13:06:35 -04:00
|
|
|
#include <gtkmm/liststore.h>
|
|
|
|
#include <gtkmm/notebook.h>
|
2023-08-23 07:27:21 -04:00
|
|
|
#include <gtkmm/radiobutton.h>
|
|
|
|
#include <gtkmm/scale.h>
|
2012-04-13 13:06:35 -04:00
|
|
|
#include <gtkmm/scrolledwindow.h>
|
2023-08-23 07:27:21 -04:00
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/treestore.h>
|
2012-04-13 13:06:35 -04:00
|
|
|
|
2012-04-13 17:46:26 -04:00
|
|
|
namespace Gtk {
|
2015-10-08 21:55:31 -04:00
|
|
|
class CellRendererCombo;
|
2012-04-13 17:46:26 -04:00
|
|
|
}
|
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
#include "button.h"
|
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2012-04-13 13:06:35 -04:00
|
|
|
|
2019-04-20 08:08:36 -04:00
|
|
|
namespace ActionManager {
|
|
|
|
class ActionModel;
|
|
|
|
}
|
|
|
|
|
2023-08-23 07:27:21 -04:00
|
|
|
namespace ArdourSurface { namespace MACKIE_NAMESPACE {
|
2015-04-15 20:37:20 -04:00
|
|
|
|
|
|
|
class MackieControlProtocol;
|
2023-08-23 07:27:21 -04:00
|
|
|
class Surface;
|
2015-10-09 14:01:22 -04:00
|
|
|
|
2012-04-13 13:06:35 -04:00
|
|
|
class MackieControlProtocolGUI : public Gtk::Notebook
|
|
|
|
{
|
2015-10-03 12:11:32 -04:00
|
|
|
public:
|
2012-04-17 16:41:31 -04:00
|
|
|
MackieControlProtocolGUI (MackieControlProtocol &);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-10-03 12:11:32 -04:00
|
|
|
private:
|
|
|
|
MackieControlProtocol& _cp;
|
2015-10-08 21:55:31 -04:00
|
|
|
Gtk::Table table;
|
2015-10-03 12:11:32 -04:00
|
|
|
Gtk::ComboBoxText _surface_combo;
|
|
|
|
Gtk::ComboBoxText _profile_combo;
|
2015-10-08 21:55:31 -04:00
|
|
|
|
2015-10-12 13:36:22 -04:00
|
|
|
typedef std::vector<Gtk::ComboBox*> PortCombos;
|
2015-10-09 14:01:22 -04:00
|
|
|
PortCombos input_combos;
|
|
|
|
PortCombos output_combos;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-10-12 13:36:22 -04:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2015-10-03 12:11:32 -04:00
|
|
|
struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
FunctionKeyColumns() {
|
|
|
|
add (name);
|
|
|
|
add (id);
|
|
|
|
add (plain);
|
|
|
|
add (shift);
|
|
|
|
add (control);
|
|
|
|
add (option);
|
|
|
|
add (cmdalt);
|
|
|
|
add (shiftcontrol);
|
|
|
|
};
|
2023-08-25 15:05:10 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
|
|
|
Gtk::TreeModelColumn<int> id; // enum Button::ID
|
|
|
|
Gtk::TreeModelColumn<std::string> plain;
|
|
|
|
Gtk::TreeModelColumn<std::string> shift;
|
|
|
|
Gtk::TreeModelColumn<std::string> control;
|
|
|
|
Gtk::TreeModelColumn<std::string> option;
|
|
|
|
Gtk::TreeModelColumn<std::string> cmdalt;
|
|
|
|
Gtk::TreeModelColumn<std::string> shiftcontrol;
|
2012-04-13 13:06:35 -04:00
|
|
|
};
|
2015-10-03 12:11:32 -04:00
|
|
|
|
|
|
|
FunctionKeyColumns function_key_columns;
|
2015-10-12 13:36:22 -04:00
|
|
|
MidiPortColumns midi_port_columns;
|
2015-10-03 12:11:32 -04:00
|
|
|
|
|
|
|
Gtk::ScrolledWindow function_key_scroller;
|
|
|
|
Gtk::TreeView function_key_editor;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> function_key_model;
|
2019-04-20 08:08:36 -04:00
|
|
|
|
|
|
|
const ActionManager::ActionModel& action_model;
|
2015-10-03 12:11:32 -04:00
|
|
|
|
2015-10-12 13:36:22 -04:00
|
|
|
Glib::RefPtr<Gtk::ListStore> build_midi_port_list (bool for_input);
|
|
|
|
|
2015-10-03 12:11:32 -04:00
|
|
|
void refresh_function_key_editor ();
|
|
|
|
void build_function_key_editor ();
|
2020-02-20 14:52:54 -05:00
|
|
|
void action_changed (const Glib::ustring &sPath, const Gtk::TreeModel::iterator &, Gtk::TreeModelColumnBase);
|
2015-10-03 12:11:32 -04:00
|
|
|
Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr<Gtk::TreeStore> model, Gtk::TreeModelColumnBase);
|
|
|
|
|
|
|
|
void surface_combo_changed ();
|
|
|
|
void profile_combo_changed ();
|
|
|
|
void ipmidi_spinner_changed ();
|
|
|
|
|
|
|
|
Gtk::CheckButton relay_click_button;
|
|
|
|
Gtk::CheckButton backlight_button;
|
|
|
|
Gtk::RadioButton absolute_touch_mode_button;
|
|
|
|
Gtk::RadioButton touch_move_mode_button;
|
|
|
|
Gtk::Adjustment touch_sensitivity_adjustment;
|
|
|
|
Gtk::HScale touch_sensitivity_scale;
|
|
|
|
Gtk::Button recalibrate_fader_button;
|
|
|
|
Gtk::Adjustment ipmidi_base_port_adjustment;
|
|
|
|
Gtk::Button discover_button;
|
|
|
|
|
2023-08-23 07:27:21 -04:00
|
|
|
Gtk::HBox hpacker;
|
|
|
|
Gtk::Image image;
|
|
|
|
|
2015-10-03 12:11:32 -04:00
|
|
|
void discover_clicked ();
|
2015-10-02 21:54:40 -04:00
|
|
|
void recalibrate_faders ();
|
|
|
|
void toggle_backlight ();
|
|
|
|
void touch_sensitive_change ();
|
2015-10-08 21:55:31 -04:00
|
|
|
|
|
|
|
Gtk::Widget* device_dependent_widget ();
|
|
|
|
Gtk::Widget* _device_dependent_widget;
|
|
|
|
int device_dependent_row;
|
|
|
|
|
|
|
|
PBD::ScopedConnection device_change_connection;
|
|
|
|
void device_changed ();
|
2015-10-09 14:01:22 -04:00
|
|
|
|
|
|
|
void update_port_combos (std::vector<std::string> const&, std::vector<std::string> const&,
|
2015-10-12 13:36:22 -04:00
|
|
|
Gtk::ComboBox* input_combo,
|
|
|
|
Gtk::ComboBox* output_combo,
|
2023-08-23 07:27:21 -04:00
|
|
|
std::shared_ptr<MACKIE_NAMESPACE::Surface> surface);
|
2015-10-09 14:01:22 -04:00
|
|
|
|
2021-02-04 00:19:37 -05:00
|
|
|
PBD::ScopedConnectionList _port_connections;
|
2015-10-10 17:13:04 -04:00
|
|
|
void connection_handler ();
|
2015-10-12 13:36:22 -04:00
|
|
|
|
|
|
|
Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
|
2017-05-05 17:38:19 -04:00
|
|
|
bool _ignore_profile_changed;
|
2015-10-12 13:36:22 -04:00
|
|
|
bool ignore_active_change;
|
2023-08-23 07:27:21 -04:00
|
|
|
void active_port_changed (Gtk::ComboBox* combo, std::weak_ptr<MACKIE_NAMESPACE::Surface> ws, bool for_input);
|
2012-04-13 13:06:35 -04:00
|
|
|
};
|
|
|
|
|
2023-08-23 07:27:21 -04:00
|
|
|
} // namespace Mackie
|
|
|
|
} // namespace ArdourSurface
|