diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-31 15:51:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-31 15:51:03 +0000 |
commit | 9643eb4b2320c2ec77613cddd6a66056514bcdfa (patch) | |
tree | 838d6420ae792bf98df7dd0fb313ba6c0c2f00c8 /libs | |
parent | ed48cdb3dfd10e27558d2d1063049b625830b049 (diff) |
a) persist whether the end marker should move at first capture in the session file
b) prevent transport motion if stop-at-session-end is true
c) ensure that (more) menu items that provide control over Configuration object options are in the correct state at startup
d) Configuration options removed from "have a session" sensitivity toggling
e) removed functionally empty default_keys.cc
git-svn-id: svn://localhost/trunk/ardour2@433 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/route.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 10 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 56 |
3 files changed, 43 insertions, 25 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index f8905eb43d..d338cee277 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -625,7 +625,7 @@ Route::process_output_buffers (vector<Sample*>& bufs, uint32_t nbufs, if (_session.transport_speed() > 1.5f || _session.transport_speed() < -1.5f) { pan (bufs, nbufs, nframes, offset, speed_quietning); } else { - // cerr << "panner state = " << _panner->automation_state() << endl; + // cerr << _name << " panner state = " << _panner->automation_state() << endl; if (!_panner->empty() && (_panner->automation_state() & Play || ((_panner->automation_state() & Touch) && !_panner->touching()))) { diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6523636345..5301019fa0 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -155,6 +155,7 @@ Session::first_stage_init (string fullpath, string snapshot_name) _solo_model = InverseMute; solo_update_disabled = false; currently_soloing = false; + _have_captured = false; _worst_output_latency = 0; _worst_input_latency = 0; _worst_track_latency = 0; @@ -183,7 +184,6 @@ Session::first_stage_init (string fullpath, string snapshot_name) _master_out = 0; input_auto_connect = AutoConnectOption (0); output_auto_connect = AutoConnectOption (0); - _have_captured = false; waiting_to_start = false; _exporting = false; _gain_automation_buffer = 0; @@ -1023,6 +1023,12 @@ Session::load_options (const XMLNode& node) } } + if ((child = find_named_node (node, "end-marker-is-free")) != 0) { + if ((prop = child->property ("val")) != 0) { + _end_location_is_free = (prop->value() == "yes"); + } + } + if ((child = find_named_node (node, "layer-model")) != 0) { if ((prop = child->property ("val")) != 0) { if (prop->value() == X_("LaterHigher")) { @@ -1208,6 +1214,8 @@ Session::get_options () const child->add_property ("val", get_crossfades_active () ? "yes" : "no"); child = opthead->add_child ("audible-click"); child->add_property ("val", get_clicking () ? "yes" : "no"); + child = opthead->add_child ("end-marker-is-free"); + child->add_property ("val", _end_location_is_free ? "yes" : "no"); if (click_sound.length()) { child = opthead->add_child ("click-sound"); diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 2f9f8257f9..2e12c58f65 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -165,22 +165,11 @@ Session::realtime_stop (bool abort) decrement_transport_position (_worst_output_latency); #endif - if (_transport_frame > current_end_frame()) { - - /* first capture resets end location; later captures can only extend the length */ - - if (_end_location_is_free) { - end_location->set_end (_transport_frame); - _end_location_is_free = false; - } else if (_transport_frame > end_location->start()) { - end_location->set_end (_transport_frame); - } + /* the duration change is not guaranteed to have happened, but is likely */ - post_transport_work = PostTransportWork (post_transport_work | PostTransportDuration); - } + post_transport_work = PostTransportWork (post_transport_work | PostTransportDuration); } - if (abort) { post_transport_work = PostTransportWork (post_transport_work | PostTransportAbort); } @@ -307,21 +296,34 @@ Session::non_realtime_stop (bool abort) if (did_record) { begin_reversible_command ("capture"); - + Location* loc = _locations.end_location(); + bool change_end = false; - if (loc && !_have_captured) { - - /* first capture. - - note: later captures that extend the session length get - handled because of playlist length changes. - */ + if (_transport_frame < loc->end()) { + + /* stopped recording before current end */ + + if (_end_location_is_free) { + + /* first capture for this session, move end back to where we are */ + + change_end = true; + } + + } else if (_transport_frame > loc->end()) { - add_undo (sigc::retype_return<void>(sigc::bind (mem_fun (*loc, &Location::set_end), loc->end()))); - add_redo (sigc::retype_return<void>(sigc::bind (mem_fun (*loc, &Location::set_end), _transport_frame))); + /* stopped recording after the current end, extend it */ + + change_end = true; + } + + if (change_end) { + add_undo (sigc::retype_return<void>(sigc::bind (mem_fun (*loc, &Location::set_end), loc->end()))); + add_redo (sigc::retype_return<void>(sigc::bind (mem_fun (*loc, &Location::set_end), _transport_frame))); } + _end_location_is_free = false; _have_captured = true; } @@ -718,6 +720,10 @@ Session::set_transport_speed (float speed, bool abort) } else if (transport_stopped() && speed == 1.0) { + if (Config->get_stop_at_session_end() && _transport_frame >= current_end_frame()) { + return; + } + if (Config->get_use_hardware_monitoring()) { /* Even though this is called from RT context we are using a non-tentative rwlock here, because the action must occur. @@ -740,6 +746,10 @@ Session::set_transport_speed (float speed, bool abort) } else { + if (Config->get_stop_at_session_end() && _transport_frame >= current_end_frame()) { + return; + } + if ((synced_to_jack()) && speed != 0.0 && speed != 1.0) { warning << _("Global varispeed cannot be supported while Ardour is connected to JACK transport control") << endmsg; |