change the use of "SMPTE" to "Timecode" to reflect the global economy and the end...
[ardour.git] / gtk2_ardour / editor_actions.cc
1 /*
2     Copyright (C) 2000-2007 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #include <gio/gio.h>
21 #include <gtk/gtkiconfactory.h>
22
23 #include "ardour/ardour.h"
24 #include "ardour/profile.h"
25
26 #include "actions.h"
27 #include "ardour_ui.h"
28 #include "editing.h"
29 #include "editor.h"
30 #include "gui_thread.h"
31 #include "time_axis_view.h"
32 #include "utils.h"
33 #include "i18n.h"
34 #include "audio_time_axis.h"
35 #include "editor_group_tabs.h"
36 #include "editor_routes.h"
37 #include "editor_regions.h"
38
39 using namespace Gtk;
40 using namespace Glib;
41 using namespace std;
42 using namespace sigc;
43 using namespace ARDOUR;
44 using namespace PBD;
45 using namespace Editing;
46
47 void
48 Editor::register_actions ()
49 {
50         RefPtr<Action> act;
51
52         editor_actions = ActionGroup::create (X_("Editor"));
53
54         /* non-operative menu items for menu bar */
55
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"));
106
107         /* add named actions for the editor */
108
109         ActionManager::register_action (editor_actions, "break-drag", _("Break drag"), mem_fun (*this, &Editor::break_drag));
110
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);
115
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);
122
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);
131
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);
138
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);
145
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);
154
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);
161
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);
168
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);
173
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);
178
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);
189
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);
194
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);
197
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);
202
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);
207
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);
210
211
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);
260
261
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);
280
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);
287
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);
296
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);
305
306
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::zoom_to_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::zoom_to_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);
319
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);
324
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);
333
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);
344
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);
349
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);
354
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);
361
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);
374
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);
381
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);
407
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);
416
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);
429
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);
436
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);
441
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);
448
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);
453
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);
520
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);
525
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);
530
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);
552
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);
556
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);
562
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);
574         act = ActionManager::register_action (editor_actions, "toggle-log-window", _("Log"),
575                         mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::toggle_errors));
576         ActionManager::session_sensitive_actions.push_back (act);
577
578         act = ActionManager::register_action (editor_actions, "tab-to-transient-forwards", _("Move Forward to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), true));
579         ActionManager::session_sensitive_actions.push_back (act);
580         act = ActionManager::register_action (editor_actions, "tab-to-transient-backwards", _("Move Backwards to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), false));
581         ActionManager::session_sensitive_actions.push_back (act);
582
583         act = ActionManager::register_action (editor_actions, "crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
584         ActionManager::session_sensitive_actions.push_back (act);
585         act = ActionManager::register_action (editor_actions, "insert-chunk", _("Insert Chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f));
586         ActionManager::session_sensitive_actions.push_back (act);
587
588         act = ActionManager::register_action (editor_actions, "start-range", _("Start Range"), mem_fun(*this, &Editor::keyboard_selection_begin));
589         ActionManager::session_sensitive_actions.push_back (act);
590         act = ActionManager::register_action (editor_actions, "finish-range", _("Finish Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), false));
591         ActionManager::session_sensitive_actions.push_back (act);
592         act = ActionManager::register_action (editor_actions, "finish-add-range", _("Finish add Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), true));
593         ActionManager::session_sensitive_actions.push_back (act);
594
595         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));
596         ActionManager::session_sensitive_actions.push_back (act);
597         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));
598         ActionManager::session_sensitive_actions.push_back (act);
599
600         act = ActionManager::register_toggle_action (editor_actions, "toggle-follow-playhead", _("Follow Playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
601         ActionManager::session_sensitive_actions.push_back (act);
602         act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (mem_fun(*this, &Editor::remove_last_capture)));
603         ActionManager::session_sensitive_actions.push_back (act);
604
605         act = ActionManager::register_action (editor_actions, "insert-time", _("Insert Time"), (mem_fun(*this, &Editor::do_insert_time)));
606         ActionManager::session_sensitive_actions.push_back (act);
607         ActionManager::track_selection_sensitive_actions.push_back (act);
608
609         act = ActionManager::register_action (editor_actions, "toggle-track-active", _("Toggle Active"), (mem_fun(*this, &Editor::toggle_tracks_active)));
610         ActionManager::session_sensitive_actions.push_back (act);
611         ActionManager::track_selection_sensitive_actions.push_back (act);
612         if (Profile->get_sae()) {
613                 act = ActionManager::register_action (editor_actions, "remove-track", _("Delete"), (mem_fun(*this, &Editor::remove_tracks)));
614         } else {
615                 act = ActionManager::register_action (editor_actions, "remove-track", _("Remove"), (mem_fun(*this, &Editor::remove_tracks)));
616         }
617         ActionManager::session_sensitive_actions.push_back (act);
618         ActionManager::track_selection_sensitive_actions.push_back (act);
619
620         act = ActionManager::register_action (editor_actions, "fit-tracks", _("Fit Selected Tracks"), mem_fun(*this, &Editor::fit_selected_tracks));
621         ActionManager::session_sensitive_actions.push_back (act);
622         act = ActionManager::register_action (editor_actions, "track-height-largest", _("Largest"), bind (
623                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLargest));
624         ActionManager::session_sensitive_actions.push_back (act);
625         ActionManager::track_selection_sensitive_actions.push_back (act);
626         act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), bind (
627                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLarger));
628         ActionManager::session_sensitive_actions.push_back (act);
629         ActionManager::track_selection_sensitive_actions.push_back (act);
630         act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), bind (
631                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLarge));
632         ActionManager::session_sensitive_actions.push_back (act);
633         ActionManager::track_selection_sensitive_actions.push_back (act);
634         act = ActionManager::register_action (editor_actions, "track-height-normal", _("Normal"), bind (
635                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hNormal));
636         ActionManager::session_sensitive_actions.push_back (act);
637         ActionManager::track_selection_sensitive_actions.push_back (act);
638         act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), bind (
639                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hSmall));
640         ActionManager::track_selection_sensitive_actions.push_back (act);
641         ActionManager::session_sensitive_actions.push_back (act);
642         ActionManager::track_selection_sensitive_actions.push_back (act);
643         act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), bind (
644                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hSmaller));
645         ActionManager::session_sensitive_actions.push_back (act);
646         ActionManager::track_selection_sensitive_actions.push_back (act);
647
648         Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
649         RadioAction::Group zoom_group;
650
651         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("Zoom Focus Left"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusLeft));
652         ActionManager::session_sensitive_actions.push_back (act);
653         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("Zoom Focus Right"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusRight));
654         ActionManager::session_sensitive_actions.push_back (act);
655         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("Zoom Focus Center"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusCenter));
656         ActionManager::session_sensitive_actions.push_back (act);
657         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("Zoom Focus Playhead"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusPlayhead));
658         ActionManager::session_sensitive_actions.push_back (act);
659         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-mouse", _("Zoom Focus Mouse"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusMouse));
660         ActionManager::session_sensitive_actions.push_back (act);
661         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusEdit));
662         ActionManager::session_sensitive_actions.push_back (act);
663
664         Glib::RefPtr<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
665         RadioAction::Group mouse_mode_group;
666
667         ARDOUR_UI::instance()->tooltips().set_tip (mouse_move_button, _("Select/Move Objects"));
668         ARDOUR_UI::instance()->tooltips().set_tip (mouse_select_button, _("Select/Move Ranges"));
669         ARDOUR_UI::instance()->tooltips().set_tip (mouse_gain_button, _("Draw Gain Automation"));
670         ARDOUR_UI::instance()->tooltips().set_tip (mouse_zoom_button, _("Select Zoom Range"));
671         ARDOUR_UI::instance()->tooltips().set_tip (mouse_timefx_button, _("Stretch/Shrink Regions"));
672         ARDOUR_UI::instance()->tooltips().set_tip (mouse_audition_button, _("Listen to Specific Regions"));
673         /* in the future, this may allow other kinds of "intra-region" editing, but for now its just MIDI */
674         ARDOUR_UI::instance()->tooltips().set_tip (internal_edit_button, _("Edit MIDI Notes"));
675
676         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));
677         act->connect_proxy (mouse_move_button);
678         mouse_move_button.set_image (*(manage (new Image (::get_icon("tool_object")))));
679         mouse_move_button.set_label ("");
680         mouse_move_button.set_name ("MouseModeButton");
681         mouse_move_button.get_image ()->show ();
682
683         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));
684         act->connect_proxy (mouse_select_button);
685         mouse_select_button.set_image (*(manage (new Image (::get_icon("tool_range")))));
686         mouse_select_button.set_label ("");
687         mouse_select_button.set_name ("MouseModeButton");
688         mouse_select_button.get_image ()->show ();
689
690         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));
691         act->connect_proxy (mouse_gain_button);
692         mouse_gain_button.set_image (*(manage (new Image (::get_icon("tool_gain")))));
693         mouse_gain_button.set_label ("");
694         mouse_gain_button.set_name ("MouseModeButton");
695         mouse_gain_button.get_image ()->show ();
696
697         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));
698         act->connect_proxy (mouse_zoom_button);
699         mouse_zoom_button.set_image (*(manage (new Image (::get_icon("tool_zoom")))));
700         mouse_zoom_button.set_label ("");
701         mouse_zoom_button.set_name ("MouseModeButton");
702         mouse_zoom_button.get_image ()->show ();
703
704         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));
705         act->connect_proxy (mouse_audition_button);
706         mouse_audition_button.set_image (*(manage (new Image (::get_icon("tool_audition")))));
707         mouse_audition_button.set_label ("");
708         mouse_audition_button.set_name ("MouseModeButton");
709         mouse_audition_button.get_image ()->show ();
710
711         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));
712         act->connect_proxy (mouse_timefx_button);
713         mouse_timefx_button.set_image (*(manage (new Image (::get_icon("tool_stretch")))));
714         mouse_timefx_button.set_label ("");
715         mouse_timefx_button.set_name ("MouseModeButton");
716         mouse_timefx_button.get_image ()->show ();
717
718         ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), bind (mem_fun(*this, &Editor::step_mouse_mode), true));
719
720         act = ActionManager::register_toggle_action (mouse_mode_actions, "toggle-internal-edit", _("Edit MIDI"), mem_fun(*this, &Editor::toggle_internal_editing));
721         act->connect_proxy (internal_edit_button);
722         internal_edit_button.set_image (*(manage (new Image (::get_icon("tool_note")))));
723         internal_edit_button.set_label ("");
724         internal_edit_button.set_name ("MouseModeButton");
725         internal_edit_button.get_image ()->show ();
726
727         RadioAction::Group edit_point_group;
728         ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-playhead"), _("Playhead"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
729         ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
730         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)));
731
732         ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change Edit Point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
733         ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
734         if (!Profile->get_sae()) {
735                 ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice));
736         }
737         ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), bind (mem_fun (*this, &Editor::set_edit_mode), Slide));
738         ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), bind (mem_fun (*this, &Editor::set_edit_mode), Lock));
739         ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), mem_fun (*this, &Editor::cycle_edit_mode));
740
741         ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap to"));
742         ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
743
744         RadioAction::Group snap_mode_group;
745         ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
746         ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
747         ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
748
749         ActionManager::register_action (editor_actions, X_("cycle-snap-mode"), _("Next Snap Mode"), mem_fun (*this, &Editor::cycle_snap_mode));
750         ActionManager::register_action (editor_actions, X_("cycle-snap-choice"), _("Next Snap Choice"), mem_fun (*this, &Editor::cycle_snap_choice));
751
752         Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
753         RadioAction::Group snap_choice_group;
754
755         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)));
756         ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-frame"), _("Snap to Timecode frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeFrame)));
757         ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-seconds"), _("Snap to Timecode seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeSeconds)));
758         ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-minutes"), _("Snap to Timecode minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeMinutes)));
759         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)));
760         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)));
761         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)));
762         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)));
763         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)));
764         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)));
765         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)));
766         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)));
767         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)));
768         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)));
769         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)));
770         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)));
771         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)));
772         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)));
773
774         /* RULERS */
775
776         Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers"));
777         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)));
778         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)));
779         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)));
780         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)));
781         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)));
782         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)));
783         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)));
784         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)));
785         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_timecode)));
786         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)));
787
788         /* set defaults here */
789
790         no_ruler_shown_update = true;
791         ruler_meter_action->set_active (true);
792         ruler_tempo_action->set_active (true);
793         ruler_marker_action->set_active (true);
794         ruler_range_action->set_active (false);
795         ruler_loop_punch_action->set_active (true);
796         ruler_loop_punch_action->set_active (true);
797         if (Profile->get_sae()) {
798                 ruler_bbt_action->set_active (true);
799                 ruler_cd_marker_action->set_active (false);
800                 ruler_timecode_action->set_active (false);
801                 ruler_minsec_action->set_active (true);
802         } else {
803                 ruler_bbt_action->set_active (false);
804                 ruler_cd_marker_action->set_active (true);
805                 ruler_timecode_action->set_active (true);
806                 ruler_minsec_action->set_active (false);
807         }
808         ruler_samples_action->set_active (false);
809         no_ruler_shown_update = false;
810
811         /* REGION LIST */
812
813         Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
814         RadioAction::Group sort_type_group;
815         RadioAction::Group sort_order_group;
816
817         /* the region list popup menu */
818         ActionManager::register_action (rl_actions, X_("RegionListSort"), _("Sort"));
819
820         act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
821         ActionManager::region_list_selection_sensitive_actions.push_back (act);
822         act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
823         ActionManager::region_list_selection_sensitive_actions.push_back (act);
824         act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*_regions, &EditorRegions::remove_region));
825         ActionManager::region_list_selection_sensitive_actions.push_back (act);
826         ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show All"), mem_fun(*_regions, &EditorRegions::toggle_full));
827         ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show Automatic Regions"), mem_fun (*_regions, &EditorRegions::toggle_show_auto_regions));
828
829         ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"),  _("Ascending"),
830                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), true));
831         ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"),   _("Descending"),
832                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), false));
833
834         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"),  _("By Region Name"),
835                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByName, false));
836         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"),  _("By Region Length"),
837                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByLength, false));
838         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionPosition"),  _("By Region Position"),
839                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByPosition, false));
840         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionTimestamp"),  _("By Region Timestamp"),
841                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByTimestamp, false));
842         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionStartinFile"),  _("By Region Start in File"),
843                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByStartInFile, false));
844         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionEndinFile"),  _("By Region End in File"),
845                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByEndInFile, false));
846         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileName"),  _("By Source File Name"),
847                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileName, false));
848         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileLength"),  _("By Source File Length"),
849                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileLength, false));
850         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileCreationDate"),  _("By Source File Creation Date"),
851                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileCreationDate, false));
852         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"),  _("By Source Filesystem"),
853                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileFS, false));
854
855
856         /* the next two are duplicate items with different names for use in two different contexts */
857
858         act = ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import"), mem_fun (*this, &Editor::external_audio_dialog));
859         ActionManager::session_sensitive_actions.push_back (act);
860         ActionManager::write_sensitive_actions.push_back (act);
861
862         act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Import to Region List"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
863         ActionManager::session_sensitive_actions.push_back (act);
864         ActionManager::write_sensitive_actions.push_back (act);
865
866         act = ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
867         ActionManager::write_sensitive_actions.push_back (act);
868
869         ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
870
871         ActionManager::register_toggle_action (editor_actions, X_("ToggleSummary"), _("Show Summary"), mem_fun (*this, &Editor::set_summary));
872
873         ActionManager::register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), mem_fun (*this, &Editor::set_group_tabs));
874
875         ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
876
877         /* if there is a logo in the editor canvas, its always visible at startup */
878
879         act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
880         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
881         tact->set_active (true);
882
883         /* MIDI */
884
885         Glib::RefPtr<ActionGroup> midi_actions = ActionGroup::create (X_("MIDI"));
886         ActionManager::register_action (midi_actions, X_("panic"), _("Panic"), mem_fun(*this, &Editor::midi_panic));
887
888         ActionManager::add_action_group (rl_actions);
889         ActionManager::add_action_group (ruler_actions);
890         ActionManager::add_action_group (zoom_actions);
891         ActionManager::add_action_group (mouse_mode_actions);
892         ActionManager::add_action_group (snap_actions);
893         ActionManager::add_action_group (editor_actions);
894         ActionManager::add_action_group (midi_actions);
895 }
896
897 void
898 Editor::toggle_ruler_visibility (RulerType rt)
899 {
900         const char* action = 0;
901
902         if (no_ruler_shown_update) {
903                 return;
904         }
905
906         switch (rt) {
907         case ruler_metric_timecode:
908                 action = "toggle-timecode-ruler";
909                 break;
910         case ruler_metric_bbt:
911                 action = "toggle-bbt-ruler";
912                 break;
913         case ruler_metric_frames:
914                 action = "toggle-samples-ruler";
915                 break;
916         case ruler_metric_minsec:
917                 action = "toggle-minsec-ruler";
918                 break;
919         case ruler_time_tempo:
920                 action = "toggle-tempo-ruler";
921                 break;
922         case ruler_time_meter:
923                 action = "toggle-meter-ruler";
924                 break;
925         case ruler_time_marker:
926                 action = "toggle-marker-ruler";
927                 break;
928         case ruler_time_range_marker:
929                 action = "toggle-range-ruler";
930                 break;
931         case ruler_time_transport_marker:
932                 action = "toggle-loop-punch-ruler";
933                 break;
934         case ruler_time_cd_marker:
935                 action = "toggle-cd-marker-ruler";
936                 break;
937         }
938
939         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), action);
940         if (act) {
941                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
942                 update_ruler_visibility ();
943                 store_ruler_visibility ();
944         }
945 }
946
947 void
948 Editor::toggle_waveforms_while_recording ()
949 {
950         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformsWhileRecording"));
951         if (act) {
952                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
953                 set_show_waveforms_recording (tact->get_active());
954         }
955 }
956
957 void
958 Editor::set_summary ()
959 {
960         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
961         if (act) {
962                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
963                 session->config.set_show_summary (tact->get_active ());
964         }
965 }
966
967 void
968 Editor::set_group_tabs ()
969 {
970         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
971         if (act) {
972                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
973                 session->config.set_show_group_tabs (tact->get_active ());
974         }
975 }
976
977 void
978 Editor::toggle_measure_visibility ()
979 {
980         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
981         if (act) {
982                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
983                 set_show_measures (tact->get_active());
984         }
985 }
986
987 void
988 Editor::toggle_logo_visibility ()
989 {
990         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleLogoVisibility"));
991
992         if (act) {
993                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
994                 if (logo_item) {
995                         if (tact->get_active()) {
996                                 logo_item->show ();
997                         } else {
998                                 logo_item->hide ();
999                         }
1000                 }
1001         }
1002 }
1003
1004 RefPtr<RadioAction>
1005 Editor::snap_type_action (SnapType type)
1006 {
1007
1008         const char* action = 0;
1009         RefPtr<Action> act;
1010
1011         switch (type) {
1012         case Editing::SnapToCDFrame:
1013                 action = "snap-to-cd-frame";
1014                 break;
1015         case Editing::SnapToTimecodeFrame:
1016                 action = "snap-to-timecode-frame";
1017                 break;
1018         case Editing::SnapToTimecodeSeconds:
1019                 action = "snap-to-timecode-seconds";
1020                 break;
1021         case Editing::SnapToTimecodeMinutes:
1022                 action = "snap-to-timecode-minutes";
1023                 break;
1024         case Editing::SnapToSeconds:
1025                 action = "snap-to-seconds";
1026                 break;
1027         case Editing::SnapToMinutes:
1028                 action = "snap-to-minutes";
1029                 break;
1030         case Editing::SnapToAThirtysecondBeat:
1031                 action = "snap-to-thirtyseconds";
1032                 break;
1033         case Editing::SnapToASixteenthBeat:
1034                 action = "snap-to-asixteenthbeat";
1035                 break;
1036         case Editing::SnapToAEighthBeat:
1037                 action = "snap-to-eighths";
1038                 break;
1039         case Editing::SnapToAQuarterBeat:
1040                 action = "snap-to-quarters";
1041                 break;
1042         case Editing::SnapToAThirdBeat:
1043                 action = "snap-to-thirds";
1044                 break;
1045         case Editing::SnapToBeat:
1046                 action = "snap-to-beat";
1047                 break;
1048         case Editing::SnapToBar:
1049                 action = "snap-to-bar";
1050                 break;
1051         case Editing::SnapToMark:
1052                 action = "snap-to-mark";
1053                 break;
1054         case Editing::SnapToRegionStart:
1055                 action = "snap-to-region-start";
1056                 break;
1057         case Editing::SnapToRegionEnd:
1058                 action = "snap-to-region-end";
1059                 break;
1060         case Editing::SnapToRegionSync:
1061                 action = "snap-to-region-sync";
1062                 break;
1063         case Editing::SnapToRegionBoundary:
1064                 action = "snap-to-region-boundary";
1065                 break;
1066         default:
1067                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
1068                 /*NOTREACHED*/
1069         }
1070
1071         act = ActionManager::get_action (X_("Snap"), action);
1072
1073         if (act) {
1074                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1075                 return ract;
1076
1077         } else  {
1078                 error << string_compose (_("programming error: %1"), "Editor::snap_type_chosen could not find action to match type.") << endmsg;
1079                 return RefPtr<RadioAction>();
1080         }
1081 }
1082
1083 void
1084 Editor::cycle_snap_choice()
1085 {
1086         switch (snap_type) {
1087         case Editing::SnapToCDFrame:
1088                 set_snap_to (Editing::SnapToTimecodeFrame);
1089                 break;
1090         case Editing::SnapToTimecodeFrame:
1091                 set_snap_to (Editing::SnapToTimecodeSeconds);
1092                 break;
1093         case Editing::SnapToTimecodeSeconds:
1094                 set_snap_to (Editing::SnapToTimecodeMinutes);
1095                 break;
1096         case Editing::SnapToTimecodeMinutes:
1097                 set_snap_to (Editing::SnapToSeconds);
1098                 break;
1099         case Editing::SnapToSeconds:
1100                 set_snap_to (Editing::SnapToMinutes);
1101                 break;
1102         case Editing::SnapToMinutes:
1103                 set_snap_to (Editing::SnapToAThirtysecondBeat);
1104                 break;
1105         case Editing::SnapToAThirtysecondBeat:
1106                 set_snap_to (Editing::SnapToASixteenthBeat);
1107                 break;
1108         case Editing::SnapToASixteenthBeat:
1109                 set_snap_to (Editing::SnapToAEighthBeat);
1110                 break;
1111         case Editing::SnapToAEighthBeat:
1112                 set_snap_to (Editing::SnapToAQuarterBeat);
1113                 break;
1114         case Editing::SnapToAQuarterBeat:
1115                 set_snap_to (Editing::SnapToAThirdBeat);
1116                 break;
1117         case Editing::SnapToAThirdBeat:
1118                 set_snap_to (Editing::SnapToBeat);
1119                 break;
1120         case Editing::SnapToBeat:
1121                 set_snap_to (Editing::SnapToBar);
1122                 break;
1123         case Editing::SnapToBar:
1124                 set_snap_to (Editing::SnapToMark);
1125                 break;
1126         case Editing::SnapToMark:
1127                 set_snap_to (Editing::SnapToRegionStart);
1128                 break;
1129         case Editing::SnapToRegionStart:
1130                 set_snap_to (Editing::SnapToRegionEnd);
1131                 break;
1132         case Editing::SnapToRegionEnd:
1133                 set_snap_to (Editing::SnapToRegionSync);
1134                 break;
1135         case Editing::SnapToRegionSync:
1136                 set_snap_to (Editing::SnapToRegionBoundary);
1137                 break;
1138         case Editing::SnapToRegionBoundary:
1139                 set_snap_to (Editing::SnapToCDFrame);
1140                 break;
1141         }
1142 }
1143
1144 void
1145 Editor::snap_type_chosen (SnapType type)
1146 {
1147         /* this is driven by a toggle on a radio group, and so is invoked twice,
1148            once for the item that became inactive and once for the one that became
1149            active.
1150         */
1151
1152         RefPtr<RadioAction> ract = snap_type_action (type);
1153
1154         if (ract && ract->get_active()) {
1155                 set_snap_to (type);
1156         }
1157 }
1158
1159 RefPtr<RadioAction>
1160 Editor::snap_mode_action (SnapMode mode)
1161 {
1162         const char* action = 0;
1163         RefPtr<Action> act;
1164
1165         switch (mode) {
1166         case Editing::SnapOff:
1167                 action = X_("snap-off");
1168                 break;
1169         case Editing::SnapNormal:
1170                 action = X_("snap-normal");
1171                 break;
1172         case Editing::SnapMagnetic:
1173                 action = X_("snap-magnetic");
1174                 break;
1175         default:
1176                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
1177                 /*NOTREACHED*/
1178         }
1179
1180         act = ActionManager::get_action (X_("Editor"), action);
1181
1182         if (act) {
1183                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1184                 return ract;
1185
1186         } else  {
1187                 error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
1188                 return RefPtr<RadioAction> ();
1189         }
1190 }
1191
1192 void
1193 Editor::cycle_snap_mode ()
1194 {
1195         switch (snap_mode) {
1196         case SnapOff:
1197                 set_snap_mode (SnapNormal);
1198                 break;
1199         case SnapNormal:
1200                 set_snap_mode (SnapMagnetic);
1201                 break;
1202         case SnapMagnetic:
1203                 set_snap_mode (SnapOff);
1204                 break;
1205         }
1206 }
1207
1208 void
1209 Editor::snap_mode_chosen (SnapMode mode)
1210 {
1211         /* this is driven by a toggle on a radio group, and so is invoked twice,
1212            once for the item that became inactive and once for the one that became
1213            active.
1214         */
1215
1216         RefPtr<RadioAction> ract = snap_mode_action (mode);
1217
1218         if (ract && ract->get_active()) {
1219                 set_snap_mode (mode);
1220         }
1221 }
1222
1223 RefPtr<RadioAction>
1224 Editor::edit_point_action (EditPoint ep)
1225 {
1226         const char* action = 0;
1227         RefPtr<Action> act;
1228
1229         switch (ep) {
1230         case Editing::EditAtPlayhead:
1231                 action = X_("edit-at-playhead");
1232                 break;
1233         case Editing::EditAtSelectedMarker:
1234                 action = X_("edit-at-selected-marker");
1235                 break;
1236         case Editing::EditAtMouse:
1237                 action = X_("edit-at-mouse");
1238                 break;
1239         default:
1240                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
1241                 /*NOTREACHED*/
1242         }
1243
1244         act = ActionManager::get_action (X_("Editor"), action);
1245
1246         if (act) {
1247                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1248                 return ract;
1249
1250         } else  {
1251                 error << string_compose (_("programming error: %1: %2"), "Editor::edit_point_action could not find action to match edit point.", action) << endmsg;
1252                 return RefPtr<RadioAction> ();
1253         }
1254 }
1255
1256 void
1257 Editor::edit_point_chosen (EditPoint ep)
1258 {
1259         /* this is driven by a toggle on a radio group, and so is invoked twice,
1260            once for the item that became inactive and once for the one that became
1261            active.
1262         */
1263
1264         RefPtr<RadioAction> ract = edit_point_action (ep);
1265
1266         if (ract && ract->get_active()) {
1267                 set_edit_point_preference (ep);
1268         }
1269 }
1270
1271
1272 RefPtr<RadioAction>
1273 Editor::zoom_focus_action (ZoomFocus focus)
1274 {
1275         const char* action = 0;
1276         RefPtr<Action> act;
1277
1278         switch (focus) {
1279         case ZoomFocusLeft:
1280                 action = X_("zoom-focus-left");
1281                 break;
1282         case ZoomFocusRight:
1283                 action = X_("zoom-focus-right");
1284                 break;
1285         case ZoomFocusCenter:
1286                 action = X_("zoom-focus-center");
1287                 break;
1288         case ZoomFocusPlayhead:
1289                 action = X_("zoom-focus-playhead");
1290                 break;
1291         case ZoomFocusMouse:
1292                 action = X_("zoom-focus-mouse");
1293                 break;
1294         case ZoomFocusEdit:
1295                 action = X_("zoom-focus-edit");
1296                 break;
1297         default:
1298                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
1299                 /*NOTREACHED*/
1300         }
1301
1302         act = ActionManager::get_action (X_("Zoom"), action);
1303
1304         if (act) {
1305                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1306                 return ract;
1307         } else {
1308                 error << string_compose (_("programming error: %1: %2"), "Editor::zoom_focus_action could not find action to match focus.", action) << endmsg;
1309         }
1310
1311         return RefPtr<RadioAction> ();
1312 }
1313
1314 void
1315 Editor::zoom_focus_chosen (ZoomFocus focus)
1316 {
1317         /* this is driven by a toggle on a radio group, and so is invoked twice,
1318            once for the item that became inactive and once for the one that became
1319            active.
1320         */
1321
1322         RefPtr<RadioAction> ract = zoom_focus_action (focus);
1323
1324         if (ract && ract->get_active()) {
1325                 set_zoom_focus (focus);
1326         }
1327 }
1328
1329 /** A Configuration parameter has changed.
1330  * @param parameter_name Name of the changed parameter.
1331  */
1332 void
1333 Editor::parameter_changed (std::string p)
1334 {
1335         ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::parameter_changed), p));
1336
1337         if (p == "auto-loop") {
1338                 update_loop_range_view (true);
1339         } else if (p == "punch-in") {
1340                 update_punch_range_view (true);
1341         } else if (p == "punch-out") {
1342                 update_punch_range_view (true);
1343         } else if (p == "timecode-format") {
1344                 update_just_timecode ();
1345         } else if (p == "xfades-visible") {
1346                 update_xfade_visibility ();
1347         } else if (p == "show-region-fades") {
1348                 update_region_fade_visibility ();
1349         } else if (p == "edit-mode") {
1350                 edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
1351         } else if (p == "subframes-per-frame") {
1352                 update_just_timecode ();
1353         } else if (p == "show-track-meters") {
1354                 toggle_meter_updating();
1355         } else if (p == "show-summary") {
1356
1357                 bool const s = session->config.get_show_summary ();
1358                 if (s) {
1359                         _summary->show ();
1360                 } else {
1361                         _summary->hide ();
1362                 }
1363
1364                 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
1365                 if (act) {
1366                         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
1367                         if (tact->get_active () != s) {
1368                                 tact->set_active (s);
1369                         }
1370                 }
1371         } else if (p == "show-group-tabs") {
1372
1373                 bool const s = session->config.get_show_group_tabs ();
1374                 if (s) {
1375                         _group_tabs->show ();
1376                 } else {
1377                         _group_tabs->hide ();
1378                 }
1379
1380                 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
1381                 if (act) {
1382                         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
1383                         if (tact->get_active () != s) {
1384                                 tact->set_active (s);
1385                         }
1386                 }
1387         }
1388 }
1389
1390 void
1391 Editor::reset_focus ()
1392 {
1393         track_canvas->grab_focus();
1394 }
1395
1396 void
1397 Editor::reset_canvas_action_sensitivity (bool onoff)
1398 {
1399         if (_edit_point != EditAtMouse) {
1400                 onoff = true;
1401         }
1402
1403         for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
1404              x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
1405                 (*x)->set_sensitive (onoff);
1406         }
1407 }
1408
1409 void
1410 Editor::toggle_internal_editing ()
1411 {
1412         Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
1413         if (act) {
1414                 Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
1415                 set_internal_edit (tact->get_active());
1416         }
1417 }