mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Add action to locate to loop start/end
This commit is contained in:
parent
fabb080672
commit
888d91d599
6 changed files with 40 additions and 0 deletions
|
|
@ -123,6 +123,9 @@
|
|||
<menuitem action='jump-forward-to-mark'/>
|
||||
<menuitem action='jump-backward-to-mark'/>
|
||||
<separator/>
|
||||
<menuitem action='jump-to-loop-start'/>
|
||||
<menuitem action='jump-to-loop-end'/>
|
||||
<separator/>
|
||||
<menuitem action='GotoZero'/>
|
||||
<menuitem action='GotoStart'/>
|
||||
<menuitem action='GotoEnd'/>
|
||||
|
|
|
|||
|
|
@ -582,6 +582,11 @@ ARDOUR_UI::install_dependent_actions ()
|
|||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
}
|
||||
|
||||
act = ActionManager::register_action (common_actions, "jump-to-loop-start", _("Jump to Loop Start"), sigc::bind(sigc::mem_fun(*editor, &PublicEditor::jump_to_loop_marker), true));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (common_actions, "jump-to-loop-end", _("Jump to Loop End"), sigc::bind(sigc::mem_fun(*editor, &PublicEditor::jump_to_loop_marker), false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (common_actions, X_("addExistingAudioFiles"), _("Import"), sigc::mem_fun (*editor, &PublicEditor::external_audio_dialog));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::write_sensitive_actions.push_back (act);
|
||||
|
|
|
|||
|
|
@ -1421,6 +1421,7 @@ Editor::set_session (Session *t)
|
|||
_session->locations()->added.connect (_session_connections, invalidator (*this), boost::bind (&Editor::add_new_location, this, _1), gui_context());
|
||||
_session->locations()->removed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::location_gone, this, _1), gui_context());
|
||||
_session->locations()->changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::refresh_location_display, this), gui_context());
|
||||
_session->auto_loop_location_changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::loop_location_changed, this, _1), gui_context ());
|
||||
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
|
||||
|
||||
_playhead_cursor->track_canvas_item().reparent ((ArdourCanvas::Item*) get_cursor_scroll_group());
|
||||
|
|
@ -1434,6 +1435,8 @@ Editor::set_session (Session *t)
|
|||
Config->map_parameters (pc);
|
||||
_session->config.map_parameters (pc);
|
||||
|
||||
loop_location_changed (_session->locations()->auto_loop_location ());
|
||||
|
||||
//tempo_map_changed (PropertyChange (0));
|
||||
reset_metric_marks ();
|
||||
|
||||
|
|
|
|||
|
|
@ -708,11 +708,13 @@ private:
|
|||
void add_new_location (ARDOUR::Location*);
|
||||
ArdourCanvas::Container* add_new_location_internal (ARDOUR::Location*);
|
||||
void location_gone (ARDOUR::Location*);
|
||||
void loop_location_changed (ARDOUR::Location*);
|
||||
void remove_marker (ArdourCanvas::Item&);
|
||||
void remove_marker (ArdourMarker*);
|
||||
gint really_remove_global_marker (ARDOUR::Location* loc);
|
||||
gint really_remove_region_marker (ArdourMarker*);
|
||||
void goto_nth_marker (int nth);
|
||||
void jump_to_loop_marker (bool start);
|
||||
void trigger_script (int nth);
|
||||
void trigger_script_by_name (const std::string script_name, const std::string args = "");
|
||||
void toggle_marker_lines ();
|
||||
|
|
|
|||
|
|
@ -945,6 +945,14 @@ Editor::location_gone (Location *location)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::loop_location_changed (Location* l)
|
||||
{
|
||||
bool s = 0 != l;
|
||||
ActionManager::get_action (X_("Common"), X_("jump-to-loop-start"))->set_sensitive (s);
|
||||
ActionManager::get_action (X_("Common"), X_("jump-to-loop-end"))->set_sensitive (s);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::tempo_map_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
|
||||
{
|
||||
|
|
@ -1950,6 +1958,24 @@ Editor::goto_nth_marker (int n)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::jump_to_loop_marker (bool start)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
Location* l = _session->locations ()->auto_loop_location ();
|
||||
if (!l) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (start) {
|
||||
_session->request_locate (l->start_sample());
|
||||
} else {
|
||||
_session->request_locate (l->end_sample());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_marker_menu_glue ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@ public:
|
|||
virtual void rec_with_count_in () = 0;
|
||||
virtual void maybe_locate_with_edit_preroll (samplepos_t location) = 0;
|
||||
virtual void goto_nth_marker (int nth) = 0;
|
||||
virtual void jump_to_loop_marker (bool start) = 0;
|
||||
virtual void trigger_script (int nth) = 0;
|
||||
virtual void add_location_from_playhead_cursor () = 0;
|
||||
virtual void remove_location_at_playhead_cursor () = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue