From ccedb2d44e808f8d66f7e8de2a62385497dbc887 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 29 Sep 2017 21:01:50 +0200 Subject: Remove unused punch+preroll API This API was not used, also superseded by record w/preroll. --- libs/ardour/ardour/session.h | 6 ------ libs/ardour/ardour/session_event.h | 1 - libs/ardour/disk_writer.cc | 2 +- libs/ardour/route.cc | 2 +- libs/ardour/session.cc | 6 ++---- libs/ardour/session_process.cc | 16 ++-------------- libs/ardour/session_transport.cc | 33 +-------------------------------- 7 files changed, 7 insertions(+), 59 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index a725fdc802..788e5bc4e7 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1011,13 +1011,9 @@ public: /* preroll */ samplecnt_t preroll_samples (samplepos_t) const; - void request_preroll_record_punch (samplepos_t start, samplecnt_t preroll); void request_preroll_record_trim (samplepos_t start, samplecnt_t preroll); void request_count_in_record (); - samplepos_t preroll_record_punch_pos () const { return _preroll_record_punch_pos; } - bool preroll_record_punch_enabled () const { return _preroll_record_punch_pos >= 0; } - samplecnt_t preroll_record_trim_len () const { return _preroll_record_trim_len; } /* temporary hacks to allow selection to be pushed from GUI into backend. @@ -1945,10 +1941,8 @@ private: Evoral::Range _range_selection; Evoral::Range _object_selection; - void unset_preroll_record_punch (); void unset_preroll_record_trim (); - samplepos_t _preroll_record_punch_pos; samplecnt_t _preroll_record_trim_len; bool _count_in_once; diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index 86ea425645..cdcf73d4a4 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -46,7 +46,6 @@ public: SetLoop, PunchIn, PunchOut, - RecordStart, RangeStop, RangeLocate, Overwrite, diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index a3cfc69b1b..dd256ab6b0 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -400,7 +400,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp get_location_times (loop_loc, &loop_start, &loop_end, &loop_length); } - if (nominally_recording || (re && was_recording && _session.get_record_enabled() && (_session.config.get_punch_in() || _session.preroll_record_punch_enabled()))) { + if (nominally_recording || (re && was_recording && _session.get_record_enabled() && _session.config.get_punch_in ())) { Evoral::OverlapType ot = Evoral::coverage (first_recordable_sample, last_recordable_sample, start_sample, end_sample); // XXX should this be transport_sample + nframes - 1 ? coverage() expects its parameter ranges to include their end points diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 85ed7a1fd8..d800dd5b98 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5977,7 +5977,7 @@ Route::monitoring_state () const * rg: I suspect this is not the case: monitoring may differ */ - if (_session.config.get_punch_in() || _session.config.get_punch_out() || _session.preroll_record_punch_enabled ()) { + if (_session.config.get_punch_in() || _session.config.get_punch_out()) { session_rec = _session.actively_recording (); } else { session_rec = _session.get_record_enabled(); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 3d942c6f43..1f6cb14698 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -311,7 +311,6 @@ Session::Session (AudioEngine &eng, , _play_range (false) , _range_selection (-1,-1) , _object_selection (-1,-1) - , _preroll_record_punch_pos (-1) , _preroll_record_trim_len (0) , _count_in_once (false) , main_outs (0) @@ -851,7 +850,6 @@ Session::destroy () case SessionEvent::Skip: case SessionEvent::PunchIn: case SessionEvent::PunchOut: - case SessionEvent::RecordStart: case SessionEvent::StopOnce: case SessionEvent::RangeStop: case SessionEvent::RangeLocate: @@ -2158,7 +2156,7 @@ Session::maybe_enable_record (bool rt_context) } if (_transport_speed) { - if (!config.get_punch_in() && !preroll_record_punch_enabled ()) { + if (!config.get_punch_in()) { enable_record (); } } else { @@ -3416,7 +3414,7 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i } /* set this name in the XML description that we are about to use */ - +#warning fixme -- no more Diskstream if (pd == CopyPlaylist) { XMLNode* ds_node = find_named_node (node_copy, "Diskstream"); if (ds_node) { diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index ed5422cf07..a7db77c716 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -1146,7 +1146,7 @@ Session::process_event (SessionEvent* ev) case SessionEvent::PunchIn: // cerr << "PunchIN at " << transport_sample() << endl; - if (config.get_punch_in() && record_status() == Enabled && !preroll_record_punch_enabled()) { + if (config.get_punch_in() && record_status() == Enabled) { enable_record (); } remove = false; @@ -1155,21 +1155,13 @@ Session::process_event (SessionEvent* ev) case SessionEvent::PunchOut: // cerr << "PunchOUT at " << transport_sample() << endl; - if (config.get_punch_out() && !preroll_record_punch_enabled()) { + if (config.get_punch_out()) { step_back_from_record (); } remove = false; del = false; break; - case SessionEvent::RecordStart: - if (preroll_record_punch_enabled() && record_status() == Enabled) { - enable_record (); - } - remove = false; - del = false; - break; - case SessionEvent::StopOnce: if (!non_realtime_work_pending()) { _clear_event_type (SessionEvent::StopOnce); @@ -1260,10 +1252,6 @@ Session::compute_stop_limit () const return max_samplepos; } - if (preroll_record_punch_enabled ()) { - return max_samplepos; - } - bool const punching_in = (config.get_punch_in () && _locations->auto_punch_location()); bool const punching_out = (config.get_punch_out () && _locations->auto_punch_location()); diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 07782750e3..05c6e2f2a9 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -148,49 +148,18 @@ Session::force_locate (samplepos_t target_sample, bool with_roll) queue_event (ev); } -void -Session::unset_preroll_record_punch () -{ - if (_preroll_record_punch_pos >= 0) { - remove_event (_preroll_record_punch_pos, SessionEvent::RecordStart); - } - _preroll_record_punch_pos = -1; -} - void Session::unset_preroll_record_trim () { _preroll_record_trim_len = 0; } -void -Session::request_preroll_record_punch (samplepos_t rec_in, samplecnt_t preroll) -{ - if (actively_recording ()) { - return; - } - unset_preroll_record_punch (); - unset_preroll_record_trim (); - samplepos_t start = std::max ((samplepos_t)0, rec_in - preroll); - - _preroll_record_punch_pos = rec_in; - if (_preroll_record_punch_pos >= 0) { - replace_event (SessionEvent::RecordStart, _preroll_record_punch_pos); - config.set_punch_in (false); - config.set_punch_out (false); - } - maybe_enable_record (); - request_locate (start, true); - set_requested_return_sample (rec_in); -} - void Session::request_preroll_record_trim (samplepos_t rec_in, samplecnt_t preroll) { if (actively_recording ()) { return; } - unset_preroll_record_punch (); unset_preroll_record_trim (); config.set_punch_in (false); @@ -1679,7 +1648,7 @@ Session::start_transport () switch (record_status()) { case Enabled: - if (!config.get_punch_in() && !preroll_record_punch_enabled()) { + if (!config.get_punch_in()) { enable_record (); } break; -- cgit v1.2.3