|
|
|
|
@@ -68,10 +68,8 @@ using std::string;
|
|
|
|
|
|
|
|
|
|
sigc::signal<void> EditingContext::DropDownKeys;
|
|
|
|
|
Gtkmm2ext::Bindings* EditingContext::button_bindings = nullptr;
|
|
|
|
|
Glib::RefPtr<Gtk::ActionGroup> EditingContext::_midi_actions;
|
|
|
|
|
std::vector<std::string> EditingContext::grid_type_strings;
|
|
|
|
|
MouseCursors* EditingContext::_cursors = nullptr;
|
|
|
|
|
EditingContext* EditingContext::_current_editing_context = nullptr;
|
|
|
|
|
|
|
|
|
|
static const gchar *_grid_type_strings[] = {
|
|
|
|
|
N_("No Grid"),
|
|
|
|
|
@@ -109,18 +107,6 @@ static const gchar *_zoom_focus_strings[] = {
|
|
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Editing::GridType EditingContext::_draw_length (GridTypeNone);
|
|
|
|
|
int EditingContext::_draw_velocity (DRAW_VEL_AUTO);
|
|
|
|
|
int EditingContext::_draw_channel (DRAW_CHAN_AUTO);
|
|
|
|
|
sigc::signal<void> EditingContext::DrawLengthChanged;
|
|
|
|
|
sigc::signal<void> EditingContext::DrawVelocityChanged;
|
|
|
|
|
sigc::signal<void> EditingContext::DrawChannelChanged;
|
|
|
|
|
|
|
|
|
|
Glib::RefPtr<Gtk::Action> EditingContext::undo_action;
|
|
|
|
|
Glib::RefPtr<Gtk::Action> EditingContext::redo_action;
|
|
|
|
|
Glib::RefPtr<Gtk::Action> EditingContext::alternate_redo_action;
|
|
|
|
|
Glib::RefPtr<Gtk::Action> EditingContext::alternate_alternate_redo_action;
|
|
|
|
|
|
|
|
|
|
EditingContext::EditingContext (std::string const & name)
|
|
|
|
|
: rubberband_rect (0)
|
|
|
|
|
, _name (name)
|
|
|
|
|
@@ -131,6 +117,9 @@ EditingContext::EditingContext (std::string const & name)
|
|
|
|
|
, internal_snap_mode (SnapOff)
|
|
|
|
|
, _grid_type (GridTypeBeat)
|
|
|
|
|
, _snap_mode (SnapOff)
|
|
|
|
|
, _draw_length (GridTypeNone)
|
|
|
|
|
, _draw_velocity (DRAW_VEL_AUTO)
|
|
|
|
|
, _draw_channel (DRAW_CHAN_AUTO)
|
|
|
|
|
, _timeline_origin (0.)
|
|
|
|
|
, play_note_selection_button (ArdourButton::default_elements)
|
|
|
|
|
, follow_playhead_button (_("F"), ArdourButton::Text, true)
|
|
|
|
|
@@ -341,132 +330,126 @@ EditingContext::register_common_actions (Bindings* common_bindings)
|
|
|
|
|
void
|
|
|
|
|
EditingContext::register_midi_actions (Bindings* midi_bindings)
|
|
|
|
|
{
|
|
|
|
|
/* These actions are all singletons, defined globally for all EditingContexts */
|
|
|
|
|
|
|
|
|
|
if (_midi_actions) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_midi_actions = ActionManager::create_action_group (midi_bindings, X_("Notes"));
|
|
|
|
|
_midi_actions = ActionManager::create_action_group (midi_bindings, _name + X_("Notes"));
|
|
|
|
|
|
|
|
|
|
/* two versions to allow same action for Delete and Backspace */
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("clear-selection"), _("Clear Note Selection"), []() { current_editing_context()->midi_action (&MidiRegionView::clear_note_selection); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("invert-selection"), _("Invert Note Selection"), []() { current_editing_context()->midi_action (&MidiRegionView::invert_selection); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("extend-selection"), _("Extend Note Selection"), []() { current_editing_context()->midi_action (&MidiRegionView::extend_selection); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("duplicate-selection"), _("Duplicate Note Selection"), []() { current_editing_context()->midi_action (&MidiRegionView::duplicate_selection); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("clear-selection"), _("Clear Note Selection"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::clear_note_selection));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("invert-selection"), _("Invert Note Selection"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::invert_selection));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("extend-selection"), _("Extend Note Selection"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::extend_selection));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("duplicate-selection"), _("Duplicate Note Selection"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::duplicate_selection));
|
|
|
|
|
|
|
|
|
|
/* Lengthen */
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-earlier-fine"), _("Move Note Start Earlier (fine)"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_starts_earlier_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-earlier"), _("Move Note Start Earlier"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_starts_earlier); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-later-fine"), _("Move Note Ends Later (fine)"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_ends_later_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-later"), _("Move Note Ends Later"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_ends_later); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-earlier-fine"), _("Move Note Start Earlier (fine)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_starts_earlier_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-earlier"), _("Move Note Start Earlier"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_starts_earlier));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-later-fine"), _("Move Note Ends Later (fine)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_ends_later_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-later"), _("Move Note Ends Later"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_ends_later));
|
|
|
|
|
|
|
|
|
|
/* Shorten */
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-later-fine"), _("Move Note Start Later (fine)"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_starts_later_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-later"), _("Move Note Start Later"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_starts_later); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-earlier-fine"), _("Move Note Ends Earlier (fine)"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_ends_earlier_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-earlier"), _("Move Note Ends Earlier"), []() { current_editing_context()->midi_action (&MidiRegionView::move_note_ends_earlier); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-later-fine"), _("Move Note Start Later (fine)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_starts_later_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-starts-later"), _("Move Note Start Later"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_starts_later));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-earlier-fine"), _("Move Note Ends Earlier (fine)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_ends_earlier_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("move-ends-earlier"), _("Move Note Ends Earlier"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiRegionView::move_note_ends_earlier));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Alt versions allow bindings for both Tab and ISO_Left_Tab, if desired */
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("select-next"), _("Select Next"), []() { current_editing_context()->midi_action (&MidiView::select_next_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-select-next"), _("Select Next (alternate)"), []() { current_editing_context()->midi_action (&MidiView::select_next_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("select-previous"), _("Select Previous"), []() { current_editing_context()->midi_action (&MidiView::select_previous_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-select-previous"), _("Select Previous (alternate)"), []() { current_editing_context()->midi_action (&MidiView::select_previous_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("add-select-next"), _("Add Next to Selection"), []() { current_editing_context()->midi_action (&MidiView::add_select_next_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-add-select-next"), _("Add Next to Selection (alternate)"), []() { current_editing_context()->midi_action (&MidiView::add_select_next_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("add-select-previous"), _("Add Previous to Selection"), []() { current_editing_context()->midi_action (&MidiView::add_select_previous_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-add-select-previous"), _("Add Previous to Selection (alternate)"), []() { current_editing_context()->midi_action (&MidiView::add_select_previous_note); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("select-next"), _("Select Next"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::select_next_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-select-next"), _("Select Next (alternate)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::select_next_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("select-previous"), _("Select Previous"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::select_previous_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-select-previous"), _("Select Previous (alternate)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::select_previous_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("add-select-next"), _("Add Next to Selection"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::add_select_next_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-add-select-next"), _("Add Next to Selection (alternate)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::add_select_next_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("add-select-previous"), _("Add Previous to Selection"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::add_select_previous_note));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("alt-add-select-previous"), _("Add Previous to Selection (alternate)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::add_select_previous_note));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity"), _("Increase Velocity"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine"), _("Increase Velocity (fine)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-smush"), _("Increase Velocity (allow mush)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-together"), _("Increase Velocity (non-relative)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine-smush"), _("Increase Velocity (fine, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_fine_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine-together"), _("Increase Velocity (fine, non-relative)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_fine_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-smush-together"), _("Increase Velocity (maintain ratios, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_smush_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine-smush-together"), _("Increase Velocity (fine, allow mush, non-relative)"), []() { current_editing_context()->midi_action (&MidiView::increase_note_velocity_fine_smush_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity"), _("Increase Velocity"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine"), _("Increase Velocity (fine)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-smush"), _("Increase Velocity (allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_smush));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-together"), _("Increase Velocity (non-relative)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_together));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine-smush"), _("Increase Velocity (fine, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_fine_smush));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine-together"), _("Increase Velocity (fine, non-relative)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_fine_together));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-smush-together"), _("Increase Velocity (maintain ratios, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_smush_together));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("increase-velocity-fine-smush-together"), _("Increase Velocity (fine, allow mush, non-relative)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::increase_note_velocity_fine_smush_together));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity"), _("Decrease Velocity"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine"), _("Decrease Velocity (fine)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-smush"), _("Decrease Velocity (allow mush)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-together"), _("Decrease Velocity (non-relative)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-smush"), _("Decrease Velocity (fine, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_fine_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-together"), _("Decrease Velocity (fine, non-relative)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_fine_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-smush-together"), _("Decrease Velocity (maintain ratios, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_smush_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-smush-together"), _("Decrease Velocity (fine, allow mush, non-relative)"), []() { current_editing_context()->midi_action (&MidiView::decrease_note_velocity_fine_smush_together); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity"), _("Decrease Velocity"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine"), _("Decrease Velocity (fine)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-smush"), _("Decrease Velocity (allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_smush));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-together"), _("Decrease Velocity (non-relative)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_together));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-smush"), _("Decrease Velocity (fine, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_fine_smush));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-together"), _("Decrease Velocity (fine, non-relative)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_fine_together));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-smush-together"), _("Decrease Velocity (maintain ratios, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_smush_together));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-smush-together"), _("Decrease Velocity (fine, allow mush, non-relative)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::decrease_note_velocity_fine_smush_together));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-octave"), _("Transpose Up (octave)"), []() { current_editing_context()->midi_action (&MidiView::transpose_up_octave); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-octave-smush"), _("Transpose Up (octave, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::transpose_up_octave_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-semitone"), _("Transpose Up (semitone)"), []() { current_editing_context()->midi_action (&MidiView::transpose_up_tone); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-semitone-smush"), _("Transpose Up (semitone, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::transpose_up_octave_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-octave"), _("Transpose Up (octave)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_up_octave));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-octave-smush"), _("Transpose Up (octave, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_up_octave_smush));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-semitone"), _("Transpose Up (semitone)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_up_tone));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-up-semitone-smush"), _("Transpose Up (semitone, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_up_octave_smush));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-octave"), _("Transpose Down (octave)"), []() { current_editing_context()->midi_action (&MidiView::transpose_down_octave); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-octave-smush"), _("Transpose Down (octave, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::transpose_down_octave_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-semitone"), _("Transpose Down (semitone)"), []() { current_editing_context()->midi_action (&MidiView::transpose_down_tone); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-semitone-smush"), _("Transpose Down (semitone, allow mush)"), []() { current_editing_context()->midi_action (&MidiView::transpose_down_octave_smush); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-octave"), _("Transpose Down (octave)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_down_octave));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-octave-smush"), _("Transpose Down (octave, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_down_octave_smush));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-semitone"), _("Transpose Down (semitone)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_down_tone));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("transpose-down-semitone-smush"), _("Transpose Down (semitone, allow mush)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::transpose_down_octave_smush));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-later"), _("Nudge Notes Later (grid)"), []() { current_editing_context()->midi_action (&MidiView::nudge_notes_later); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-later-fine"), _("Nudge Notes Later (1/4 grid)"), []() { current_editing_context()->midi_action (&MidiView::nudge_notes_later_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-earlier"), _("Nudge Notes Earlier (grid)"), []() { current_editing_context()->midi_action (&MidiView::nudge_notes_earlier); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-earlier-fine"), _("Nudge Notes Earlier (1/4 grid)"), []() { current_editing_context()->midi_action (&MidiView::nudge_notes_earlier_fine); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-later"), _("Nudge Notes Later (grid)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::nudge_notes_later));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-later-fine"), _("Nudge Notes Later (1/4 grid)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::nudge_notes_later_fine));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-earlier"), _("Nudge Notes Earlier (grid)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::nudge_notes_earlier));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("nudge-earlier-fine"), _("Nudge Notes Earlier (1/4 grid)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::nudge_notes_earlier_fine));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("split-notes-grid"), _("Split Selected Notes on grid boundaries"), []() { current_editing_context()->midi_action (&MidiView::split_notes_grid); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("split-notes-more"), _("Split Selected Notes into more pieces"), []() { current_editing_context()->midi_action (&MidiView::split_notes_more); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("split-notes-less"), _("Split Selected Notes into less pieces"), []() { current_editing_context()->midi_action (&MidiView::split_notes_less); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("join-notes"), _("Join Selected Notes"), []() { current_editing_context()->midi_action (&MidiView::join_notes); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("split-notes-grid"), _("Split Selected Notes on grid boundaries"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::split_notes_grid));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("split-notes-more"), _("Split Selected Notes into more pieces"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::split_notes_more));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("split-notes-less"), _("Split Selected Notes into less pieces"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::split_notes_less));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("join-notes"), _("Join Selected Notes"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::join_notes));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("edit-channels"), _("Edit Note Channels"), []() { current_editing_context()->midi_action (&MidiView::channel_edit); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("edit-velocities"), _("Edit Note Velocities"), []() { current_editing_context()->midi_action (&MidiView::velocity_edit); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("edit-channels"), _("Edit Note Channels"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::channel_edit));
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("edit-velocities"), _("Edit Note Velocities"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::velocity_edit));
|
|
|
|
|
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("quantize-selected-notes"), _("Quantize Selected Notes"), []() { current_editing_context()->midi_action ( &MidiView::quantize_selected_notes); });
|
|
|
|
|
ActionManager::register_action (_midi_actions, X_("quantize-selected-notes"), _("Quantize Selected Notes"), sigc::bind (sigc::mem_fun (*this, &EditingContext::midi_action), &MidiView::quantize_selected_notes));
|
|
|
|
|
|
|
|
|
|
Glib::RefPtr<ActionGroup> length_actions = ActionManager::create_action_group (midi_bindings, X_("DrawLength"));
|
|
|
|
|
Glib::RefPtr<ActionGroup> length_actions = ActionManager::create_action_group (midi_bindings, _name + X_("DrawLength"));
|
|
|
|
|
RadioAction::Group draw_length_group;
|
|
|
|
|
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-thirtyseconds"), grid_type_strings[(int)GridTypeBeatDiv32].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv32); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twentyeighths"), grid_type_strings[(int)GridTypeBeatDiv28].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv28); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twentyfourths"), grid_type_strings[(int)GridTypeBeatDiv24].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv24); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twentieths"), grid_type_strings[(int)GridTypeBeatDiv20].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv20); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-asixteenthbeat"), grid_type_strings[(int)GridTypeBeatDiv16].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv16); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-fourteenths"), grid_type_strings[(int)GridTypeBeatDiv14].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv14); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twelfths"), grid_type_strings[(int)GridTypeBeatDiv12].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv12); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-tenths"), grid_type_strings[(int)GridTypeBeatDiv10].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv10); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-eighths"), grid_type_strings[(int)GridTypeBeatDiv8].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv8); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-sevenths"), grid_type_strings[(int)GridTypeBeatDiv7].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv7); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-sixths"), grid_type_strings[(int)GridTypeBeatDiv6].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv6); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-fifths"), grid_type_strings[(int)GridTypeBeatDiv5].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv5); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-quarters"), grid_type_strings[(int)GridTypeBeatDiv4].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv4); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-thirds"), grid_type_strings[(int)GridTypeBeatDiv3].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv3); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-halves"), grid_type_strings[(int)GridTypeBeatDiv2].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeatDiv2); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-beat"), grid_type_strings[(int)GridTypeBeat].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBeat); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-bar"), grid_type_strings[(int)GridTypeBar].c_str(), []() { EditingContext::draw_length_action_method (Editing::GridTypeBar); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-auto"), _("Auto"), []() { EditingContext::draw_length_action_method (DRAW_LEN_AUTO); });
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-thirtyseconds"), grid_type_strings[(int)GridTypeBeatDiv32].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv32));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twentyeighths"), grid_type_strings[(int)GridTypeBeatDiv28].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv28));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twentyfourths"), grid_type_strings[(int)GridTypeBeatDiv24].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv24));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twentieths"), grid_type_strings[(int)GridTypeBeatDiv20].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv20));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-asixteenthbeat"), grid_type_strings[(int)GridTypeBeatDiv16].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv16));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-fourteenths"), grid_type_strings[(int)GridTypeBeatDiv14].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv14));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-twelfths"), grid_type_strings[(int)GridTypeBeatDiv12].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv12));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-tenths"), grid_type_strings[(int)GridTypeBeatDiv10].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv10));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-eighths"), grid_type_strings[(int)GridTypeBeatDiv8].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv8));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-sevenths"), grid_type_strings[(int)GridTypeBeatDiv7].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv7));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-sixths"), grid_type_strings[(int)GridTypeBeatDiv6].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv6));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-fifths"), grid_type_strings[(int)GridTypeBeatDiv5].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv5));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-quarters"), grid_type_strings[(int)GridTypeBeatDiv4].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv4));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-thirds"), grid_type_strings[(int)GridTypeBeatDiv3].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv3));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-halves"), grid_type_strings[(int)GridTypeBeatDiv2].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeatDiv2));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-beat"), grid_type_strings[(int)GridTypeBeat].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBeat));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-bar"), grid_type_strings[(int)GridTypeBar].c_str(), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), Editing::GridTypeBar));
|
|
|
|
|
ActionManager::register_radio_action (length_actions, draw_length_group, X_("draw-length-auto"), _("Auto"), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), DRAW_LEN_AUTO));
|
|
|
|
|
|
|
|
|
|
Glib::RefPtr<ActionGroup> velocity_actions = ActionManager::create_action_group (midi_bindings, _("Draw Velocity"));
|
|
|
|
|
Glib::RefPtr<ActionGroup> velocity_actions = ActionManager::create_action_group (midi_bindings, _name + X_("DrawVelocity"));
|
|
|
|
|
RadioAction::Group draw_velocity_group;
|
|
|
|
|
ActionManager::register_radio_action (velocity_actions, draw_velocity_group, X_("draw-velocity-auto"), _("Auto"), []() { EditingContext::draw_velocity_action_method (DRAW_VEL_AUTO); });
|
|
|
|
|
ActionManager::register_radio_action (velocity_actions, draw_velocity_group, X_("draw-velocity-auto"), _("Auto"), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), DRAW_VEL_AUTO));
|
|
|
|
|
for (int i = 1; i <= 127; i++) {
|
|
|
|
|
char buf[64];
|
|
|
|
|
snprintf(buf, sizeof (buf), X_("draw-velocity-%d"), i);
|
|
|
|
|
char vel[64];
|
|
|
|
|
sprintf(vel, _("Velocity %d"), i);
|
|
|
|
|
ActionManager::register_radio_action (velocity_actions, draw_velocity_group, buf, vel, [i]() { EditingContext::draw_velocity_action_method (i); });
|
|
|
|
|
ActionManager::register_radio_action (velocity_actions, draw_velocity_group, buf, vel, sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Glib::RefPtr<ActionGroup> channel_actions = ActionManager::create_action_group (midi_bindings, _("Draw Channel"));
|
|
|
|
|
Glib::RefPtr<ActionGroup> channel_actions = ActionManager::create_action_group (midi_bindings, _name + X_("DrawChannel"));
|
|
|
|
|
RadioAction::Group draw_channel_group;
|
|
|
|
|
ActionManager::register_radio_action (channel_actions, draw_channel_group, X_("draw-channel-auto"), _("Auto"), []() { EditingContext::draw_channel_action_method (DRAW_CHAN_AUTO); });
|
|
|
|
|
ActionManager::register_radio_action (channel_actions, draw_channel_group, X_("draw-channel-auto"), _("Auto"), sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_channel_chosen), DRAW_CHAN_AUTO));
|
|
|
|
|
for (int i = 0; i <= 15; i++) {
|
|
|
|
|
char buf[64];
|
|
|
|
|
snprintf(buf, sizeof (buf), X_("draw-channel-%d"), i+1);
|
|
|
|
|
char ch[64];
|
|
|
|
|
sprintf(ch, X_("Channel %d"), i+1);
|
|
|
|
|
ActionManager::register_radio_action (channel_actions, draw_channel_group, buf, ch, [i]() { EditingContext::draw_channel_action_method (i); });
|
|
|
|
|
ActionManager::register_radio_action (channel_actions, draw_channel_group, buf, ch, sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_channel_chosen), i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ActionManager::set_sensitive (_midi_actions, false);
|
|
|
|
|
@@ -713,22 +696,6 @@ EditingContext::grid_type_chosen (GridType type)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
EditingContext::draw_length_action_method (GridType type)
|
|
|
|
|
{
|
|
|
|
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
|
|
|
|
once for the item that became inactive and once for the one that became
|
|
|
|
|
active.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
RefPtr<RadioAction> ract = draw_length_action (type);
|
|
|
|
|
|
|
|
|
|
if (ract && ract->get_active()) {
|
|
|
|
|
/* It doesn't really matter which EditingContext executes this */
|
|
|
|
|
current_editing_context()->set_draw_length_to (type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
EditingContext::draw_length_chosen (GridType type)
|
|
|
|
|
{
|
|
|
|
|
@@ -741,25 +708,7 @@ EditingContext::draw_length_chosen (GridType type)
|
|
|
|
|
|
|
|
|
|
if (ract && ract->get_active()) {
|
|
|
|
|
/* It doesn't really matter which EditingContext executes this */
|
|
|
|
|
current_editing_context()->set_draw_length_to (type);
|
|
|
|
|
} else {
|
|
|
|
|
ract->set_active();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
EditingContext::draw_velocity_action_method (int v)
|
|
|
|
|
{
|
|
|
|
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
|
|
|
|
once for the item that became inactive and once for the one that became
|
|
|
|
|
active.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
RefPtr<RadioAction> ract = draw_velocity_action (v);
|
|
|
|
|
|
|
|
|
|
if (ract && ract->get_active()) {
|
|
|
|
|
/* It doesn't really matter which EditingContext executes this */
|
|
|
|
|
current_editing_context()->set_draw_velocity_to (v);
|
|
|
|
|
set_draw_length_to (type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -775,25 +724,7 @@ EditingContext::draw_velocity_chosen (int v)
|
|
|
|
|
|
|
|
|
|
if (ract && ract->get_active()) {
|
|
|
|
|
/* It doesn't really matter which EditingContext executes this */
|
|
|
|
|
current_editing_context()->set_draw_velocity_to (v);
|
|
|
|
|
} else {
|
|
|
|
|
ract->set_active();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
EditingContext::draw_channel_action_method (int c)
|
|
|
|
|
{
|
|
|
|
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
|
|
|
|
once for the item that became inactive and once for the one that became
|
|
|
|
|
active.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
RefPtr<RadioAction> ract = draw_channel_action (c);
|
|
|
|
|
|
|
|
|
|
if (ract && ract->get_active()) {
|
|
|
|
|
/* It doesn't really matter which EditingContext executes this */
|
|
|
|
|
current_editing_context()->set_draw_channel_to (c);
|
|
|
|
|
set_draw_velocity_to (v);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -809,9 +740,7 @@ EditingContext::draw_channel_chosen (int c)
|
|
|
|
|
|
|
|
|
|
if (ract && ract->get_active()) {
|
|
|
|
|
/* It doesn't really matter which EditingContext executes this */
|
|
|
|
|
current_editing_context()->set_draw_channel_to (c);
|
|
|
|
|
} else {
|
|
|
|
|
ract->set_active();
|
|
|
|
|
set_draw_channel_to (c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1111,7 +1040,7 @@ EditingContext::draw_velocity_action (int v)
|
|
|
|
|
action = buf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
act = ActionManager::get_action (_("Draw Velocity"), action);
|
|
|
|
|
act = ActionManager::get_action ((_name + X_("DrawVelocity")).c_str(), action);
|
|
|
|
|
if (act) {
|
|
|
|
|
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
|
|
|
|
return ract;
|
|
|
|
|
@@ -1135,7 +1064,7 @@ EditingContext::draw_channel_action (int c)
|
|
|
|
|
action = buf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
act = ActionManager::get_action (_("Draw Channel"), action);
|
|
|
|
|
act = ActionManager::get_action ((_name + X_("DrawChannel")).c_str(), action);
|
|
|
|
|
if (act) {
|
|
|
|
|
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
|
|
|
|
return ract;
|
|
|
|
|
@@ -1214,7 +1143,7 @@ EditingContext::draw_length_action (GridType type)
|
|
|
|
|
abort(); /*NOTREACHED*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
act = ActionManager::get_action (X_("DrawLength"), action);
|
|
|
|
|
act = ActionManager::get_action ((_name + X_("DrawLength")).c_str(), action);
|
|
|
|
|
|
|
|
|
|
if (act) {
|
|
|
|
|
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
|
|
|
|
@@ -1290,13 +1219,13 @@ EditingContext::build_draw_midi_menus ()
|
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
|
|
|
|
|
/* Note-Length when drawing */
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeat], []() { EditingContext::draw_length_chosen ((GridType) GridTypeBeat); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv2], []() { EditingContext::draw_length_chosen ((GridType) GridTypeBeatDiv2); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv4], []() { EditingContext::draw_length_chosen ((GridType) GridTypeBeatDiv4); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv8], []() { EditingContext::draw_length_chosen ((GridType) GridTypeBeatDiv8); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv16],[]() { EditingContext::draw_length_chosen ((GridType) GridTypeBeatDiv16); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv32],[]() { EditingContext::draw_length_chosen ((GridType) GridTypeBeatDiv32); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (_("Auto"),[]() { EditingContext::draw_length_chosen ((GridType) DRAW_LEN_AUTO); }));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeat], sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) GridTypeBeat)));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv2], sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) GridTypeBeatDiv2)));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv4], sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) GridTypeBeatDiv4)));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv8], sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) GridTypeBeatDiv8)));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv16],sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) GridTypeBeatDiv16)));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv32],sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) GridTypeBeatDiv32)));
|
|
|
|
|
draw_length_selector.AddMenuElem (MenuElem (_("Auto"),sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_length_chosen), (GridType) DRAW_LEN_AUTO)));
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::string> draw_grid_type_strings = {grid_type_strings.begin() + GridTypeBeat, grid_type_strings.begin() + GridTypeBeatDiv32 + 1};
|
|
|
|
|
@@ -1306,21 +1235,21 @@ EditingContext::build_draw_midi_menus ()
|
|
|
|
|
|
|
|
|
|
/* Note-Velocity when drawing */
|
|
|
|
|
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("8", []() { EditingContext::draw_velocity_chosen (8); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("32", []() { EditingContext::draw_velocity_chosen (32); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("64", []() { EditingContext::draw_velocity_chosen (64); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("82", []() { EditingContext::draw_velocity_chosen (82); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("100", []() { EditingContext::draw_velocity_chosen (100); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("127", []() { EditingContext::draw_velocity_chosen (127); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem (_("Auto"),[]() { EditingContext::draw_velocity_chosen (DRAW_VEL_AUTO); }));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("8", sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), 8)));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("32", sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), 32)));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("64", sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), 64)));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("82", sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), 82)));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("100", sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), 100)));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem ("127", sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), 127)));
|
|
|
|
|
draw_velocity_selector.AddMenuElem (MenuElem (_("Auto"),sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_velocity_chosen), DRAW_VEL_AUTO)));
|
|
|
|
|
|
|
|
|
|
/* Note-Channel when drawing */
|
|
|
|
|
for (int i = 0; i<= 15; i++) {
|
|
|
|
|
char buf[64];
|
|
|
|
|
sprintf(buf, "%d", i+1);
|
|
|
|
|
draw_channel_selector.AddMenuElem (MenuElem (buf, [i]() { EditingContext::draw_channel_chosen (i); }));
|
|
|
|
|
draw_channel_selector.AddMenuElem (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_channel_chosen), i)));
|
|
|
|
|
}
|
|
|
|
|
draw_channel_selector.AddMenuElem (MenuElem (_("Auto"),[]() { EditingContext::draw_channel_chosen (DRAW_CHAN_AUTO); }));
|
|
|
|
|
draw_channel_selector.AddMenuElem (MenuElem (_("Auto"),sigc::bind (sigc::mem_fun (*this, &EditingContext::draw_channel_chosen), DRAW_CHAN_AUTO)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
@@ -2087,19 +2016,6 @@ EditingContext::apply_midi_note_edit_op (MidiOperator& op, const RegionSelection
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EditingContext*
|
|
|
|
|
EditingContext::current_editing_context()
|
|
|
|
|
{
|
|
|
|
|
return _current_editing_context;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
EditingContext::switch_editing_context (EditingContext* ec)
|
|
|
|
|
{
|
|
|
|
|
assert (ec);
|
|
|
|
|
_current_editing_context = ec;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double
|
|
|
|
|
EditingContext::horizontal_position () const
|
|
|
|
|
{
|
|
|
|
|
@@ -3288,15 +3204,15 @@ EditingContext::load_shared_bindings ()
|
|
|
|
|
* the keys may overlap.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
Bindings* midi_bindings = Bindings::get_bindings (X_("MIDI"));
|
|
|
|
|
register_midi_actions (midi_bindings);
|
|
|
|
|
|
|
|
|
|
Bindings* b = Bindings::get_bindings (X_("Editing"));
|
|
|
|
|
|
|
|
|
|
/* Copy the Editing bindings, which will make them refer to actions
|
|
|
|
|
/* Copy each set of shared bindings but give them a new name, which will make them refer to actions
|
|
|
|
|
* named after this EditingContext (ie. unique to this EC)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
Bindings* m = Bindings::get_bindings (X_("MIDI"));
|
|
|
|
|
Bindings* midi_bindings = new Bindings (_name, *m);
|
|
|
|
|
register_midi_actions (midi_bindings);
|
|
|
|
|
|
|
|
|
|
Bindings* b = Bindings::get_bindings (X_("Editing"));
|
|
|
|
|
Bindings* shared_bindings = new Bindings (_name, *b);
|
|
|
|
|
register_common_actions (shared_bindings);
|
|
|
|
|
|
|
|
|
|
|