2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <gtk/gtkiconfactory.h>
23 #include "ardour/ardour.h"
24 #include "ardour/profile.h"
27 #include "ardour_ui.h"
30 #include "gui_thread.h"
31 #include "time_axis_view.h"
34 #include "audio_time_axis.h"
35 #include "editor_group_tabs.h"
36 #include "editor_routes.h"
37 #include "editor_regions.h"
43 using namespace ARDOUR;
45 using namespace Editing;
48 Editor::register_actions ()
52 editor_actions = ActionGroup::create (X_("Editor"));
54 /* non-operative menu items for menu bar */
56 ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align"));
57 ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect"));
58 ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades"));
59 ActionManager::register_action (editor_actions, X_("Edit"), _("Edit"));
60 ActionManager::register_action (editor_actions, X_("EditCursorMovementOptions"), _("Move Selected Marker"));
61 ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations"));
62 ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions"));
63 ActionManager::register_action (editor_actions, X_("EditPointMenu"), _("Edit Point"));
64 ActionManager::register_action (editor_actions, X_("FadeMenu"), _("Fade"));
65 ActionManager::register_action (editor_actions, X_("LatchMenu"), _("Latch"));
66 ActionManager::register_action (editor_actions, X_("Layering"), _("Layering"));
67 ActionManager::register_action (editor_actions, X_("Link"), _("Link"));
68 ActionManager::register_action (editor_actions, X_("ZoomFocusMenu"), _("Zoom Focus"));
69 ActionManager::register_action (editor_actions, X_("KeyMouseActions"), _("Key Mouse"));
70 ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate to Markers"));
71 ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers"));
72 ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff"));
73 ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold"));
74 ActionManager::register_action (editor_actions, X_("MiscOptions"), _("Misc Options"));
75 ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring"));
76 ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark"));
77 ActionManager::register_action (editor_actions, X_("MovePlayHeadMenu"), _("Playhead"));
78 ActionManager::register_action (editor_actions, X_("NudgeRegionMenu"), _("Nudge"));
79 ActionManager::register_action (editor_actions, X_("PlayMenu"), _("Play"));
80 ActionManager::register_action (editor_actions, X_("PrimaryClockMenu"), _("Primary Clock"));
81 ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown"));
82 ActionManager::register_action (editor_actions, X_("RegionMenu"), _("Region"));
83 ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations"));
84 ActionManager::register_action (editor_actions, X_("RegionGainMenu"), _("Gain"));
85 ActionManager::register_action (editor_actions, X_("RulerMenu"), _("Rulers"));
86 ActionManager::register_action (editor_actions, X_("SavedViewMenu"), _("Views"));
87 ActionManager::register_action (editor_actions, X_("ScrollMenu"), _("Scroll"));
88 ActionManager::register_action (editor_actions, X_("SecondaryClockMenu"), _("Secondary Clock"));
89 ActionManager::register_action (editor_actions, X_("Select"), _("Select"));
90 ActionManager::register_action (editor_actions, X_("SelectMenu"), _("Select"));
91 ActionManager::register_action (editor_actions, X_("SeparateMenu"), _("Separate"));
92 ActionManager::register_action (editor_actions, X_("SetLoopMenu"), _("Loop"));
93 ActionManager::register_action (editor_actions, X_("SetPunchMenu"), _("Punch"));
94 ActionManager::register_action (editor_actions, X_("Solo"), _("Solo"));
95 ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes"));
96 ActionManager::register_action (editor_actions, X_("SyncMenu"), _("Sync"));
97 ActionManager::register_action (editor_actions, X_("TempoMenu"), _("Tempo"));
98 ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps"));
99 ActionManager::register_action (editor_actions, X_("TrackHeightMenu"), _("Height"));
100 ActionManager::register_action (editor_actions, X_("TrackMenu"), _("Track"));
101 ActionManager::register_action (editor_actions, X_("Tools"), _("Tools"));
102 ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim"));
103 ActionManager::register_action (editor_actions, X_("View"), _("View"));
104 ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom Focus"));
105 ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom"));
107 /* add named actions for the editor */
109 ActionManager::register_action (editor_actions, "break-drag", _("Break drag"), mem_fun (*this, &Editor::break_drag));
111 act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
112 ActionManager::session_sensitive_actions.push_back (act);
113 act = ActionManager::register_toggle_action (editor_actions, "show-editor-list", _("Show Editor List"), mem_fun (*this, &Editor::editor_list_button_toggled));
114 ActionManager::session_sensitive_actions.push_back (act);
116 act = ActionManager::register_action (editor_actions, "toggle-selected-region-fade-in", _("Toggle Region Fade In"), bind (mem_fun(*this, &Editor::toggle_selected_region_fades), 1));;
117 ActionManager::session_sensitive_actions.push_back (act);
118 act = ActionManager::register_action (editor_actions, "toggle-selected-region-fade-out", _("Toggle Region Fade Out"), bind (mem_fun(*this, &Editor::toggle_selected_region_fades), -1));;
119 ActionManager::session_sensitive_actions.push_back (act);
120 act = ActionManager::register_action (editor_actions, "toggle-selected-region-fades", _("Toggle Region Fades"), bind (mem_fun(*this, &Editor::toggle_selected_region_fades), 0));
121 ActionManager::session_sensitive_actions.push_back (act);
123 act = ActionManager::register_action (editor_actions, "playhead-to-next-region-boundary", _("Playhead to Next Region Boundary"), bind (mem_fun(*this, &Editor::cursor_to_next_region_boundary), true ));
124 ActionManager::session_sensitive_actions.push_back (act);
125 act = ActionManager::register_action (editor_actions, "playhead-to-next-region-boundary-noselection", _("Playhead to Next Region Boundary (No Track Selection)"), bind (mem_fun(*this, &Editor::cursor_to_next_region_boundary), false ));
126 ActionManager::session_sensitive_actions.push_back (act);
127 act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-boundary", _("Playhead to Previous Region Boundary"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_boundary), true));
128 ActionManager::session_sensitive_actions.push_back (act);
129 act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-boundary-noselection", _("Playhead to Previous Region Boundary (No Track Selection"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_boundary), false));
130 ActionManager::session_sensitive_actions.push_back (act);
132 act = ActionManager::register_action (editor_actions, "playhead-to-next-region-start", _("Playhead to Next Region Start"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), playhead_cursor, RegionPoint (Start)));
133 ActionManager::session_sensitive_actions.push_back (act);
134 act = ActionManager::register_action (editor_actions, "playhead-to-next-region-end", _("Playhead to Next Region End"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), playhead_cursor, RegionPoint (End)));
135 ActionManager::session_sensitive_actions.push_back (act);
136 act = ActionManager::register_action (editor_actions, "playhead-to-next-region-sync", _("Playhead to Next Region Sync"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), playhead_cursor, RegionPoint (SyncPoint)));
137 ActionManager::session_sensitive_actions.push_back (act);
139 act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-start", _("Playhead to Previous Region Start"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), playhead_cursor, RegionPoint (Start)));
140 ActionManager::session_sensitive_actions.push_back (act);
141 act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-end", _("Playhead to Previous Region End"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), playhead_cursor, RegionPoint (End)));
142 ActionManager::session_sensitive_actions.push_back (act);
143 act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-sync", _("Playhead to Previous Region Sync"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), playhead_cursor, RegionPoint (SyncPoint)));
144 ActionManager::session_sensitive_actions.push_back (act);
146 act = ActionManager::register_action (editor_actions, "selected-marker-to-next-region-boundary", _("to Next Region Boundary"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_boundary), true));
147 ActionManager::session_sensitive_actions.push_back (act);
148 act = ActionManager::register_action (editor_actions, "selected-marker-to-next-region-boundary-noselection", _("to Next Region Boundary (No Track Selection)"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_boundary), false));
149 ActionManager::session_sensitive_actions.push_back (act);
150 act = ActionManager::register_action (editor_actions, "selected-marker-to-previous-region-boundary", _("to Previous Region Boundary"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_boundary), true));
151 ActionManager::session_sensitive_actions.push_back (act);
152 act = ActionManager::register_action (editor_actions, "selected-marker-to-previous-region-boundary-noselection", _("to Previous Region Boundary (No Track Selection)"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_boundary), false));
153 ActionManager::session_sensitive_actions.push_back (act);
155 act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-start", _("To Next Region Start"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (Start)));
156 ActionManager::session_sensitive_actions.push_back (act);
157 act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-end", _("To Next Region End"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (End)));
158 ActionManager::session_sensitive_actions.push_back (act);
159 act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-sync", _("To Next Region Sync"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (SyncPoint)));
160 ActionManager::session_sensitive_actions.push_back (act);
162 act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-start", _("To Previous Region Start"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (Start)));
163 ActionManager::session_sensitive_actions.push_back (act);
164 act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-end", _("To Previous Region End"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (End)));
165 ActionManager::session_sensitive_actions.push_back (act);
166 act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-sync", _("To Previous Region Sync"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (SyncPoint)));
167 ActionManager::session_sensitive_actions.push_back (act);
169 act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("To Range Start"), mem_fun(*this, &Editor::selected_marker_to_selection_start));
170 ActionManager::session_sensitive_actions.push_back (act);
171 act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("To Range End"), mem_fun(*this, &Editor::selected_marker_to_selection_end));
172 ActionManager::session_sensitive_actions.push_back (act);
174 act = ActionManager::register_action (editor_actions, "playhead-to-range-start", _("Playhead to Range Start"), bind (mem_fun(*this, &Editor::cursor_to_selection_start), playhead_cursor));
175 ActionManager::session_sensitive_actions.push_back (act);
176 act = ActionManager::register_action (editor_actions, "playhead-to-range-end", _("Playhead to Range End"), bind (mem_fun(*this, &Editor::cursor_to_selection_end), playhead_cursor));
177 ActionManager::session_sensitive_actions.push_back (act);
179 act = ActionManager::register_action (editor_actions, "select-all", _("Select All"), bind (mem_fun(*this, &Editor::select_all), Selection::Set));
180 ActionManager::session_sensitive_actions.push_back (act);
181 act = ActionManager::register_action (editor_actions, "deselect-all", _("Deselect All"), mem_fun(*this, &Editor::deselect_all));
182 ActionManager::session_sensitive_actions.push_back (act);
183 act = ActionManager::register_action (editor_actions, "invert-selection", _("Invert Selection"), mem_fun(*this, &Editor::invert_selection));
184 ActionManager::session_sensitive_actions.push_back (act);
185 act = ActionManager::register_action (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
186 ActionManager::session_sensitive_actions.push_back (act);
187 act = ActionManager::register_action (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
188 ActionManager::session_sensitive_actions.push_back (act);
190 act = ActionManager::register_action (editor_actions, "select-all-between-cursors", _("Select All Overlapping Edit Range"), bind (mem_fun(*this, &Editor::select_all_selectables_between), false));
191 ActionManager::session_sensitive_actions.push_back (act);
192 act = ActionManager::register_action (editor_actions, "select-all-within-cursors", _("Select All Inside Edit Range"), bind (mem_fun(*this, &Editor::select_all_selectables_between), true));
193 ActionManager::session_sensitive_actions.push_back (act);
195 act = ActionManager::register_action (editor_actions, "select-range-between-cursors", _("Select Edit Range"), mem_fun(*this, &Editor::select_range_between));
196 ActionManager::session_sensitive_actions.push_back (act);
198 act = ActionManager::register_action (editor_actions, "select-all-in-punch-range", _("Select All in Punch Range"), mem_fun(*this, &Editor::select_all_selectables_using_punch));
199 ActionManager::session_sensitive_actions.push_back (act);
200 act = ActionManager::register_action (editor_actions, "select-all-in-loop-range", _("Select All in Loop Range"), mem_fun(*this, &Editor::select_all_selectables_using_loop));
201 ActionManager::session_sensitive_actions.push_back (act);
203 act = ActionManager::register_action (editor_actions, "select-next-route", _("Select Next Track/Bus"), mem_fun(*this, &Editor::select_next_route));
204 ActionManager::session_sensitive_actions.push_back (act);
205 act = ActionManager::register_action (editor_actions, "select-prev-route", _("Select Previous Track/Bus"), mem_fun(*this, &Editor::select_prev_route));
206 ActionManager::session_sensitive_actions.push_back (act);
208 act = ActionManager::register_action (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), mem_fun(*this, &Editor::toggle_record_enable));
209 ActionManager::session_sensitive_actions.push_back (act);
212 act = ActionManager::register_action (editor_actions, "save-visual-state-1", _("Save View 1"), bind (mem_fun (*this, &Editor::start_visual_state_op), 0));
213 ActionManager::session_sensitive_actions.push_back (act);
214 act = ActionManager::register_action (editor_actions, "goto-visual-state-1", _("Goto View 1"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 0));
215 ActionManager::session_sensitive_actions.push_back (act);
216 act = ActionManager::register_action (editor_actions, "save-visual-state-2", _("Save View 2"), bind (mem_fun (*this, &Editor::start_visual_state_op), 1));
217 ActionManager::session_sensitive_actions.push_back (act);
218 act = ActionManager::register_action (editor_actions, "goto-visual-state-2", _("Goto View 2"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 1));
219 ActionManager::session_sensitive_actions.push_back (act);
220 act = ActionManager::register_action (editor_actions, "save-visual-state-3", _("Save View 3"), bind (mem_fun (*this, &Editor::start_visual_state_op), 2));
221 ActionManager::session_sensitive_actions.push_back (act);
222 act = ActionManager::register_action (editor_actions, "goto-visual-state-3", _("Goto View 3"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 2));
223 ActionManager::session_sensitive_actions.push_back (act);
224 act = ActionManager::register_action (editor_actions, "save-visual-state-4", _("Save View 4"), bind (mem_fun (*this, &Editor::start_visual_state_op), 3));
225 ActionManager::session_sensitive_actions.push_back (act);
226 act = ActionManager::register_action (editor_actions, "goto-visual-state-4", _("Goto View 4"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 3));
227 ActionManager::session_sensitive_actions.push_back (act);
228 act = ActionManager::register_action (editor_actions, "save-visual-state-5", _("Save View 5"), bind (mem_fun (*this, &Editor::start_visual_state_op), 4));
229 ActionManager::session_sensitive_actions.push_back (act);
230 act = ActionManager::register_action (editor_actions, "goto-visual-state-5", _("Goto View 5"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 4));
231 ActionManager::session_sensitive_actions.push_back (act);
232 act = ActionManager::register_action (editor_actions, "save-visual-state-6", _("Save View 6"), bind (mem_fun (*this, &Editor::start_visual_state_op), 5));
233 ActionManager::session_sensitive_actions.push_back (act);
234 act = ActionManager::register_action (editor_actions, "goto-visual-state-6", _("Goto View 6"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 5));
235 ActionManager::session_sensitive_actions.push_back (act);
236 act = ActionManager::register_action (editor_actions, "save-visual-state-7", _("Save View 7"), bind (mem_fun (*this, &Editor::start_visual_state_op), 6));
237 ActionManager::session_sensitive_actions.push_back (act);
238 act = ActionManager::register_action (editor_actions, "goto-visual-state-7", _("Goto View 7"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 6));
239 ActionManager::session_sensitive_actions.push_back (act);
240 act = ActionManager::register_action (editor_actions, "save-visual-state-8", _("Save View 8"), bind (mem_fun (*this, &Editor::start_visual_state_op), 7));
241 ActionManager::session_sensitive_actions.push_back (act);
242 act = ActionManager::register_action (editor_actions, "goto-visual-state-8", _("Goto View 8"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 7));
243 ActionManager::session_sensitive_actions.push_back (act);
244 act = ActionManager::register_action (editor_actions, "save-visual-state-9", _("Save View 9"), bind (mem_fun (*this, &Editor::start_visual_state_op), 8));
245 ActionManager::session_sensitive_actions.push_back (act);
246 act = ActionManager::register_action (editor_actions, "goto-visual-state-9", _("Goto View 9"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 8));
247 ActionManager::session_sensitive_actions.push_back (act);
248 act = ActionManager::register_action (editor_actions, "save-visual-state-10", _("Save View 10"), bind (mem_fun (*this, &Editor::start_visual_state_op), 9));
249 ActionManager::session_sensitive_actions.push_back (act);
250 act = ActionManager::register_action (editor_actions, "goto-visual-state-10", _("Goto View 10"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 9));
251 ActionManager::session_sensitive_actions.push_back (act);
252 act = ActionManager::register_action (editor_actions, "save-visual-state-11", _("Save View 11"), bind (mem_fun (*this, &Editor::start_visual_state_op), 10));
253 ActionManager::session_sensitive_actions.push_back (act);
254 act = ActionManager::register_action (editor_actions, "goto-visual-state-11", _("Goto View 11"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 10));
255 ActionManager::session_sensitive_actions.push_back (act);
256 act = ActionManager::register_action (editor_actions, "save-visual-state-12", _("Save View 12"), bind (mem_fun (*this, &Editor::start_visual_state_op), 11));
257 ActionManager::session_sensitive_actions.push_back (act);
258 act = ActionManager::register_action (editor_actions, "goto-visual-state-12", _("Goto View 12"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 11));
259 ActionManager::session_sensitive_actions.push_back (act);
262 act = ActionManager::register_action (editor_actions, "goto-mark-1", _("Locate to Mark 1"), bind (mem_fun (*this, &Editor::goto_nth_marker), 0));
263 ActionManager::session_sensitive_actions.push_back (act);
264 act = ActionManager::register_action (editor_actions, "goto-mark-2", _("Locate to Mark 2"), bind (mem_fun (*this, &Editor::goto_nth_marker), 1));
265 ActionManager::session_sensitive_actions.push_back (act);
266 act = ActionManager::register_action (editor_actions, "goto-mark-3", _("Locate to Mark 3"), bind (mem_fun (*this, &Editor::goto_nth_marker), 2));
267 ActionManager::session_sensitive_actions.push_back (act);
268 act = ActionManager::register_action (editor_actions, "goto-mark-4", _("Locate to Mark 4"), bind (mem_fun (*this, &Editor::goto_nth_marker), 3));
269 ActionManager::session_sensitive_actions.push_back (act);
270 act = ActionManager::register_action (editor_actions, "goto-mark-5", _("Locate to Mark 5"), bind (mem_fun (*this, &Editor::goto_nth_marker), 4));
271 ActionManager::session_sensitive_actions.push_back (act);
272 act = ActionManager::register_action (editor_actions, "goto-mark-6", _("Locate to Mark 6"), bind (mem_fun (*this, &Editor::goto_nth_marker), 5));
273 ActionManager::session_sensitive_actions.push_back (act);
274 act = ActionManager::register_action (editor_actions, "goto-mark-7", _("Locate to Mark 7"), bind (mem_fun (*this, &Editor::goto_nth_marker), 6));
275 ActionManager::session_sensitive_actions.push_back (act);
276 act = ActionManager::register_action (editor_actions, "goto-mark-8", _("Locate to Mark 8"), bind (mem_fun (*this, &Editor::goto_nth_marker), 7));
277 ActionManager::session_sensitive_actions.push_back (act);
278 act = ActionManager::register_action (editor_actions, "goto-mark-9", _("Locate to Mark 9"), bind (mem_fun (*this, &Editor::goto_nth_marker), 8));
279 ActionManager::session_sensitive_actions.push_back (act);
281 act = ActionManager::register_action (editor_actions, "jump-forward-to-mark", _("Jump Forward to Mark"), mem_fun(*this, &Editor::jump_forward_to_mark));
282 ActionManager::session_sensitive_actions.push_back (act);
283 act = ActionManager::register_action (editor_actions, "jump-backward-to-mark", _("Jump Backward to Mark"), mem_fun(*this, &Editor::jump_backward_to_mark));
284 ActionManager::session_sensitive_actions.push_back (act);
285 act = ActionManager::register_action (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), mem_fun(*this, &Editor::add_location_from_playhead_cursor));
286 ActionManager::session_sensitive_actions.push_back (act);
288 act = ActionManager::register_action (editor_actions, "nudge-forward", _("Nudge Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, false));
289 ActionManager::session_sensitive_actions.push_back (act);
290 act = ActionManager::register_action (editor_actions, "nudge-next-forward", _("Nudge Next Forward"), bind (mem_fun(*this, &Editor::nudge_forward), true, false));
291 ActionManager::session_sensitive_actions.push_back (act);
292 act = ActionManager::register_action (editor_actions, "nudge-backward", _("Nudge Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, false));
293 ActionManager::session_sensitive_actions.push_back (act);
294 act = ActionManager::register_action (editor_actions, "nudge-next-backward", _("Nudge Next Backward"), bind (mem_fun(*this, &Editor::nudge_backward), true, false));
295 ActionManager::session_sensitive_actions.push_back (act);
297 act = ActionManager::register_action (editor_actions, "nudge-playhead-forward", _("Nudge Playhead Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, true));
298 ActionManager::session_sensitive_actions.push_back (act);
299 act = ActionManager::register_action (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, true));
300 ActionManager::session_sensitive_actions.push_back (act);
301 act = ActionManager::register_action (editor_actions, "playhead-forward-to-grid", _("Forward to Grid"), mem_fun(*this, &Editor::playhead_forward_to_grid));
302 ActionManager::session_sensitive_actions.push_back (act);
303 act = ActionManager::register_action (editor_actions, "playhead-backward-to-grid", _("Backward to Grid"), mem_fun(*this, &Editor::playhead_backward_to_grid));
304 ActionManager::session_sensitive_actions.push_back (act);
307 act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
308 ActionManager::session_sensitive_actions.push_back (act);
309 act = ActionManager::register_action (editor_actions, "temporal-zoom-in", _("Zoom In"), bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
310 ActionManager::session_sensitive_actions.push_back (act);
311 act = ActionManager::register_action (editor_actions, "zoom-to-session", _("Zoom to Session"), mem_fun(*this, &Editor::temporal_zoom_session));
312 ActionManager::session_sensitive_actions.push_back (act);
313 act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), bind (mem_fun(*this, &Editor::toggle_zoom_region), false));
314 ActionManager::session_sensitive_actions.push_back (act);
315 act = ActionManager::register_action (editor_actions, "zoom-to-region-both-axes", _("Zoom to Region (W&H)"), bind (mem_fun(*this, &Editor::toggle_zoom_region), true));
316 ActionManager::session_sensitive_actions.push_back (act);
317 act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
318 ActionManager::session_sensitive_actions.push_back (act);
320 act = ActionManager::register_action (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), bind (mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true));
321 ActionManager::session_sensitive_actions.push_back (act);
322 act = ActionManager::register_action (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), bind (mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false));
323 ActionManager::session_sensitive_actions.push_back (act);
325 act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up));
326 ActionManager::session_sensitive_actions.push_back (act);
327 act = ActionManager::register_action (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), mem_fun(*this, &Editor::scroll_tracks_down));
328 ActionManager::session_sensitive_actions.push_back (act);
329 act = ActionManager::register_action (editor_actions, "step-tracks-up", _("Step Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up_line));
330 ActionManager::session_sensitive_actions.push_back (act);
331 act = ActionManager::register_action (editor_actions, "step-tracks-down", _("Step Tracks Down"), mem_fun(*this, &Editor::scroll_tracks_down_line));
332 ActionManager::session_sensitive_actions.push_back (act);
334 act = ActionManager::register_action (editor_actions, "scroll-backward", _("Scroll Backward"), bind (mem_fun(*this, &Editor::scroll_backward), 0.8f));
335 ActionManager::session_sensitive_actions.push_back (act);
336 act = ActionManager::register_action (editor_actions, "scroll-forward", _("Scroll Forward"), bind (mem_fun(*this, &Editor::scroll_forward), 0.8f));
337 ActionManager::session_sensitive_actions.push_back (act);
338 act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame));
339 ActionManager::session_sensitive_actions.push_back (act);
340 act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead));
341 ActionManager::session_sensitive_actions.push_back (act);
342 act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Active Marker"), mem_fun(*this, &Editor::center_edit_point));
343 ActionManager::session_sensitive_actions.push_back (act);
345 act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead Forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));;
346 ActionManager::session_sensitive_actions.push_back (act);
347 act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false));
348 ActionManager::session_sensitive_actions.push_back (act);
350 act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead to Active Mark"), bind (mem_fun(*this, &Editor::cursor_align), true));
351 ActionManager::session_sensitive_actions.push_back (act);
352 act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Active Mark to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
353 ActionManager::session_sensitive_actions.push_back (act);
355 act = ActionManager::register_action (editor_actions, "trim-front", _("Trim Start at Edit Point"), mem_fun(*this, &Editor::trim_region_front));
356 ActionManager::session_sensitive_actions.push_back (act);
357 ActionManager::region_selection_sensitive_actions.push_back (act);
358 act = ActionManager::register_action (editor_actions, "trim-back", _("Trim End at Edit Point"), mem_fun(*this, &Editor::trim_region_back));
359 ActionManager::session_sensitive_actions.push_back (act);
360 ActionManager::region_selection_sensitive_actions.push_back (act);
362 act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to Edit Point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
363 ActionManager::session_sensitive_actions.push_back (act);
364 ActionManager::region_selection_sensitive_actions.push_back (act);
365 act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit Point to End"), mem_fun(*this, &Editor::trim_region_to_edit_point));
366 ActionManager::session_sensitive_actions.push_back (act);
367 ActionManager::region_selection_sensitive_actions.push_back (act);
368 act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim to Loop"), mem_fun(*this, &Editor::trim_region_to_loop));
369 ActionManager::session_sensitive_actions.push_back (act);
370 ActionManager::region_selection_sensitive_actions.push_back (act);
371 act = ActionManager::register_action (editor_actions, "trim-region-to-punch", _("Trim to Punch"), mem_fun(*this, &Editor::trim_region_to_punch));
372 ActionManager::session_sensitive_actions.push_back (act);
373 ActionManager::region_selection_sensitive_actions.push_back (act);
375 act = ActionManager::register_action (editor_actions, "trim-to-previous-region", _("Trim to Previous"), mem_fun(*this, &Editor::trim_region_to_previous_region_end));
376 ActionManager::session_sensitive_actions.push_back (act);
377 ActionManager::region_selection_sensitive_actions.push_back (act);
378 act = ActionManager::register_action (editor_actions, "trim-to-next-region", _("Trim to Next"), mem_fun(*this, &Editor::trim_region_to_next_region_start));
379 ActionManager::session_sensitive_actions.push_back (act);
380 ActionManager::region_selection_sensitive_actions.push_back (act);
382 act = ActionManager::register_action (editor_actions, "set-loop-from-edit-range", _("Set Loop from Edit Range"), bind (mem_fun(*this, &Editor::set_loop_from_edit_range), false));
383 ActionManager::session_sensitive_actions.push_back (act);
384 act = ActionManager::register_action (editor_actions, "set-loop-from-region", _("Set Loop from Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), false));
385 ActionManager::session_sensitive_actions.push_back (act);
386 ActionManager::region_selection_sensitive_actions.push_back (act);
387 act = ActionManager::register_action (editor_actions, "loop-region", _("Loop Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), true));
388 ActionManager::session_sensitive_actions.push_back (act);
389 ActionManager::region_selection_sensitive_actions.push_back (act);
390 act = ActionManager::register_action (editor_actions, "set-punch-from-edit-range", _("Set Punch from Edit Range"), mem_fun(*this, &Editor::set_punch_from_edit_range));
391 ActionManager::session_sensitive_actions.push_back (act);
392 act = ActionManager::register_action (editor_actions, "set-punch-from-region", _("Set Punch From Region"), mem_fun(*this, &Editor::set_punch_from_region));
393 ActionManager::session_sensitive_actions.push_back (act);
394 ActionManager::region_selection_sensitive_actions.push_back (act);
395 act = ActionManager::register_action (editor_actions, "pitch-shift-region", _("Transpose"), mem_fun(*this, &Editor::pitch_shift_regions));
396 ActionManager::session_sensitive_actions.push_back (act);
397 ActionManager::region_selection_sensitive_actions.push_back (act);
398 act = ActionManager::register_action (editor_actions, "toggle-opaque-region", _("Toggle Opaque"), mem_fun(*this, &Editor::toggle_region_opaque));
399 ActionManager::session_sensitive_actions.push_back (act);
400 ActionManager::region_selection_sensitive_actions.push_back (act);
401 act = ActionManager::register_action (editor_actions, "add-range-marker-from-region", _("Add 1 Range Marker"), mem_fun(*this, &Editor::add_location_from_audio_region));
402 ActionManager::session_sensitive_actions.push_back (act);
403 ActionManager::region_selection_sensitive_actions.push_back (act);
404 act = ActionManager::register_action (editor_actions, "add-range-markers-from-region", _("Add Range Marker(s)"), mem_fun(*this, &Editor::add_locations_from_audio_region));
405 ActionManager::session_sensitive_actions.push_back (act);
406 ActionManager::region_selection_sensitive_actions.push_back (act);
408 act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true));
409 ActionManager::session_sensitive_actions.push_back (act);
410 act = ActionManager::register_action (editor_actions, "toggle-fade-in-active", _("Toggle Fade In Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), true));
411 ActionManager::session_sensitive_actions.push_back (act);
412 act = ActionManager::register_action (editor_actions, "set-fade-out-length", _("Set Fade Out Length"), bind (mem_fun(*this, &Editor::set_fade_length), false));
413 ActionManager::session_sensitive_actions.push_back (act);
414 act = ActionManager::register_action (editor_actions, "toggle-fade-out-active", _("Toggle Fade Out Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), false));
415 ActionManager::session_sensitive_actions.push_back (act);
417 act = ActionManager::register_action (editor_actions, "align-regions-start", _("Align Regions Start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start));
418 ActionManager::session_sensitive_actions.push_back (act);
419 ActionManager::region_selection_sensitive_actions.push_back (act);
420 act = ActionManager::register_action (editor_actions, "align-regions-start-relative", _("Align Regions Start Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::Start));
421 ActionManager::session_sensitive_actions.push_back (act);
422 ActionManager::region_selection_sensitive_actions.push_back (act);
423 act = ActionManager::register_action (editor_actions, "align-regions-end", _("Align Regions End"), bind (mem_fun(*this, &Editor::align), ARDOUR::End));
424 ActionManager::session_sensitive_actions.push_back (act);
425 ActionManager::region_selection_sensitive_actions.push_back (act);
426 act = ActionManager::register_action (editor_actions, "align-regions-end-relative", _("Align Regions End Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::End));
427 ActionManager::session_sensitive_actions.push_back (act);
428 ActionManager::region_selection_sensitive_actions.push_back (act);
430 act = ActionManager::register_action (editor_actions, "align-regions-sync", _("Align Regions Sync"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint));
431 ActionManager::session_sensitive_actions.push_back (act);
432 ActionManager::region_selection_sensitive_actions.push_back (act);
433 act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("Align Regions Sync Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint));
434 ActionManager::session_sensitive_actions.push_back (act);
435 ActionManager::region_selection_sensitive_actions.push_back (act);
437 act = ActionManager::register_action (editor_actions, "play-from-edit-point", _("Play From Edit Point"), mem_fun(*this, &Editor::play_from_edit_point));
438 ActionManager::session_sensitive_actions.push_back (act);
439 act = ActionManager::register_action (editor_actions, "play-from-edit-point-and-return", _("Play from Edit Point & Return"), mem_fun(*this, &Editor::play_from_edit_point_and_return));
440 ActionManager::session_sensitive_actions.push_back (act);
442 act = ActionManager::register_action (editor_actions, "play-edit-range", _("Play Edit Range"), mem_fun(*this, &Editor::play_edit_range));
443 act = ActionManager::register_action (editor_actions, "play-selected-regions", _("Play Selected Region(s)"), mem_fun(*this, &Editor::play_selected_region));
444 ActionManager::session_sensitive_actions.push_back (act);
445 ActionManager::region_selection_sensitive_actions.push_back (act);
446 act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush));
447 ActionManager::session_sensitive_actions.push_back (act);
449 act = ActionManager::register_action (editor_actions, "set-playhead", _("Playhead to Mouse"), mem_fun(*this, &Editor::set_playhead_cursor));
450 ActionManager::session_sensitive_actions.push_back (act);
451 act = ActionManager::register_action (editor_actions, "set-edit-point", _("Active Marker to Mouse"), mem_fun(*this, &Editor::set_edit_point));
452 ActionManager::session_sensitive_actions.push_back (act);
454 act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
455 ActionManager::session_sensitive_actions.push_back (act);
456 ActionManager::region_selection_sensitive_actions.push_back (act);
457 act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true));
458 ActionManager::session_sensitive_actions.push_back (act);
459 ActionManager::region_selection_sensitive_actions.push_back (act);
460 act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
461 ActionManager::session_sensitive_actions.push_back (act);
462 ActionManager::region_selection_sensitive_actions.push_back (act);
463 act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection));
464 ActionManager::session_sensitive_actions.push_back (act);
465 ActionManager::region_selection_sensitive_actions.push_back (act);
466 act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region));
467 ActionManager::session_sensitive_actions.push_back (act);
468 ActionManager::region_selection_sensitive_actions.push_back (act);
469 act = ActionManager::register_action (editor_actions, "rename-region", _("Rename"), mem_fun(*this, &Editor::rename_region));
470 ActionManager::session_sensitive_actions.push_back (act);
471 ActionManager::region_selection_sensitive_actions.push_back (act);
472 act = ActionManager::register_action (editor_actions, "auto-rename-region", _("Auto-Rename"), mem_fun(*this, &Editor::rename_region));
473 ActionManager::session_sensitive_actions.push_back (act);
474 ActionManager::region_selection_sensitive_actions.push_back (act);
475 act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true));
476 ActionManager::session_sensitive_actions.push_back (act);
477 ActionManager::region_selection_sensitive_actions.push_back (act);
478 act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false));
479 ActionManager::session_sensitive_actions.push_back (act);
480 ActionManager::region_selection_sensitive_actions.push_back (act);
481 act = ActionManager::register_action (editor_actions, "split-region", _("Split Region"), mem_fun(*this, &Editor::split));
482 ActionManager::session_sensitive_actions.push_back (act);
483 ActionManager::region_selection_sensitive_actions.push_back (act);
484 act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::set_region_sync_from_edit_point));
485 ActionManager::session_sensitive_actions.push_back (act);
486 ActionManager::region_selection_sensitive_actions.push_back (act);
487 act = ActionManager::register_action (editor_actions, "remove-region-sync", _("Remove Region Sync"), mem_fun(*this, &Editor::remove_region_sync));
488 ActionManager::session_sensitive_actions.push_back (act);
489 ActionManager::region_selection_sensitive_actions.push_back (act);
490 act = ActionManager::register_action (editor_actions, "raise-region", _("Raise Region"), mem_fun(*this, &Editor::raise_region));
491 ActionManager::session_sensitive_actions.push_back (act);
492 ActionManager::region_selection_sensitive_actions.push_back (act);
493 act = ActionManager::register_action (editor_actions, "lower-region", _("Lower Region"), mem_fun(*this, &Editor::lower_region));
494 ActionManager::session_sensitive_actions.push_back (act);
495 ActionManager::region_selection_sensitive_actions.push_back (act);
496 act = ActionManager::register_action (editor_actions, "export-region", _("Export Region"), mem_fun(*this, &Editor::export_region));
497 ActionManager::session_sensitive_actions.push_back (act);
498 ActionManager::region_selection_sensitive_actions.push_back (act);
499 act = ActionManager::register_toggle_action (editor_actions, "lock-region", _("Lock Region"), mem_fun(*this, &Editor::toggle_region_lock));
500 ActionManager::session_sensitive_actions.push_back (act);
501 ActionManager::region_selection_sensitive_actions.push_back (act);
502 act = ActionManager::register_toggle_action (editor_actions, "glue-region", _("Glue Region to Bars & Beats"), bind (mem_fun (*this, &Editor::set_region_lock_style), Region::MusicTime));
503 ActionManager::session_sensitive_actions.push_back (act);
504 ActionManager::region_selection_sensitive_actions.push_back (act);
505 act = ActionManager::register_action (editor_actions, "naturalize-region", _("Move to Original Position"), mem_fun (*this, &Editor::naturalize));
506 ActionManager::session_sensitive_actions.push_back (act);
507 ActionManager::region_selection_sensitive_actions.push_back (act);
508 act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse"), mem_fun (*this, &Editor::reverse_region));
509 ActionManager::session_sensitive_actions.push_back (act);
510 ActionManager::region_selection_sensitive_actions.push_back (act);
511 act = ActionManager::register_action (editor_actions, "monoize-region", _("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region)));
512 ActionManager::session_sensitive_actions.push_back (act);
513 ActionManager::region_selection_sensitive_actions.push_back (act);
514 act = ActionManager::register_action (editor_actions, "region-fill-track", _("Fill Track"), (mem_fun(*this, &Editor::region_fill_track)));
515 ActionManager::session_sensitive_actions.push_back (act);
516 ActionManager::region_selection_sensitive_actions.push_back (act);
517 act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region));
518 ActionManager::session_sensitive_actions.push_back (act);
519 ActionManager::region_selection_sensitive_actions.push_back (act);
521 undo_action = act = ActionManager::register_action (editor_actions, "undo", _("Undo"), bind (mem_fun(*this, &Editor::undo), 1U));
522 ActionManager::session_sensitive_actions.push_back (act);
523 redo_action = act = ActionManager::register_action (editor_actions, "redo", _("Redo"), bind (mem_fun(*this, &Editor::redo), 1U));
524 ActionManager::session_sensitive_actions.push_back (act);
526 act = ActionManager::register_action (editor_actions, "export-audio", _("Export Audio"), mem_fun(*this, &Editor::export_audio));
527 ActionManager::session_sensitive_actions.push_back (act);
528 act = ActionManager::register_action (editor_actions, "export-range", _("Export Range"), mem_fun(*this, &Editor::export_range));
529 ActionManager::session_sensitive_actions.push_back (act);
531 act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection));
532 ActionManager::session_sensitive_actions.push_back (act);
533 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
534 act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch));
535 ActionManager::session_sensitive_actions.push_back (act);
536 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
537 act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop));
538 ActionManager::session_sensitive_actions.push_back (act);
539 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
540 act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
541 ActionManager::session_sensitive_actions.push_back (act);
542 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
543 act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut));
544 ActionManager::session_sensitive_actions.push_back (act);
545 /* Note: for now, editor-delete does the exact same thing as editor-cut */
546 act = ActionManager::register_action (editor_actions, "editor-delete", _("Delete"), mem_fun(*this, &Editor::cut));
547 ActionManager::session_sensitive_actions.push_back (act);
548 act = ActionManager::register_action (editor_actions, "editor-copy", _("Copy"), mem_fun(*this, &Editor::copy));
549 ActionManager::session_sensitive_actions.push_back (act);
550 act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste));
551 ActionManager::session_sensitive_actions.push_back (act);
553 act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region));
554 ActionManager::session_sensitive_actions.push_back (act);
555 ActionManager::region_selection_sensitive_actions.push_back (act);
557 act = ActionManager::register_action (editor_actions, "set-tempo-from-region", _("Set Tempo from Region=Bar"), mem_fun(*this, &Editor::use_region_as_bar));
558 ActionManager::session_sensitive_actions.push_back (act);
559 ActionManager::region_selection_sensitive_actions.push_back (act);
560 act = ActionManager::register_action (editor_actions, "set-tempo-from-edit-range", _("Set Tempo from Edit Range=Bar"), mem_fun(*this, &Editor::use_range_as_bar));
561 ActionManager::session_sensitive_actions.push_back (act);
563 act = ActionManager::register_action (editor_actions, "split-region-at-transients", _("Split Regions At Percussion Onsets"), mem_fun(*this, &Editor::split_region_at_transients));
564 ActionManager::session_sensitive_actions.push_back (act);
565 ActionManager::region_selection_sensitive_actions.push_back (act);
566 act = ActionManager::register_action (editor_actions, "toggle-rhythm-ferret", _("Rhythm Ferret"), mem_fun(*this, &Editor::show_rhythm_ferret));
567 ActionManager::session_sensitive_actions.push_back (act);
568 act = ActionManager::register_action (editor_actions, "toggle-bundle-manager", _("Bundle Manager"), mem_fun (*this, &Editor::show_bundle_manager));
569 ActionManager::session_sensitive_actions.push_back (act);
570 act = ActionManager::register_action (editor_actions, "toggle-audio-connection-manager", _("Audio Connection Manager"), bind (mem_fun (*this, &Editor::show_global_port_matrix), ARDOUR::DataType::AUDIO));
571 ActionManager::session_sensitive_actions.push_back (act);
572 act = ActionManager::register_action (editor_actions, "toggle-midi-connection-manager", _("MIDI Connection Manager"), bind (mem_fun (*this, &Editor::show_global_port_matrix), ARDOUR::DataType::MIDI));
573 ActionManager::session_sensitive_actions.push_back (act);
575 act = ActionManager::register_action (editor_actions, "tab-to-transient-forwards", _("Move Forward to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), true));
576 ActionManager::session_sensitive_actions.push_back (act);
577 act = ActionManager::register_action (editor_actions, "tab-to-transient-backwards", _("Move Backwards to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), false));
578 ActionManager::session_sensitive_actions.push_back (act);
580 act = ActionManager::register_action (editor_actions, "crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
581 ActionManager::session_sensitive_actions.push_back (act);
582 act = ActionManager::register_action (editor_actions, "insert-chunk", _("Insert Chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f));
583 ActionManager::session_sensitive_actions.push_back (act);
585 act = ActionManager::register_action (editor_actions, "start-range", _("Start Range"), mem_fun(*this, &Editor::keyboard_selection_begin));
586 ActionManager::session_sensitive_actions.push_back (act);
587 act = ActionManager::register_action (editor_actions, "finish-range", _("Finish Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), false));
588 ActionManager::session_sensitive_actions.push_back (act);
589 act = ActionManager::register_action (editor_actions, "finish-add-range", _("Finish add Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), true));
590 ActionManager::session_sensitive_actions.push_back (act);
592 act = ActionManager::register_action (editor_actions, "extend-range-to-end-of-region", _("Extend Range to End of Region"), bind (mem_fun(*this, &Editor::extend_selection_to_end_of_region), false));
593 ActionManager::session_sensitive_actions.push_back (act);
594 act = ActionManager::register_action (editor_actions, "extend-range-to-start-of-region", _("Extend Range to Start of Region"), bind (mem_fun(*this, &Editor::extend_selection_to_start_of_region), false));
595 ActionManager::session_sensitive_actions.push_back (act);
597 act = ActionManager::register_toggle_action (editor_actions, "toggle-follow-playhead", _("Follow Playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
598 ActionManager::session_sensitive_actions.push_back (act);
599 act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (mem_fun(*this, &Editor::remove_last_capture)));
600 ActionManager::session_sensitive_actions.push_back (act);
602 act = ActionManager::register_action (editor_actions, "insert-time", _("Insert Time"), (mem_fun(*this, &Editor::do_insert_time)));
603 ActionManager::session_sensitive_actions.push_back (act);
604 ActionManager::track_selection_sensitive_actions.push_back (act);
606 act = ActionManager::register_action (editor_actions, "toggle-track-active", _("Toggle Active"), (mem_fun(*this, &Editor::toggle_tracks_active)));
607 ActionManager::session_sensitive_actions.push_back (act);
608 ActionManager::track_selection_sensitive_actions.push_back (act);
609 if (Profile->get_sae()) {
610 act = ActionManager::register_action (editor_actions, "remove-track", _("Delete"), (mem_fun(*this, &Editor::remove_tracks)));
612 act = ActionManager::register_action (editor_actions, "remove-track", _("Remove"), (mem_fun(*this, &Editor::remove_tracks)));
614 ActionManager::session_sensitive_actions.push_back (act);
615 ActionManager::track_selection_sensitive_actions.push_back (act);
617 act = ActionManager::register_action (editor_actions, "fit-tracks", _("Fit Selected Tracks"), mem_fun(*this, &Editor::fit_selected_tracks));
618 ActionManager::session_sensitive_actions.push_back (act);
619 act = ActionManager::register_action (editor_actions, "track-height-largest", _("Largest"), bind (
620 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLargest));
621 ActionManager::session_sensitive_actions.push_back (act);
622 ActionManager::track_selection_sensitive_actions.push_back (act);
623 act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), bind (
624 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLarger));
625 ActionManager::session_sensitive_actions.push_back (act);
626 ActionManager::track_selection_sensitive_actions.push_back (act);
627 act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), bind (
628 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLarge));
629 ActionManager::session_sensitive_actions.push_back (act);
630 ActionManager::track_selection_sensitive_actions.push_back (act);
631 act = ActionManager::register_action (editor_actions, "track-height-normal", _("Normal"), bind (
632 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hNormal));
633 ActionManager::session_sensitive_actions.push_back (act);
634 ActionManager::track_selection_sensitive_actions.push_back (act);
635 act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), bind (
636 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hSmall));
637 ActionManager::track_selection_sensitive_actions.push_back (act);
638 ActionManager::session_sensitive_actions.push_back (act);
639 ActionManager::track_selection_sensitive_actions.push_back (act);
640 act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), bind (
641 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hSmaller));
642 ActionManager::session_sensitive_actions.push_back (act);
643 ActionManager::track_selection_sensitive_actions.push_back (act);
645 Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
646 RadioAction::Group zoom_group;
648 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("Zoom Focus Left"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusLeft));
649 ActionManager::session_sensitive_actions.push_back (act);
650 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("Zoom Focus Right"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusRight));
651 ActionManager::session_sensitive_actions.push_back (act);
652 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("Zoom Focus Center"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusCenter));
653 ActionManager::session_sensitive_actions.push_back (act);
654 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("Zoom Focus Playhead"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusPlayhead));
655 ActionManager::session_sensitive_actions.push_back (act);
656 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-mouse", _("Zoom Focus Mouse"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusMouse));
657 ActionManager::session_sensitive_actions.push_back (act);
658 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusEdit));
659 ActionManager::session_sensitive_actions.push_back (act);
661 Glib::RefPtr<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
662 RadioAction::Group mouse_mode_group;
664 ARDOUR_UI::instance()->tooltips().set_tip (mouse_move_button, _("Select/Move Objects"));
665 ARDOUR_UI::instance()->tooltips().set_tip (mouse_select_button, _("Select/Move Ranges"));
666 ARDOUR_UI::instance()->tooltips().set_tip (mouse_gain_button, _("Draw Gain Automation"));
667 ARDOUR_UI::instance()->tooltips().set_tip (mouse_zoom_button, _("Select Zoom Range"));
668 ARDOUR_UI::instance()->tooltips().set_tip (mouse_timefx_button, _("Stretch/Shrink Regions"));
669 ARDOUR_UI::instance()->tooltips().set_tip (mouse_audition_button, _("Listen to Specific Regions"));
670 /* in the future, this may allow other kinds of "intra-region" editing, but for now its just MIDI */
671 ARDOUR_UI::instance()->tooltips().set_tip (internal_edit_button, _("Edit MIDI Notes"));
673 act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-object", _("Object Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseObject));
674 act->connect_proxy (mouse_move_button);
675 mouse_move_button.set_image (*(manage (new Image (::get_icon("tool_object")))));
676 mouse_move_button.set_label ("");
677 mouse_move_button.set_name ("MouseModeButton");
679 act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-range", _("Range Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange));
680 act->connect_proxy (mouse_select_button);
681 mouse_select_button.set_image (*(manage (new Image (::get_xpm("tool_range.xpm")))));
682 mouse_select_button.set_label ("");
683 mouse_select_button.set_name ("MouseModeButton");
685 act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-gain", _("Gain Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseGain));
686 act->connect_proxy (mouse_gain_button);
687 mouse_gain_button.set_image (*(manage (new Image (::get_icon("tool_gain")))));
688 mouse_gain_button.set_label ("");
689 mouse_gain_button.set_name ("MouseModeButton");
691 act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-zoom", _("Zoom Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseZoom));
692 act->connect_proxy (mouse_zoom_button);
693 mouse_zoom_button.set_image (*(manage (new Image (::get_icon("tool_zoom")))));
694 mouse_zoom_button.set_label ("");
695 mouse_zoom_button.set_name ("MouseModeButton");
697 act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-audition", _("Audition Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseAudition));
698 act->connect_proxy (mouse_audition_button);
699 mouse_audition_button.set_image (*(manage (new Image (::get_icon("tool_audition")))));
700 mouse_audition_button.set_label ("");
701 mouse_audition_button.set_name ("MouseModeButton");
703 act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("Timefx Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseTimeFX));
704 act->connect_proxy (mouse_timefx_button);
705 mouse_timefx_button.set_image (*(manage (new Image (::get_icon("tool_stretch")))));
706 mouse_timefx_button.set_label ("");
707 mouse_timefx_button.set_name ("MouseModeButton");
709 ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), bind (mem_fun(*this, &Editor::step_mouse_mode), true));
711 act = ActionManager::register_toggle_action (mouse_mode_actions, "toggle-internal-edit", _("Edit MIDI"), mem_fun(*this, &Editor::toggle_internal_editing));
712 act->connect_proxy (internal_edit_button);
713 internal_edit_button.set_image (*(manage (new Image (::get_icon("tool_note")))));
714 internal_edit_button.set_label ("");
715 internal_edit_button.set_name ("MouseModeButton");
717 RadioAction::Group edit_point_group;
718 ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-playhead"), _("Playhead"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
719 ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
720 ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
722 ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change Edit Point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
723 ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
724 if (!Profile->get_sae()) {
725 ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice));
727 ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), bind (mem_fun (*this, &Editor::set_edit_mode), Slide));
728 ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), bind (mem_fun (*this, &Editor::set_edit_mode), Lock));
729 ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), mem_fun (*this, &Editor::cycle_edit_mode));
731 ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap to"));
732 ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
734 RadioAction::Group snap_mode_group;
735 ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
736 ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
737 ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
739 ActionManager::register_action (editor_actions, X_("cycle-snap-mode"), _("Next Snap Mode"), mem_fun (*this, &Editor::cycle_snap_mode));
740 ActionManager::register_action (editor_actions, X_("cycle-snap-choice"), _("Next Snap Choice"), mem_fun (*this, &Editor::cycle_snap_choice));
742 Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
743 RadioAction::Group snap_choice_group;
745 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("Snap to CD Frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToCDFrame)));
746 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-frame"), _("Snap to SMPTE frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEFrame)));
747 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-seconds"), _("Snap to SMPTE seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTESeconds)));
748 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-minutes"), _("Snap to SMPTE minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEMinutes)));
749 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-seconds"), _("Snap to Seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSeconds)));
750 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-minutes"), _("Snap to Minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMinutes)));
751 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirtyseconds"), _("Snap to Thirtyseconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAThirtysecondBeat)));
752 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-asixteenthbeat"), _("Snap to Asixteenthbeat"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToASixteenthBeat)));
753 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-eighths"), _("Snap to Eighths"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAEighthBeat)));
754 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-quarters"), _("Snap to Quarters"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAQuarterBeat)));
755 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirds"), _("Snap to Thirds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAThirdBeat)));
756 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-beat"), _("Snap to Beat"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeat)));
757 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-bar"), _("Snap to Bar"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBar)));
758 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-mark"), _("Snap to Mark"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMark)));
759 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-start"), _("Snap to Region start"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionStart)));
760 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-end"), _("Snap to Region End"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionEnd)));
761 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to Region Sync"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionSync)));
762 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to Region Boundary"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionBoundary)));
766 Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers"));
767 ruler_tempo_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-tempo-ruler"), _("Tempo"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_tempo)));
768 ruler_meter_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-meter-ruler"), _("Meter"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_meter)));
769 ruler_range_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-range-ruler"), _("Ranges"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_range_marker)));
770 ruler_marker_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-marker-ruler"), _("Markers"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_marker)));
771 ruler_cd_marker_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-cd-marker-ruler"), _("CD Markers"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_cd_marker)));
772 ruler_loop_punch_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-loop-punch-ruler"), _("Loop/Punch"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_transport_marker)));
773 ruler_bbt_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-bbt-ruler"), _("Bars & Beats"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_frames)));
774 ruler_samples_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-samples-ruler"), _("Samples"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_bbt)));
775 ruler_timecode_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_smpte)));
776 ruler_minsec_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Min:Sec"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_minsec)));
778 /* set defaults here */
780 no_ruler_shown_update = true;
781 ruler_meter_action->set_active (true);
782 ruler_tempo_action->set_active (true);
783 ruler_marker_action->set_active (true);
784 ruler_range_action->set_active (false);
785 ruler_loop_punch_action->set_active (true);
786 ruler_loop_punch_action->set_active (true);
787 if (Profile->get_sae()) {
788 ruler_bbt_action->set_active (true);
789 ruler_cd_marker_action->set_active (false);
790 ruler_timecode_action->set_active (false);
791 ruler_minsec_action->set_active (true);
793 ruler_bbt_action->set_active (false);
794 ruler_cd_marker_action->set_active (true);
795 ruler_timecode_action->set_active (true);
796 ruler_minsec_action->set_active (false);
798 ruler_samples_action->set_active (false);
799 no_ruler_shown_update = false;
803 Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
804 RadioAction::Group sort_type_group;
805 RadioAction::Group sort_order_group;
807 /* the region list popup menu */
808 ActionManager::register_action (rl_actions, X_("RegionListSort"), _("Sort"));
810 act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
811 ActionManager::region_list_selection_sensitive_actions.push_back (act);
812 act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
813 ActionManager::region_list_selection_sensitive_actions.push_back (act);
814 act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*_regions, &EditorRegions::remove_region));
815 ActionManager::region_list_selection_sensitive_actions.push_back (act);
816 ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show All"), mem_fun(*_regions, &EditorRegions::toggle_full));
817 ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show Automatic Regions"), mem_fun (*_regions, &EditorRegions::toggle_show_auto_regions));
819 ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"), _("Ascending"),
820 bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), true));
821 ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"),
822 bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), false));
824 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"), _("By Region Name"),
825 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByName, false));
826 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"), _("By Region Length"),
827 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByLength, false));
828 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionPosition"), _("By Region Position"),
829 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByPosition, false));
830 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionTimestamp"), _("By Region Timestamp"),
831 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByTimestamp, false));
832 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionStartinFile"), _("By Region Start in File"),
833 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByStartInFile, false));
834 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionEndinFile"), _("By Region End in File"),
835 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByEndInFile, false));
836 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileName"), _("By Source File Name"),
837 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileName, false));
838 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileLength"), _("By Source File Length"),
839 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileLength, false));
840 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileCreationDate"), _("By Source File Creation Date"),
841 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileCreationDate, false));
842 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
843 bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileFS, false));
846 /* the next two are duplicate items with different names for use in two different contexts */
848 act = ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import"), mem_fun (*this, &Editor::external_audio_dialog));
849 ActionManager::session_sensitive_actions.push_back (act);
850 ActionManager::write_sensitive_actions.push_back (act);
852 act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Import to Region List"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
853 ActionManager::session_sensitive_actions.push_back (act);
854 ActionManager::write_sensitive_actions.push_back (act);
856 act = ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
857 ActionManager::write_sensitive_actions.push_back (act);
859 ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
861 ActionManager::register_toggle_action (editor_actions, X_("ToggleSummary"), _("Show Summary"), mem_fun (*this, &Editor::set_summary));
863 ActionManager::register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), mem_fun (*this, &Editor::set_group_tabs));
865 ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
867 /* if there is a logo in the editor canvas, its always visible at startup */
869 act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
870 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
871 tact->set_active (true);
875 Glib::RefPtr<ActionGroup> midi_actions = ActionGroup::create (X_("MIDI"));
876 ActionManager::register_action (midi_actions, X_("panic"), _("Panic"), mem_fun(*this, &Editor::midi_panic));
878 ActionManager::add_action_group (rl_actions);
879 ActionManager::add_action_group (ruler_actions);
880 ActionManager::add_action_group (zoom_actions);
881 ActionManager::add_action_group (mouse_mode_actions);
882 ActionManager::add_action_group (snap_actions);
883 ActionManager::add_action_group (editor_actions);
884 ActionManager::add_action_group (midi_actions);
888 Editor::toggle_ruler_visibility (RulerType rt)
890 const char* action = 0;
892 if (no_ruler_shown_update) {
897 case ruler_metric_smpte:
898 action = "toggle-timecode-ruler";
900 case ruler_metric_bbt:
901 action = "toggle-bbt-ruler";
903 case ruler_metric_frames:
904 action = "toggle-samples-ruler";
906 case ruler_metric_minsec:
907 action = "toggle-minsec-ruler";
909 case ruler_time_tempo:
910 action = "toggle-tempo-ruler";
912 case ruler_time_meter:
913 action = "toggle-meter-ruler";
915 case ruler_time_marker:
916 action = "toggle-marker-ruler";
918 case ruler_time_range_marker:
919 action = "toggle-range-ruler";
921 case ruler_time_transport_marker:
922 action = "toggle-loop-punch-ruler";
924 case ruler_time_cd_marker:
925 action = "toggle-cd-marker-ruler";
929 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), action);
931 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
932 update_ruler_visibility ();
933 store_ruler_visibility ();
938 Editor::toggle_waveforms_while_recording ()
940 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformsWhileRecording"));
942 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
943 set_show_waveforms_recording (tact->get_active());
948 Editor::set_summary ()
950 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
952 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
953 session->config.set_show_summary (tact->get_active ());
958 Editor::set_group_tabs ()
960 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
962 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
963 session->config.set_show_group_tabs (tact->get_active ());
968 Editor::toggle_measure_visibility ()
970 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
972 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
973 set_show_measures (tact->get_active());
978 Editor::toggle_logo_visibility ()
980 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleLogoVisibility"));
983 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
985 if (tact->get_active()) {
995 Editor::snap_type_action (SnapType type)
998 const char* action = 0;
1002 case Editing::SnapToCDFrame:
1003 action = "snap-to-cd-frame";
1005 case Editing::SnapToSMPTEFrame:
1006 action = "snap-to-smpte-frame";
1008 case Editing::SnapToSMPTESeconds:
1009 action = "snap-to-smpte-seconds";
1011 case Editing::SnapToSMPTEMinutes:
1012 action = "snap-to-smpte-minutes";
1014 case Editing::SnapToSeconds:
1015 action = "snap-to-seconds";
1017 case Editing::SnapToMinutes:
1018 action = "snap-to-minutes";
1020 case Editing::SnapToAThirtysecondBeat:
1021 action = "snap-to-thirtyseconds";
1023 case Editing::SnapToASixteenthBeat:
1024 action = "snap-to-asixteenthbeat";
1026 case Editing::SnapToAEighthBeat:
1027 action = "snap-to-eighths";
1029 case Editing::SnapToAQuarterBeat:
1030 action = "snap-to-quarters";
1032 case Editing::SnapToAThirdBeat:
1033 action = "snap-to-thirds";
1035 case Editing::SnapToBeat:
1036 action = "snap-to-beat";
1038 case Editing::SnapToBar:
1039 action = "snap-to-bar";
1041 case Editing::SnapToMark:
1042 action = "snap-to-mark";
1044 case Editing::SnapToRegionStart:
1045 action = "snap-to-region-start";
1047 case Editing::SnapToRegionEnd:
1048 action = "snap-to-region-end";
1050 case Editing::SnapToRegionSync:
1051 action = "snap-to-region-sync";
1053 case Editing::SnapToRegionBoundary:
1054 action = "snap-to-region-boundary";
1057 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
1061 act = ActionManager::get_action (X_("Snap"), action);
1064 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1068 error << string_compose (_("programming error: %1"), "Editor::snap_type_chosen could not find action to match type.") << endmsg;
1069 return RefPtr<RadioAction>();
1074 Editor::cycle_snap_choice()
1076 switch (snap_type) {
1077 case Editing::SnapToCDFrame:
1078 set_snap_to (Editing::SnapToSMPTEFrame);
1080 case Editing::SnapToSMPTEFrame:
1081 set_snap_to (Editing::SnapToSMPTESeconds);
1083 case Editing::SnapToSMPTESeconds:
1084 set_snap_to (Editing::SnapToSMPTEMinutes);
1086 case Editing::SnapToSMPTEMinutes:
1087 set_snap_to (Editing::SnapToSeconds);
1089 case Editing::SnapToSeconds:
1090 set_snap_to (Editing::SnapToMinutes);
1092 case Editing::SnapToMinutes:
1093 set_snap_to (Editing::SnapToAThirtysecondBeat);
1095 case Editing::SnapToAThirtysecondBeat:
1096 set_snap_to (Editing::SnapToASixteenthBeat);
1098 case Editing::SnapToASixteenthBeat:
1099 set_snap_to (Editing::SnapToAEighthBeat);
1101 case Editing::SnapToAEighthBeat:
1102 set_snap_to (Editing::SnapToAQuarterBeat);
1104 case Editing::SnapToAQuarterBeat:
1105 set_snap_to (Editing::SnapToAThirdBeat);
1107 case Editing::SnapToAThirdBeat:
1108 set_snap_to (Editing::SnapToBeat);
1110 case Editing::SnapToBeat:
1111 set_snap_to (Editing::SnapToBar);
1113 case Editing::SnapToBar:
1114 set_snap_to (Editing::SnapToMark);
1116 case Editing::SnapToMark:
1117 set_snap_to (Editing::SnapToRegionStart);
1119 case Editing::SnapToRegionStart:
1120 set_snap_to (Editing::SnapToRegionEnd);
1122 case Editing::SnapToRegionEnd:
1123 set_snap_to (Editing::SnapToRegionSync);
1125 case Editing::SnapToRegionSync:
1126 set_snap_to (Editing::SnapToRegionBoundary);
1128 case Editing::SnapToRegionBoundary:
1129 set_snap_to (Editing::SnapToCDFrame);
1135 Editor::snap_type_chosen (SnapType type)
1137 /* this is driven by a toggle on a radio group, and so is invoked twice,
1138 once for the item that became inactive and once for the one that became
1142 RefPtr<RadioAction> ract = snap_type_action (type);
1144 if (ract && ract->get_active()) {
1150 Editor::snap_mode_action (SnapMode mode)
1152 const char* action = 0;
1156 case Editing::SnapOff:
1157 action = X_("snap-off");
1159 case Editing::SnapNormal:
1160 action = X_("snap-normal");
1162 case Editing::SnapMagnetic:
1163 action = X_("snap-magnetic");
1166 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
1170 act = ActionManager::get_action (X_("Editor"), action);
1173 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1177 error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
1178 return RefPtr<RadioAction> ();
1183 Editor::cycle_snap_mode ()
1185 switch (snap_mode) {
1187 set_snap_mode (SnapNormal);
1190 set_snap_mode (SnapMagnetic);
1193 set_snap_mode (SnapOff);
1199 Editor::snap_mode_chosen (SnapMode mode)
1201 /* this is driven by a toggle on a radio group, and so is invoked twice,
1202 once for the item that became inactive and once for the one that became
1206 RefPtr<RadioAction> ract = snap_mode_action (mode);
1208 if (ract && ract->get_active()) {
1209 set_snap_mode (mode);
1214 Editor::edit_point_action (EditPoint ep)
1216 const char* action = 0;
1220 case Editing::EditAtPlayhead:
1221 action = X_("edit-at-playhead");
1223 case Editing::EditAtSelectedMarker:
1224 action = X_("edit-at-selected-marker");
1226 case Editing::EditAtMouse:
1227 action = X_("edit-at-mouse");
1230 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
1234 act = ActionManager::get_action (X_("Editor"), action);
1237 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1241 error << string_compose (_("programming error: %1: %2"), "Editor::edit_point_action could not find action to match edit point.", action) << endmsg;
1242 return RefPtr<RadioAction> ();
1247 Editor::edit_point_chosen (EditPoint ep)
1249 /* this is driven by a toggle on a radio group, and so is invoked twice,
1250 once for the item that became inactive and once for the one that became
1254 RefPtr<RadioAction> ract = edit_point_action (ep);
1256 if (ract && ract->get_active()) {
1257 set_edit_point_preference (ep);
1263 Editor::zoom_focus_action (ZoomFocus focus)
1265 const char* action = 0;
1270 action = X_("zoom-focus-left");
1272 case ZoomFocusRight:
1273 action = X_("zoom-focus-right");
1275 case ZoomFocusCenter:
1276 action = X_("zoom-focus-center");
1278 case ZoomFocusPlayhead:
1279 action = X_("zoom-focus-playhead");
1281 case ZoomFocusMouse:
1282 action = X_("zoom-focus-mouse");
1285 action = X_("zoom-focus-edit");
1288 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
1292 act = ActionManager::get_action (X_("Zoom"), action);
1295 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1298 error << string_compose (_("programming error: %1: %2"), "Editor::zoom_focus_action could not find action to match focus.", action) << endmsg;
1301 return RefPtr<RadioAction> ();
1305 Editor::zoom_focus_chosen (ZoomFocus focus)
1307 /* this is driven by a toggle on a radio group, and so is invoked twice,
1308 once for the item that became inactive and once for the one that became
1312 RefPtr<RadioAction> ract = zoom_focus_action (focus);
1314 if (ract && ract->get_active()) {
1315 set_zoom_focus (focus);
1319 /** A Configuration parameter has changed.
1320 * @param parameter_name Name of the changed parameter.
1323 Editor::parameter_changed (std::string p)
1325 ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::parameter_changed), p));
1327 if (p == "auto-loop") {
1328 update_loop_range_view (true);
1329 } else if (p == "punch-in") {
1330 update_punch_range_view (true);
1331 } else if (p == "punch-out") {
1332 update_punch_range_view (true);
1333 } else if (p == "smpte-format") {
1334 update_just_smpte ();
1335 } else if (p == "xfades-visible") {
1336 update_xfade_visibility ();
1337 } else if (p == "show-region-fades") {
1338 update_region_fade_visibility ();
1339 } else if (p == "edit-mode") {
1340 edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
1341 } else if (p == "subframes-per-frame") {
1342 update_just_smpte ();
1343 } else if (p == "show-track-meters") {
1344 toggle_meter_updating();
1345 } else if (p == "show-summary") {
1347 bool const s = session->config.get_show_summary ();
1354 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
1356 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
1357 if (tact->get_active () != s) {
1358 tact->set_active (s);
1361 } else if (p == "show-group-tabs") {
1363 bool const s = session->config.get_show_group_tabs ();
1365 _group_tabs->show ();
1367 _group_tabs->hide ();
1370 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
1372 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
1373 if (tact->get_active () != s) {
1374 tact->set_active (s);
1381 Editor::reset_focus ()
1383 track_canvas->grab_focus();
1387 Editor::reset_canvas_action_sensitivity (bool onoff)
1389 if (_edit_point != EditAtMouse) {
1393 for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
1394 x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
1395 (*x)->set_sensitive (onoff);
1400 Editor::toggle_internal_editing ()
1402 Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
1404 Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
1405 set_internal_edit (tact->get_active());