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