move zoom in/out actions into shared "Editing" group

This commit is contained in:
Paul Davis 2024-11-26 21:20:11 -07:00
parent 7e08e560cc
commit 5b112e489b
12 changed files with 26 additions and 16 deletions

View file

@ -106,8 +106,9 @@ This mode provides many different operations on both regions and control points,
;; punctuation
@vis|Editor/temporal-zoom-in| equal|zoom in
@vis|Editor/temporal-zoom-out| minus|zoom out
@editing|Editing/temporal-zoom-in| equal|zoom in
@editing|Editing/temporal-zoom-out| minus|zoom out
@vis|Editor/expand-tracks| <@TERTIARY@>plus|expand track height
@vis|Editor/shrink-tracks| <@SECONDARY@><@TERTIARY@>plus|shrink track height
@vis|Editor/zoom-to-session| <@SECONDARY@><@TERTIARY@>underscore|zoom to session

View file

@ -260,6 +260,9 @@ EditingContext::register_common_actions (Bindings* common_bindings)
_common_actions = ActionManager::create_action_group (common_bindings, X_("Editing"));
reg_sens (_common_actions, "temporal-zoom-out", _("Zoom Out"), []() { current_editing_context()->temporal_zoom_step (true); });
reg_sens (_common_actions, "temporal-zoom-in", _("Zoom In"), []() { current_editing_context()->temporal_zoom_step (false); });
undo_action = reg_sens (_common_actions, "undo", S_("Command|Undo"), []() { current_editing_context()->undo(1U) ; });
redo_action = reg_sens (_common_actions, "redo", _("Redo"), []() { current_editing_context()->redo(1U) ; });
alternate_redo_action = reg_sens (_common_actions, "alternate-redo", _("Redo"), []() { current_editing_context()->redo(1U) ; });

View file

@ -178,6 +178,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
virtual void set_selected_midi_region_view (MidiRegionView&);
virtual void temporal_zoom_step (bool zoom_out) = 0;
samplecnt_t get_current_zoom () const { return samples_per_pixel; }
double timeline_origin() const { return _timeline_origin; }

View file

@ -2713,12 +2713,12 @@ Editor::setup_toolbar ()
zoom_in_button.set_name ("zoom button");
zoom_in_button.set_icon (ArdourIcon::ZoomIn);
act = ActionManager::get_action (X_("Editor"), X_("temporal-zoom-in"));
act = ActionManager::get_action (X_("Editing"), X_("temporal-zoom-in"));
zoom_in_button.set_related_action (act);
zoom_out_button.set_name ("zoom button");
zoom_out_button.set_icon (ArdourIcon::ZoomOut);
act = ActionManager::get_action (X_("Editor"), X_("temporal-zoom-out"));
act = ActionManager::get_action (X_("Editing"), X_("temporal-zoom-out"));
zoom_out_button.set_related_action (act);
zoom_out_full_button.set_name ("zoom button");

View file

@ -296,8 +296,6 @@ Editor::register_actions ()
reg_sens (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::cancel_visual_state_op), i - 1));
}
reg_sens (editor_actions, "temporal-zoom-out", _("Zoom Out"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), true));
reg_sens (editor_actions, "temporal-zoom-in", _("Zoom In"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), false));
reg_sens (editor_actions, "zoom-to-session", _("Zoom to Session"), sigc::mem_fun(*this, &Editor::temporal_zoom_session));
reg_sens (editor_actions, "zoom-to-extents", _("Zoom to Extents"), sigc::mem_fun(*this, &Editor::temporal_zoom_extents));
reg_sens (editor_actions, "zoom-to-selection", _("Zoom to Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), Both));

View file

@ -1815,6 +1815,12 @@ MidiCueEditor::set (TriggerReference & tref)
}
}
void
MidiCueEditor::temporal_zoom_step (bool zoom_out)
{
std::cerr << "MCE: zoom step out ? " << zoom_out << std::endl;
}
void
MidiCueEditor::unset ()
{

View file

@ -58,6 +58,7 @@ class MidiCueEditor : public CueEditor
double visible_canvas_width() const { return _visible_canvas_width; }
samplecnt_t current_page_samples() const;
void temporal_zoom_step (bool zoom_out);
void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<std::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const {}

View file

@ -760,8 +760,8 @@ void BasicUI::zoom_1_min() { access_action("Editor/zoom_1_min"); }
void BasicUI::zoom_5_min() { access_action("Editor/zoom_5_min"); }
void BasicUI::zoom_10_min() { access_action("Editor/zoom_10_min"); }
void BasicUI::zoom_to_session() { access_action("Editor/zoom-to-session"); }
void BasicUI::temporal_zoom_in() { access_action("Editor/temporal-zoom-in"); }
void BasicUI::temporal_zoom_out() { access_action("Editor/temporal-zoom-out"); }
void BasicUI::temporal_zoom_in() { access_action("Editing/temporal-zoom-in"); }
void BasicUI::temporal_zoom_out() { access_action("Editing/temporal-zoom-out"); }
void BasicUI::scroll_up_1_track() { access_action("Editor/step-tracks-up"); }
void BasicUI::scroll_dn_1_track() { access_action("Editor/step-tracks-down"); }

View file

@ -392,8 +392,8 @@ FPGUI::build_proj_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs)
actions.push_back (make_pair (string (_("Zoom to Session")), string (X_("Editor/zoom-to-session"))));
#if 0
actions.push_back (make_pair (string (_("Zoom In")), string (X_("Editor/temporal-zoom-in"))));
actions.push_back (make_pair (string (_("Zoom Out")), string (X_("Editor/temporal-zoom-out"))));
actions.push_back (make_pair (string (_("Zoom In")), string (X_("Editing/temporal-zoom-in"))));
actions.push_back (make_pair (string (_("Zoom Out")), string (X_("Editing/temporal-zoom-out"))));
#endif
build_action_combo (cb, actions, FaderPort::Proj, bs);

View file

@ -348,9 +348,9 @@ Maschine2::encoder_master (int delta)
case MST_NONE:
if (_ctrl->button (M2Contols::BtnShift, M2Contols::ModNone)->active ()) {
if (delta > 0) {
AccessAction ("Editor", "temporal-zoom-in");
AccessAction ("Editing", "temporal-zoom-in");
} else {
AccessAction ("Editor", "temporal-zoom-out");
AccessAction ("Editing", "temporal-zoom-out");
}
} else {
if (delta > 0) {

View file

@ -417,12 +417,12 @@ WiimoteControlProtocol::wiimote_callback (int mesg_count, union cwiid_mesg mesg[
// + = zoom in
if (b & CWIID_BTN_PLUS) {
access_action ("Editor/temporal-zoom-in");
access_action ("Editing/temporal-zoom-in");
}
// - = zoom out
if (b & CWIID_BTN_MINUS) {
access_action ("Editor/temporal-zoom-out");
access_action ("Editing/temporal-zoom-out");
}
// home = no-op

View file

@ -37,9 +37,9 @@
<!-- home -->
<Binding channel="1" note="37" action="Editor/playhead-to-edit"/>
<!-- minus -->
<Binding channel="1" note="38" action="Editor/temporal-zoom-out"/>
<Binding channel="1" note="38" action="Editing/temporal-zoom-out"/>
<!-- plus -->
<Binding channel="1" note="39" action="Editor/temporal-zoom-in"/>
<Binding channel="1" note="39" action="Editing/temporal-zoom-in"/>
<!-- one -->
<Binding channel="1" note="40" action="Editor/track-record-enable-toggle"/>
<!-- Two -->