add GUI/action control over replicate-missing-region-channels
[ardour2.git] / gtk2_ardour / editor_actions.cc
blob89136db682d081e31469a7edcfca0741e3a88063
1 /*
2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <ardour/ardour.h>
21 #include <ardour/profile.h>
23 #include "utils.h"
24 #include "editor.h"
25 #include "editing.h"
26 #include "actions.h"
27 #include "ardour_ui.h"
28 #include "gui_thread.h"
29 #include "i18n.h"
31 using namespace Gtk;
32 using namespace Glib;
33 using namespace std;
34 using namespace sigc;
35 using namespace ARDOUR;
36 using namespace PBD;
37 using namespace Editing;
39 void
40 Editor::register_actions ()
42 RefPtr<Action> act;
44 editor_actions = ActionGroup::create (X_("Editor"));
46 /* non-operative menu items for menu bar */
48 ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align"));
49 ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect"));
50 ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades"));
51 ActionManager::register_action (editor_actions, X_("Edit"), _("Edit"));
52 ActionManager::register_action (editor_actions, X_("EditCursorMovementOptions"), _("Move Selected Marker"));
53 ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations"));
54 ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions"));
55 ActionManager::register_action (editor_actions, X_("EditPointMenu"), _("Edit Point"));
56 ActionManager::register_action (editor_actions, X_("FadeMenu"), _("Fade"));
57 ActionManager::register_action (editor_actions, X_("LatchMenu"), _("Latch"));
58 ActionManager::register_action (editor_actions, X_("Layering"), _("Layering"));
59 ActionManager::register_action (editor_actions, X_("Link"), _("Link"));
60 ActionManager::register_action (editor_actions, X_("ZoomFocusMenu"), _("Zoom Focus"));
61 ActionManager::register_action (editor_actions, X_("KeyMouseActions"), _("Key Mouse"));
62 ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate To Markers"));
63 ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers"));
64 ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff"));
65 ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold"));
66 ActionManager::register_action (editor_actions, X_("Performance"), _("Performance"));
67 ActionManager::register_action (editor_actions, X_("MiscOptions"), _("Misc Options"));
68 ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring"));
69 ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark"));
70 ActionManager::register_action (editor_actions, X_("MovePlayHeadMenu"), _("Playhead"));
71 ActionManager::register_action (editor_actions, X_("NudgeRegionMenu"), _("Nudge"));
72 ActionManager::register_action (editor_actions, X_("PlayMenu"), _("Play"));
73 ActionManager::register_action (editor_actions, X_("PrimaryClockMenu"), _("Primary Clock"));
74 ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown"));
75 ActionManager::register_action (editor_actions, X_("RegionMenu"), _("Region"));
76 ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations"));
77 ActionManager::register_action (editor_actions, X_("RegionGainMenu"), _("Gain"));
78 ActionManager::register_action (editor_actions, X_("RulerMenu"), _("Rulers"));
79 ActionManager::register_action (editor_actions, X_("SavedViewMenu"), _("Views"));
80 ActionManager::register_action (editor_actions, X_("ScrollMenu"), _("Scroll"));
81 ActionManager::register_action (editor_actions, X_("SecondaryClockMenu"), _("Secondary Clock"));
82 ActionManager::register_action (editor_actions, X_("Select"), _("Select"));
83 ActionManager::register_action (editor_actions, X_("SelectMenu"), _("Select"));
84 ActionManager::register_action (editor_actions, X_("SeparateMenu"), _("Separate"));
85 ActionManager::register_action (editor_actions, X_("SetLoopMenu"), _("Loop"));
86 ActionManager::register_action (editor_actions, X_("SetPunchMenu"), _("Punch"));
87 ActionManager::register_action (editor_actions, X_("Solo"), _("Solo"));
88 ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes"));
89 ActionManager::register_action (editor_actions, X_("SyncMenu"), _("Sync"));
90 ActionManager::register_action (editor_actions, X_("TempoMenu"), _("Tempo"));
91 ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps"));
92 ActionManager::register_action (editor_actions, X_("TrackHeightMenu"), _("Height"));
93 ActionManager::register_action (editor_actions, X_("TrackMenu"), _("Track"));
94 ActionManager::register_action (editor_actions, X_("Tools"), _("Tools"));
95 ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim"));
96 ActionManager::register_action (editor_actions, X_("View"), _("View"));
97 ActionManager::register_action (editor_actions, X_("WaveformMenu"), _("Waveforms"));
98 ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom Focus"));
99 ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom"));
101 ActionManager::register_toggle_action (editor_actions, "link-region-and-track-selection", _("Link Region/Track Selection"), mem_fun (*this, &Editor::toggle_link_region_and_track_selection));
102 ActionManager::register_action (editor_actions, "break-drag", _("Break drag"), mem_fun (*this, &Editor::break_drag));
104 act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
105 ActionManager::session_sensitive_actions.push_back (act);
107 RadioAction::Group crossfade_model_group;
109 act = ActionManager::register_radio_action (editor_actions, crossfade_model_group, "CrossfadesFull", _("Span Entire Overlap"), bind (mem_fun(*this, &Editor::set_crossfade_model), FullCrossfade));
110 ActionManager::session_sensitive_actions.push_back (act);
111 act = ActionManager::register_radio_action (editor_actions, crossfade_model_group, "CrossfadesShort", _("Short"), bind (mem_fun(*this, &Editor::set_crossfade_model), ShortCrossfade));
112 ActionManager::session_sensitive_actions.push_back (act);
114 act = ActionManager::register_toggle_action (editor_actions, "toggle-xfades-active", _("Active"), mem_fun(*this, &Editor::toggle_xfades_active));
115 ActionManager::session_sensitive_actions.push_back (act);
116 act = ActionManager::register_toggle_action (editor_actions, "toggle-xfades-visible", _("Show"), mem_fun(*this, &Editor::toggle_xfade_visibility));
117 ActionManager::session_sensitive_actions.push_back (act);
118 act = ActionManager::register_toggle_action (editor_actions, "toggle-auto-xfades", _("Created Automatically"), mem_fun(*this, &Editor::toggle_auto_xfade));
119 ActionManager::session_sensitive_actions.push_back (act);
121 act = ActionManager::register_toggle_action (editor_actions, "toggle-replicate-missing-region-channels", _("Replicate Missing Channels"), mem_fun(*this, &Editor::toggle_replicate_missing_region_channels));
122 ActionManager::session_sensitive_actions.push_back (act);
123 act = ActionManager::register_toggle_action (editor_actions, "toggle-region-fades", _("Use Region Fades"), mem_fun(*this, &Editor::toggle_region_fades));
124 ActionManager::session_sensitive_actions.push_back (act);
125 act = ActionManager::register_toggle_action (editor_actions, "toggle-region-fades-visible", _("Show Region Fades"), mem_fun(*this, &Editor::toggle_region_fades_visible));
126 ActionManager::session_sensitive_actions.push_back (act);
127 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));;
128 ActionManager::session_sensitive_actions.push_back (act);
129 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));;
130 ActionManager::session_sensitive_actions.push_back (act);
131 act = ActionManager::register_action (editor_actions, "toggle-selected-region-fades", _("Toggle Region Fades"), bind (mem_fun(*this, &Editor::toggle_selected_region_fades), 0));
132 ActionManager::session_sensitive_actions.push_back (act);
134 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 ));
135 ActionManager::session_sensitive_actions.push_back (act);
136 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 ));
137 ActionManager::session_sensitive_actions.push_back (act);
138 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));
139 ActionManager::session_sensitive_actions.push_back (act);
140 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));
141 ActionManager::session_sensitive_actions.push_back (act);
143 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)));
144 ActionManager::session_sensitive_actions.push_back (act);
145 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)));
146 ActionManager::session_sensitive_actions.push_back (act);
147 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)));
148 ActionManager::session_sensitive_actions.push_back (act);
150 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)));
151 ActionManager::session_sensitive_actions.push_back (act);
152 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)));
153 ActionManager::session_sensitive_actions.push_back (act);
154 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)));
155 ActionManager::session_sensitive_actions.push_back (act);
157 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));
158 ActionManager::session_sensitive_actions.push_back (act);
159 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));
160 ActionManager::session_sensitive_actions.push_back (act);
161 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));
162 ActionManager::session_sensitive_actions.push_back (act);
163 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));
164 ActionManager::session_sensitive_actions.push_back (act);
166 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)));
167 ActionManager::session_sensitive_actions.push_back (act);
168 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)));
169 ActionManager::session_sensitive_actions.push_back (act);
170 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)));
171 ActionManager::session_sensitive_actions.push_back (act);
173 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)));
174 ActionManager::session_sensitive_actions.push_back (act);
175 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)));
176 ActionManager::session_sensitive_actions.push_back (act);
177 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)));
178 ActionManager::session_sensitive_actions.push_back (act);
180 act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("to Range Start"), mem_fun(*this, &Editor::selected_marker_to_selection_start));
181 ActionManager::session_sensitive_actions.push_back (act);
182 act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("to Range End"), mem_fun(*this, &Editor::selected_marker_to_selection_end));
183 ActionManager::session_sensitive_actions.push_back (act);
185 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));
186 ActionManager::session_sensitive_actions.push_back (act);
187 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));
188 ActionManager::session_sensitive_actions.push_back (act);
190 act = ActionManager::register_action (editor_actions, "select-all", _("Select All"), bind (mem_fun(*this, &Editor::select_all), Selection::Set));
191 ActionManager::session_sensitive_actions.push_back (act);
192 act = ActionManager::register_action (editor_actions, "deselect-all", _("Deselect All"), mem_fun(*this, &Editor::deselect_all));
193 ActionManager::session_sensitive_actions.push_back (act);
194 act = ActionManager::register_action (editor_actions, "invert-selection", _("Invert Selection"), mem_fun(*this, &Editor::invert_selection));
195 ActionManager::session_sensitive_actions.push_back (act);
196 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));
197 ActionManager::session_sensitive_actions.push_back (act);
198 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));
199 ActionManager::session_sensitive_actions.push_back (act);
201 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));
202 ActionManager::session_sensitive_actions.push_back (act);
203 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));
204 ActionManager::session_sensitive_actions.push_back (act);
206 act = ActionManager::register_action (editor_actions, "select-range-between-cursors", _("Select Edit Range"), mem_fun(*this, &Editor::select_range_between));
207 ActionManager::session_sensitive_actions.push_back (act);
209 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));
210 ActionManager::session_sensitive_actions.push_back (act);
211 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));
212 ActionManager::session_sensitive_actions.push_back (act);
214 act = ActionManager::register_action (editor_actions, "select-next-route", _("Select Next Track/Bus"), mem_fun(*this, &Editor::select_next_route));
215 ActionManager::session_sensitive_actions.push_back (act);
216 act = ActionManager::register_action (editor_actions, "select-prev-route", _("Select Previous Track/Bus"), mem_fun(*this, &Editor::select_prev_route));
217 ActionManager::session_sensitive_actions.push_back (act);
219 act = ActionManager::register_action (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), mem_fun(*this, &Editor::toggle_record_enable));
220 ActionManager::session_sensitive_actions.push_back (act);
221 ActionManager::track_selection_sensitive_actions.push_back (act);
224 act = ActionManager::register_action (editor_actions, "save-visual-state-1", _("Save View 1"), bind (mem_fun (*this, &Editor::start_visual_state_op), 0));
225 ActionManager::session_sensitive_actions.push_back (act);
226 act = ActionManager::register_action (editor_actions, "goto-visual-state-1", _("Goto View 1"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 0));
227 ActionManager::session_sensitive_actions.push_back (act);
228 act = ActionManager::register_action (editor_actions, "save-visual-state-2", _("Save View 2"), bind (mem_fun (*this, &Editor::start_visual_state_op), 1));
229 ActionManager::session_sensitive_actions.push_back (act);
230 act = ActionManager::register_action (editor_actions, "goto-visual-state-2", _("Goto View 2"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 1));
231 ActionManager::session_sensitive_actions.push_back (act);
232 act = ActionManager::register_action (editor_actions, "save-visual-state-3", _("Save View 3"), bind (mem_fun (*this, &Editor::start_visual_state_op), 2));
233 ActionManager::session_sensitive_actions.push_back (act);
234 act = ActionManager::register_action (editor_actions, "goto-visual-state-3", _("Goto View 3"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 2));
235 ActionManager::session_sensitive_actions.push_back (act);
236 act = ActionManager::register_action (editor_actions, "save-visual-state-4", _("Save View 4"), bind (mem_fun (*this, &Editor::start_visual_state_op), 3));
237 ActionManager::session_sensitive_actions.push_back (act);
238 act = ActionManager::register_action (editor_actions, "goto-visual-state-4", _("Goto View 4"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 3));
239 ActionManager::session_sensitive_actions.push_back (act);
240 act = ActionManager::register_action (editor_actions, "save-visual-state-5", _("Save View 5"), bind (mem_fun (*this, &Editor::start_visual_state_op), 4));
241 ActionManager::session_sensitive_actions.push_back (act);
242 act = ActionManager::register_action (editor_actions, "goto-visual-state-5", _("Goto View 5"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 4));
243 ActionManager::session_sensitive_actions.push_back (act);
244 act = ActionManager::register_action (editor_actions, "save-visual-state-6", _("Save View 6"), bind (mem_fun (*this, &Editor::start_visual_state_op), 5));
245 ActionManager::session_sensitive_actions.push_back (act);
246 act = ActionManager::register_action (editor_actions, "goto-visual-state-6", _("Goto View 6"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 5));
247 ActionManager::session_sensitive_actions.push_back (act);
248 act = ActionManager::register_action (editor_actions, "save-visual-state-7", _("Save View 7"), bind (mem_fun (*this, &Editor::start_visual_state_op), 6));
249 ActionManager::session_sensitive_actions.push_back (act);
250 act = ActionManager::register_action (editor_actions, "goto-visual-state-7", _("Goto View 7"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 6));
251 ActionManager::session_sensitive_actions.push_back (act);
252 act = ActionManager::register_action (editor_actions, "save-visual-state-8", _("Save View 8"), bind (mem_fun (*this, &Editor::start_visual_state_op), 7));
253 ActionManager::session_sensitive_actions.push_back (act);
254 act = ActionManager::register_action (editor_actions, "goto-visual-state-8", _("Goto View 8"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 7));
255 ActionManager::session_sensitive_actions.push_back (act);
256 act = ActionManager::register_action (editor_actions, "save-visual-state-9", _("Save View 9"), bind (mem_fun (*this, &Editor::start_visual_state_op), 8));
257 ActionManager::session_sensitive_actions.push_back (act);
258 act = ActionManager::register_action (editor_actions, "goto-visual-state-9", _("Goto View 9"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 8));
259 ActionManager::session_sensitive_actions.push_back (act);
260 act = ActionManager::register_action (editor_actions, "save-visual-state-10", _("Save View 10"), bind (mem_fun (*this, &Editor::start_visual_state_op), 9));
261 ActionManager::session_sensitive_actions.push_back (act);
262 act = ActionManager::register_action (editor_actions, "goto-visual-state-10", _("Goto View 10"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 9));
263 ActionManager::session_sensitive_actions.push_back (act);
264 act = ActionManager::register_action (editor_actions, "save-visual-state-11", _("Save View 11"), bind (mem_fun (*this, &Editor::start_visual_state_op), 10));
265 ActionManager::session_sensitive_actions.push_back (act);
266 act = ActionManager::register_action (editor_actions, "goto-visual-state-11", _("Goto View 11"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 10));
267 ActionManager::session_sensitive_actions.push_back (act);
268 act = ActionManager::register_action (editor_actions, "save-visual-state-12", _("Save View 12"), bind (mem_fun (*this, &Editor::start_visual_state_op), 11));
269 ActionManager::session_sensitive_actions.push_back (act);
270 act = ActionManager::register_action (editor_actions, "goto-visual-state-12", _("Goto View 12"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 11));
271 ActionManager::session_sensitive_actions.push_back (act);
274 act = ActionManager::register_action (editor_actions, "goto-mark-1", _("Locate to Mark 1"), bind (mem_fun (*this, &Editor::goto_nth_marker), 0));
275 ActionManager::session_sensitive_actions.push_back (act);
276 act = ActionManager::register_action (editor_actions, "goto-mark-2", _("Locate to Mark 2"), bind (mem_fun (*this, &Editor::goto_nth_marker), 1));
277 ActionManager::session_sensitive_actions.push_back (act);
278 act = ActionManager::register_action (editor_actions, "goto-mark-3", _("Locate to Mark 3"), bind (mem_fun (*this, &Editor::goto_nth_marker), 2));
279 ActionManager::session_sensitive_actions.push_back (act);
280 act = ActionManager::register_action (editor_actions, "goto-mark-4", _("Locate to Mark 4"), bind (mem_fun (*this, &Editor::goto_nth_marker), 3));
281 ActionManager::session_sensitive_actions.push_back (act);
282 act = ActionManager::register_action (editor_actions, "goto-mark-5", _("Locate to Mark 5"), bind (mem_fun (*this, &Editor::goto_nth_marker), 4));
283 ActionManager::session_sensitive_actions.push_back (act);
284 act = ActionManager::register_action (editor_actions, "goto-mark-6", _("Locate to Mark 6"), bind (mem_fun (*this, &Editor::goto_nth_marker), 5));
285 ActionManager::session_sensitive_actions.push_back (act);
286 act = ActionManager::register_action (editor_actions, "goto-mark-7", _("Locate to Mark 7"), bind (mem_fun (*this, &Editor::goto_nth_marker), 6));
287 ActionManager::session_sensitive_actions.push_back (act);
288 act = ActionManager::register_action (editor_actions, "goto-mark-8", _("Locate to Mark 8"), bind (mem_fun (*this, &Editor::goto_nth_marker), 7));
289 ActionManager::session_sensitive_actions.push_back (act);
290 act = ActionManager::register_action (editor_actions, "goto-mark-9", _("Locate to Mark 9"), bind (mem_fun (*this, &Editor::goto_nth_marker), 8));
291 ActionManager::session_sensitive_actions.push_back (act);
293 act = ActionManager::register_action (editor_actions, "jump-forward-to-mark", _("Jump Forward to Mark"), mem_fun(*this, &Editor::jump_forward_to_mark));
294 ActionManager::session_sensitive_actions.push_back (act);
295 act = ActionManager::register_action (editor_actions, "jump-backward-to-mark", _("Jump Backward to Mark"), mem_fun(*this, &Editor::jump_backward_to_mark));
296 ActionManager::session_sensitive_actions.push_back (act);
297 act = ActionManager::register_action (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), mem_fun(*this, &Editor::add_location_from_playhead_cursor));
298 ActionManager::session_sensitive_actions.push_back (act);
300 act = ActionManager::register_action (editor_actions, "nudge-forward", _("Nudge Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, false));
301 ActionManager::session_sensitive_actions.push_back (act);
302 act = ActionManager::register_action (editor_actions, "nudge-next-forward", _("Nudge Next Forward"), bind (mem_fun(*this, &Editor::nudge_forward), true, false));
303 ActionManager::session_sensitive_actions.push_back (act);
304 act = ActionManager::register_action (editor_actions, "nudge-backward", _("Nudge Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, false));
305 ActionManager::session_sensitive_actions.push_back (act);
306 act = ActionManager::register_action (editor_actions, "nudge-next-backward", _("Nudge Next Backward"), bind (mem_fun(*this, &Editor::nudge_backward), true, false));
307 ActionManager::session_sensitive_actions.push_back (act);
309 act = ActionManager::register_action (editor_actions, "nudge-playhead-forward", _("Nudge Playhead Forward"), bind (mem_fun(*this, &Editor::nudge_forward), false, true));
310 ActionManager::session_sensitive_actions.push_back (act);
311 act = ActionManager::register_action (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, true));
312 ActionManager::session_sensitive_actions.push_back (act);
313 act = ActionManager::register_action (editor_actions, "playhead-forward-to-grid", _("Forward To Grid"), mem_fun(*this, &Editor::playhead_forward_to_grid));
314 ActionManager::session_sensitive_actions.push_back (act);
315 act = ActionManager::register_action (editor_actions, "playhead-backward-to-grid", _("Backward To Grid"), mem_fun(*this, &Editor::playhead_backward_to_grid));
316 ActionManager::session_sensitive_actions.push_back (act);
319 act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
320 ActionManager::session_sensitive_actions.push_back (act);
321 act = ActionManager::register_action (editor_actions, "temporal-zoom-in", _("Zoom In"), bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
322 ActionManager::session_sensitive_actions.push_back (act);
323 act = ActionManager::register_action (editor_actions, "zoom-to-session", _("Zoom to Session"), mem_fun(*this, &Editor::temporal_zoom_session));
324 ActionManager::session_sensitive_actions.push_back (act);
325 act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), bind (mem_fun(*this, &Editor::toggle_zoom_region), false));
326 ActionManager::session_sensitive_actions.push_back (act);
327 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));
328 ActionManager::session_sensitive_actions.push_back (act);
329 act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
330 ActionManager::session_sensitive_actions.push_back (act);
332 act = ActionManager::register_action (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), bind (mem_fun(*this, &Editor::move_selected_tracks), true));
333 ActionManager::session_sensitive_actions.push_back (act);
334 ActionManager::track_selection_sensitive_actions.push_back (act);
335 act = ActionManager::register_action (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), bind (mem_fun(*this, &Editor::move_selected_tracks), false));
336 ActionManager::session_sensitive_actions.push_back (act);
337 ActionManager::track_selection_sensitive_actions.push_back (act);
339 act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up));
340 ActionManager::session_sensitive_actions.push_back (act);
341 act = ActionManager::register_action (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), mem_fun(*this, &Editor::scroll_tracks_down));
342 ActionManager::session_sensitive_actions.push_back (act);
343 act = ActionManager::register_action (editor_actions, "step-tracks-up", _("Step Tracks Up"), mem_fun(*this, &Editor::scroll_tracks_up_line));
344 ActionManager::session_sensitive_actions.push_back (act);
345 act = ActionManager::register_action (editor_actions, "step-tracks-down", _("Step Tracks Down"), mem_fun(*this, &Editor::scroll_tracks_down_line));
346 ActionManager::session_sensitive_actions.push_back (act);
348 act = ActionManager::register_action (editor_actions, "scroll-backward", _("Scroll Backward"), bind (mem_fun(*this, &Editor::scroll_backward), 0.8f));
349 ActionManager::session_sensitive_actions.push_back (act);
350 act = ActionManager::register_action (editor_actions, "scroll-forward", _("Scroll Forward"), bind (mem_fun(*this, &Editor::scroll_forward), 0.8f));
351 ActionManager::session_sensitive_actions.push_back (act);
352 act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame));
353 ActionManager::session_sensitive_actions.push_back (act);
354 act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead));
355 ActionManager::session_sensitive_actions.push_back (act);
356 act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Active Marker"), mem_fun(*this, &Editor::center_edit_point));
357 ActionManager::session_sensitive_actions.push_back (act);
359 act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead Forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));;
360 ActionManager::session_sensitive_actions.push_back (act);
361 act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false));
362 ActionManager::session_sensitive_actions.push_back (act);
364 act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead To Active Mark"), bind (mem_fun(*this, &Editor::cursor_align), true));
365 ActionManager::session_sensitive_actions.push_back (act);
366 act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Active Mark To Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
367 ActionManager::session_sensitive_actions.push_back (act);
369 act = ActionManager::register_action (editor_actions, "trim-front", _("Trim Start At Edit Point"), mem_fun(*this, &Editor::trim_region_front));
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-back", _("Trim End At Edit Point"), mem_fun(*this, &Editor::trim_region_back));
373 ActionManager::session_sensitive_actions.push_back (act);
374 ActionManager::region_selection_sensitive_actions.push_back (act);
376 act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start To Edit Point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
377 ActionManager::session_sensitive_actions.push_back (act);
378 ActionManager::region_selection_sensitive_actions.push_back (act);
379 act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit Point To End"), mem_fun(*this, &Editor::trim_region_to_edit_point));
380 ActionManager::session_sensitive_actions.push_back (act);
381 ActionManager::region_selection_sensitive_actions.push_back (act);
382 act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim To Loop"), mem_fun(*this, &Editor::trim_region_to_loop));
383 ActionManager::session_sensitive_actions.push_back (act);
384 ActionManager::region_selection_sensitive_actions.push_back (act);
385 act = ActionManager::register_action (editor_actions, "trim-region-to-punch", _("Trim To Punch"), mem_fun(*this, &Editor::trim_region_to_punch));
386 ActionManager::session_sensitive_actions.push_back (act);
387 ActionManager::region_selection_sensitive_actions.push_back (act);
389 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));
390 ActionManager::session_sensitive_actions.push_back (act);
391 act = ActionManager::register_action (editor_actions, "set-loop-from-region", _("Set Loop From Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), false));
392 ActionManager::session_sensitive_actions.push_back (act);
393 ActionManager::region_selection_sensitive_actions.push_back (act);
394 act = ActionManager::register_action (editor_actions, "loop-region", _("Loop Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), true));
395 ActionManager::session_sensitive_actions.push_back (act);
396 ActionManager::region_selection_sensitive_actions.push_back (act);
397 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));
398 ActionManager::session_sensitive_actions.push_back (act);
399 ActionManager::region_selection_sensitive_actions.push_back (act);
400 act = ActionManager::register_action (editor_actions, "set-punch-from-region", _("Set Punch From Region"), mem_fun(*this, &Editor::set_punch_from_region));
401 ActionManager::session_sensitive_actions.push_back (act);
402 ActionManager::region_selection_sensitive_actions.push_back (act);
403 act = ActionManager::register_action (editor_actions, "pitch-shift-region", _("Transpose"), mem_fun(*this, &Editor::pitch_shift_regions));
404 ActionManager::session_sensitive_actions.push_back (act);
405 ActionManager::region_selection_sensitive_actions.push_back (act);
406 act = ActionManager::register_action (editor_actions, "toggle-opaque-region", _("Toggle Opaque"), mem_fun(*this, &Editor::toggle_region_opaque));
407 ActionManager::session_sensitive_actions.push_back (act);
408 ActionManager::region_selection_sensitive_actions.push_back (act);
409 act = ActionManager::register_action (editor_actions, "add-range-marker-from-region", _("Add 1 Range Marker"), mem_fun(*this, &Editor::add_location_from_audio_region));
410 ActionManager::session_sensitive_actions.push_back (act);
411 ActionManager::region_selection_sensitive_actions.push_back (act);
412 act = ActionManager::register_action (editor_actions, "add-range-markers-from-region", _("Add Range Marker(s)"), mem_fun(*this, &Editor::add_locations_from_audio_region));
413 ActionManager::session_sensitive_actions.push_back (act);
414 ActionManager::region_selection_sensitive_actions.push_back (act);
416 act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true));
417 ActionManager::session_sensitive_actions.push_back (act);
418 act = ActionManager::register_action (editor_actions, "toggle-fade-in-active", _("Toggle Fade In Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), true));
419 ActionManager::session_sensitive_actions.push_back (act);
420 act = ActionManager::register_action (editor_actions, "set-fade-out-length", _("Set Fade Out Length"), bind (mem_fun(*this, &Editor::set_fade_length), false));
421 ActionManager::session_sensitive_actions.push_back (act);
422 act = ActionManager::register_action (editor_actions, "toggle-fade-out-active", _("Toggle Fade Out Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), false));
423 ActionManager::session_sensitive_actions.push_back (act);
425 act = ActionManager::register_action (editor_actions, "align-regions-start", _("Align Regions Start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start));
426 ActionManager::session_sensitive_actions.push_back (act);
427 ActionManager::region_selection_sensitive_actions.push_back (act);
428 act = ActionManager::register_action (editor_actions, "align-regions-start-relative", _("Align Regions Start Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::Start));
429 ActionManager::session_sensitive_actions.push_back (act);
430 ActionManager::region_selection_sensitive_actions.push_back (act);
431 act = ActionManager::register_action (editor_actions, "align-regions-end", _("Align Regions End"), bind (mem_fun(*this, &Editor::align), ARDOUR::End));
432 ActionManager::session_sensitive_actions.push_back (act);
433 ActionManager::region_selection_sensitive_actions.push_back (act);
434 act = ActionManager::register_action (editor_actions, "align-regions-end-relative", _("Align Regions End Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::End));
435 ActionManager::session_sensitive_actions.push_back (act);
436 ActionManager::region_selection_sensitive_actions.push_back (act);
438 act = ActionManager::register_action (editor_actions, "align-regions-sync", _("Align Regions Sync"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint));
439 ActionManager::session_sensitive_actions.push_back (act);
440 ActionManager::region_selection_sensitive_actions.push_back (act);
441 act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("Align Regions Sync Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint));
442 ActionManager::session_sensitive_actions.push_back (act);
443 ActionManager::region_selection_sensitive_actions.push_back (act);
445 act = ActionManager::register_action (editor_actions, "play-from-edit-point", _("Play From Edit Point"), mem_fun(*this, &Editor::play_from_edit_point));
446 ActionManager::session_sensitive_actions.push_back (act);
447 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));
448 ActionManager::session_sensitive_actions.push_back (act);
450 act = ActionManager::register_action (editor_actions, "play-edit-range", _("Play Edit Range"), mem_fun(*this, &Editor::play_edit_range));
451 act = ActionManager::register_action (editor_actions, "play-selected-regions", _("Play Selected Region(s)"), mem_fun(*this, &Editor::play_selected_region));
452 ActionManager::session_sensitive_actions.push_back (act);
453 ActionManager::region_selection_sensitive_actions.push_back (act);
454 act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush));
455 ActionManager::session_sensitive_actions.push_back (act);
457 act = ActionManager::register_action (editor_actions, "set-playhead", _("Playhead to Mouse"), mem_fun(*this, &Editor::set_playhead_cursor));
458 ActionManager::session_sensitive_actions.push_back (act);
459 act = ActionManager::register_action (editor_actions, "set-edit-point", _("Active Marker to Mouse"), mem_fun(*this, &Editor::set_edit_point));
460 ActionManager::session_sensitive_actions.push_back (act);
462 act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
463 ActionManager::session_sensitive_actions.push_back (act);
464 ActionManager::region_selection_sensitive_actions.push_back (act);
465 act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true));
466 ActionManager::session_sensitive_actions.push_back (act);
467 ActionManager::region_selection_sensitive_actions.push_back (act);
468 act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
469 ActionManager::session_sensitive_actions.push_back (act);
470 ActionManager::region_selection_sensitive_actions.push_back (act);
471 act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region from List"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection));
472 ActionManager::session_sensitive_actions.push_back (act);
473 ActionManager::region_selection_sensitive_actions.push_back (act);
474 act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region));
475 ActionManager::session_sensitive_actions.push_back (act);
476 ActionManager::region_selection_sensitive_actions.push_back (act);
477 act = ActionManager::register_action (editor_actions, "rename-region", _("Rename"), mem_fun(*this, &Editor::rename_region));
478 ActionManager::session_sensitive_actions.push_back (act);
479 ActionManager::region_selection_sensitive_actions.push_back (act);
480 act = ActionManager::register_action (editor_actions, "auto-rename-region", _("Auto-Rename"), mem_fun(*this, &Editor::rename_region));
481 ActionManager::session_sensitive_actions.push_back (act);
482 ActionManager::region_selection_sensitive_actions.push_back (act);
483 act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true));
484 ActionManager::session_sensitive_actions.push_back (act);
485 ActionManager::region_selection_sensitive_actions.push_back (act);
486 act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false));
487 ActionManager::session_sensitive_actions.push_back (act);
488 ActionManager::region_selection_sensitive_actions.push_back (act);
489 act = ActionManager::register_action (editor_actions, "split-region", _("Split Region"), mem_fun(*this, &Editor::split));
490 ActionManager::session_sensitive_actions.push_back (act);
491 ActionManager::region_selection_sensitive_actions.push_back (act);
492 act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::set_region_sync_from_edit_point));
493 ActionManager::session_sensitive_actions.push_back (act);
494 ActionManager::region_selection_sensitive_actions.push_back (act);
495 act = ActionManager::register_action (editor_actions, "remove-region-sync", _("Remove Region Sync"), mem_fun(*this, &Editor::remove_region_sync));
496 ActionManager::session_sensitive_actions.push_back (act);
497 ActionManager::region_selection_sensitive_actions.push_back (act);
498 act = ActionManager::register_action (editor_actions, "raise-region", _("Raise Region"), mem_fun(*this, &Editor::raise_region));
499 ActionManager::session_sensitive_actions.push_back (act);
500 ActionManager::region_selection_sensitive_actions.push_back (act);
501 act = ActionManager::register_action (editor_actions, "lower-region", _("Lower Region"), mem_fun(*this, &Editor::lower_region));
502 ActionManager::session_sensitive_actions.push_back (act);
503 ActionManager::region_selection_sensitive_actions.push_back (act);
504 act = ActionManager::register_action (editor_actions, "export-region", _("Export selected regions to audiofile..."), mem_fun(*this, &Editor::export_region));
505 ActionManager::session_sensitive_actions.push_back (act);
506 ActionManager::region_selection_sensitive_actions.push_back (act);
507 act = ActionManager::register_toggle_action (editor_actions, "lock-region", _("Lock Region"), mem_fun(*this, &Editor::toggle_region_lock));
508 ActionManager::session_sensitive_actions.push_back (act);
509 ActionManager::region_selection_sensitive_actions.push_back (act);
510 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));
511 ActionManager::session_sensitive_actions.push_back (act);
512 ActionManager::region_selection_sensitive_actions.push_back (act);
513 act = ActionManager::register_action (editor_actions, "naturalize-region", _("Move To Original Position"), mem_fun (*this, &Editor::naturalize));
514 ActionManager::session_sensitive_actions.push_back (act);
515 ActionManager::region_selection_sensitive_actions.push_back (act);
516 act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse"), mem_fun (*this, &Editor::reverse_region));
517 ActionManager::session_sensitive_actions.push_back (act);
518 ActionManager::region_selection_sensitive_actions.push_back (act);
519 act = ActionManager::register_action (editor_actions, "monoize-region", _("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region)));
520 ActionManager::session_sensitive_actions.push_back (act);
521 ActionManager::region_selection_sensitive_actions.push_back (act);
522 act = ActionManager::register_action (editor_actions, "region-fill-track", _("Fill Track"), (mem_fun(*this, &Editor::region_fill_track)));
523 ActionManager::session_sensitive_actions.push_back (act);
524 ActionManager::region_selection_sensitive_actions.push_back (act);
525 act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region));
526 ActionManager::session_sensitive_actions.push_back (act);
527 ActionManager::region_selection_sensitive_actions.push_back (act);
529 undo_action = act = ActionManager::register_action (editor_actions, "undo", _("Undo"), bind (mem_fun(*this, &Editor::undo), 1U));
530 ActionManager::session_sensitive_actions.push_back (act);
531 redo_action = act = ActionManager::register_action (editor_actions, "redo", _("Redo"), bind (mem_fun(*this, &Editor::redo), 1U));
532 ActionManager::session_sensitive_actions.push_back (act);
534 act = ActionManager::register_action (editor_actions, "export-session", _("Export Session"), mem_fun(*this, &Editor::export_session));
535 ActionManager::session_sensitive_actions.push_back (act);
536 act = ActionManager::register_action (editor_actions, "export-range", _("Export Range"), mem_fun(*this, &Editor::export_selection));
537 ActionManager::session_sensitive_actions.push_back (act);
539 act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection));
540 ActionManager::session_sensitive_actions.push_back (act);
541 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
542 act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch));
543 ActionManager::session_sensitive_actions.push_back (act);
544 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
545 act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop));
546 ActionManager::session_sensitive_actions.push_back (act);
547 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
548 act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
549 ActionManager::session_sensitive_actions.push_back (act);
550 ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
551 act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut));
552 ActionManager::session_sensitive_actions.push_back (act);
553 /* Note: for now, editor-delete does the exact same thing as editor-cut */
554 act = ActionManager::register_action (editor_actions, "editor-delete", _("Delete"), mem_fun(*this, &Editor::cut));
555 ActionManager::session_sensitive_actions.push_back (act);
556 act = ActionManager::register_action (editor_actions, "editor-copy", _("Copy"), mem_fun(*this, &Editor::copy));
557 ActionManager::session_sensitive_actions.push_back (act);
558 act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste));
559 ActionManager::session_sensitive_actions.push_back (act);
561 act = ActionManager::register_action (editor_actions, "set-tempo-from-region", _("Set Tempo from Region=Bar"), mem_fun(*this, &Editor::use_region_as_bar));
562 ActionManager::session_sensitive_actions.push_back (act);
563 ActionManager::region_selection_sensitive_actions.push_back (act);
564 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));
565 ActionManager::session_sensitive_actions.push_back (act);
567 act = ActionManager::register_action (editor_actions, "split-region-at-transients", _("Split Regions At Percussion Onsets"), mem_fun(*this, &Editor::split_region_at_transients));
568 ActionManager::session_sensitive_actions.push_back (act);
569 ActionManager::region_selection_sensitive_actions.push_back (act);
570 act = ActionManager::register_action (editor_actions, "toggle-rhythm-ferret", _("Rhythm Ferret"), mem_fun(*this, &Editor::show_rhythm_ferret));
571 ActionManager::session_sensitive_actions.push_back (act);
573 act = ActionManager::register_action (editor_actions, "tab-to-transient-forwards", _("Move Forward to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), true));
574 ActionManager::session_sensitive_actions.push_back (act);
575 act = ActionManager::register_action (editor_actions, "tab-to-transient-backwards", _("Move Backwards to Transient"), bind (mem_fun(*this, &Editor::tab_to_transient), false));
576 ActionManager::session_sensitive_actions.push_back (act);
578 act = ActionManager::register_action (editor_actions, "crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
579 ActionManager::session_sensitive_actions.push_back (act);
580 act = ActionManager::register_action (editor_actions, "insert-chunk", _("Insert Chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f));
581 ActionManager::session_sensitive_actions.push_back (act);
583 act = ActionManager::register_action (editor_actions, "split-at-edit-cursor", _("Split At Edit Point"), mem_fun(*this, &Editor::split_region));
584 ActionManager::edit_point_in_region_sensitive_actions.push_back (act);
586 act = ActionManager::register_action (editor_actions, "start-range", _("Start Range"), mem_fun(*this, &Editor::keyboard_selection_begin));
587 ActionManager::session_sensitive_actions.push_back (act);
588 act = ActionManager::register_action (editor_actions, "finish-range", _("Finish Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), false));
589 ActionManager::session_sensitive_actions.push_back (act);
590 act = ActionManager::register_action (editor_actions, "finish-add-range", _("Finish add Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), true));
591 ActionManager::session_sensitive_actions.push_back (act);
593 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));
594 ActionManager::session_sensitive_actions.push_back (act);
595 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));
596 ActionManager::session_sensitive_actions.push_back (act);
598 act = ActionManager::register_toggle_action (editor_actions, "toggle-follow-playhead", _("Follow Playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
599 ActionManager::session_sensitive_actions.push_back (act);
600 act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (mem_fun(*this, &Editor::remove_last_capture)));
601 ActionManager::session_sensitive_actions.push_back (act);
603 act = ActionManager::register_toggle_action (editor_actions, "toggle-stationary-playhead", _("Stationary Playhead"), (mem_fun(*this, &Editor::toggle_stationary_playhead)));
604 ActionManager::session_sensitive_actions.push_back (act);
606 act = ActionManager::register_action (editor_actions, "insert-time", _("Insert Time"), (mem_fun(*this, &Editor::do_insert_time)));
607 ActionManager::session_sensitive_actions.push_back (act);
608 ActionManager::track_selection_sensitive_actions.push_back (act);
610 act = ActionManager::register_action (editor_actions, "toggle-track-active", _("Toggle Active"), (mem_fun(*this, &Editor::toggle_tracks_active)));
611 ActionManager::session_sensitive_actions.push_back (act);
612 ActionManager::track_selection_sensitive_actions.push_back (act);
613 if (Profile->get_sae()) {
614 act = ActionManager::register_action (editor_actions, "remove-track", _("Delete"), (mem_fun(*this, &Editor::remove_tracks)));
615 } else {
616 act = ActionManager::register_action (editor_actions, "remove-track", _("Remove"), (mem_fun(*this, &Editor::remove_tracks)));
618 ActionManager::session_sensitive_actions.push_back (act);
619 ActionManager::track_selection_sensitive_actions.push_back (act);
621 act = ActionManager::register_action (editor_actions, "fit-tracks", _("Fit Selected Tracks"), (mem_fun(*this, &Editor::fit_tracks)));
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-largest", _("Largest"), (mem_fun(*this, &Editor::set_track_height_largest)));
625 ActionManager::session_sensitive_actions.push_back (act);
626 ActionManager::track_selection_sensitive_actions.push_back (act);
627 act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), (mem_fun(*this, &Editor::set_track_height_larger)));
628 ActionManager::session_sensitive_actions.push_back (act);
629 ActionManager::track_selection_sensitive_actions.push_back (act);
630 act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), (mem_fun(*this, &Editor::set_track_height_large)));
631 ActionManager::session_sensitive_actions.push_back (act);
632 ActionManager::track_selection_sensitive_actions.push_back (act);
633 act = ActionManager::register_action (editor_actions, "track-height-normal", _("Normal"), (mem_fun(*this, &Editor::set_track_height_normal)));
634 ActionManager::session_sensitive_actions.push_back (act);
635 ActionManager::track_selection_sensitive_actions.push_back (act);
636 act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), (mem_fun(*this, &Editor::set_track_height_small)));
637 ActionManager::track_selection_sensitive_actions.push_back (act);
638 ActionManager::session_sensitive_actions.push_back (act);
639 ActionManager::track_selection_sensitive_actions.push_back (act);
640 act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), (mem_fun(*this, &Editor::set_track_height_smaller)));
641 ActionManager::session_sensitive_actions.push_back (act);
642 ActionManager::track_selection_sensitive_actions.push_back (act);
644 Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
645 RadioAction::Group zoom_group;
647 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("Zoom Focus Left"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusLeft));
648 ActionManager::session_sensitive_actions.push_back (act);
649 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("Zoom Focus Right"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusRight));
650 ActionManager::session_sensitive_actions.push_back (act);
651 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("Zoom Focus Center"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusCenter));
652 ActionManager::session_sensitive_actions.push_back (act);
653 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("Zoom Focus Playhead"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusPlayhead));
654 ActionManager::session_sensitive_actions.push_back (act);
655 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-mouse", _("Zoom Focus Mouse"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusMouse));
656 ActionManager::session_sensitive_actions.push_back (act);
657 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusEdit));
658 ActionManager::session_sensitive_actions.push_back (act);
660 Glib::RefPtr<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
661 RadioAction::Group mouse_mode_group;
663 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));
664 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));
665 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));
666 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));
667 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));
669 RadioAction::Group edit_point_group;
670 ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-playhead"), _("Playhead"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
671 ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
672 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 ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
675 ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
676 if (!Profile->get_sae()) {
677 ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice));
679 ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), bind (mem_fun (*this, &Editor::set_edit_mode), Slide));
680 ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), bind (mem_fun (*this, &Editor::set_edit_mode), Lock));
681 ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Next Edit Mode"), mem_fun (*this, &Editor::cycle_edit_mode));
683 ActionManager::register_action (editor_actions, X_("MouseMode"), _("Mouse Mode"));
684 ActionManager::register_action (editor_actions, "step-mouse-mode", _("Next Mouse Mode"), bind (mem_fun(*this, &Editor::step_mouse_mode), true));
686 ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap To"));
687 ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
689 RadioAction::Group snap_mode_group;
690 ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
691 ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
692 ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
694 ActionManager::register_action (editor_actions, X_("cycle-snap-mode"), _("Next Snap Mode"), mem_fun (*this, &Editor::cycle_snap_mode));
695 ActionManager::register_action (editor_actions, X_("cycle-snap-choice"), _("Next Snap Choice"), mem_fun (*this, &Editor::cycle_snap_choice));
697 Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
698 RadioAction::Group snap_choice_group;
700 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)));
701 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)));
702 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)));
703 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)));
704 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)));
705 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)));
706 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)));
707 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)));
708 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)));
709 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)));
710 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)));
711 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)));
712 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)));
713 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)));
714 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)));
715 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)));
716 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)));
717 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)));
719 /* RULERS */
721 Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers"));
722 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)));
723 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)));
724 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)));
725 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)));
726 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)));
727 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)));
728 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)));
729 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)));
730 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)));
731 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)));
733 /* set defaults here */
735 no_ruler_shown_update = true;
736 ruler_meter_action->set_active (true);
737 ruler_tempo_action->set_active (true);
738 ruler_marker_action->set_active (true);
739 ruler_range_action->set_active (false);
740 ruler_loop_punch_action->set_active (true);
741 ruler_loop_punch_action->set_active (true);
742 if (Profile->get_sae()) {
743 ruler_bbt_action->set_active (true);
744 ruler_cd_marker_action->set_active (false);
745 ruler_timecode_action->set_active (false);
746 ruler_minsec_action->set_active (true);
747 } else {
748 ruler_bbt_action->set_active (false);
749 ruler_cd_marker_action->set_active (true);
750 ruler_timecode_action->set_active (true);
751 ruler_minsec_action->set_active (false);
753 ruler_samples_action->set_active (false);
754 no_ruler_shown_update = false;
756 /* REGION LIST */
758 Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
759 RadioAction::Group sort_type_group;
760 RadioAction::Group sort_order_group;
762 /* the region list popup menu */
763 ActionManager::register_action (rl_actions, X_("RegionListSort"), _("Sort"));
765 act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
766 ActionManager::region_list_selection_sensitive_actions.push_back (act);
767 act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
768 ActionManager::region_list_selection_sensitive_actions.push_back (act);
769 act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*this, &Editor::remove_region_from_region_list));
770 ActionManager::region_list_selection_sensitive_actions.push_back (act);
771 ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show all"), mem_fun(*this, &Editor::toggle_full_region_list));
772 ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show automatic regions"), mem_fun(*this, &Editor::toggle_show_auto_regions));
774 ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"), _("Ascending"),
775 bind (mem_fun(*this, &Editor::reset_region_list_sort_direction), true));
776 ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"),
777 bind (mem_fun(*this, &Editor::reset_region_list_sort_direction), false));
779 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"), _("By Region Name"),
780 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByName));
781 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"), _("By Region Length"),
782 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByLength));
783 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionPosition"), _("By Region Position"),
784 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByPosition));
785 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionTimestamp"), _("By Region Timestamp"),
786 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByTimestamp));
787 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionStartinFile"), _("By Region Start in File"),
788 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByStartInFile));
789 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionEndinFile"), _("By Region End in File"),
790 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByEndInFile));
791 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileName"), _("By Source File Name"),
792 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileName));
793 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileLength"), _("By Source File Length"),
794 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileLength));
795 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileCreationDate"), _("By Source File Creation Date"),
796 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileCreationDate));
797 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
798 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileFS));
801 /* the next two are duplicate items with different names for use in two different contexts */
803 act = ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import"), mem_fun (*this, &Editor::external_audio_dialog));
804 ActionManager::write_sensitive_actions.push_back (act);
806 act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Import to Region List"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
807 ActionManager::session_sensitive_actions.push_back (act);
808 ActionManager::write_sensitive_actions.push_back (act);
810 act = ActionManager::register_toggle_action (editor_actions, X_("toggle-waveform-visible"), _("Show Waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
811 act = ActionManager::register_toggle_action (editor_actions, X_("toggle-waveform-rectified"), _("Show Waveforms Rectified"), mem_fun (*this, &Editor::toggle_waveform_rectified));
812 ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms while Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
814 ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
816 act = ActionManager::register_action (editor_actions, X_("linear-waveforms"), _("Set Selected Tracks to Linear Waveforms"), bind (mem_fun (*this, &Editor::set_waveform_scale), Editing::LinearWaveform));
817 ActionManager::track_selection_sensitive_actions.push_back (act);
818 act = ActionManager::register_action (editor_actions, X_("logarithmic-waveforms"), _("Set Selected Tracks to Logarithmic Waveforms"), bind (mem_fun (*this, &Editor::set_waveform_scale), Editing::LogWaveform));
819 ActionManager::track_selection_sensitive_actions.push_back (act);
821 /* if there is a logo in the editor canvas, its always visible at startup */
823 act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
824 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
825 tact->set_active (true);
827 RadioAction::Group layer_model_group;
829 ActionManager::register_radio_action (editor_actions, layer_model_group, X_("LayerLaterHigher"), _("Later is Higher"), bind (mem_fun (*this, &Editor::set_layer_model), LaterHigher));
830 ActionManager::register_radio_action (editor_actions, layer_model_group, X_("LayerMoveAddHigher"), _("Most Recently Moved/Added is Higher"), bind (mem_fun (*this, &Editor::set_layer_model), MoveAddHigher));
831 ActionManager::register_radio_action (editor_actions, layer_model_group, X_("LayerAddHigher"), _("Most Recently Added is Higher"), bind (mem_fun (*this, &Editor::set_layer_model), AddHigher));
833 RadioAction::Group smpte_group;
835 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte23976"), _("23.976"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_23976));
836 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte24"), _("24"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_24));
837 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte24976"), _("24.976"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_24976));
838 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte25"), _("25"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_25));
839 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte2997"), _("29.97"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_2997));
840 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte2997drop"), _("29.97 drop"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_2997drop));
841 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte30"), _("30"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_30));
842 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte30drop"), _("30 drop"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_30drop));
843 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte5994"), _("59.94"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_5994));
844 ActionManager::register_radio_action (editor_actions, smpte_group, X_("Smpte60"), _("60"), bind (mem_fun (*this, &Editor::smpte_fps_chosen), smpte_60));
846 RadioAction::Group pullup_group;
848 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupPlus4Plus1"), _("+4.1667% + 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Plus4Plus1));
849 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupPlus4"), _("+4.1667%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Plus4));
850 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupPlus4Minus1"), _("+4.1667% - 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Plus4Minus1));
851 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupPlus1"), _("+ 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Plus1));
852 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupNone"), _("None"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_None));
853 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupMinus1"), _("- 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Minus1));
854 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupMinus4Plus1"), _("-4.1667% + 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Minus4Plus1));
855 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupMinus4"), _("-4.1667%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Minus4));
856 ActionManager::register_radio_action (editor_actions, pullup_group, X_("PullupMinus4Minus1"), _("-4.1667% - 0.1%"), bind (mem_fun (*this, &Editor::video_pullup_chosen), Session::pullup_Minus4Minus1));
858 RadioAction::Group subframe_group;
860 ActionManager::register_radio_action (editor_actions, subframe_group, X_("Subframes80"), _("80 per frame"), bind (mem_fun (*this,
861 &Editor::subframes_per_frame_chosen), 80));
862 ActionManager::register_radio_action (editor_actions, subframe_group, X_("Subframes100"), _("100 per frame"), bind (mem_fun (*this,
863 &Editor::subframes_per_frame_chosen), 100));
865 ActionManager::add_action_group (rl_actions);
866 ActionManager::add_action_group (ruler_actions);
867 ActionManager::add_action_group (zoom_actions);
868 ActionManager::add_action_group (mouse_mode_actions);
869 ActionManager::add_action_group (snap_actions);
870 ActionManager::add_action_group (editor_actions);
873 void
874 Editor::toggle_ruler_visibility (RulerType rt)
876 const char* action = 0;
878 if (no_ruler_shown_update) {
879 return;
882 switch (rt) {
883 case ruler_metric_smpte:
884 action = "toggle-timecode-ruler";
885 break;
886 case ruler_metric_bbt:
887 action = "toggle-bbt-ruler";
888 break;
889 case ruler_metric_frames:
890 action = "toggle-samples-ruler";
891 break;
892 case ruler_metric_minsec:
893 action = "toggle-minsec-ruler";
894 break;
895 case ruler_time_tempo:
896 action = "toggle-tempo-ruler";
897 break;
898 case ruler_time_meter:
899 action = "toggle-meter-ruler";
900 break;
901 case ruler_time_marker:
902 action = "toggle-marker-ruler";
903 break;
904 case ruler_time_range_marker:
905 action = "toggle-range-ruler";
906 break;
907 case ruler_time_transport_marker:
908 action = "toggle-loop-punch-ruler";
909 break;
910 case ruler_time_cd_marker:
911 action = "toggle-cd-marker-ruler";
912 break;
915 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), action);
916 if (act) {
917 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
918 update_ruler_visibility ();
919 store_ruler_visibility ();
923 void
924 Editor::toggle_waveform_visibility ()
926 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
927 if (act) {
928 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
929 set_show_waveforms (tact->get_active());
933 void
934 Editor::toggle_waveform_rectified ()
936 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-rectified"));
937 if (act) {
938 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
939 set_show_waveforms_rectified (tact->get_active());
943 void
944 Editor::toggle_waveforms_while_recording ()
946 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformsWhileRecording"));
947 if (act) {
948 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
949 set_show_waveforms_recording (tact->get_active());
953 void
954 Editor::toggle_measure_visibility ()
956 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
957 if (act) {
958 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
959 set_show_measures (tact->get_active());
963 void
964 Editor::toggle_logo_visibility ()
966 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleLogoVisibility"));
968 if (act) {
969 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
970 if (logo_item) {
971 if (tact->get_active()) {
972 logo_item->show ();
973 } else {
974 logo_item->hide ();
980 void
981 Editor::set_crossfade_model (CrossfadeModel model)
983 RefPtr<Action> act;
985 /* this is driven by a toggle on a radio group, and so is invoked twice,
986 once for the item that became inactive and once for the one that became
987 active.
990 switch (model) {
991 case FullCrossfade:
992 act = ActionManager::get_action (X_("Editor"), X_("CrossfadesFull"));
993 break;
994 case ShortCrossfade:
995 act = ActionManager::get_action (X_("Editor"), X_("CrossfadesShort"));
996 break;
999 if (act) {
1000 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1001 if (ract && ract->get_active()) {
1002 Config->set_xfade_model (model);
1007 void
1008 Editor::update_crossfade_model ()
1010 RefPtr<Action> act;
1012 switch (Config->get_xfade_model()) {
1013 case FullCrossfade:
1014 act = ActionManager::get_action (X_("Editor"), X_("CrossfadesFull"));
1015 break;
1016 case ShortCrossfade:
1017 act = ActionManager::get_action (X_("Editor"), X_("CrossfadesShort"));
1018 break;
1021 if (act) {
1022 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1023 if (ract && !ract->get_active()) {
1024 ract->set_active (true);
1030 void
1031 Editor::update_smpte_mode ()
1033 ENSURE_GUI_THREAD(mem_fun(*this, &Editor::update_smpte_mode));
1035 RefPtr<Action> act;
1036 const char* action = 0;
1038 switch (Config->get_smpte_format()) {
1039 case smpte_23976:
1040 action = X_("Smpte23976");
1041 break;
1042 case smpte_24:
1043 action = X_("Smpte24");
1044 break;
1045 case smpte_24976:
1046 action = X_("Smpte24976");
1047 break;
1048 case smpte_25:
1049 action = X_("Smpte25");
1050 break;
1051 case smpte_2997:
1052 action = X_("Smpte2997");
1053 break;
1054 case smpte_2997drop:
1055 action = X_("Smpte2997drop");
1056 break;
1057 case smpte_30:
1058 action = X_("Smpte30");
1059 break;
1060 case smpte_30drop:
1061 action = X_("Smpte30drop");
1062 break;
1063 case smpte_5994:
1064 action = X_("Smpte5994");
1065 break;
1066 case smpte_60:
1067 action = X_("Smpte60");
1068 break;
1071 act = ActionManager::get_action (X_("Editor"), action);
1073 if (act) {
1074 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1075 if (ract && !ract->get_active()) {
1076 ract->set_active (true);
1081 void
1082 Editor::update_video_pullup ()
1084 ENSURE_GUI_THREAD (mem_fun(*this, &Editor::update_video_pullup));
1086 RefPtr<Action> act;
1087 const char* action = 0;
1089 float pullup = Config->get_video_pullup();
1091 if ( pullup < (-4.1667 - 0.1) * 0.99) {
1092 action = X_("PullupMinus4Minus1");
1093 } else if ( pullup < (-4.1667) * 0.99 ) {
1094 action = X_("PullupMinus4");
1095 } else if ( pullup < (-4.1667 + 0.1) * 0.99 ) {
1096 action = X_("PullupMinus4Plus1");
1097 } else if ( pullup < (-0.1) * 0.99 ) {
1098 action = X_("PullupMinus1");
1099 } else if (pullup > (4.1667 + 0.1) * 0.99 ) {
1100 action = X_("PullupPlus4Plus1");
1101 } else if ( pullup > (4.1667) * 0.99 ) {
1102 action = X_("PullupPlus4");
1103 } else if ( pullup > (4.1667 - 0.1) * 0.99) {
1104 action = X_("PullupPlus4Minus1");
1105 } else if ( pullup > (0.1) * 0.99 ) {
1106 action = X_("PullupPlus1");
1107 } else {
1108 action = X_("PullupNone");
1111 act = ActionManager::get_action (X_("Editor"), action);
1113 if (act) {
1114 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1115 if (ract && !ract->get_active()) {
1116 ract->set_active (true);
1121 void
1122 Editor::update_layering_model ()
1124 RefPtr<Action> act;
1126 switch (Config->get_layer_model()) {
1127 case LaterHigher:
1128 act = ActionManager::get_action (X_("Editor"), X_("LayerLaterHigher"));
1129 break;
1130 case MoveAddHigher:
1131 act = ActionManager::get_action (X_("Editor"), X_("LayerMoveAddHigher"));
1132 break;
1133 case AddHigher:
1134 act = ActionManager::get_action (X_("Editor"), X_("LayerAddHigher"));
1135 break;
1138 if (act) {
1139 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1140 if (ract && !ract->get_active()) {
1141 ract->set_active (true);
1146 void
1147 Editor::set_layer_model (LayerModel model)
1149 /* this is driven by a toggle on a radio group, and so is invoked twice,
1150 once for the item that became inactive and once for the one that became
1151 active.
1154 RefPtr<Action> act;
1156 switch (model) {
1157 case LaterHigher:
1158 act = ActionManager::get_action (X_("Editor"), X_("LayerLaterHigher"));
1159 break;
1160 case MoveAddHigher:
1161 act = ActionManager::get_action (X_("Editor"), X_("LayerMoveAddHigher"));
1162 break;
1163 case AddHigher:
1164 act = ActionManager::get_action (X_("Editor"), X_("LayerAddHigher"));
1165 break;
1168 if (act) {
1169 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1170 if (ract && ract->get_active() && Config->get_layer_model() != model) {
1171 Config->set_layer_model (model);
1176 RefPtr<RadioAction>
1177 Editor::snap_type_action (SnapType type)
1180 const char* action = 0;
1181 RefPtr<Action> act;
1183 switch (type) {
1184 case Editing::SnapToCDFrame:
1185 action = "snap-to-cd-frame";
1186 break;
1187 case Editing::SnapToSMPTEFrame:
1188 action = "snap-to-smpte-frame";
1189 break;
1190 case Editing::SnapToSMPTESeconds:
1191 action = "snap-to-smpte-seconds";
1192 break;
1193 case Editing::SnapToSMPTEMinutes:
1194 action = "snap-to-smpte-minutes";
1195 break;
1196 case Editing::SnapToSeconds:
1197 action = "snap-to-seconds";
1198 break;
1199 case Editing::SnapToMinutes:
1200 action = "snap-to-minutes";
1201 break;
1202 case Editing::SnapToAThirtysecondBeat:
1203 action = "snap-to-thirtyseconds";
1204 break;
1205 case Editing::SnapToASixteenthBeat:
1206 action = "snap-to-asixteenthbeat";
1207 break;
1208 case Editing::SnapToAEighthBeat:
1209 action = "snap-to-eighths";
1210 break;
1211 case Editing::SnapToAQuarterBeat:
1212 action = "snap-to-quarters";
1213 break;
1214 case Editing::SnapToAThirdBeat:
1215 action = "snap-to-thirds";
1216 break;
1217 case Editing::SnapToBeat:
1218 action = "snap-to-beat";
1219 break;
1220 case Editing::SnapToBar:
1221 action = "snap-to-bar";
1222 break;
1223 case Editing::SnapToMark:
1224 action = "snap-to-mark";
1225 break;
1226 case Editing::SnapToRegionStart:
1227 action = "snap-to-region-start";
1228 break;
1229 case Editing::SnapToRegionEnd:
1230 action = "snap-to-region-end";
1231 break;
1232 case Editing::SnapToRegionSync:
1233 action = "snap-to-region-sync";
1234 break;
1235 case Editing::SnapToRegionBoundary:
1236 action = "snap-to-region-boundary";
1237 break;
1238 default:
1239 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
1240 /*NOTREACHED*/
1243 act = ActionManager::get_action (X_("Snap"), action);
1245 if (act) {
1246 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1247 return ract;
1249 } else {
1250 error << string_compose (_("programming error: %1"), "Editor::snap_type_chosen could not find action to match type.") << endmsg;
1251 return RefPtr<RadioAction>();
1255 void
1256 Editor::cycle_snap_choice()
1258 switch (snap_type) {
1259 case Editing::SnapToCDFrame:
1260 set_snap_to (Editing::SnapToSMPTEFrame);
1261 break;
1262 case Editing::SnapToSMPTEFrame:
1263 set_snap_to (Editing::SnapToSMPTESeconds);
1264 break;
1265 case Editing::SnapToSMPTESeconds:
1266 set_snap_to (Editing::SnapToSMPTEMinutes);
1267 break;
1268 case Editing::SnapToSMPTEMinutes:
1269 set_snap_to (Editing::SnapToSeconds);
1270 break;
1271 case Editing::SnapToSeconds:
1272 set_snap_to (Editing::SnapToMinutes);
1273 break;
1274 case Editing::SnapToMinutes:
1275 set_snap_to (Editing::SnapToAThirtysecondBeat);
1276 break;
1277 case Editing::SnapToAThirtysecondBeat:
1278 set_snap_to (Editing::SnapToASixteenthBeat);
1279 break;
1280 case Editing::SnapToASixteenthBeat:
1281 set_snap_to (Editing::SnapToAEighthBeat);
1282 break;
1283 case Editing::SnapToAEighthBeat:
1284 set_snap_to (Editing::SnapToAQuarterBeat);
1285 break;
1286 case Editing::SnapToAQuarterBeat:
1287 set_snap_to (Editing::SnapToAThirdBeat);
1288 break;
1289 case Editing::SnapToAThirdBeat:
1290 set_snap_to (Editing::SnapToBeat);
1291 break;
1292 case Editing::SnapToBeat:
1293 set_snap_to (Editing::SnapToBar);
1294 break;
1295 case Editing::SnapToBar:
1296 set_snap_to (Editing::SnapToMark);
1297 break;
1298 case Editing::SnapToMark:
1299 set_snap_to (Editing::SnapToRegionStart);
1300 break;
1301 case Editing::SnapToRegionStart:
1302 set_snap_to (Editing::SnapToRegionEnd);
1303 break;
1304 case Editing::SnapToRegionEnd:
1305 set_snap_to (Editing::SnapToRegionSync);
1306 break;
1307 case Editing::SnapToRegionSync:
1308 set_snap_to (Editing::SnapToRegionBoundary);
1309 break;
1310 case Editing::SnapToRegionBoundary:
1311 set_snap_to (Editing::SnapToCDFrame);
1312 break;
1316 void
1317 Editor::snap_type_chosen (SnapType type)
1319 /* this is driven by a toggle on a radio group, and so is invoked twice,
1320 once for the item that became inactive and once for the one that became
1321 active.
1324 RefPtr<RadioAction> ract = snap_type_action (type);
1326 if (ract && ract->get_active()) {
1327 set_snap_to (type);
1331 RefPtr<RadioAction>
1332 Editor::snap_mode_action (SnapMode mode)
1334 const char* action = 0;
1335 RefPtr<Action> act;
1337 switch (mode) {
1338 case Editing::SnapOff:
1339 action = X_("snap-off");
1340 break;
1341 case Editing::SnapNormal:
1342 action = X_("snap-normal");
1343 break;
1344 case Editing::SnapMagnetic:
1345 action = X_("snap-magnetic");
1346 break;
1347 default:
1348 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
1349 /*NOTREACHED*/
1352 act = ActionManager::get_action (X_("Editor"), action);
1354 if (act) {
1355 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1356 return ract;
1358 } else {
1359 error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
1360 return RefPtr<RadioAction> ();
1364 void
1365 Editor::cycle_snap_mode ()
1367 switch (snap_mode) {
1368 case SnapOff:
1369 set_snap_mode (SnapNormal);
1370 break;
1371 case SnapNormal:
1372 set_snap_mode (SnapMagnetic);
1373 break;
1374 case SnapMagnetic:
1375 set_snap_mode (SnapOff);
1376 break;
1380 void
1381 Editor::snap_mode_chosen (SnapMode mode)
1383 /* this is driven by a toggle on a radio group, and so is invoked twice,
1384 once for the item that became inactive and once for the one that became
1385 active.
1388 RefPtr<RadioAction> ract = snap_mode_action (mode);
1390 if (ract && ract->get_active()) {
1391 set_snap_mode (mode);
1395 RefPtr<RadioAction>
1396 Editor::edit_point_action (EditPoint ep)
1398 const char* action = 0;
1399 RefPtr<Action> act;
1401 switch (ep) {
1402 case Editing::EditAtPlayhead:
1403 action = X_("edit-at-playhead");
1404 break;
1405 case Editing::EditAtSelectedMarker:
1406 action = X_("edit-at-selected-marker");
1407 break;
1408 case Editing::EditAtMouse:
1409 action = X_("edit-at-mouse");
1410 break;
1411 default:
1412 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
1413 /*NOTREACHED*/
1416 act = ActionManager::get_action (X_("Editor"), action);
1418 if (act) {
1419 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1420 return ract;
1422 } else {
1423 error << string_compose (_("programming error: %1: %2"), "Editor::edit_point_action could not find action to match edit point.", action) << endmsg;
1424 return RefPtr<RadioAction> ();
1428 void
1429 Editor::edit_point_chosen (EditPoint ep)
1431 /* this is driven by a toggle on a radio group, and so is invoked twice,
1432 once for the item that became inactive and once for the one that became
1433 active.
1436 RefPtr<RadioAction> ract = edit_point_action (ep);
1438 if (ract && ract->get_active()) {
1439 set_edit_point_preference (ep);
1444 RefPtr<RadioAction>
1445 Editor::zoom_focus_action (ZoomFocus focus)
1447 const char* action = 0;
1448 RefPtr<Action> act;
1450 switch (focus) {
1451 case ZoomFocusLeft:
1452 action = X_("zoom-focus-left");
1453 break;
1454 case ZoomFocusRight:
1455 action = X_("zoom-focus-right");
1456 break;
1457 case ZoomFocusCenter:
1458 action = X_("zoom-focus-center");
1459 break;
1460 case ZoomFocusPlayhead:
1461 action = X_("zoom-focus-playhead");
1462 break;
1463 case ZoomFocusMouse:
1464 action = X_("zoom-focus-mouse");
1465 break;
1466 case ZoomFocusEdit:
1467 action = X_("zoom-focus-edit");
1468 break;
1469 default:
1470 fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
1471 /*NOTREACHED*/
1474 act = ActionManager::get_action (X_("Zoom"), action);
1476 if (act) {
1477 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1478 return ract;
1479 } else {
1480 error << string_compose (_("programming error: %1: %2"), "Editor::zoom_focus_action could not find action to match focus.", action) << endmsg;
1483 return RefPtr<RadioAction> ();
1486 void
1487 Editor::zoom_focus_chosen (ZoomFocus focus)
1489 /* this is driven by a toggle on a radio group, and so is invoked twice,
1490 once for the item that became inactive and once for the one that became
1491 active.
1494 RefPtr<RadioAction> ract = zoom_focus_action (focus);
1496 if (ract && ract->get_active()) {
1497 set_zoom_focus (focus);
1501 void
1502 Editor::smpte_fps_chosen (SmpteFormat format)
1504 /* this is driven by a toggle on a radio group, and so is invoked twice,
1505 once for the item that became inactive and once for the one that became
1506 active.
1509 if (session) {
1511 RefPtr<Action> act;
1513 switch (format) {
1514 case smpte_23976:
1515 act = ActionManager::get_action (X_("Editor"), X_("Smpte23976"));
1516 break;
1517 case smpte_24:
1518 act = ActionManager::get_action (X_("Editor"), X_("Smpte24"));
1519 break;
1520 case smpte_24976:
1521 act = ActionManager::get_action (X_("Editor"), X_("Smpte24976"));
1522 break;
1523 case smpte_25:
1524 act = ActionManager::get_action (X_("Editor"), X_("Smpte25"));
1525 break;
1526 case smpte_2997:
1527 act = ActionManager::get_action (X_("Editor"), X_("Smpte2997"));
1528 break;
1529 case smpte_2997drop:
1530 act = ActionManager::get_action (X_("Editor"), X_("Smpte2997drop"));
1531 break;
1532 case smpte_30:
1533 act = ActionManager::get_action (X_("Editor"), X_("Smpte30"));
1534 break;
1535 case smpte_30drop:
1536 act = ActionManager::get_action (X_("Editor"), X_("Smpte30drop"));
1537 break;
1538 case smpte_5994:
1539 act = ActionManager::get_action (X_("Editor"), X_("Smpte5994"));
1540 break;
1541 case smpte_60:
1542 act = ActionManager::get_action (X_("Editor"), X_("Smpte60"));
1543 break;
1544 default:
1545 cerr << "Editor received unexpected smpte type" << endl;
1548 if (act) {
1549 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1550 if (ract && ract->get_active()) {
1551 session->set_smpte_format (format);
1557 void
1558 Editor::video_pullup_chosen (Session::PullupFormat pullup)
1560 /* this is driven by a toggle on a radio group, and so is invoked twice,
1561 once for the item that became inactive and once for the one that became
1562 active.
1565 const char* action = 0;
1567 RefPtr<Action> act;
1569 float pull = 0.0;
1571 switch (pullup) {
1572 case Session::pullup_Plus4Plus1:
1573 pull = 4.1667 + 0.1;
1574 action = X_("PullupPlus4Plus1");
1575 break;
1576 case Session::pullup_Plus4:
1577 pull = 4.1667;
1578 action = X_("PullupPlus4");
1579 break;
1580 case Session::pullup_Plus4Minus1:
1581 pull = 4.1667 - 0.1;
1582 action = X_("PullupPlus4Minus1");
1583 break;
1584 case Session::pullup_Plus1:
1585 pull = 0.1;
1586 action = X_("PullupPlus1");
1587 break;
1588 case Session::pullup_None:
1589 pull = 0.0;
1590 action = X_("PullupNone");
1591 break;
1592 case Session::pullup_Minus1:
1593 pull = -0.1;
1594 action = X_("PullupMinus1");
1595 break;
1596 case Session::pullup_Minus4Plus1:
1597 pull = -4.1667 + 0.1;
1598 action = X_("PullupMinus4Plus1");
1599 break;
1600 case Session::pullup_Minus4:
1601 pull = -4.1667;
1602 action = X_("PullupMinus4");
1603 break;
1604 case Session::pullup_Minus4Minus1:
1605 pull = -4.1667 - 0.1;
1606 action = X_("PullupMinus4Minus1");
1607 break;
1608 default:
1609 fatal << string_compose (_("programming error: %1"), "Session received unexpected pullup type") << endmsg;
1610 /*NOTREACHED*/
1613 act = ActionManager::get_action (X_("Editor"), action);
1615 if (act) {
1616 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1617 if (ract && ract->get_active()) {
1618 Config->set_video_pullup ( pull );
1621 } else {
1622 error << string_compose (_("programming error: %1"), "Editor::video_pullup_chosen could not find action to match pullup.") << endmsg;
1626 void
1627 Editor::update_subframes_per_frame ()
1629 ENSURE_GUI_THREAD (mem_fun(*this, &Editor::update_subframes_per_frame));
1631 RefPtr<Action> act;
1632 const char* action = 0;
1634 uint32_t sfpf = Config->get_subframes_per_frame();
1636 if (sfpf == 80) {
1637 action = X_("Subframes80");
1638 } else if (sfpf == 100) {
1639 action = X_("Subframes100");
1640 } else {
1641 warning << string_compose (_("Configuraton is using unhandled subframes per frame value: %1"), sfpf) << endmsg;
1642 /*NOTREACHED*/
1643 return;
1646 act = ActionManager::get_action (X_("Editor"), action);
1648 if (act) {
1649 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1650 if (ract && !ract->get_active()) {
1651 ract->set_active (true);
1656 void
1657 Editor::subframes_per_frame_chosen (uint32_t sfpf)
1659 /* this is driven by a toggle on a radio group, and so is invoked twice,
1660 once for the item that became inactive and once for the one that became
1661 active.
1664 const char* action = 0;
1666 RefPtr<Action> act;
1668 if (sfpf == 80) {
1669 action = X_("Subframes80");
1670 } else if (sfpf == 100) {
1671 action = X_("Subframes100");
1672 } else {
1673 fatal << string_compose (_("programming error: %1 %2"), "Session received unexpected subframes per frame value: ", sfpf) << endmsg;
1674 /*NOTREACHED*/
1677 act = ActionManager::get_action (X_("Editor"), action);
1679 if (act) {
1680 RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
1681 if (ract && ract->get_active()) {
1682 Config->set_subframes_per_frame ((uint32_t) rint (sfpf));
1685 } else {
1686 error << string_compose (_("programming error: %1"), "Editor::subframes_per_frame_chosen could not find action to match value.") << endmsg;
1690 void
1691 Editor::toggle_replicate_missing_region_channels ()
1693 ActionManager::toggle_config_state ("Editor", "toggle-replicate-missing-region-channels", &Configuration::set_replicate_missing_region_channels, &Configuration::get_replicate_missing_region_channels);
1696 void
1697 Editor::toggle_region_fades ()
1699 ActionManager::toggle_config_state ("Editor", "toggle-region-fades", &Configuration::set_use_region_fades, &Configuration::get_use_region_fades);
1702 void
1703 Editor::toggle_region_fades_visible ()
1705 ActionManager::toggle_config_state ("Editor", "toggle-region-fades-visible", &Configuration::set_show_region_fades, &Configuration::get_show_region_fades);
1708 void
1709 Editor::toggle_auto_xfade ()
1711 ActionManager::toggle_config_state ("Editor", "toggle-auto-xfades", &Configuration::set_auto_xfade, &Configuration::get_auto_xfade);
1714 void
1715 Editor::toggle_xfades_active ()
1717 ActionManager::toggle_config_state ("Editor", "toggle-xfades-active", &Configuration::set_xfades_active, &Configuration::get_xfades_active);
1720 void
1721 Editor::toggle_xfade_visibility ()
1723 ActionManager::toggle_config_state ("Editor", "toggle-xfades-visible", &Configuration::set_xfades_visible, &Configuration::get_xfades_visible);
1726 void
1727 Editor::toggle_link_region_and_track_selection ()
1729 ActionManager::toggle_config_state ("Editor", "link-region-and-track-selection", &Configuration::set_link_region_and_track_selection, &Configuration::get_link_region_and_track_selection);
1732 /** A Configuration parameter has changed.
1733 * @param parameter_name Name of the changed parameter.
1735 void
1736 Editor::parameter_changed (const char* parameter_name)
1738 #define PARAM_IS(x) (!strcmp (parameter_name, (x)))
1739 //cerr << "Editor::parameter_changed: " << parameter_name << endl;
1740 ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::parameter_changed), parameter_name));
1742 if (PARAM_IS ("auto-loop")) {
1743 update_loop_range_view (true);
1744 } else if (PARAM_IS ("punch-in")) {
1745 update_punch_range_view (true);
1746 } else if (PARAM_IS ("punch-out")) {
1747 update_punch_range_view (true);
1748 } else if (PARAM_IS ("layer-model")) {
1749 update_layering_model ();
1750 } else if (PARAM_IS ("smpte-format")) {
1751 update_smpte_mode ();
1752 update_just_smpte ();
1753 } else if (PARAM_IS ("video-pullup")) {
1754 update_video_pullup ();
1755 } else if (PARAM_IS ("xfades-active")) {
1756 ActionManager::map_some_state ("Editor", "toggle-xfades-active", &Configuration::get_xfades_active);
1757 } else if (PARAM_IS ("xfades-visible")) {
1758 ActionManager::map_some_state ("Editor", "toggle-xfades-visible", &Configuration::get_xfades_visible);
1759 update_xfade_visibility ();
1760 } else if (PARAM_IS ("show-region-fades")) {
1761 ActionManager::map_some_state ("Editor", "toggle-region-fades-visible", &Configuration::get_show_region_fades);
1762 update_region_fade_visibility ();
1763 } else if (PARAM_IS ("use-region-fades")) {
1764 ActionManager::map_some_state ("Editor", "toggle-region-fades", &Configuration::get_use_region_fades);
1765 } else if (PARAM_IS ("auto-xfade")) {
1766 ActionManager::map_some_state ("Editor", "toggle-auto-xfades", &Configuration::get_auto_xfade);
1767 } else if (PARAM_IS ("xfade-model")) {
1768 update_crossfade_model ();
1769 } else if (PARAM_IS ("edit-mode")) {
1770 edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
1771 } else if (PARAM_IS ("subframes-per-frame")) {
1772 update_subframes_per_frame ();
1773 update_just_smpte ();
1774 } else if (PARAM_IS ("link-region-and-track-selection")) {
1775 ActionManager::map_some_state ("Editor", "link-region-and-track-selection", &Configuration::get_link_region_and_track_selection);
1778 #undef PARAM_IS
1781 void
1782 Editor::reset_focus ()
1784 track_canvas->grab_focus();
1787 void
1788 Editor::reset_canvas_action_sensitivity (bool onoff)
1790 if (_edit_point != EditAtMouse) {
1791 onoff = true;
1794 for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
1795 x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
1796 (*x)->set_sensitive (onoff);