1 #include <ardour/ardour.h>
14 using namespace ARDOUR;
15 using namespace Editing;
18 Editor::register_actions ()
21 RefPtr<ActionGroup> editor_actions = ActionGroup::create (X_("Editor"));
23 /* non-operative menu items for menu bar */
25 ActionManager::register_action (editor_actions, X_("Edit"), _("Edit"));
26 ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select regions"));
27 ActionManager::register_action (editor_actions, X_("EditCursorMovementOptions"), _("Move edit cursor"));
28 ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations"));
29 ActionManager::register_action (editor_actions, X_("View"), _("View"));
30 ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("ZoomFocus"));
31 ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold"));
32 ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff"));
33 ActionManager::register_action (editor_actions, X_("Solo"), _("Solo"));
34 ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring"));
35 ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect"));
37 /* add named actions for the editor */
39 act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("show editor mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled));
40 ActionManager::session_sensitive_actions.push_back (act);
42 act = ActionManager::register_action (editor_actions, "toggle-xfades-active", _("toggle xfades active"), mem_fun(*this, &Editor::toggle_xfades_active));
43 ActionManager::session_sensitive_actions.push_back (act);
45 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)));
46 ActionManager::session_sensitive_actions.push_back (act);
47 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)));
48 ActionManager::session_sensitive_actions.push_back (act);
49 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)));
50 ActionManager::session_sensitive_actions.push_back (act);
52 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)));
53 ActionManager::session_sensitive_actions.push_back (act);
54 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)));
55 ActionManager::session_sensitive_actions.push_back (act);
56 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)));
57 ActionManager::session_sensitive_actions.push_back (act);
59 act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-start", _("edit cursor to next region start"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), edit_cursor, RegionPoint (Start)));
60 ActionManager::session_sensitive_actions.push_back (act);
61 act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-end", _("edit cursor to next region end"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), edit_cursor, RegionPoint (End)));
62 ActionManager::session_sensitive_actions.push_back (act);
63 act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-sync", _("edit cursor to next region sync"), bind (mem_fun(*this, &Editor::cursor_to_next_region_point), edit_cursor, RegionPoint (SyncPoint)));
64 ActionManager::session_sensitive_actions.push_back (act);
66 act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-start", _("edit cursor to previous region start"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), edit_cursor, RegionPoint (Start)));
67 ActionManager::session_sensitive_actions.push_back (act);
68 act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-end", _("edit cursor to previous region end"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), edit_cursor, RegionPoint (End)));
69 ActionManager::session_sensitive_actions.push_back (act);
70 act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-sync", _("edit cursor to previous region sync"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), edit_cursor, RegionPoint (SyncPoint)));
71 ActionManager::session_sensitive_actions.push_back (act);
73 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));
74 ActionManager::session_sensitive_actions.push_back (act);
75 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));
76 ActionManager::session_sensitive_actions.push_back (act);
78 act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("edit cursor to range start"), bind (mem_fun(*this, &Editor::cursor_to_selection_start), edit_cursor));
79 ActionManager::session_sensitive_actions.push_back (act);
80 act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("edit cursor to range end"), bind (mem_fun(*this, &Editor::cursor_to_selection_end), edit_cursor));
81 ActionManager::session_sensitive_actions.push_back (act);
83 act = ActionManager::register_action (editor_actions, "select-all", _("select all"), bind (mem_fun(*this, &Editor::select_all), false));
84 ActionManager::session_sensitive_actions.push_back (act);
85 act = ActionManager::register_action (editor_actions, "select-all-after-edit-cursor", _("select all after edit cursor"), bind (mem_fun(*this, &Editor::select_all_after_cursor), edit_cursor, true));
86 ActionManager::session_sensitive_actions.push_back (act);
87 act = ActionManager::register_action (editor_actions, "select-all-before-edit-cursor", _("select all before edit cursor"), bind (mem_fun(*this, &Editor::select_all_after_cursor), edit_cursor, false));
88 ActionManager::session_sensitive_actions.push_back (act);
90 act = ActionManager::register_action (editor_actions, "select-all-after-playhead", _("select all after playhead"), bind (mem_fun(*this, &Editor::select_all_after_cursor), playhead_cursor, true));
91 ActionManager::session_sensitive_actions.push_back (act);
92 act = ActionManager::register_action (editor_actions, "select-all-before-playhead", _("select all before playhead"), bind (mem_fun(*this, &Editor::select_all_after_cursor), playhead_cursor, false));
93 ActionManager::session_sensitive_actions.push_back (act);
95 act = ActionManager::register_action (editor_actions, "select-all-in-punch-range", _("select all in punch range"), mem_fun(*this, &Editor::select_all_from_punch));
96 ActionManager::session_sensitive_actions.push_back (act);
97 act = ActionManager::register_action (editor_actions, "select-all-in-loop-range", _("select all in loop range"), mem_fun(*this, &Editor::select_all_from_loop));
98 ActionManager::session_sensitive_actions.push_back (act);
100 act = ActionManager::register_action (editor_actions, "jump-forward-to-mark", _("jump forward to mark"), mem_fun(*this, &Editor::jump_forward_to_mark));
101 ActionManager::session_sensitive_actions.push_back (act);
102 act = ActionManager::register_action (editor_actions, "jump-backward-to-mark", _("jump backward to mark"), mem_fun(*this, &Editor::jump_backward_to_mark));
103 ActionManager::session_sensitive_actions.push_back (act);
104 act = ActionManager::register_action (editor_actions, "add-location-from-playhead", _("add location from playhead"), mem_fun(*this, &Editor::add_location_from_playhead_cursor));
105 ActionManager::session_sensitive_actions.push_back (act);
107 act = ActionManager::register_action (editor_actions, "nudge-forward", _("nudge forward"), bind (mem_fun(*this, &Editor::nudge_forward), false));
108 ActionManager::session_sensitive_actions.push_back (act);
109 act = ActionManager::register_action (editor_actions, "nudge-next-forward", _("nudge next forward"), bind (mem_fun(*this, &Editor::nudge_forward), true));
110 ActionManager::session_sensitive_actions.push_back (act);
111 act = ActionManager::register_action (editor_actions, "nudge-backward", _("nudge backward"), bind (mem_fun(*this, &Editor::nudge_backward), false));
112 ActionManager::session_sensitive_actions.push_back (act);
113 act = ActionManager::register_action (editor_actions, "nudge-next-backward", _("nudge next backward"), bind (mem_fun(*this, &Editor::nudge_backward), true));
114 ActionManager::session_sensitive_actions.push_back (act);
116 act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("zoom out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
117 ActionManager::session_sensitive_actions.push_back (act);
118 act = ActionManager::register_action (editor_actions, "temporal-zoom-in", _("zoom in"), bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
119 ActionManager::session_sensitive_actions.push_back (act);
120 act = ActionManager::register_action (editor_actions, "zoom-to-session", _("zoom to session"), mem_fun(*this, &Editor::temporal_zoom_session));
121 ActionManager::session_sensitive_actions.push_back (act);
123 act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("scroll tracks up"), mem_fun(*this, &Editor::scroll_tracks_up));
124 ActionManager::session_sensitive_actions.push_back (act);
125 act = ActionManager::register_action (editor_actions, "scroll-tracks-down", _("scroll tracks down"), mem_fun(*this, &Editor::scroll_tracks_down));
126 ActionManager::session_sensitive_actions.push_back (act);
127 act = ActionManager::register_action (editor_actions, "step-tracks-up", _("step tracks up"), mem_fun(*this, &Editor::scroll_tracks_up_line));
128 ActionManager::session_sensitive_actions.push_back (act);
129 act = ActionManager::register_action (editor_actions, "step-tracks-down", _("step tracks down"), mem_fun(*this, &Editor::scroll_tracks_down_line));
130 ActionManager::session_sensitive_actions.push_back (act);
132 act = ActionManager::register_action (editor_actions, "scroll-backward", _("scroll backward"), bind (mem_fun(*this, &Editor::scroll_backward), 0.8f));
133 ActionManager::session_sensitive_actions.push_back (act);
134 act = ActionManager::register_action (editor_actions, "scroll-forward", _("scroll forward"), bind (mem_fun(*this, &Editor::scroll_forward), 0.8f));
135 ActionManager::session_sensitive_actions.push_back (act);
136 act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame));
137 ActionManager::session_sensitive_actions.push_back (act);
138 act = ActionManager::register_action (editor_actions, "center-playhead", _("center playhead"), mem_fun(*this, &Editor::center_playhead));
139 ActionManager::session_sensitive_actions.push_back (act);
140 act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("center edit cursor"), mem_fun(*this, &Editor::center_edit_cursor));
141 ActionManager::session_sensitive_actions.push_back (act);
142 act = ActionManager::register_action (editor_actions, "playhead-forward", _("playhead forward"), mem_fun(*this, &Editor::playhead_forward));
143 ActionManager::session_sensitive_actions.push_back (act);
144 act = ActionManager::register_action (editor_actions, "playhead-backward", _("playhead backward"), mem_fun(*this, &Editor::playhead_backward));
145 ActionManager::session_sensitive_actions.push_back (act);
146 act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("playhead to edit"), bind (mem_fun(*this, &Editor::cursor_align), true));
147 ActionManager::session_sensitive_actions.push_back (act);
148 act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("edit to playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
149 ActionManager::session_sensitive_actions.push_back (act);
151 act = ActionManager::register_action (editor_actions, "align-regions-start", _("align regions start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start));
152 ActionManager::session_sensitive_actions.push_back (act);
153 act = ActionManager::register_action (editor_actions, "align-regions-start-relative", _("align regions start relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::Start));
154 ActionManager::session_sensitive_actions.push_back (act);
155 act = ActionManager::register_action (editor_actions, "align-regions-end", _("align regions end"), bind (mem_fun(*this, &Editor::align), ARDOUR::End));
156 ActionManager::session_sensitive_actions.push_back (act);
157 act = ActionManager::register_action (editor_actions, "align-regions-end-relative", _("align regions end relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::End));
158 ActionManager::session_sensitive_actions.push_back (act);
160 act = ActionManager::register_action (editor_actions, "align-regions-sync", _("align regions sync"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint));
161 ActionManager::session_sensitive_actions.push_back (act);
162 act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("align regions sync relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint));
163 ActionManager::session_sensitive_actions.push_back (act);
165 act = ActionManager::register_action (editor_actions, "audition-at-mouse", _("audition at mouse"), mem_fun(*this, &Editor::kbd_audition));
166 ActionManager::session_sensitive_actions.push_back (act);
167 act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("brush at mouse"), mem_fun(*this, &Editor::kbd_brush));
168 ActionManager::session_sensitive_actions.push_back (act);
169 act = ActionManager::register_action (editor_actions, "set-edit-cursor", _("set edit cursor"), mem_fun(*this, &Editor::kbd_set_edit_cursor));
170 ActionManager::session_sensitive_actions.push_back (act);
171 act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("mute/unmute region"), mem_fun(*this, &Editor::kbd_mute_unmute_region));
172 ActionManager::session_sensitive_actions.push_back (act);
173 act = ActionManager::register_action (editor_actions, "set-playhead", _("set playhead"), mem_fun(*this, &Editor::kbd_set_playhead_cursor));
174 ActionManager::session_sensitive_actions.push_back (act);
175 act = ActionManager::register_action (editor_actions, "split-region", _("split region"), mem_fun(*this, &Editor::kbd_split));
176 ActionManager::session_sensitive_actions.push_back (act);
177 act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("set region sync position"), mem_fun(*this, &Editor::kbd_set_sync_position));
178 ActionManager::session_sensitive_actions.push_back (act);
180 act = ActionManager::register_action (editor_actions, "undo", _("undo"), bind (mem_fun(*this, &Editor::undo), 1U));
181 ActionManager::session_sensitive_actions.push_back (act);
182 act = ActionManager::register_action (editor_actions, "redo", _("redo"), bind (mem_fun(*this, &Editor::redo), 1U));
183 ActionManager::session_sensitive_actions.push_back (act);
185 act = ActionManager::register_action (editor_actions, "export-session", _("export session"), mem_fun(*this, &Editor::export_session));
186 ActionManager::session_sensitive_actions.push_back (act);
187 act = ActionManager::register_action (editor_actions, "export-range", _("export range"), mem_fun(*this, &Editor::export_selection));
188 ActionManager::session_sensitive_actions.push_back (act);
190 act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut));
191 ActionManager::session_sensitive_actions.push_back (act);
192 act = ActionManager::register_action (editor_actions, "editor-copy", _("Copy"), mem_fun(*this, &Editor::copy));
193 ActionManager::session_sensitive_actions.push_back (act);
194 act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste));
195 ActionManager::session_sensitive_actions.push_back (act);
196 act = ActionManager::register_action (editor_actions, "duplicate-region", _("duplicate region"), mem_fun(*this, &Editor::keyboard_duplicate_region));
197 ActionManager::session_sensitive_actions.push_back (act);
198 act = ActionManager::register_action (editor_actions, "duplicate-range", _("duplicate range"), mem_fun(*this, &Editor::keyboard_duplicate_selection));
199 ActionManager::session_sensitive_actions.push_back (act);
200 act = ActionManager::register_action (editor_actions, "insert-region", _("insert region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection));
201 ActionManager::session_sensitive_actions.push_back (act);
202 act = ActionManager::register_action (editor_actions, "reverse-region", _("reverse region"), mem_fun(*this, &Editor::reverse_region));
203 ActionManager::session_sensitive_actions.push_back (act);
204 act = ActionManager::register_action (editor_actions, "normalize-region", _("normalize region"), mem_fun(*this, &Editor::normalize_region));
205 ActionManager::session_sensitive_actions.push_back (act);
206 act = ActionManager::register_action (editor_actions, "crop", _("crop"), mem_fun(*this, &Editor::crop_region_to_selection));
207 ActionManager::session_sensitive_actions.push_back (act);
208 act = ActionManager::register_action (editor_actions, "insert-chunk", _("insert chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f));
209 ActionManager::session_sensitive_actions.push_back (act);
211 act = ActionManager::register_action (editor_actions, "split-at-edit-cursor", _("split at edit cursor"), mem_fun(*this, &Editor::split_region));
212 ActionManager::edit_cursor_in_region_sensitive_actions.push_back (act);
214 act = ActionManager::register_action (editor_actions, "start-range", _("start range"), mem_fun(*this, &Editor::keyboard_selection_begin));
215 ActionManager::session_sensitive_actions.push_back (act);
216 act = ActionManager::register_action (editor_actions, "finish-range", _("finish range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), false));
217 ActionManager::session_sensitive_actions.push_back (act);
218 act = ActionManager::register_action (editor_actions, "finish-add-range", _("finish add range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), true));
219 ActionManager::session_sensitive_actions.push_back (act);
221 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));
222 ActionManager::session_sensitive_actions.push_back (act);
223 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));
224 ActionManager::session_sensitive_actions.push_back (act);
226 act = ActionManager::register_toggle_action (editor_actions, "ToggleFollowPlayhead", _("follow playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
227 ActionManager::session_sensitive_actions.push_back (act);
228 act = ActionManager::register_action (editor_actions, "remove-last-capture", _("remove last capture"), (mem_fun(*this, &Editor::remove_last_capture)));
229 ActionManager::session_sensitive_actions.push_back (act);
231 Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
232 RadioAction::Group zoom_group;
234 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("zoom focus left"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusLeft));
235 ActionManager::session_sensitive_actions.push_back (act);
236 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("zoom focus right"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusRight));
237 ActionManager::session_sensitive_actions.push_back (act);
238 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("zoom focus center"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusCenter));
239 ActionManager::session_sensitive_actions.push_back (act);
240 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("zoom focus playhead"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusPlayhead));
241 ActionManager::session_sensitive_actions.push_back (act);
242 ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("zoom focus edit"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusEdit));
243 ActionManager::session_sensitive_actions.push_back (act);
245 Glib::RefPtr<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
246 RadioAction::Group mouse_mode_group;
248 ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-object", _("set mouse mode object"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseObject, false));
249 ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-range", _("set mouse mode range"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseRange, false));
250 ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-gain", _("set mouse mode gain"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseGain, false));
251 ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-zoom", _("set mouse mode zoom"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseZoom, false));
252 ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("set mouse mode timefx"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseTimeFX, false));
254 Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
255 RadioAction::Group snap_choice_group;
257 ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap To"));
259 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-frame"), _("snap to frame"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToFrame)));
260 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("snap to cd frame"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToCDFrame)));
261 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-frame"), _("snap to smpte frame"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSMPTEFrame)));
262 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-seconds"), _("snap to smpte seconds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSMPTESeconds)));
263 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-minutes"), _("snap to smpte minutes"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSMPTEMinutes)));
264 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-seconds"), _("snap to seconds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSeconds)));
265 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-minutes"), _("snap to minutes"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToMinutes)));
266 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirtyseconds"), _("snap to thirtyseconds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAThirtysecondBeat)));
267 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-asixteenthbeat"), _("snap to asixteenthbeat"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToASixteenthBeat)));
268 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-eighths"), _("snap to eighths"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAEighthBeat)));
269 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-quarters"), _("snap to quarters"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAQuarterBeat)));
270 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirds"), _("snap to thirds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAThirdBeat)));
271 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-beat"), _("snap to beat"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToBeat)));
272 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-bar"), _("snap to bar"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToBar)));
273 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-mark"), _("snap to mark"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToMark)));
274 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-edit-cursor"), _("snap to edit cursor"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToEditCursor)));
275 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-start"), _("snap to region start"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionStart)));
276 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-end"), _("snap to region end"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionEnd)));
277 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("snap to region sync"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionSync)));
278 ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("snap to region boundary"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionBoundary)));
282 Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
283 RadioAction::Group sort_type_group;
284 RadioAction::Group sort_order_group;
286 /* the region list popup menu */
287 ActionManager::register_action (rl_actions, X_("RegionListSort"), _("Sort"));
289 act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
290 ActionManager::region_list_selection_sensitive_actions.push_back (act);
291 act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
292 ActionManager::region_list_selection_sensitive_actions.push_back (act);
293 act = ActionManager::register_action (rl_actions, X_("rlRemove"), _("Remove"), mem_fun (*this, &Editor::remove_region_from_region_list));
294 ActionManager::region_list_selection_sensitive_actions.push_back (act);
295 ActionManager::register_toggle_action (rl_actions, X_("rlShowAll"), _("Show all"), mem_fun(*this, &Editor::toggle_full_region_list));
296 ActionManager::register_toggle_action (rl_actions, X_("rlShowAuto"), _("Show automatic regions"), mem_fun(*this, &Editor::toggle_show_auto_regions));
298 ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortAscending"), _("Ascending"),
299 bind (mem_fun(*this, &Editor::reset_region_list_sort_direction), true));
300 ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"),
301 bind (mem_fun(*this, &Editor::reset_region_list_sort_direction), false));
303 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"), _("By Region Name"),
304 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByName));
305 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"), _("By Region Length"),
306 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByLength));
307 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionPosition"), _("By Region Position"),
308 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByPosition));
309 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionTimestamp"), _("By Region Timestamp"),
310 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByTimestamp));
311 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionStartinFile"), _("By Region Start in File"),
312 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByStartInFile));
313 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionEndinFile"), _("By Region End in File"),
314 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), ByEndInFile));
315 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileName"), _("By Source File Name"),
316 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileName));
317 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileLength"), _("By Source File Length"),
318 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileLength));
319 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFileCreationDate"), _("By Source File Creation Date"),
320 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileCreationDate));
321 ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
322 bind (mem_fun(*this, &Editor::reset_region_list_sort_type), BySourceFileFS));
324 act = ActionManager::register_action (rl_actions, X_("rlEmbedAudio"), _("Embed audio (link)"), mem_fun(*this, &Editor::embed_audio));
325 ActionManager::session_sensitive_actions.push_back (act);
326 act = ActionManager::register_action (rl_actions, X_("rlImportAudio"), _("Embed audio (link)"), bind (mem_fun(*this, &Editor::import_audio), false));
327 ActionManager::session_sensitive_actions.push_back (act);
329 ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformVisibility"), _("show waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
330 ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("show waveforms while recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
331 act = ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("show measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
333 RadioAction::Group meter_falloff_group;
334 RadioAction::Group meter_hold_group;
337 Slowest = 6.6dB/sec falloff at update rate of 40ms
338 Slow = 6.8dB/sec falloff at update rate of 40ms
341 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffOff"), _("off"), bind (mem_fun (*this, &Editor::set_meter_falloff), 0.0f));
342 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffSlowest"), _("slowest"), bind (mem_fun (*this, &Editor::set_meter_falloff), 0.266f));
343 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffSlow"), _("slow"), bind (mem_fun (*this, &Editor::set_meter_falloff), 0.342f));
344 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffMedium"), _("medium"), bind (mem_fun (*this, &Editor::set_meter_falloff), 0.7f));
345 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffFast"), _("fast"), bind (mem_fun (*this, &Editor::set_meter_falloff), 1.1f));
346 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffFaster"), _("faster"), bind (mem_fun (*this, &Editor::set_meter_falloff), 1.5f));
347 ActionManager::register_radio_action (editor_actions, meter_falloff_group, X_("MeterFalloffFastest"), _("fastest"), bind (mem_fun (*this, &Editor::set_meter_falloff), 2.5f));
349 ActionManager::register_radio_action (editor_actions, meter_hold_group, X_("MeterHoldOff"), _("off"), bind (mem_fun (*this, &Editor::set_meter_hold), 0));
350 ActionManager::register_radio_action (editor_actions, meter_hold_group, X_("MeterHoldShort"), _("short"), bind (mem_fun (*this, &Editor::set_meter_hold), 40));
351 ActionManager::register_radio_action (editor_actions, meter_hold_group, X_("MeterHoldMedium"), _("medium"), bind (mem_fun (*this, &Editor::set_meter_hold), 100));
352 ActionManager::register_radio_action (editor_actions, meter_hold_group, X_("MeterHoldLong"), _("long"), bind (mem_fun (*this, &Editor::set_meter_hold), 200));
354 ActionManager::add_action_group (rl_actions);
355 ActionManager::add_action_group (zoom_actions);
356 ActionManager::add_action_group (mouse_mode_actions);
357 ActionManager::add_action_group (snap_actions);
358 ActionManager::add_action_group (editor_actions);
362 Editor::toggle_waveform_visibility ()
364 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformVisibility"));
366 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
367 set_show_waveforms (tact->get_active());
372 Editor::toggle_waveforms_while_recording ()
374 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformVisibility"));
376 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
377 set_show_waveforms_recording (tact->get_active());
382 Editor::toggle_measure_visibility ()
384 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
386 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
387 set_show_measures (tact->get_active());