2015-11-30 12:51:18 -05:00
|
|
|
/*
|
|
|
|
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>
|
2015-12-01 09:03:16 -05:00
|
|
|
#include <gtkmm/image.h>
|
2015-11-30 12:51:18 -05:00
|
|
|
#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;
|
2015-12-01 09:03:16 -05:00
|
|
|
Gtk::HBox hpacker;
|
2015-11-30 12:51:18 -05:00
|
|
|
Gtk::Table table;
|
|
|
|
Gtk::Table action_table;
|
|
|
|
Gtk::ComboBox input_combo;
|
|
|
|
Gtk::ComboBox output_combo;
|
2015-12-01 09:03:16 -05:00
|
|
|
Gtk::Image image;
|
2015-11-30 12:51:18 -05:00
|
|
|
|
|
|
|
/* 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.
|
|
|
|
*/
|
|
|
|
|
2015-12-01 09:23:02 -05:00
|
|
|
Gtk::ComboBox mix_combo[3];
|
|
|
|
Gtk::ComboBox proj_combo[3];
|
|
|
|
Gtk::ComboBox trns_combo[3];
|
2015-12-01 16:19:16 -05:00
|
|
|
Gtk::ComboBox user_combo[2];
|
2015-11-30 12:51:18 -05:00
|
|
|
|
|
|
|
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);
|
2015-12-01 11:20:09 -05:00
|
|
|
void build_user_action_combo (Gtk::ComboBox&, FaderPort::ButtonState);
|
2015-11-30 12:51:18 -05:00
|
|
|
|
|
|
|
void build_available_action_menu ();
|
2015-11-30 15:05:30 -05:00
|
|
|
void action_changed (Gtk::ComboBox*, FaderPort::ButtonID, FaderPort::ButtonState);
|
2015-11-30 12:51:18 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ardour_faderport_gui_h__ */
|