2012-04-13 13:06:35 -04:00
|
|
|
/*
|
2012-04-17 16:41:31 -04:00
|
|
|
Copyright (C) 2010-2012 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.
|
2012-04-13 13:06:35 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtkmm/comboboxtext.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/table.h>
|
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/liststore.h>
|
|
|
|
#include <gtkmm/notebook.h>
|
|
|
|
#include <gtkmm/scrolledwindow.h>
|
|
|
|
|
2012-04-13 17:46:26 -04:00
|
|
|
namespace Gtk {
|
|
|
|
class CellRendererCombo;
|
|
|
|
}
|
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
#include "button.h"
|
|
|
|
|
2012-04-13 13:06:35 -04:00
|
|
|
#include "i18n.h"
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
namespace ArdourSurface {
|
|
|
|
|
|
|
|
class MackieControlProtocol;
|
|
|
|
|
2012-04-13 13:06:35 -04:00
|
|
|
class MackieControlProtocolGUI : public Gtk::Notebook
|
|
|
|
{
|
|
|
|
public:
|
2012-04-17 16:41:31 -04:00
|
|
|
MackieControlProtocolGUI (MackieControlProtocol &);
|
|
|
|
|
2012-04-13 13:06:35 -04:00
|
|
|
private:
|
|
|
|
MackieControlProtocol& _cp;
|
|
|
|
Gtk::ComboBoxText _surface_combo;
|
2012-04-17 16:41:31 -04:00
|
|
|
Gtk::ComboBoxText _profile_combo;
|
2012-04-13 13:06:35 -04:00
|
|
|
|
|
|
|
struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
AvailableActionColumns() {
|
|
|
|
add (name);
|
|
|
|
add (path);
|
|
|
|
}
|
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
|
|
|
Gtk::TreeModelColumn<std::string> path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
FunctionKeyColumns() {
|
|
|
|
add (name);
|
2012-04-17 16:41:31 -04:00
|
|
|
add (id);
|
2012-04-13 13:58:36 -04:00
|
|
|
add (plain);
|
2012-04-13 13:06:35 -04:00
|
|
|
add (shift);
|
|
|
|
add (control);
|
|
|
|
add (option);
|
|
|
|
add (cmdalt);
|
|
|
|
add (shiftcontrol);
|
|
|
|
};
|
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
2012-04-17 16:41:31 -04:00
|
|
|
Gtk::TreeModelColumn<Mackie::Button::ID> id;
|
2012-04-13 13:58:36 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> plain;
|
2012-04-13 13:06:35 -04:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
AvailableActionColumns available_action_columns;
|
|
|
|
FunctionKeyColumns function_key_columns;
|
|
|
|
|
|
|
|
Gtk::ScrolledWindow function_key_scroller;
|
|
|
|
Gtk::TreeView function_key_editor;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> function_key_model;
|
|
|
|
Glib::RefPtr<Gtk::TreeStore> available_action_model;
|
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
void build_available_action_menu ();
|
|
|
|
void refresh_function_key_editor ();
|
|
|
|
void build_function_key_editor ();
|
2012-04-13 17:46:26 -04:00
|
|
|
void action_changed (const Glib::ustring &sPath, const Glib::ustring &text, Gtk::TreeModelColumnBase);
|
|
|
|
Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr<Gtk::TreeStore> model, Gtk::TreeModelColumnBase);
|
2012-04-17 16:41:31 -04:00
|
|
|
|
|
|
|
void surface_combo_changed ();
|
|
|
|
void profile_combo_changed ();
|
2012-04-25 17:21:36 -04:00
|
|
|
void ipmidi_spinner_changed ();
|
2012-04-17 16:41:31 -04:00
|
|
|
|
|
|
|
std::map<std::string,std::string> action_map; // map from action names to paths
|
2012-04-18 12:21:16 -04:00
|
|
|
|
|
|
|
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;
|
2012-04-25 00:42:01 -04:00
|
|
|
Gtk::Adjustment ipmidi_base_port_adjustment;
|
|
|
|
Gtk::SpinButton ipmidi_base_port_spinner;
|
2012-05-09 12:44:06 -04:00
|
|
|
Gtk::Button discover_button;
|
|
|
|
|
|
|
|
void discover_clicked ();
|
2015-10-02 21:54:40 -04:00
|
|
|
void recalibrate_faders ();
|
|
|
|
void toggle_backlight ();
|
|
|
|
void touch_sensitive_change ();
|
2012-04-13 13:06:35 -04:00
|
|
|
};
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
}
|
|
|
|
|