Remove unused punch+preroll API
authorRobin Gareus <robin@gareus.org>
Fri, 29 Sep 2017 19:01:50 +0000 (21:01 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 29 Sep 2017 19:02:22 +0000 (21:02 +0200)
This API was not used, also superseded by record w/preroll.

libs/ardour/ardour/session.h
libs/ardour/ardour/session_event.h
libs/ardour/disk_writer.cc
libs/ardour/route.cc
libs/ardour/session.cc
libs/ardour/session_process.cc
libs/ardour/session_transport.cc

index a725fdc8028b5a3285802d3bf29db96b48c7a2db..788e5bc4e75128bffe410ffba486a9a33a4d1290 100644 (file)
@@ -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<samplepos_t> _range_selection;
        Evoral::Range<samplepos_t> _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;
 
index 86ea42564586620d14272bb8f6397eda0f814a06..cdcf73d4a4243db95725f437df970db7a8a03c92 100644 (file)
@@ -46,7 +46,6 @@ public:
                SetLoop,
                PunchIn,
                PunchOut,
-               RecordStart,
                RangeStop,
                RangeLocate,
                Overwrite,
index a3cfc69b1b821c6aae214433a033560d8395e67e..dd256ab6b070768f2b11a485790e044536460317 100644 (file)
@@ -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
index 85ed7a1fd89a454764fbcd86cffe05e1e70e3f7d..d800dd5b983673e3dd240f9435b380bd9bed461c 100644 (file)
@@ -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();
index 3d942c6f43e37c75bf5861ab0aacdc75efe906e9..1f6cb14698c72f81c28aa2f16ba7adb5f5d47930 100644 (file)
@@ -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) {
index ed5422cf07a189f5c8495d01d0ff350719f9a8e3..a7db77c71610900bc0e277fc0a9bf5a062737311 100644 (file)
@@ -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());
 
index 07782750e3e18efd66c8ff7b0625ab7d9cbd06c6..05c6e2f2a9f91df56db12188cd7982c54700cde0 100644 (file)
@@ -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;