From 914224f808a5611029434c55855448c82053d0f8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 10 Dec 2016 16:01:20 +0100 Subject: Add editor actions to set tempo and meter --- gtk2_ardour/editor_actions.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gtk2_ardour/editor_actions.cc') diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index c9f63c02ba..44d8063af8 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -38,6 +38,7 @@ #include "editing.h" #include "editor.h" #include "gui_thread.h" +#include "main_clock.h" #include "time_axis_view.h" #include "ui_config.h" #include "utils.h" @@ -202,6 +203,9 @@ Editor::register_actions () reg_sens (editor_actions, "select-punch-range", _("Set Range to Punch Range"), sigc::mem_fun(*this, &Editor::set_selection_from_punch)); reg_sens (editor_actions, "select-from-regions", _("Set Range to Selected Regions"), sigc::mem_fun(*this, &Editor::set_selection_from_region)); + reg_sens (editor_actions, "edit-current-tempo", _("Edit Current Tempo"), sigc::mem_fun(*this, &Editor::edit_current_meter)); + reg_sens (editor_actions, "edit-current-meter", _("Edit Current Meter"), sigc::mem_fun(*this, &Editor::edit_current_tempo)); + reg_sens (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true, false)); reg_sens (editor_actions, "alternate-select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true, false)); reg_sens (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false, false)); @@ -991,6 +995,20 @@ Editor::toggle_measure_visibility () } } +void +Editor::edit_current_meter () +{ + ARDOUR::MeterSection* ms = const_cast(&_session->tempo_map().meter_section_at_frame (ARDOUR_UI::instance()->primary_clock->absolute_time())); + edit_meter_section (ms); +} + +void +Editor::edit_current_tempo () +{ + ARDOUR::TempoSection* ts = const_cast(&_session->tempo_map().tempo_section_at_frame (ARDOUR_UI::instance()->primary_clock->absolute_time())); + edit_tempo_section (ts); +} + RefPtr Editor::snap_type_action (SnapType type) { -- cgit v1.2.3