diff options
-rw-r--r-- | ardour.rc.in | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour.menus | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 21 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 3 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_options.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/editor_rulers.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/configuration_vars.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 4 |
14 files changed, 53 insertions, 13 deletions
diff --git a/ardour.rc.in b/ardour.rc.in index daf8333558..5e5043963a 100644 --- a/ardour.rc.in +++ b/ardour.rc.in @@ -20,6 +20,7 @@ <Option name="plugins-stop-with-transport" value="no"/> <Option name="no-sw-monitoring" value="no"/> <Option name="stop-recording-on-xrun" value="no"/> + <Option name="create-xrun-marker" value="no"/> <Option name="stop-at-session-end" value="no"/> <Option name="auto-xfade" value="yes"/> <Option name="crossfades-active" value="1"/> diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index a14b884539..03d3c83a61 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -428,6 +428,7 @@ <menuitem action='PeriodicSafetyBackups'/> <menuitem action='VerifyRemoveLastCapture'/> <menuitem action='StopRecordingOnXrun'/> + <menuitem action='CreateXrunMarker'/> <menuitem action='StopTransportAtEndOfSession'/> <menuitem action='GainReduceFastTransport'/> <menuitem action='PrimaryClockDeltaEditCursor'/> diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index cbb39d5e8b..b9b38d650a 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2917,16 +2917,33 @@ ARDOUR_UI::keyboard_settings () const } void -ARDOUR_UI::halt_on_xrun_message () +ARDOUR_UI::create_xrun_marker(nframes_t where) { - ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::halt_on_xrun_message)); + ENSURE_GUI_THREAD (bind(mem_fun(*this, &ARDOUR_UI::create_xrun_marker), where)); + editor->mouse_add_new_marker (where, false, true); +} +void +ARDOUR_UI::halt_on_xrun_message () +{ MessageDialog msg (*editor, _("Recording was stopped because your system could not keep up.")); msg.run (); } void +ARDOUR_UI::xrun_handler(nframes_t where) +{ + if (Config->get_create_xrun_marker() && session->actively_recording()) { + create_xrun_marker(where); + } + + if (Config->get_stop_recording_on_xrun() && session->actively_recording()) { + halt_on_xrun_message (); + } +} + +void ARDOUR_UI::disk_overrun_handler () { ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler)); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 284c3dc1da..aa826908ea 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -193,6 +193,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI void do_transport_locate (nframes_t position); void halt_on_xrun_message (); + void xrun_handler (nframes_t); + void create_xrun_marker (nframes_t); AudioClock primary_clock; AudioClock secondary_clock; @@ -712,6 +714,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI void toggle_VerifyRemoveLastCapture(); void toggle_PeriodicSafetyBackups(); void toggle_StopRecordingOnXrun(); + void toggle_CreateXrunMarker(); void toggle_StopTransportAtEndOfSession(); void toggle_GainReduceFastTransport(); void toggle_LatchedSolo(); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index aa3455b7da..1fe21b7cb1 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -50,7 +50,7 @@ ARDOUR_UI::connect_to_session (Session *s) { session = s; - session->HaltOnXrun.connect (mem_fun(*this, &ARDOUR_UI::halt_on_xrun_message)); + session->Xrun.connect (mem_fun(*this, &ARDOUR_UI::xrun_handler)); session->RecordStateChanged.connect (mem_fun (*this, &ARDOUR_UI::record_state_changed)); /* sensitize menu bar options that are now valid */ diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 4b375d0654..063a579d25 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -420,6 +420,7 @@ ARDOUR_UI::install_actions () ActionManager::register_toggle_action (option_actions, X_("VerifyRemoveLastCapture"), _("Verify remove last capture"), mem_fun (*this, &ARDOUR_UI::toggle_VerifyRemoveLastCapture)); ActionManager::register_toggle_action (option_actions, X_("PeriodicSafetyBackups"), _("Make periodic safety backups"), mem_fun (*this, &ARDOUR_UI::toggle_PeriodicSafetyBackups)); ActionManager::register_toggle_action (option_actions, X_("StopRecordingOnXrun"), _("Stop recording on xrun"), mem_fun (*this, &ARDOUR_UI::toggle_StopRecordingOnXrun)); + ActionManager::register_toggle_action (option_actions, X_("CreateXrunMarker"), _("Create marker at xrun location"), mem_fun (*this, &ARDOUR_UI::toggle_CreateXrunMarker)); ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession)); ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport)); ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable)); diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index e1fbe42d83..f70fbe8744 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -466,6 +466,12 @@ ARDOUR_UI::toggle_StopRecordingOnXrun() } void +ARDOUR_UI::toggle_CreateXrunMarker() +{ + ActionManager::toggle_config_state ("options", "CreateXrunMarker", &Configuration::set_create_xrun_marker, &Configuration::get_create_xrun_marker); +} + +void ARDOUR_UI::toggle_sync_order_keys () { ActionManager::toggle_config_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::set_sync_all_route_ordering, &Configuration::get_sync_all_route_ordering); @@ -1047,6 +1053,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name) ActionManager::map_some_state ("options", "PeriodicSafetyBackups", &Configuration::get_periodic_safety_backups); } else if (PARAM_IS ("stop-recording-on-xrun")) { ActionManager::map_some_state ("options", "StopRecordingOnXrun", &Configuration::get_stop_recording_on_xrun); + } else if (PARAM_IS ("create-xrun-marker")) { + ActionManager::map_some_state ("options", "CreateXrunMarker", &Configuration::get_create_xrun_marker); } else if (PARAM_IS ("sync-all-route-ordering")) { ActionManager::map_some_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::get_sync_all_route_ordering); } else if (PARAM_IS ("stop-at-session-end")) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 892506941f..54e7ca6adf 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -456,7 +456,7 @@ class Editor : public PublicEditor void hide_marker (ArdourCanvas::Item*, GdkEvent*); void clear_marker_display (); - void mouse_add_new_marker (nframes_t where, bool is_cd=false); + void mouse_add_new_marker (nframes_t where, bool is_cd=false, bool is_xrun=false); void update_cd_marker_display (); void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 300cfe3cf7..583040d71e 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -388,13 +388,20 @@ Editor::LocationMarkers::set_color_rgba (uint32_t rgba) } void -Editor::mouse_add_new_marker (nframes_t where, bool is_cd) +Editor::mouse_add_new_marker (nframes_t where, bool is_cd, bool is_xrun) { - string markername; + string markername, markerprefix; int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark); - + + if (is_xrun) { + markerprefix = "xrun"; + flags = Location::IsMark; + } else { + markerprefix = "mark"; + } + if (session) { - session->locations()->next_available_name(markername,"mark"); + session->locations()->next_available_name(markername, markerprefix); Location *location = new Location (where, where, markername, (Location::Flags) flags); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 9b8bf5beeb..74fd0aff7e 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -363,7 +363,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t) switch (t) { case MarkerBarItem: - ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, false))); + ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, false, false))); ruler_items.push_back (MenuElem (_("Clear all locations"), mem_fun(*this, &Editor::clear_markers))); ruler_items.push_back (MenuElem (_("Unhide locations"), mem_fun(*this, &Editor::unhide_markers))); ruler_items.push_back (SeparatorElem ()); @@ -381,7 +381,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t) case CdMarkerBarItem: // TODO - ruler_items.push_back (MenuElem (_("New CD track marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, true))); + ruler_items.push_back (MenuElem (_("New CD track marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, true, false))); break; diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 7e3b55e44d..787cdcbdc3 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -158,6 +158,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway virtual nframes64_t get_preferred_edit_position (bool ignore_playhead = false) = 0; virtual void toggle_meter_updating() = 0; virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret) = 0; + virtual void mouse_add_new_marker (nframes_t where, bool is_cd=false, bool is_xrun=false) = 0; sigc::signal<void> ZoomFocusChanged; sigc::signal<void> ZoomChanged; diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h index cb045091ef..d6c87a59af 100644 --- a/libs/ardour/ardour/configuration_vars.h +++ b/libs/ardour/ardour/configuration_vars.h @@ -105,6 +105,7 @@ CONFIG_VARIABLE (bool, punch_out, "punch-out", false) CONFIG_VARIABLE (bool, plugins_stop_with_transport, "plugins-stop-with-transport", false) CONFIG_VARIABLE (bool, do_not_record_plugins, "do-not-record-plugins", false) CONFIG_VARIABLE (bool, stop_recording_on_xrun, "stop-recording-on-xrun", false) +CONFIG_VARIABLE (bool, create_xrun_marker, "create-xrun-marker", false) CONFIG_VARIABLE (bool, stop_at_session_end, "stop-at-session-end", true) CONFIG_VARIABLE (bool, seamless_loop, "seamless-loop", false) CONFIG_VARIABLE (nframes_t, preroll, "preroll", 0) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 9ad291662d..2889e73c38 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -346,7 +346,7 @@ class Session : public PBD::StatefulDestructible sigc::signal<void> TransportStateChange; /* generic */ sigc::signal<void,nframes_t> PositionChanged; /* sent after any non-sequential motion */ sigc::signal<void> DurationChanged; - sigc::signal<void> HaltOnXrun; + sigc::signal<void,nframes_t> Xrun; sigc::signal<void> TransportLooped; sigc::signal<void,RouteList&> RouteAdded; diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 9aeb5a0e57..1c44830954 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1229,9 +1229,9 @@ Session::engine_halted () void Session::xrun_recovery () { - if (Config->get_stop_recording_on_xrun() && actively_recording()) { + Xrun (transport_frame()); //EMIT SIGNAL - HaltOnXrun (); /* EMIT SIGNAL */ + if (Config->get_stop_recording_on_xrun() && actively_recording()) { /* it didn't actually halt, but we need to handle things in the same way. |