#include "pbd/strsplit.h"
#include "pbd/file_utils.h"
-#include "gtkmm2ext/actions.h"
+#include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/utils.h"
#include "faderport.h"
#include "gui.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace PBD;
using namespace ARDOUR;
FPGUI::FPGUI (FaderPort& p)
: fp (p)
, table (2, 5)
- , action_table (4, 4)
+ , action_table (5, 4)
, ignore_active_change (false)
{
set_border_width (12);
build_available_action_menu ();
+ build_foot_action_combo (foot_combo[0], FaderPort::ButtonState(0));
+ build_foot_action_combo (foot_combo[1], FaderPort::ShiftDown);
+ build_foot_action_combo (foot_combo[2], FaderPort::LongPress);
+
/* No shift-press combo for User because that is labelled as "next"
* (marker)
*/
action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
action_row++;
+ l = manage (new Gtk::Label);
+ l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Footswitch")));
+ l->set_alignment (1.0, 0.5);
+ action_table.attach (*l, 0, 1, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
+ align = manage (new Alignment);
+ align->set (0.0, 0.5);
+ align->add (foot_combo[0]);
+ action_table.attach (*align, 1, 2, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
+ align = manage (new Alignment);
+ align->set (0.0, 0.5);
+ align->add (foot_combo[1]);
+ action_table.attach (*align, 2, 3, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
+ align = manage (new Alignment);
+ align->set (0.0, 0.5);
+ align->add (foot_combo[2]);
+ action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
+ action_row++;
+
table.attach (action_table, 0, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
vector<string> labels;
vector<string> tooltips;
vector<string> keys;
- vector<AccelKey> bindings;
+ vector<Glib::RefPtr<Gtk::Action> > actions;
+
+ Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions);
+
typedef std::map<string,TreeIter> NodeMap;
NodeMap nodes;
NodeMap::iterator r;
- ActionManager::get_all_actions (labels, paths, tooltips, keys, bindings);
vector<string>::iterator k;
vector<string>::iterator p;
{
vector<pair<string,string> > actions;
- actions.push_back (make_pair (string (_("Toggle Editor & Mixer Windows")), string (X_("Common/toggle-editor-mixer"))));
+ actions.push_back (make_pair (string (_("Toggle Editor & Mixer Windows")), string (X_("Common/toggle-editor-and-mixer"))));
actions.push_back (make_pair (string (_("Show/Hide Mixer list")), string (X_("Common/ToggleMixerList"))));
actions.push_back (make_pair (string("Toggle Meterbridge"), string(X_("Common/toggle-meterbridge"))));
actions.push_back (make_pair (string (_("Show/Hide Editor mixer strip")), string (X_("Editor/show-editor-mixer"))));
build_action_combo (cb, actions, FaderPort::Trns, bs);
}
+void
+FPGUI::build_foot_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs)
+{
+ vector<pair<string,string> > actions;
+
+ actions.push_back (make_pair (string("Toggle Roll"), string(X_("Transport/ToggleRoll"))));
+ actions.push_back (make_pair (string("Toggle Rec-Enable"), string(X_("Transport/Record"))));
+ actions.push_back (make_pair (string("Toggle Roll+Rec"), string(X_("Transport/record-roll"))));
+ actions.push_back (make_pair (string("Toggle Loop"), string(X_("Transport/Loop"))));
+ actions.push_back (make_pair (string("Toggle Click"), string(X_("Transport/ToggleClick"))));
+
+ build_action_combo (cb, actions, FaderPort::Footswitch, bs);
+}
+
bool
FPGUI::find_action_in_model (const TreeModel::iterator& iter, std::string const & action_path, TreeModel::iterator* found)
{