drastic, deep and wide changes to make RouteGroup use boost::shared_ptr<Route> and...
[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 #include "ardour/session.h"
26
27 #include "actions.h"
28 #include "ardour_ui.h"
29 #include "editing.h"
30 #include "editor.h"
31 #include "gui_thread.h"
32 #include "time_axis_view.h"
33 #include "utils.h"
34 #include "i18n.h"
35 #include "audio_time_axis.h"
36 #include "editor_group_tabs.h"
37 #include "editor_routes.h"
38 #include "editor_regions.h"
39
40 using namespace Gtk;
41 using namespace Glib;
42 using namespace std;
43 using namespace sigc;
44 using namespace ARDOUR;
45 using namespace PBD;
46 using namespace Editing;
47
48 void
49 Editor::register_actions ()
50 {
51         RefPtr<Action> act;
52
53         editor_actions = ActionGroup::create (X_("Editor"));
54
55         /* non-operative menu items for menu bar */
56
57         ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align"));
58         ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect"));
59         ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades"));
60         ActionManager::register_action (editor_actions, X_("Edit"), _("Edit"));
61         ActionManager::register_action (editor_actions, X_("EditCursorMovementOptions"), _("Move Selected Marker"));
62         ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations"));
63         ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions"));
64         ActionManager::register_action (editor_actions, X_("EditPointMenu"), _("Edit Point"));
65         ActionManager::register_action (editor_actions, X_("FadeMenu"), _("Fade"));
66         ActionManager::register_action (editor_actions, X_("LatchMenu"), _("Latch"));
67         ActionManager::register_action (editor_actions, X_("Layering"), _("Layering"));
68         ActionManager::register_action (editor_actions, X_("Link"), _("Link"));
69         ActionManager::register_action (editor_actions, X_("ZoomFocusMenu"), _("Zoom Focus"));
70         ActionManager::register_action (editor_actions, X_("KeyMouseActions"), _("Key Mouse"));
71         ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate to Markers"));
72         ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers"));
73         ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff"));
74         ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold"));
75         ActionManager::register_action (editor_actions, X_("MiscOptions"), _("Misc Options"));
76         ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring"));
77         ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark"));
78         ActionManager::register_action (editor_actions, X_("MovePlayHeadMenu"), _("Playhead"));
79         ActionManager::register_action (editor_actions, X_("NudgeRegionMenu"), _("Nudge"));
80         ActionManager::register_action (editor_actions, X_("PlayMenu"), _("Play"));
81         ActionManager::register_action (editor_actions, X_("PrimaryClockMenu"), _("Primary Clock"));
82         ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown"));
83         ActionManager::register_action (editor_actions, X_("RegionMenu"), _("Region"));
84         ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations"));
85         ActionManager::register_action (editor_actions, X_("RegionGainMenu"), _("Gain"));
86         ActionManager::register_action (editor_actions, X_("RulerMenu"), _("Rulers"));
87         ActionManager::register_action (editor_actions, X_("SavedViewMenu"), _("Views"));
88         ActionManager::register_action (editor_actions, X_("ScrollMenu"), _("Scroll"));
89         ActionManager::register_action (editor_actions, X_("SecondaryClockMenu"), _("Secondary Clock"));
90         ActionManager::register_action (editor_actions, X_("Select"), _("Select"));
91         ActionManager::register_action (editor_actions, X_("SelectMenu"), _("Select"));
92         ActionManager::register_action (editor_actions, X_("SeparateMenu"), _("Separate"));
93         ActionManager::register_action (editor_actions, X_("SetLoopMenu"), _("Loop"));
94         ActionManager::register_action (editor_actions, X_("SetPunchMenu"), _("Punch"));
95         ActionManager::register_action (editor_actions, X_("Solo"), _("Solo"));
96         ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes"));
97         ActionManager::register_action (editor_actions, X_("SyncMenu"), _("Sync"));
98         ActionManager::register_action (editor_actions, X_("TempoMenu"), _("Tempo"));
99         ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps"));
100         ActionManager::register_action (editor_actions, X_("TrackHeightMenu"), _("Height"));
101         ActionManager::register_action (editor_actions, X_("TrackMenu"), _("Track"));
102         ActionManager::register_action (editor_actions, X_("Tools"), _("Tools"));
103         ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim"));
104         ActionManager::register_action (editor_actions, X_("View"), _("View"));
105         ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom Focus"));
106         ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom"));
107
108         /* add named actions for the editor */
109
110         ActionManager::register_action (editor_actions, "break-drag", _("Break drag"), mem_fun (*this, &Editor::break_drag));
111
112         act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
113         ActionManager::session_sensitive_actions.push_back (act);
114         act = ActionManager::register_toggle_action (editor_actions, "show-editor-list", _("Show Editor List"), mem_fun (*this, &Editor::editor_list_button_toggled));
115         ActionManager::session_sensitive_actions.push_back (act);
116
117         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));;
118         ActionManager::session_sensitive_actions.push_back (act);
119         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));;
120         ActionManager::session_sensitive_actions.push_back (act);
121         act = ActionManager::register_action (editor_actions, "toggle-selected-region-fades", _("Toggle Region Fades"), bind (mem_fun(*this, &Editor::toggle_selected_region_fades), 0));
122         ActionManager::session_sensitive_actions.push_back (act);
123
124         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 ));
125         ActionManager::session_sensitive_actions.push_back (act);
126         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 ));
127         ActionManager::session_sensitive_actions.push_back (act);
128         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));
129         ActionManager::session_sensitive_actions.push_back (act);
130         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));
131         ActionManager::session_sensitive_actions.push_back (act);
132
133         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)));
134         ActionManager::session_sensitive_actions.push_back (act);
135         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)));
136         ActionManager::session_sensitive_actions.push_back (act);
137         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)));
138         ActionManager::session_sensitive_actions.push_back (act);
139
140         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)));
141         ActionManager::session_sensitive_actions.push_back (act);
142         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)));
143         ActionManager::session_sensitive_actions.push_back (act);
144         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)));
145         ActionManager::session_sensitive_actions.push_back (act);
146
147         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));
148         ActionManager::session_sensitive_actions.push_back (act);
149         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));
150         ActionManager::session_sensitive_actions.push_back (act);
151         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));
152         ActionManager::session_sensitive_actions.push_back (act);
153         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));
154         ActionManager::session_sensitive_actions.push_back (act);
155
156         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)));
157         ActionManager::session_sensitive_actions.push_back (act);
158         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)));
159         ActionManager::session_sensitive_actions.push_back (act);
160         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)));
161         ActionManager::session_sensitive_actions.push_back (act);
162
163         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)));
164         ActionManager::session_sensitive_actions.push_back (act);
165         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)));
166         ActionManager::session_sensitive_actions.push_back (act);
167         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)));
168         ActionManager::session_sensitive_actions.push_back (act);
169
170         act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("To Range Start"), mem_fun(*this, &Editor::selected_marker_to_selection_start));
171         ActionManager::session_sensitive_actions.push_back (act);
172         act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("To Range End"), mem_fun(*this, &Editor::selected_marker_to_selection_end));
173         ActionManager::session_sensitive_actions.push_back (act);
174
175         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));
176         ActionManager::session_sensitive_actions.push_back (act);
177         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));
178         ActionManager::session_sensitive_actions.push_back (act);
179
180         act = ActionManager::register_action (editor_actions, "select-all", _("Select All"), bind (mem_fun(*this, &Editor::select_all), Selection::Set));
181         ActionManager::session_sensitive_actions.push_back (act);
182         act = ActionManager::register_action (editor_actions, "deselect-all", _("Deselect All"), mem_fun(*this, &Editor::deselect_all));
183         ActionManager::session_sensitive_actions.push_back (act);
184         act = ActionManager::register_action (editor_actions, "invert-selection", _("Invert Selection"), mem_fun(*this, &Editor::invert_selection));
185         ActionManager::session_sensitive_actions.push_back (act);
186         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));
187         ActionManager::session_sensitive_actions.push_back (act);
188         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));
189         ActionManager::session_sensitive_actions.push_back (act);
190
191         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));
192         ActionManager::session_sensitive_actions.push_back (act);
193         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));
194         ActionManager::session_sensitive_actions.push_back (act);
195
196         act = ActionManager::register_action (editor_actions, "select-range-between-cursors", _("Select Edit Range"), mem_fun(*this, &Editor::select_range_between));
197         ActionManager::session_sensitive_actions.push_back (act);
198
199         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));
200         ActionManager::session_sensitive_actions.push_back (act);
201         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));
202         ActionManager::session_sensitive_actions.push_back (act);
203
204         act = ActionManager::register_action (editor_actions, "select-next-route", _("Select Next Track/Bus"), mem_fun(*this, &Editor::select_next_route));
205         ActionManager::session_sensitive_actions.push_back (act);
206         act = ActionManager::register_action (editor_actions, "select-prev-route", _("Select Previous Track/Bus"), mem_fun(*this, &Editor::select_prev_route));
207         ActionManager::session_sensitive_actions.push_back (act);
208
209         act = ActionManager::register_action (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), mem_fun(*this, &Editor::toggle_record_enable));
210         ActionManager::session_sensitive_actions.push_back (act);
211
212
213         act = ActionManager::register_action (editor_actions, "save-visual-state-1", _("Save View 1"), bind (mem_fun (*this, &Editor::start_visual_state_op), 0));
214         ActionManager::session_sensitive_actions.push_back (act);
215         act = ActionManager::register_action (editor_actions, "goto-visual-state-1", _("Goto View 1"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 0));
216         ActionManager::session_sensitive_actions.push_back (act);
217         act = ActionManager::register_action (editor_actions, "save-visual-state-2", _("Save View 2"), bind (mem_fun (*this, &Editor::start_visual_state_op), 1));
218         ActionManager::session_sensitive_actions.push_back (act);
219         act = ActionManager::register_action (editor_actions, "goto-visual-state-2", _("Goto View 2"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 1));
220         ActionManager::session_sensitive_actions.push_back (act);
221         act = ActionManager::register_action (editor_actions, "save-visual-state-3", _("Save View 3"), bind (mem_fun (*this, &Editor::start_visual_state_op), 2));
222         ActionManager::session_sensitive_actions.push_back (act);
223         act = ActionManager::register_action (editor_actions, "goto-visual-state-3", _("Goto View 3"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 2));
224         ActionManager::session_sensitive_actions.push_back (act);
225         act = ActionManager::register_action (editor_actions, "save-visual-state-4", _("Save View 4"), bind (mem_fun (*this, &Editor::start_visual_state_op), 3));
226         ActionManager::session_sensitive_actions.push_back (act);
227         act = ActionManager::register_action (editor_actions, "goto-visual-state-4", _("Goto View 4"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 3));
228         ActionManager::session_sensitive_actions.push_back (act);
229         act = ActionManager::register_action (editor_actions, "save-visual-state-5", _("Save View 5"), bind (mem_fun (*this, &Editor::start_visual_state_op), 4));
230         ActionManager::session_sensitive_actions.push_back (act);
231         act = ActionManager::register_action (editor_actions, "goto-visual-state-5", _("Goto View 5"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 4));
232         ActionManager::session_sensitive_actions.push_back (act);
233         act = ActionManager::register_action (editor_actions, "save-visual-state-6", _("Save View 6"), bind (mem_fun (*this, &Editor::start_visual_state_op), 5));
234         ActionManager::session_sensitive_actions.push_back (act);
235         act = ActionManager::register_action (editor_actions, "goto-visual-state-6", _("Goto View 6"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 5));
236         ActionManager::session_sensitive_actions.push_back (act);
237         act = ActionManager::register_action (editor_actions, "save-visual-state-7", _("Save View 7"), bind (mem_fun (*this, &Editor::start_visual_state_op), 6));
238         ActionManager::session_sensitive_actions.push_back (act);
239         act = ActionManager::register_action (editor_actions, "goto-visual-state-7", _("Goto View 7"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 6));
240         ActionManager::session_sensitive_actions.push_back (act);
241         act = ActionManager::register_action (editor_actions, "save-visual-state-8", _("Save View 8"), bind (mem_fun (*this, &Editor::start_visual_state_op), 7));
242         ActionManager::session_sensitive_actions.push_back (act);
243         act = ActionManager::register_action (editor_actions, "goto-visual-state-8", _("Goto View 8"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 7));
244         ActionManager::session_sensitive_actions.push_back (act);
245         act = ActionManager::register_action (editor_actions, "save-visual-state-9", _("Save View 9"), bind (mem_fun (*this, &Editor::start_visual_state_op), 8));
246         ActionManager::session_sensitive_actions.push_back (act);
247         act = ActionManager::register_action (editor_actions, "goto-visual-state-9", _("Goto View 9"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 8));
248         ActionManager::session_sensitive_actions.push_back (act);
249         act = ActionManager::register_action (editor_actions, "save-visual-state-10", _("Save View 10"), bind (mem_fun (*this, &Editor::start_visual_state_op), 9));
250         ActionManager::session_sensitive_actions.push_back (act);
251         act = ActionManager::register_action (editor_actions, "goto-visual-state-10", _("Goto View 10"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 9));
252         ActionManager::session_sensitive_actions.push_back (act);
253         act = ActionManager::register_action (editor_actions, "save-visual-state-11", _("Save View 11"), bind (mem_fun (*this, &Editor::start_visual_state_op), 10));
254         ActionManager::session_sensitive_actions.push_back (act);
255         act = ActionManager::register_action (editor_actions, "goto-visual-state-11", _("Goto View 11"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 10));
256         ActionManager::session_sensitive_actions.push_back (act);
257         act = ActionManager::register_action (editor_actions, "save-visual-state-12", _("Save View 12"), bind (mem_fun (*this, &Editor::start_visual_state_op), 11));
258         ActionManager::session_sensitive_actions.push_back (act);
259         act = ActionManager::register_action (editor_actions, "goto-visual-state-12", _("Goto View 12"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 11));
260         ActionManager::session_sensitive_actions.push_back (act);
261
262
263         act = ActionManager::register_action (editor_actions, "goto-mark-1", _("Locate to Mark 1"), bind (mem_fun (*this, &Editor::goto_nth_marker), 0));
264         ActionManager::session_sensitive_actions.push_back (act);
265         act = ActionManager::register_action (editor_actions, "goto-mark-2", _("Locate to Mark 2"), bind (mem_fun (*this, &Editor::goto_nth_marker), 1));
266         ActionManager::session_sensitive_actions.push_back (act);
267         act = ActionManager::register_action (editor_actions, "goto-mark-3", _("Locate to Mark 3"), bind (mem_fun (*this, &Editor::goto_nth_marker), 2));
268         ActionManager::session_sensitive_actions.push_back (act);
269         act = ActionManager::register_action (editor_actions, "goto-mark-4", _("Locate to Mark 4"), bind (mem_fun (*this, &Editor::goto_nth_marker), 3));
270         ActionManager::session_sensitive_actions.push_back (act);
271         act = ActionManager::register_action (editor_actions, "goto-mark-5", _("Locate to Mark 5"), bind (mem_fun (*this, &Editor::goto_nth_marker), 4));
272         ActionManager::session_sensitive_actions.push_back (act);
273         act = ActionManager::register_action (editor_actions, "goto-mark-6", _("Locate to Mark 6"), bind (mem_fun (*this, &Editor::goto_nth_marker), 5));
274         ActionManager::session_sensitive_actions.push_back (act);
275         act = ActionManager::register_action (editor_actions, "goto-mark-7", _("Locate to Mark 7"), bind (mem_fun (*this, &Editor::goto_nth_marker), 6));
276         ActionManager::session_sensitive_actions.push_back (act);
277         act = ActionManager::register_action (editor_actions, "goto-mark-8", _("Locate to Mark 8"), bind (mem_fun (*this, &Editor::goto_nth_marker), 7));
278         ActionManager::session_sensitive_actions.push_back (act);
279         act = ActionManager::register_action (editor_actions, "goto-mark-9", _("Locate to Mark 9"), bind (mem_fun (*this, &Editor::goto_nth_marker), 8));
280         ActionManager::session_sensitive_actions.push_back (act);
281
282         act = ActionManager::register_action (editor_actions, "jump-forward-to-mark", _("Jump Forward to Mark"), mem_fun(*this, &Editor::jump_forward_to_mark));
283         ActionManager::session_sensitive_actions.push_back (act);
284         act = ActionManager::register_action (editor_actions, "jump-backward-to-mark", _("Jump Backward to Mark"), mem_fun(*this, &Editor::jump_backward_to_mark));
285         ActionManager::session_sensitive_actions.push_back (act);
286         act = ActionManager::register_action (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), mem_fun(*this, &Editor::add_location_from_playhead_cursor));
287         ActionManager::session_sensitive_actions.push_back (act);
288
289         act = ActionManager::register_action (editor_actions, "nudge-forward", _("Nudge Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, false));
290         ActionManager::session_sensitive_actions.push_back (act);
291         act = ActionManager::register_action (editor_actions, "nudge-next-forward", _("Nudge Next Forward"), bind (mem_fun(*this, &Editor::nudge_forward), true, false));
292         ActionManager::session_sensitive_actions.push_back (act);
293         act = ActionManager::register_action (editor_actions, "nudge-backward", _("Nudge Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, false));
294         ActionManager::session_sensitive_actions.push_back (act);
295         act = ActionManager::register_action (editor_actions, "nudge-next-backward", _("Nudge Next Backward"), bind (mem_fun(*this, &Editor::nudge_backward), true, false));
296         ActionManager::session_sensitive_actions.push_back (act);
297
298         act = ActionManager::register_action (editor_actions, "nudge-playhead-forward", _("Nudge Playhead Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, true));
299         ActionManager::session_sensitive_actions.push_back (act);
300         act = ActionManager::register_action (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, true));
301         ActionManager::session_sensitive_actions.push_back (act);
302         act = ActionManager::register_action (editor_actions, "playhead-forward-to-grid", _("Forward to Grid"), mem_fun(*this, &Editor::playhead_forward_to_grid));
303         ActionManager::session_sensitive_actions.push_back (act);
304         act = ActionManager::register_action (editor_actions, "playhead-backward-to-grid", _("Backward to Grid"), mem_fun(*this, &Editor::playhead_backward_to_grid));
305         ActionManager::session_sensitive_actions.push_back (act);
306
307
308         act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
309         ActionManager::session_sensitive_actions.push_back (act);
310         act = ActionManager::register_action (editor_actions, "temporal-zoom-in", _("Zoom In"), bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
311         ActionManager::session_sensitive_actions.push_back (act);
312         act = ActionManager::register_action (editor_actions, "zoom-to-session", _("Zoom to Session"), mem_fun(*this, &Editor::temporal_zoom_session));
313         ActionManager::session_sensitive_actions.push_back (act);
314         act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), bind (mem_fun(*this, &Editor::zoom_to_region), false));
315         ActionManager::session_sensitive_actions.push_back (act);
316         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));
317         ActionManager::session_sensitive_actions.push_back (act);
318         act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
319         ActionManager::session_sensitive_actions.push_back (act);
320
321         act = ActionManager::register_action (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), bind (mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true));
322         ActionManager::session_sensitive_actions.push_back (act);
323         act = ActionManager::register_action (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), bind (mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false));
324         ActionManager::session_sensitive_actions.push_back (act);
325
326         act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up));
327         ActionManager::session_sensitive_actions.push_back (act);
328         act = ActionManager::register_action (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), mem_fun(*this, &Editor::scroll_tracks_down));
329         ActionManager::session_sensitive_actions.push_back (act);
330         act = ActionManager::register_action (editor_actions, "step-tracks-up", _("Step Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up_line));
331         ActionManager::session_sensitive_actions.push_back (act);
332         act = ActionManager::register_action (editor_actions, "step-tracks-down", _("Step Tracks Down"), mem_fun(*this, &Editor::scroll_tracks_down_line));
333         ActionManager::session_sensitive_actions.push_back (act);
334
335         act = ActionManager::register_action (editor_actions, "scroll-backward", _("Scroll Backward"), bind (mem_fun(*this, &Editor::scroll_backward), 0.8f));
336         ActionManager::session_sensitive_actions.push_back (act);
337         act = ActionManager::register_action (editor_actions, "scroll-forward", _("Scroll Forward"), bind (mem_fun(*this, &Editor::scroll_forward), 0.8f));
338         ActionManager::session_sensitive_actions.push_back (act);
339         act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame));
340         ActionManager::session_sensitive_actions.push_back (act);
341         act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead));
342         ActionManager::session_sensitive_actions.push_back (act);
343         act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Active Marker"), mem_fun(*this, &Editor::center_edit_point));
344         ActionManager::session_sensitive_actions.push_back (act);
345
346         act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead Forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));;
347         ActionManager::session_sensitive_actions.push_back (act);
348         act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false));
349         ActionManager::session_sensitive_actions.push_back (act);
350
351         act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead to Active Mark"), bind (mem_fun(*this, &Editor::cursor_align), true));
352         ActionManager::session_sensitive_actions.push_back (act);
353         act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Active Mark to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
354         ActionManager::session_sensitive_actions.push_back (act);
355
356         act = ActionManager::register_action (editor_actions, "trim-front", _("Trim Start at Edit Point"), mem_fun(*this, &Editor::trim_region_front));
357         ActionManager::session_sensitive_actions.push_back (act);
358         ActionManager::region_selection_sensitive_actions.push_back (act);
359         act = ActionManager::register_action (editor_actions, "trim-back", _("Trim End at Edit Point"), mem_fun(*this, &Editor::trim_region_back));
360         ActionManager::session_sensitive_actions.push_back (act);
361         ActionManager::region_selection_sensitive_actions.push_back (act);
362
363         act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to Edit Point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
364         ActionManager::session_sensitive_actions.push_back (act);
365         ActionManager::region_selection_sensitive_actions.push_back (act);
366         act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit Point to End"), mem_fun(*this, &Editor::trim_region_to_edit_point));
367         ActionManager::session_sensitive_actions.push_back (act);
368         ActionManager::region_selection_sensitive_actions.push_back (act);
369         act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim to Loop"), mem_fun(*this, &Editor::trim_region_to_loop));
370         ActionManager::session_sensitive_actions.push_back (act);
371         ActionManager::region_selection_sensitive_actions.push_back (act);
372         act = ActionManager::register_action (editor_actions, "trim-region-to-punch", _("Trim to Punch"), mem_fun(*this, &Editor::trim_region_to_punch));
373         ActionManager::session_sensitive_actions.push_back (act);
374         ActionManager::region_selection_sensitive_actions.push_back (act);
375
376         act = ActionManager::register_action (editor_actions, "trim-to-previous-region", _("Trim to Previous"), mem_fun(*this, &Editor::trim_region_to_previous_region_end));
377         ActionManager::session_sensitive_actions.push_back (act);
378         ActionManager::region_selection_sensitive_actions.push_back (act);
379         act = ActionManager::register_action (editor_actions, "trim-to-next-region", _("Trim to Next"), mem_fun(*this, &Editor::trim_region_to_next_region_start));
380         ActionManager::session_sensitive_actions.push_back (act);
381         ActionManager::region_selection_sensitive_actions.push_back (act);
382
383         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));
384         ActionManager::session_sensitive_actions.push_back (act);
385         act = ActionManager::register_action (editor_actions, "set-loop-from-region", _("Set Loop from Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), false));
386         ActionManager::session_sensitive_actions.push_back (act);
387         ActionManager::region_selection_sensitive_actions.push_back (act);
388         act = ActionManager::register_action (editor_actions, "loop-region", _("Loop Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), true));
389         ActionManager::session_sensitive_actions.push_back (act);
390         ActionManager::region_selection_sensitive_actions.push_back (act);
391         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));
392         ActionManager::session_sensitive_actions.push_back (act);
393         act = ActionManager::register_action (editor_actions, "set-punch-from-region", _("Set Punch From Region"), mem_fun(*this, &Editor::set_punch_from_region));
394         ActionManager::session_sensitive_actions.push_back (act);
395         ActionManager::region_selection_sensitive_actions.push_back (act);
396         act = ActionManager::register_action (editor_actions, "pitch-shift-region", _("Transpose"), mem_fun(*this, &Editor::pitch_shift_regions));
397         ActionManager::session_sensitive_actions.push_back (act);
398         ActionManager::region_selection_sensitive_actions.push_back (act);
399         act = ActionManager::register_action (editor_actions, "toggle-opaque-region", _("Toggle Opaque"), mem_fun(*this, &Editor::toggle_region_opaque));
400         ActionManager::session_sensitive_actions.push_back (act);
401         ActionManager::region_selection_sensitive_actions.push_back (act);
402         act = ActionManager::register_action (editor_actions, "add-range-marker-from-region", _("Add 1 Range Marker"), mem_fun(*this, &Editor::add_location_from_audio_region));
403         ActionManager::session_sensitive_actions.push_back (act);
404         ActionManager::region_selection_sensitive_actions.push_back (act);
405         act = ActionManager::register_action (editor_actions, "add-range-markers-from-region", _("Add Range Marker(s)"), mem_fun(*this, &Editor::add_locations_from_audio_region));
406         ActionManager::session_sensitive_actions.push_back (act);
407         ActionManager::region_selection_sensitive_actions.push_back (act);
408
409         act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true));
410         ActionManager::session_sensitive_actions.push_back (act);
411         act = ActionManager::register_action (editor_actions, "toggle-fade-in-active", _("Toggle Fade In Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), true));
412         ActionManager::session_sensitive_actions.push_back (act);
413         act = ActionManager::register_action (editor_actions, "set-fade-out-length", _("Set Fade Out Length"), bind (mem_fun(*this, &Editor::set_fade_length), false));
414         ActionManager::session_sensitive_actions.push_back (act);
415         act = ActionManager::register_action (editor_actions, "toggle-fade-out-active", _("Toggle Fade Out Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), false));
416         ActionManager::session_sensitive_actions.push_back (act);
417
418         act = ActionManager::register_action (editor_actions, "align-regions-start", _("Align Regions Start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start));
419         ActionManager::session_sensitive_actions.push_back (act);
420         ActionManager::region_selection_sensitive_actions.push_back (act);
421         act = ActionManager::register_action (editor_actions, "align-regions-start-relative", _("Align Regions Start Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::Start));
422         ActionManager::session_sensitive_actions.push_back (act);
423         ActionManager::region_selection_sensitive_actions.push_back (act);
424         act = ActionManager::register_action (editor_actions, "align-regions-end", _("Align Regions End"), bind (mem_fun(*this, &Editor::align), ARDOUR::End));
425         ActionManager::session_sensitive_actions.push_back (act);
426         ActionManager::region_selection_sensitive_actions.push_back (act);
427         act = ActionManager::register_action (editor_actions, "align-regions-end-relative", _("Align Regions End Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::End));
428         ActionManager::session_sensitive_actions.push_back (act);
429         ActionManager::region_selection_sensitive_actions.push_back (act);
430
431         act = ActionManager::register_action (editor_actions, "align-regions-sync", _("Align Regions Sync"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint));
432         ActionManager::session_sensitive_actions.push_back (act);
433         ActionManager::region_selection_sensitive_actions.push_back (act);
434         act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("Align Regions Sync Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint));
435         ActionManager::session_sensitive_actions.push_back (act);
436         ActionManager::region_selection_sensitive_actions.push_back (act);
437
438         act = ActionManager::register_action (editor_actions, "play-from-edit-point", _("Play From Edit Point"), mem_fun(*this, &Editor::play_from_edit_point));
439         ActionManager::session_sensitive_actions.push_back (act);
440         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));
441         ActionManager::session_sensitive_actions.push_back (act);
442
443         act = ActionManager::register_action (editor_actions, "play-edit-range", _("Play Edit Range"), mem_fun(*this, &Editor::play_edit_range));
444         act = ActionManager::register_action (editor_actions, "play-selected-regions", _("Play Selected Region(s)"), mem_fun(*this, &Editor::play_selected_region));
445         ActionManager::session_sensitive_actions.push_back (act);
446         ActionManager::region_selection_sensitive_actions.push_back (act);
447         act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush));
448         ActionManager::session_sensitive_actions.push_back (act);
449
450         act = ActionManager::register_action (editor_actions, "set-playhead", _("Playhead to Mouse"), mem_fun(*this, &Editor::set_playhead_cursor));
451         ActionManager::session_sensitive_actions.push_back (act);
452         act = ActionManager::register_action (editor_actions, "set-edit-point", _("Active Marker to Mouse"), mem_fun(*this, &Editor::set_edit_point));
453         ActionManager::session_sensitive_actions.push_back (act);
454
455         act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
456         ActionManager::session_sensitive_actions.push_back (act);
457         ActionManager::region_selection_sensitive_actions.push_back (act);
458         act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true));
459         ActionManager::session_sensitive_actions.push_back (act);
460         ActionManager::region_selection_sensitive_actions.push_back (act);
461         act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
462         ActionManager::session_sensitive_actions.push_back (act);
463         ActionManager::region_selection_sensitive_actions.push_back (act);
464         act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection));
465         ActionManager::session_sensitive_actions.push_back (act);
466         ActionManager::region_selection_sensitive_actions.push_back (act);
467         act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region));
468         ActionManager::session_sensitive_actions.push_back (act);
469         ActionManager::region_selection_sensitive_actions.push_back (act);
470         act = ActionManager::register_action (editor_actions, "rename-region", _("Rename"), mem_fun(*this, &Editor::rename_region));
471         ActionManager::session_sensitive_actions.push_back (act);
472         ActionManager::region_selection_sensitive_actions.push_back (act);
473         act = ActionManager::register_action (editor_actions, "auto-rename-region", _("Auto-Rename"), mem_fun(*this, &Editor::rename_region));
474         ActionManager::session_sensitive_actions.push_back (act);
475         ActionManager::region_selection_sensitive_actions.push_back (act);
476         act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true));
477         ActionManager::session_sensitive_actions.push_back (act);
478         ActionManager::region_selection_sensitive_actions.push_back (act);
479         act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false));
480         ActionManager::session_sensitive_actions.push_back (act);
481         ActionManager::region_selection_sensitive_actions.push_back (act);
482         act = ActionManager::register_action (editor_actions, "split-region", _("Split Region"), mem_fun(*this, &Editor::split));
483         ActionManager::session_sensitive_actions.push_back (act);
484         ActionManager::region_selection_sensitive_actions.push_back (act);
485         act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::set_region_sync_from_edit_point));
486         ActionManager::session_sensitive_actions.push_back (act);
487         ActionManager::region_selection_sensitive_actions.push_back (act);
488         act = ActionManager::register_action (editor_actions, "remove-region-sync", _("Remove Region Sync"), mem_fun(*this, &Editor::remove_region_sync));
489         ActionManager::session_sensitive_actions.push_back (act);
490         ActionManager::region_selection_sensitive_actions.push_back (act);
491         act = ActionManager::register_action (editor_actions, "raise-region", _("Raise Region"), mem_fun(*this, &Editor::raise_region));
492         ActionManager::session_sensitive_actions.push_back (act);
493         ActionManager::region_selection_sensitive_actions.push_back (act);
494         act = ActionManager::register_action (editor_actions, "lower-region", _("Lower Region"), mem_fun(*this, &Editor::lower_region));
495         ActionManager::session_sensitive_actions.push_back (act);
496         ActionManager::region_selection_sensitive_actions.push_back (act);
497         act = ActionManager::register_action (editor_actions, "export-region", _("Export Region"), mem_fun(*this, &Editor::export_region));
498         ActionManager::session_sensitive_actions.push_back (act);
499         ActionManager::region_selection_sensitive_actions.push_back (act);
500         act = ActionManager::register_toggle_action (editor_actions, "lock-region", _("Lock Region"), mem_fun(*this, &Editor::toggle_region_lock));
501         ActionManager::session_sensitive_actions.push_back (act);
502         ActionManager::region_selection_sensitive_actions.push_back (act);
503         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));
504         ActionManager::session_sensitive_actions.push_back (act);
505         ActionManager::region_selection_sensitive_actions.push_back (act);
506         act = ActionManager::register_action (editor_actions, "naturalize-region", _("Move to Original Position"), mem_fun (*this, &Editor::naturalize));
507         ActionManager::session_sensitive_actions.push_back (act);
508         ActionManager::region_selection_sensitive_actions.push_back (act);
509         act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse"), mem_fun (*this, &Editor::reverse_region));
510         ActionManager::session_sensitive_actions.push_back (act);
511         ActionManager::region_selection_sensitive_actions.push_back (act);
512         act = ActionManager::register_action (editor_actions, "monoize-region", _("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region)));
513         ActionManager::session_sensitive_actions.push_back (act);
514         ActionManager::region_selection_sensitive_actions.push_back (act);
515         act = ActionManager::register_action (editor_actions, "region-fill-track", _("Fill Track"), (mem_fun(*this, &Editor::region_fill_track)));
516         ActionManager::session_sensitive_actions.push_back (act);
517         ActionManager::region_selection_sensitive_actions.push_back (act);
518         act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region));
519         ActionManager::session_sensitive_actions.push_back (act);
520         ActionManager::region_selection_sensitive_actions.push_back (act);
521
522         undo_action = act = ActionManager::register_action (editor_actions, "undo", _("Undo"), bind (mem_fun(*this, &Editor::undo), 1U));
523         ActionManager::session_sensitive_actions.push_back (act);
524         redo_action = act = ActionManager::register_action (editor_actions, "redo", _("Redo"), bind (mem_fun(*this, &Editor::redo), 1U));
525         ActionManager::session_sensitive_actions.push_back (act);
526
527         act = ActionManager::register_action (editor_actions, "export-audio", _("Export Audio"), mem_fun(*this, &Editor::export_audio));
528         ActionManager::session_sensitive_actions.push_back (act);
529         act = ActionManager::register_action (editor_actions, "export-range", _("Export Range"), mem_fun(*this, &Editor::export_range));
530         ActionManager::session_sensitive_actions.push_back (act);
531
532         act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection));
533         ActionManager::session_sensitive_actions.push_back (act);
534         ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
535         act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch));
536         ActionManager::session_sensitive_actions.push_back (act);
537         ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
538         act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop));
539         ActionManager::session_sensitive_actions.push_back (act);
540         ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
541         act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
542         ActionManager::session_sensitive_actions.push_back (act);
543         ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
544         act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut));
545         ActionManager::session_sensitive_actions.push_back (act);
546         /* Note: for now, editor-delete does the exact same thing as editor-cut */
547         act = ActionManager::register_action (editor_actions, "editor-delete", _("Delete"), mem_fun(*this, &Editor::cut));
548         ActionManager::session_sensitive_actions.push_back (act);
549         act = ActionManager::register_action (editor_actions, "editor-copy", _("Copy"), mem_fun(*this, &Editor::copy));
550         ActionManager::session_sensitive_actions.push_back (act);
551         act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste));
552         ActionManager::session_sensitive_actions.push_back (act);
553
554         act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region));
555         ActionManager::session_sensitive_actions.push_back (act);
556         ActionManager::region_selection_sensitive_actions.push_back (act);
557
558         act = ActionManager::register_action (editor_actions, "set-tempo-from-region", _("Set Tempo from Region=Bar"), mem_fun(*this, &Editor::use_region_as_bar));
559         ActionManager::session_sensitive_actions.push_back (act);
560         ActionManager::region_selection_sensitive_actions.push_back (act);
561         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));
562         ActionManager::session_sensitive_actions.push_back (act);
563
564         act = ActionManager::register_action (editor_actions, "split-region-at-transients", _("Split Regions At Percussion Onsets"), mem_fun(*this, &Editor::split_region_at_transients));
565         ActionManager::session_sensitive_actions.push_back (act);
566         ActionManager::region_selection_sensitive_actions.push_back (act);
567         act = ActionManager::register_action (editor_actions, "toggle-rhythm-ferret", _("Rhythm Ferret"), mem_fun(*this, &Editor::show_rhythm_ferret));
568         ActionManager::session_sensitive_actions.push_back (act);
569         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));
570         ActionManager::session_sensitive_actions.push_back (act);
571         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));
572         ActionManager::session_sensitive_actions.push_back (act);
573         act = ActionManager::register_action (editor_actions, "toggle-log-window", _("Log"),
574                         mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::toggle_errors));
575         ActionManager::session_sensitive_actions.push_back (act);
576
577         act = ActionManager::register_action (editor_actions, "tab-to-transient-forwards", _("Move Forward to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), true));
578         ActionManager::session_sensitive_actions.push_back (act);
579         act = ActionManager::register_action (editor_actions, "tab-to-transient-backwards", _("Move Backwards to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), false));
580         ActionManager::session_sensitive_actions.push_back (act);
581
582         act = ActionManager::register_action (editor_actions, "crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
583         ActionManager::session_sensitive_actions.push_back (act);
584
585         act = ActionManager::register_action (editor_actions, "start-range", _("Start Range"), mem_fun(*this, &Editor::keyboard_selection_begin));
586         ActionManager::session_sensitive_actions.push_back (act);
587         act = ActionManager::register_action (editor_actions, "finish-range", _("Finish Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), false));
588         ActionManager::session_sensitive_actions.push_back (act);
589         act = ActionManager::register_action (editor_actions, "finish-add-range", _("Finish add Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), true));
590         ActionManager::session_sensitive_actions.push_back (act);
591
592         act = ActionManager::register_action (editor_actions, "extend-range-to-end-of-region", _("Extend Range to End of Region"), bind (mem_fun(*this, &Editor::extend_selection_to_end_of_region), false));
593         ActionManager::session_sensitive_actions.push_back (act);
594         act = ActionManager::register_action (editor_actions, "extend-range-to-start-of-region", _("Extend Range to Start of Region"), bind (mem_fun(*this, &Editor::extend_selection_to_start_of_region), false));
595         ActionManager::session_sensitive_actions.push_back (act);
596
597         act = ActionManager::register_toggle_action (editor_actions, "toggle-follow-playhead", _("Follow Playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
598         ActionManager::session_sensitive_actions.push_back (act);
599         act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (mem_fun(*this, &Editor::remove_last_capture)));
600         ActionManager::session_sensitive_actions.push_back (act);
601
602         act = ActionManager::register_action (editor_actions, "insert-time", _("Insert Time"), (mem_fun(*this, &Editor::do_insert_time)));
603         ActionManager::session_sensitive_actions.push_back (act);
604         ActionManager::track_selection_sensitive_actions.push_back (act);
605
606         act = ActionManager::register_action (editor_actions, "toggle-track-active", _("Toggle Active"), (mem_fun(*this, &Editor::toggle_tracks_active)));
607         ActionManager::session_sensitive_actions.push_back (act);
608         ActionManager::track_selection_sensitive_actions.push_back (act);
609         if (Profile->get_sae()) {
610                 act = ActionManager::register_action (editor_actions, "remove-track", _("Delete"), (mem_fun(*this, &Editor::remove_tracks)));
611         } else {
612                 act = ActionManager::register_action (editor_actions, "remove-track", _("Remove"), (mem_fun(*this, &Editor::remove_tracks)));
613         }
614         ActionManager::session_sensitive_actions.push_back (act);
615         ActionManager::track_selection_sensitive_actions.push_back (act);
616
617         act = ActionManager::register_action (editor_actions, "fit-tracks", _("Fit Selected Tracks"), mem_fun(*this, &Editor::fit_selected_tracks));
618         ActionManager::session_sensitive_actions.push_back (act);
619         act = ActionManager::register_action (editor_actions, "track-height-largest", _("Largest"), bind (
620                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLargest));
621         ActionManager::session_sensitive_actions.push_back (act);
622         ActionManager::track_selection_sensitive_actions.push_back (act);
623         act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), bind (
624                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLarger));
625         ActionManager::session_sensitive_actions.push_back (act);
626         ActionManager::track_selection_sensitive_actions.push_back (act);
627         act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), bind (
628                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hLarge));
629         ActionManager::session_sensitive_actions.push_back (act);
630         ActionManager::track_selection_sensitive_actions.push_back (act);
631         act = ActionManager::register_action (editor_actions, "track-height-normal", _("Normal"), bind (
632                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hNormal));
633         ActionManager::session_sensitive_actions.push_back (act);
634         ActionManager::track_selection_sensitive_actions.push_back (act);
635         act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), bind (
636                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hSmall));
637         ActionManager::track_selection_sensitive_actions.push_back (act);
638         ActionManager::session_sensitive_actions.push_back (act);
639         ActionManager::track_selection_sensitive_actions.push_back (act);
640         act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), bind (
641                                 mem_fun(*this, &Editor::set_track_height), TimeAxisView::hSmaller));
642         ActionManager::session_sensitive_actions.push_back (act);
643         ActionManager::track_selection_sensitive_actions.push_back (act);
644
645         Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
646         RadioAction::Group zoom_group;
647
648         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("Zoom Focus Left"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusLeft));
649         ActionManager::session_sensitive_actions.push_back (act);
650         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("Zoom Focus Right"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusRight));
651         ActionManager::session_sensitive_actions.push_back (act);
652         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("Zoom Focus Center"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusCenter));
653         ActionManager::session_sensitive_actions.push_back (act);
654         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("Zoom Focus Playhead"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusPlayhead));
655         ActionManager::session_sensitive_actions.push_back (act);
656         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-mouse", _("Zoom Focus Mouse"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusMouse));
657         ActionManager::session_sensitive_actions.push_back (act);
658         ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit Point"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusEdit));
659         ActionManager::session_sensitive_actions.push_back (act);
660
661         Glib::RefPtr<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
662         RadioAction::Group mouse_mode_group;
663
664         ARDOUR_UI::instance()->tooltips().set_tip (mouse_move_button, _("Select/Move Objects"));
665         ARDOUR_UI::instance()->tooltips().set_tip (mouse_select_button, _("Select/Move Ranges"));
666         ARDOUR_UI::instance()->tooltips().set_tip (mouse_gain_button, _("Draw Gain Automation"));
667         ARDOUR_UI::instance()->tooltips().set_tip (mouse_zoom_button, _("Select Zoom Range"));
668         ARDOUR_UI::instance()->tooltips().set_tip (mouse_timefx_button, _("Stretch/Shrink Regions"));
669         ARDOUR_UI::instance()->tooltips().set_tip (mouse_audition_button, _("Listen to Specific Regions"));
670         /* in the future, this may allow other kinds of "intra-region" editing, but for now its just MIDI */
671         ARDOUR_UI::instance()->tooltips().set_tip (internal_edit_button, _("Edit MIDI Notes"));
672
673         act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-object", _("Object Tool"), bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseObject));
674         act->connect_proxy (mouse_move_button);
675         mouse_move_button.set_image (*(manage (new Image (::get_icon("tool_object")))));
676         mouse_move_button.set_label ("");
677         mouse_move_button.set_name ("MouseModeButton");
678         mouse_move_button.get_image ()->show ();
679
680         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));
681         act->connect_proxy (mouse_select_button);
682         mouse_select_button.set_image (*(manage (new Image (::get_icon("tool_range")))));
683         mouse_select_button.set_label ("");
684         mouse_select_button.set_name ("MouseModeButton");
685         mouse_select_button.get_image ()->show ();
686
687         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));
688         act->connect_proxy (mouse_gain_button);
689         mouse_gain_button.set_image (*(manage (new Image (::get_icon("tool_gain")))));
690         mouse_gain_button.set_label ("");
691         mouse_gain_button.set_name ("MouseModeButton");
692         mouse_gain_button.get_image ()->show ();
693
694         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));
695         act->connect_proxy (mouse_zoom_button);
696         mouse_zoom_button.set_image (*(manage (new Image (::get_icon("tool_zoom")))));
697         mouse_zoom_button.set_label ("");
698         mouse_zoom_button.set_name ("MouseModeButton");
699         mouse_zoom_button.get_image ()->show ();
700
701         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));
702         act->connect_proxy (mouse_audition_button);
703         mouse_audition_button.set_image (*(manage (new Image (::get_icon("tool_audition")))));
704         mouse_audition_button.set_label ("");
705         mouse_audition_button.set_name ("MouseModeButton");
706         mouse_audition_button.get_image ()->show ();
707
708         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));
709         act->connect_proxy (mouse_timefx_button);
710         mouse_timefx_button.set_image (*(manage (new Image (::get_icon("tool_stretch")))));
711         mouse_timefx_button.set_label ("");
712         mouse_timefx_button.set_name ("MouseModeButton");
713         mouse_timefx_button.get_image ()->show ();
714
715         ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), bind (mem_fun(*this, &Editor::step_mouse_mode), true));
716
717         act = ActionManager::register_toggle_action (mouse_mode_actions, "toggle-internal-edit", _("Edit MIDI"), mem_fun(*this, &Editor::toggle_internal_editing));
718         act->connect_proxy (internal_edit_button);
719         internal_edit_button.set_image (*(manage (new Image (::get_icon("tool_note")))));
720         internal_edit_button.set_label ("");
721         internal_edit_button.set_name ("MouseModeButton");
722         internal_edit_button.get_image ()->show ();
723
724         RadioAction::Group edit_point_group;
725         ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-playhead"), _("Playhead"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
726         ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
727         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)));
728
729         ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change Edit Point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
730         ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
731         if (!Profile->get_sae()) {
732                 ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice));
733         }
734         ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), bind (mem_fun (*this, &Editor::set_edit_mode), Slide));
735         ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), bind (mem_fun (*this, &Editor::set_edit_mode), Lock));
736         ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), mem_fun (*this, &Editor::cycle_edit_mode));
737
738         ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap to"));
739         ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
740
741         RadioAction::Group snap_mode_group;
742         ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
743         ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
744         ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
745
746         ActionManager::register_action (editor_actions, X_("cycle-snap-mode"), _("Next Snap Mode"), mem_fun (*this, &Editor::cycle_snap_mode));
747         ActionManager::register_action (editor_actions, X_("cycle-snap-choice"), _("Next Snap Choice"), mem_fun (*this, &Editor::cycle_snap_choice));
748
749         Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
750         RadioAction::Group snap_choice_group;
751
752         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)));
753         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)));
754         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)));
755         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)));
756         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)));
757         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)));
758         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)));
759         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)));
760         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)));
761         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)));
762         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)));
763         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)));
764         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)));
765         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)));
766         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)));
767         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)));
768         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)));
769         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)));
770
771         /* RULERS */
772
773         Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers"));
774         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)));
775         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)));
776         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)));
777         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)));
778         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)));
779         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)));
780         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)));
781         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)));
782         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)));
783         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)));
784
785         /* set defaults here */
786
787         no_ruler_shown_update = true;
788         ruler_meter_action->set_active (true);
789         ruler_tempo_action->set_active (true);
790         ruler_marker_action->set_active (true);
791         ruler_range_action->set_active (false);
792         ruler_loop_punch_action->set_active (true);
793         ruler_loop_punch_action->set_active (true);
794         if (Profile->get_sae()) {
795                 ruler_bbt_action->set_active (true);
796                 ruler_cd_marker_action->set_active (false);
797                 ruler_timecode_action->set_active (false);
798                 ruler_minsec_action->set_active (true);
799         } else {
800                 ruler_bbt_action->set_active (false);
801                 ruler_cd_marker_action->set_active (true);
802                 ruler_timecode_action->set_active (true);
803                 ruler_minsec_action->set_active (false);
804         }
805         ruler_samples_action->set_active (false);
806         no_ruler_shown_update = false;
807
808         /* REGION LIST */
809
810         Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
811         RadioAction::Group sort_type_group;
812         RadioAction::Group sort_order_group;
813
814         /* the region list popup menu */
815         ActionManager::register_action (rl_actions, X_("RegionListSort"), _("Sort"));
816
817         act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
818         ActionManager::region_list_selection_sensitive_actions.push_back (act);
819         act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
820         ActionManager::region_list_selection_sensitive_actions.push_back (act);
821         act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*_regions, &EditorRegions::remove_region));
822         ActionManager::region_list_selection_sensitive_actions.push_back (act);
823         ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show All"), mem_fun(*_regions, &EditorRegions::toggle_full));
824         ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show Automatic Regions"), mem_fun (*_regions, &EditorRegions::toggle_show_auto_regions));
825
826         ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"),  _("Ascending"),
827                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), true));
828         ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"),   _("Descending"),
829                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), false));
830
831         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"),  _("By Region Name"),
832                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByName, false));
833         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"),  _("By Region Length"),
834                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByLength, false));
835         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionPosition"),  _("By Region Position"),
836                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByPosition, false));
837         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionTimestamp"),  _("By Region Timestamp"),
838                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByTimestamp, false));
839         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionStartinFile"),  _("By Region Start in File"),
840                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByStartInFile, false));
841         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionEndinFile"),  _("By Region End in File"),
842                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByEndInFile, false));
843         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileName"),  _("By Source File Name"),
844                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileName, false));
845         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileLength"),  _("By Source File Length"),
846                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileLength, false));
847         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileCreationDate"),  _("By Source File Creation Date"),
848                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileCreationDate, false));
849         ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"),  _("By Source Filesystem"),
850                         bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileFS, false));
851
852
853         /* the next two are duplicate items with different names for use in two different contexts */
854
855         act = ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import"), mem_fun (*this, &Editor::external_audio_dialog));
856         ActionManager::session_sensitive_actions.push_back (act);
857         ActionManager::write_sensitive_actions.push_back (act);
858
859         act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Import to Region List"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
860         ActionManager::session_sensitive_actions.push_back (act);
861         ActionManager::write_sensitive_actions.push_back (act);
862
863         act = ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
864         ActionManager::write_sensitive_actions.push_back (act);
865
866         ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
867
868         ActionManager::register_toggle_action (editor_actions, X_("ToggleSummary"), _("Show Summary"), mem_fun (*this, &Editor::set_summary));
869
870         ActionManager::register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), mem_fun (*this, &Editor::set_group_tabs));
871
872         ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
873
874         /* if there is a logo in the editor canvas, its always visible at startup */
875
876         act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
877         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
878         tact->set_active (true);
879
880         /* MIDI */
881
882         Glib::RefPtr<ActionGroup> midi_actions = ActionGroup::create (X_("MIDI"));
883         ActionManager::register_action (midi_actions, X_("panic"), _("Panic"), mem_fun(*this, &Editor::midi_panic));
884
885         ActionManager::add_action_group (rl_actions);
886         ActionManager::add_action_group (ruler_actions);
887         ActionManager::add_action_group (zoom_actions);
888         ActionManager::add_action_group (mouse_mode_actions);
889         ActionManager::add_action_group (snap_actions);
890         ActionManager::add_action_group (editor_actions);
891         ActionManager::add_action_group (midi_actions);
892 }
893
894 void
895 Editor::toggle_ruler_visibility (RulerType rt)
896 {
897         const char* action = 0;
898
899         if (no_ruler_shown_update) {
900                 return;
901         }
902
903         switch (rt) {
904         case ruler_metric_timecode:
905                 action = "toggle-timecode-ruler";
906                 break;
907         case ruler_metric_bbt:
908                 action = "toggle-bbt-ruler";
909                 break;
910         case ruler_metric_frames:
911                 action = "toggle-samples-ruler";
912                 break;
913         case ruler_metric_minsec:
914                 action = "toggle-minsec-ruler";
915                 break;
916         case ruler_time_tempo:
917                 action = "toggle-tempo-ruler";
918                 break;
919         case ruler_time_meter:
920                 action = "toggle-meter-ruler";
921                 break;
922         case ruler_time_marker:
923                 action = "toggle-marker-ruler";
924                 break;
925         case ruler_time_range_marker:
926                 action = "toggle-range-ruler";
927                 break;
928         case ruler_time_transport_marker:
929                 action = "toggle-loop-punch-ruler";
930                 break;
931         case ruler_time_cd_marker:
932                 action = "toggle-cd-marker-ruler";
933                 break;
934         }
935
936         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), action);
937         if (act) {
938                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
939                 update_ruler_visibility ();
940                 store_ruler_visibility ();
941         }
942 }
943
944 void
945 Editor::toggle_waveforms_while_recording ()
946 {
947         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformsWhileRecording"));
948         if (act) {
949                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
950                 set_show_waveforms_recording (tact->get_active());
951         }
952 }
953
954 void
955 Editor::set_summary ()
956 {
957         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
958         if (act) {
959                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
960                 session->config.set_show_summary (tact->get_active ());
961         }
962 }
963
964 void
965 Editor::set_group_tabs ()
966 {
967         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
968         if (act) {
969                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
970                 session->config.set_show_group_tabs (tact->get_active ());
971         }
972 }
973
974 void
975 Editor::toggle_measure_visibility ()
976 {
977         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
978         if (act) {
979                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
980                 set_show_measures (tact->get_active());
981         }
982 }
983
984 void
985 Editor::toggle_logo_visibility ()
986 {
987         Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleLogoVisibility"));
988
989         if (act) {
990                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
991                 if (logo_item) {
992                         if (tact->get_active()) {
993                                 logo_item->show ();
994                         } else {
995                                 logo_item->hide ();
996                         }
997                 }
998         }
999 }
1000
1001 RefPtr<RadioAction>
1002 Editor::snap_type_action (SnapType type)
1003 {
1004
1005         const char* action = 0;
1006         RefPtr<Action> act;
1007
1008         switch (type) {
1009         case Editing::SnapToCDFrame:
1010                 action = "snap-to-cd-frame";
1011                 break;
1012         case Editing::SnapToTimecodeFrame:
1013                 action = "snap-to-timecode-frame";
1014                 break;
1015         case Editing::SnapToTimecodeSeconds:
1016                 action = "snap-to-timecode-seconds";
1017                 break;
1018         case Editing::SnapToTimecodeMinutes:
1019                 action = "snap-to-timecode-minutes";
1020                 break;
1021         case Editing::SnapToSeconds:
1022                 action = "snap-to-seconds";
1023                 break;
1024         case Editing::SnapToMinutes:
1025                 action = "snap-to-minutes";
1026                 break;
1027         case Editing::SnapToAThirtysecondBeat:
1028                 action = "snap-to-thirtyseconds";
1029                 break;
1030         case Editing::SnapToASixteenthBeat:
1031                 action = "snap-to-asixteenthbeat";
1032                 break;
1033         case Editing::SnapToAEighthBeat:
1034                 action = "snap-to-eighths";
1035                 break;
1036         case Editing::SnapToAQuarterBeat:
1037                 action = "snap-to-quarters";
1038                 break;
1039         case Editing::SnapToAThirdBeat:
1040                 action = "snap-to-thirds";
1041                 break;
1042         case Editing::SnapToBeat:
1043                 action = "snap-to-beat";
1044                 break;
1045         case Editing::SnapToBar:
1046                 action = "snap-to-bar";
1047                 break;
1048         case Editing::SnapToMark:
1049                 action = "snap-to-mark";
1050                 break;
1051         case Editing::SnapToRegionStart:
1052                 action = "snap-to-region-start";
1053                 break;
1054         case Editing::SnapToRegionEnd:
1055                 action = "snap-to-region-end";
1056                 break;
1057         case Editing::SnapToRegionSync:
1058                 action = "snap-to-region-sync";
1059                 break;
1060         case Editing::SnapToRegionBoundary:
1061                 action = "snap-to-region-boundary";
1062                 break;
1063         default:
1064                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
1065                 /*NOTREACHED*/
1066         }
1067
1068         act = ActionManager::get_action (X_("Snap"), action);
1069
1070         if (act) {
1071                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1072                 return ract;
1073
1074         } else  {
1075                 error << string_compose (_("programming error: %1"), "Editor::snap_type_chosen could not find action to match type.") << endmsg;
1076                 return RefPtr<RadioAction>();
1077         }
1078 }
1079
1080 void
1081 Editor::cycle_snap_choice()
1082 {
1083         switch (_snap_type) {
1084         case Editing::SnapToCDFrame:
1085                 set_snap_to (Editing::SnapToTimecodeFrame);
1086                 break;
1087         case Editing::SnapToTimecodeFrame:
1088                 set_snap_to (Editing::SnapToTimecodeSeconds);
1089                 break;
1090         case Editing::SnapToTimecodeSeconds:
1091                 set_snap_to (Editing::SnapToTimecodeMinutes);
1092                 break;
1093         case Editing::SnapToTimecodeMinutes:
1094                 set_snap_to (Editing::SnapToSeconds);
1095                 break;
1096         case Editing::SnapToSeconds:
1097                 set_snap_to (Editing::SnapToMinutes);
1098                 break;
1099         case Editing::SnapToMinutes:
1100                 set_snap_to (Editing::SnapToAThirtysecondBeat);
1101                 break;
1102         case Editing::SnapToAThirtysecondBeat:
1103                 set_snap_to (Editing::SnapToASixteenthBeat);
1104                 break;
1105         case Editing::SnapToASixteenthBeat:
1106                 set_snap_to (Editing::SnapToAEighthBeat);
1107                 break;
1108         case Editing::SnapToAEighthBeat:
1109                 set_snap_to (Editing::SnapToAQuarterBeat);
1110                 break;
1111         case Editing::SnapToAQuarterBeat:
1112                 set_snap_to (Editing::SnapToAThirdBeat);
1113                 break;
1114         case Editing::SnapToAThirdBeat:
1115                 set_snap_to (Editing::SnapToBeat);
1116                 break;
1117         case Editing::SnapToBeat:
1118                 set_snap_to (Editing::SnapToBar);
1119                 break;
1120         case Editing::SnapToBar:
1121                 set_snap_to (Editing::SnapToMark);
1122                 break;
1123         case Editing::SnapToMark:
1124                 set_snap_to (Editing::SnapToRegionStart);
1125                 break;
1126         case Editing::SnapToRegionStart:
1127                 set_snap_to (Editing::SnapToRegionEnd);
1128                 break;
1129         case Editing::SnapToRegionEnd:
1130                 set_snap_to (Editing::SnapToRegionSync);
1131                 break;
1132         case Editing::SnapToRegionSync:
1133                 set_snap_to (Editing::SnapToRegionBoundary);
1134                 break;
1135         case Editing::SnapToRegionBoundary:
1136                 set_snap_to (Editing::SnapToCDFrame);
1137                 break;
1138         }
1139 }
1140
1141 void
1142 Editor::snap_type_chosen (SnapType type)
1143 {
1144         /* this is driven by a toggle on a radio group, and so is invoked twice,
1145            once for the item that became inactive and once for the one that became
1146            active.
1147         */
1148
1149         RefPtr<RadioAction> ract = snap_type_action (type);
1150
1151         if (ract && ract->get_active()) {
1152                 set_snap_to (type);
1153         }
1154 }
1155
1156 RefPtr<RadioAction>
1157 Editor::snap_mode_action (SnapMode mode)
1158 {
1159         const char* action = 0;
1160         RefPtr<Action> act;
1161
1162         switch (mode) {
1163         case Editing::SnapOff:
1164                 action = X_("snap-off");
1165                 break;
1166         case Editing::SnapNormal:
1167                 action = X_("snap-normal");
1168                 break;
1169         case Editing::SnapMagnetic:
1170                 action = X_("snap-magnetic");
1171                 break;
1172         default:
1173                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
1174                 /*NOTREACHED*/
1175         }
1176
1177         act = ActionManager::get_action (X_("Editor"), action);
1178
1179         if (act) {
1180                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1181                 return ract;
1182
1183         } else  {
1184                 error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
1185                 return RefPtr<RadioAction> ();
1186         }
1187 }
1188
1189 void
1190 Editor::cycle_snap_mode ()
1191 {
1192         switch (_snap_mode) {
1193         case SnapOff:
1194                 set_snap_mode (SnapNormal);
1195                 break;
1196         case SnapNormal:
1197                 set_snap_mode (SnapMagnetic);
1198                 break;
1199         case SnapMagnetic:
1200                 set_snap_mode (SnapOff);
1201                 break;
1202         }
1203 }
1204
1205 void
1206 Editor::snap_mode_chosen (SnapMode mode)
1207 {
1208         /* this is driven by a toggle on a radio group, and so is invoked twice,
1209            once for the item that became inactive and once for the one that became
1210            active.
1211         */
1212
1213         RefPtr<RadioAction> ract = snap_mode_action (mode);
1214
1215         if (ract && ract->get_active()) {
1216                 set_snap_mode (mode);
1217         }
1218 }
1219
1220 RefPtr<RadioAction>
1221 Editor::edit_point_action (EditPoint ep)
1222 {
1223         const char* action = 0;
1224         RefPtr<Action> act;
1225
1226         switch (ep) {
1227         case Editing::EditAtPlayhead:
1228                 action = X_("edit-at-playhead");
1229                 break;
1230         case Editing::EditAtSelectedMarker:
1231                 action = X_("edit-at-selected-marker");
1232                 break;
1233         case Editing::EditAtMouse:
1234                 action = X_("edit-at-mouse");
1235                 break;
1236         default:
1237                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
1238                 /*NOTREACHED*/
1239         }
1240
1241         act = ActionManager::get_action (X_("Editor"), action);
1242
1243         if (act) {
1244                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1245                 return ract;
1246
1247         } else  {
1248                 error << string_compose (_("programming error: %1: %2"), "Editor::edit_point_action could not find action to match edit point.", action) << endmsg;
1249                 return RefPtr<RadioAction> ();
1250         }
1251 }
1252
1253 void
1254 Editor::edit_point_chosen (EditPoint ep)
1255 {
1256         /* this is driven by a toggle on a radio group, and so is invoked twice,
1257            once for the item that became inactive and once for the one that became
1258            active.
1259         */
1260
1261         RefPtr<RadioAction> ract = edit_point_action (ep);
1262
1263         if (ract && ract->get_active()) {
1264                 set_edit_point_preference (ep);
1265         }
1266 }
1267
1268
1269 RefPtr<RadioAction>
1270 Editor::zoom_focus_action (ZoomFocus focus)
1271 {
1272         const char* action = 0;
1273         RefPtr<Action> act;
1274
1275         switch (focus) {
1276         case ZoomFocusLeft:
1277                 action = X_("zoom-focus-left");
1278                 break;
1279         case ZoomFocusRight:
1280                 action = X_("zoom-focus-right");
1281                 break;
1282         case ZoomFocusCenter:
1283                 action = X_("zoom-focus-center");
1284                 break;
1285         case ZoomFocusPlayhead:
1286                 action = X_("zoom-focus-playhead");
1287                 break;
1288         case ZoomFocusMouse:
1289                 action = X_("zoom-focus-mouse");
1290                 break;
1291         case ZoomFocusEdit:
1292                 action = X_("zoom-focus-edit");
1293                 break;
1294         default:
1295                 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
1296                 /*NOTREACHED*/
1297         }
1298
1299         act = ActionManager::get_action (X_("Zoom"), action);
1300
1301         if (act) {
1302                 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1303                 return ract;
1304         } else {
1305                 error << string_compose (_("programming error: %1: %2"), "Editor::zoom_focus_action could not find action to match focus.", action) << endmsg;
1306         }
1307
1308         return RefPtr<RadioAction> ();
1309 }
1310
1311 void
1312 Editor::zoom_focus_chosen (ZoomFocus focus)
1313 {
1314         /* this is driven by a toggle on a radio group, and so is invoked twice,
1315            once for the item that became inactive and once for the one that became
1316            active.
1317         */
1318
1319         RefPtr<RadioAction> ract = zoom_focus_action (focus);
1320
1321         if (ract && ract->get_active()) {
1322                 set_zoom_focus (focus);
1323         }
1324 }
1325
1326 /** A Configuration parameter has changed.
1327  * @param parameter_name Name of the changed parameter.
1328  */
1329 void
1330 Editor::parameter_changed (std::string p)
1331 {
1332         ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::parameter_changed), p));
1333
1334         if (p == "auto-loop") {
1335                 update_loop_range_view (true);
1336         } else if (p == "punch-in") {
1337                 update_punch_range_view (true);
1338         } else if (p == "punch-out") {
1339                 update_punch_range_view (true);
1340         } else if (p == "timecode-format") {
1341                 update_just_timecode ();
1342         } else if (p == "xfades-visible") {
1343                 update_xfade_visibility ();
1344         } else if (p == "show-region-fades") {
1345                 update_region_fade_visibility ();
1346         } else if (p == "edit-mode") {
1347                 edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
1348         } else if (p == "subframes-per-frame") {
1349                 update_just_timecode ();
1350         } else if (p == "show-track-meters") {
1351                 toggle_meter_updating();
1352         } else if (p == "show-summary") {
1353
1354                 bool const s = session->config.get_show_summary ();
1355                 if (s) {
1356                         _summary->show ();
1357                 } else {
1358                         _summary->hide ();
1359                 }
1360
1361                 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleSummary"));
1362                 if (act) {
1363                         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
1364                         if (tact->get_active () != s) {
1365                                 tact->set_active (s);
1366                         }
1367                 }
1368         } else if (p == "show-group-tabs") {
1369
1370                 bool const s = session->config.get_show_group_tabs ();
1371                 if (s) {
1372                         _group_tabs->show ();
1373                 } else {
1374                         _group_tabs->hide ();
1375                 }
1376
1377                 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
1378                 if (act) {
1379                         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
1380                         if (tact->get_active () != s) {
1381                                 tact->set_active (s);
1382                         }
1383                 }
1384         }
1385 }
1386
1387 void
1388 Editor::reset_focus ()
1389 {
1390         track_canvas->grab_focus();
1391 }
1392
1393 void
1394 Editor::reset_canvas_action_sensitivity (bool onoff)
1395 {
1396         if (_edit_point != EditAtMouse) {
1397                 onoff = true;
1398         }
1399
1400         for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
1401              x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
1402                 (*x)->set_sensitive (onoff);
1403         }
1404 }
1405
1406 void
1407 Editor::toggle_internal_editing ()
1408 {
1409         Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
1410         if (act) {
1411                 Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
1412                 set_internal_edit (tact->get_active());
1413         }
1414 }