#include "pbd/file_utils.h"
-#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/actions.h"
-#include "gtkmm2ext/bindings.h"
+#include "gtkmm2ext/keyboard.h"
#include "ardour/filesystem_paths.h"
#include "tooltips.h"
#include "utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
, _piano (0)
, piano (0)
, se (&seditor)
+ , myactions (X_("step entry"))
{
register_actions ();
load_bindings ();
forward to main window
*/
- if (!gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
- KeyboardKey k (ev->state, ev->keyval);
-
- if (bindings.activate (k, Bindings::Press)) {
- return true;
- }
+ if (gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
+ return true;
}
- return relay_key_press (ev);
+ return relay_key_press (ev, this);
}
bool
StepEntry::on_key_release_event (GdkEventKey* ev)
{
- if (!gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
- KeyboardKey k (ev->state, ev->keyval);
-
- if (bindings.activate (k, Bindings::Release)) {
- return true;
- }
+ if (gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
+ return true;
}
/* don't forward releases */
myactions.register_action (group, "octave-9", _("Switch to the 10th octave"), sigc::mem_fun (*this, &StepEntry::octave_9));
myactions.register_action (group, "octave-10", _("Switch to the 11th octave"), sigc::mem_fun (*this, &StepEntry::octave_10));
- myactions.register_toggle_action (group, "toggle-triplet", _("Toggle Triple Notes"),
- sigc::mem_fun (*this, &StepEntry::toggle_triplet));
-
- myactions.register_toggle_action (group, "toggle-chord", _("Toggle Chord Entry"),
- sigc::mem_fun (*this, &StepEntry::toggle_chord));
- myactions.register_action (group, "sustain", _("Sustain Selected Notes by Note Length"),
- sigc::mem_fun (*this, &StepEntry::do_sustain));
-
- myactions.register_action (group, "sync-to-edit-point", _("Move Insert Position to Edit Point"),
- sigc::mem_fun (*this, &StepEntry::sync_to_edit_point));
- myactions.register_action (group, "back", _("Move Insert Position Back by Note Length"),
- sigc::mem_fun (*this, &StepEntry::back));
- RadioAction::Group note_length_group;
-
- myactions.register_radio_action (group, note_length_group, "note-length-whole",
- _("Set Note Length to Whole"), sigc::mem_fun (*this, &StepEntry::note_length_change), 1);
- myactions.register_radio_action (group, note_length_group, "note-length-half",
- _("Set Note Length to 1/2"), sigc::mem_fun (*this, &StepEntry::note_length_change), 2);
- myactions.register_radio_action (group, note_length_group, "note-length-third",
- _("Set Note Length to 1/3"), sigc::mem_fun (*this, &StepEntry::note_length_change), 3);
- myactions.register_radio_action (group, note_length_group, "note-length-quarter",
- _("Set Note Length to 1/4"), sigc::mem_fun (*this, &StepEntry::note_length_change), 4);
- myactions.register_radio_action (group, note_length_group, "note-length-eighth",
- _("Set Note Length to 1/8"), sigc::mem_fun (*this, &StepEntry::note_length_change), 8);
- myactions.register_radio_action (group, note_length_group, "note-length-sixteenth",
- _("Set Note Length to 1/16"), sigc::mem_fun (*this, &StepEntry::note_length_change), 16);
- myactions.register_radio_action (group, note_length_group, "note-length-thirtysecond",
- _("Set Note Length to 1/32"), sigc::mem_fun (*this, &StepEntry::note_length_change), 32);
- myactions.register_radio_action (group, note_length_group, "note-length-sixtyfourth",
- _("Set Note Length to 1/64"), sigc::mem_fun (*this, &StepEntry::note_length_change), 64);
-
- RadioAction::Group note_velocity_group;
-
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-ppp",
- _("Set Note Velocity to Pianississimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 1);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-pp",
- _("Set Note Velocity to Pianissimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 16);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-p",
- _("Set Note Velocity to Piano"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 32);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-mp",
- _("Set Note Velocity to Mezzo-Piano"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 64);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-mf",
- _("Set Note Velocity to Mezzo-Forte"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 80);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-f",
- _("Set Note Velocity to Forte"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 96);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-ff",
- _("Set Note Velocity to Fortississimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 112);
- myactions.register_radio_action (group, note_velocity_group, "note-velocity-fff",
- _("Set Note Velocity to Fortississimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 127);
-
-
- RadioAction::Group dot_group;
-
- myactions.register_radio_action (group, dot_group, "no-dotted", _("No Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 0);
- myactions.register_radio_action (group, dot_group, "toggle-dotted", _("Toggled Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 1);
- myactions.register_radio_action (group, dot_group, "toggle-double-dotted", _("Toggled Double-Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 2);
- myactions.register_radio_action (group, dot_group, "toggle-triple-dotted", _("Toggled Triple-Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 3);
+ myactions.register_toggle_action (group, "toggle-triplet", _("Toggle Triple Notes"),
+ sigc::mem_fun (*this, &StepEntry::toggle_triplet));
+
+ myactions.register_toggle_action (group, "toggle-chord", _("Toggle Chord Entry"),
+ sigc::mem_fun (*this, &StepEntry::toggle_chord));
+ myactions.register_action (group, "sustain", _("Sustain Selected Notes by Note Length"),
+ sigc::mem_fun (*this, &StepEntry::do_sustain));
+
+ myactions.register_action (group, "sync-to-edit-point", _("Move Insert Position to Edit Point"),
+ sigc::mem_fun (*this, &StepEntry::sync_to_edit_point));
+ myactions.register_action (group, "back", _("Move Insert Position Back by Note Length"),
+ sigc::mem_fun (*this, &StepEntry::back));
+ RadioAction::Group note_length_group;
+
+ myactions.register_radio_action (group, note_length_group, "note-length-whole",
+ _("Set Note Length to Whole"), sigc::mem_fun (*this, &StepEntry::note_length_change), 1);
+ myactions.register_radio_action (group, note_length_group, "note-length-half",
+ _("Set Note Length to 1/2"), sigc::mem_fun (*this, &StepEntry::note_length_change), 2);
+ myactions.register_radio_action (group, note_length_group, "note-length-third",
+ _("Set Note Length to 1/3"), sigc::mem_fun (*this, &StepEntry::note_length_change), 3);
+ myactions.register_radio_action (group, note_length_group, "note-length-quarter",
+ _("Set Note Length to 1/4"), sigc::mem_fun (*this, &StepEntry::note_length_change), 4);
+ myactions.register_radio_action (group, note_length_group, "note-length-eighth",
+ _("Set Note Length to 1/8"), sigc::mem_fun (*this, &StepEntry::note_length_change), 8);
+ myactions.register_radio_action (group, note_length_group, "note-length-sixteenth",
+ _("Set Note Length to 1/16"), sigc::mem_fun (*this, &StepEntry::note_length_change), 16);
+ myactions.register_radio_action (group, note_length_group, "note-length-thirtysecond",
+ _("Set Note Length to 1/32"), sigc::mem_fun (*this, &StepEntry::note_length_change), 32);
+ myactions.register_radio_action (group, note_length_group, "note-length-sixtyfourth",
+ _("Set Note Length to 1/64"), sigc::mem_fun (*this, &StepEntry::note_length_change), 64);
+
+ RadioAction::Group note_velocity_group;
+
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-ppp",
+ _("Set Note Velocity to Pianississimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 1);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-pp",
+ _("Set Note Velocity to Pianissimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 16);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-p",
+ _("Set Note Velocity to Piano"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 32);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-mp",
+ _("Set Note Velocity to Mezzo-Piano"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 64);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-mf",
+ _("Set Note Velocity to Mezzo-Forte"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 80);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-f",
+ _("Set Note Velocity to Forte"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 96);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-ff",
+ _("Set Note Velocity to Fortississimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 112);
+ myactions.register_radio_action (group, note_velocity_group, "note-velocity-fff",
+ _("Set Note Velocity to Fortississimo"), sigc::mem_fun (*this, &StepEntry::note_velocity_change), 127);
+
+
+ RadioAction::Group dot_group;
+
+ myactions.register_radio_action (group, dot_group, "no-dotted", _("No Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 0);
+ myactions.register_radio_action (group, dot_group, "toggle-dotted", _("Toggled Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 1);
+ myactions.register_radio_action (group, dot_group, "toggle-double-dotted", _("Toggled Double-Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 2);
+ myactions.register_radio_action (group, dot_group, "toggle-triple-dotted", _("Toggled Triple-Dotted Notes"), sigc::mem_fun (*this, &StepEntry::dot_change), 3);
}
void
StepEntry::load_bindings ()
{
- bindings.set_action_map (myactions);
- bindings.load ("step-editing");
+ bindings = Bindings::get_bindings (X_("Step Editing"), myactions);
+ set_data ("ardour-bindings", bindings);
}
void