/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
RefPtr<Action> act;
editor_actions = ActionGroup::create (X_("Editor"));
-
+
/* non-operative menu items for menu bar */
ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align"));
ActionManager::session_sensitive_actions.push_back (act);
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));
ActionManager::session_sensitive_actions.push_back (act);
-
+
act = ActionManager::register_action (editor_actions, "select-next-route", _("Select Next Track/Bus"), mem_fun(*this, &Editor::select_next_route));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "select-prev-route", _("Select Previous Track/Bus"), mem_fun(*this, &Editor::select_prev_route));
ActionManager::session_sensitive_actions.push_back (act);
-
+
act = ActionManager::register_action (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), mem_fun(*this, &Editor::toggle_record_enable));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "add-range-markers-from-region", _("Add Range Marker(s)"), mem_fun(*this, &Editor::add_locations_from_audio_region));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
-
+
act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "toggle-fade-in-active", _("Toggle Fade In Active"), bind (mem_fun(*this, &Editor::toggle_fade_active), true));
act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
-
+
act = ActionManager::register_action (editor_actions, "set-tempo-from-region", _("Set Tempo from Region=Bar"), mem_fun(*this, &Editor::use_region_as_bar));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "insert-chunk", _("Insert Chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "split-at-edit-cursor", _("Split At Edit Point"), mem_fun(*this, &Editor::split_region));
- ActionManager::edit_point_in_region_sensitive_actions.push_back (act);
-
act = ActionManager::register_action (editor_actions, "start-range", _("Start Range"), mem_fun(*this, &Editor::keyboard_selection_begin));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "finish-range", _("Finish Range"), bind (mem_fun(*this, &Editor::keyboard_selection_finish), false));
mouse_timefx_button.set_image (*(manage (new Image (::get_icon("tool_stretch")))));
mouse_timefx_button.set_label ("");
mouse_timefx_button.set_name ("MouseModeButton");
-
+
ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), bind (mem_fun(*this, &Editor::step_mouse_mode), true));
-
+
act = ActionManager::register_toggle_action (mouse_mode_actions, "toggle-internal-edit", _("Edit MIDI"), mem_fun(*this, &Editor::toggle_internal_editing));
act->connect_proxy (internal_edit_button);
internal_edit_button.set_image (*(manage (new Image (::get_icon("tool_note")))));
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
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)));
- ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
- ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
+ ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change Edit Point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
+ ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
if (!Profile->get_sae()) {
ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), bind (mem_fun (*this, &Editor::set_edit_mode), Splice));
}
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)));
/* RULERS */
-
+
Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers"));
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)));
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)));
}
ruler_samples_action->set_active (false);
no_ruler_shown_update = false;
-
+
/* REGION LIST */
Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList"));
bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), true));
ActionManager::register_radio_action (rl_actions, sort_order_group, X_("SortDescending"), _("Descending"),
bind (mem_fun (*_regions, &EditorRegions::reset_sort_direction), false));
-
+
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionName"), _("By Region Name"),
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), ByName, false));
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortByRegionLength"), _("By Region Length"),
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileCreationDate, false));
ActionManager::register_radio_action (rl_actions, sort_type_group, X_("SortBySourceFilesystem"), _("By Source Filesystem"),
bind (mem_fun (*_regions, &EditorRegions::reset_sort_type), BySourceFileFS, false));
-
+
/* the next two are duplicate items with different names for use in two different contexts */
act = ActionManager::register_action (editor_actions, X_("addExistingAudioFiles"), _("Import"), mem_fun (*this, &Editor::external_audio_dialog));
ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::write_sensitive_actions.push_back (act);
+
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Import to Region List"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
ActionManager::session_sensitive_actions.push_back (act);
-
- ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
+ ActionManager::write_sensitive_actions.push_back (act);
+
+ act = ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
+ ActionManager::write_sensitive_actions.push_back (act);
ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
ActionManager::register_toggle_action (editor_actions, X_("ToggleSummary"), _("Show Summary"), mem_fun (*this, &Editor::set_summary));
ActionManager::register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), mem_fun (*this, &Editor::set_group_tabs));
-
+
ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
-
+
/* if there is a logo in the editor canvas, its always visible at startup */
act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
tact->set_active (true);
+ /* MIDI */
+
+ Glib::RefPtr<ActionGroup> midi_actions = ActionGroup::create (X_("MIDI"));
+ ActionManager::register_action (midi_actions, X_("panic"), _("Panic"), mem_fun(*this, &Editor::midi_panic));
+
ActionManager::add_action_group (rl_actions);
ActionManager::add_action_group (ruler_actions);
ActionManager::add_action_group (zoom_actions);
ActionManager::add_action_group (mouse_mode_actions);
ActionManager::add_action_group (snap_actions);
ActionManager::add_action_group (editor_actions);
+ ActionManager::add_action_group (midi_actions);
}
void
const char* action = 0;
RefPtr<Action> act;
-
+
switch (type) {
case Editing::SnapToCDFrame:
action = "snap-to-cd-frame";
{
const char* action = 0;
RefPtr<Action> act;
-
+
switch (mode) {
case Editing::SnapOff:
action = X_("snap-off");
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
/*NOTREACHED*/
}
-
+
act = ActionManager::get_action (X_("Editor"), action);
-
+
if (act) {
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
return ract;
-
+
} else {
error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
return RefPtr<RadioAction> ();
{
const char* action = 0;
RefPtr<Action> act;
-
+
switch (ep) {
case Editing::EditAtPlayhead:
action = X_("edit-at-playhead");
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
/*NOTREACHED*/
}
-
+
act = ActionManager::get_action (X_("Editor"), action);
-
+
if (act) {
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
return ract;
-
+
} else {
error << string_compose (_("programming error: %1: %2"), "Editor::edit_point_action could not find action to match edit point.", action) << endmsg;
return RefPtr<RadioAction> ();
{
const char* action = 0;
RefPtr<Action> act;
-
+
switch (focus) {
case ZoomFocusLeft:
action = X_("zoom-focus-left");
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
/*NOTREACHED*/
}
-
+
act = ActionManager::get_action (X_("Zoom"), action);
-
+
if (act) {
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
return ract;
} else if (p == "show-track-meters") {
toggle_meter_updating();
} else if (p == "show-summary") {
-
+
bool const s = session->config.get_show_summary ();
if (s) {
_summary->show ();
onoff = true;
}
- for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
+ for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin();
x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) {
(*x)->set_sensitive (onoff);
}