Remove unused CubicInterpolation from session
[ardour.git] / libs / ardour / session_process.cc
index fe946f865d6f08307687ff17ed766d54c88f86a1..eeb8cb871e905cefaf6d654a3ee26a2d35979132 100644 (file)
@@ -136,7 +136,6 @@ Session::no_roll (pframes_t nframes)
 
        samplepos_t end_sample = _transport_sample + nframes; // FIXME: varispeed + no_roll ??
        int ret = 0;
-       int declick = (config.get_use_transport_fades() ? get_transport_declick_required() : false);
        boost::shared_ptr<RouteList> r = routes.reader ();
 
        if (_click_io) {
@@ -152,7 +151,7 @@ Session::no_roll (pframes_t nframes)
 
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
-               _process_graph->routes_no_roll( nframes, _transport_sample, end_sample, non_realtime_work_pending(), declick);
+               _process_graph->routes_no_roll( nframes, _transport_sample, end_sample, non_realtime_work_pending());
        } else {
                PT_TIMING_CHECK (10);
                for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
@@ -161,8 +160,6 @@ Session::no_roll (pframes_t nframes)
                                continue;
                        }
 
-                       (*i)->set_pending_declick (declick);
-
                        if ((*i)->no_roll (nframes, _transport_sample, end_sample, non_realtime_work_pending())) {
                                error << string_compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
                                ret = -1;
@@ -182,7 +179,6 @@ Session::no_roll (pframes_t nframes)
 int
 Session::process_routes (pframes_t nframes, bool& need_butler)
 {
-       int declick = (config.get_use_transport_fades() ? get_transport_declick_required() : false);
        boost::shared_ptr<RouteList> r = routes.reader ();
 
        const samplepos_t start_sample = _transport_sample;
@@ -197,7 +193,7 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
 
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
-               if (_process_graph->process_routes (nframes, start_sample, end_sample, declick, need_butler) < 0) {
+               if (_process_graph->process_routes (nframes, start_sample, end_sample, need_butler) < 0) {
                        stop_transport ();
                        return -1;
                }
@@ -211,11 +207,9 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
                                continue;
                        }
 
-                       (*i)->set_pending_declick (declick);
-
                        bool b = false;
 
-                       if ((ret = (*i)->roll (nframes, start_sample, end_sample, declick, b)) < 0) {
+                       if ((ret = (*i)->roll (nframes, start_sample, end_sample, b)) < 0) {
                                stop_transport ();
                                return -1;
                        }
@@ -369,8 +363,6 @@ Session::process_with_events (pframes_t nframes)
                        set_next_event ();
                }
 
-               check_declick_out ();
-
                if (nframes == 0) {
                        return;
                } else {
@@ -433,16 +425,9 @@ Session::process_with_events (pframes_t nframes)
                }
        }
 
-       if (_transport_speed == 1.0) {
-               samples_moved = (samplecnt_t) nframes;
-       } else {
-               /* use a cubic midi interpolation to compute the number of
-                * samples we will move at the current speed.
-                */
-               CubicInterpolation interp;
-               interp.set_speed (_transport_speed);
-               samples_moved = interp.distance (nframes);
-       }
+       assert (_transport_speed == 0 || _transport_speed == 1.0 || _transport_speed == -1.0);
+
+       samples_moved = (samplecnt_t) nframes * _transport_speed;
 
        end_sample = _transport_sample + samples_moved;
 
@@ -521,7 +506,6 @@ Session::process_with_events (pframes_t nframes)
                                }
 
                                maybe_stop (stop_limit);
-                               check_declick_out ();
                        }
 
                        if (nframes > 0) {
@@ -887,12 +871,8 @@ Session::process_without_events (pframes_t nframes)
                return;
        }
 
-       if (_transport_speed == 1.0) {
-               samples_moved = (samplecnt_t) nframes;
-       } else {
-               interpolation.set_speed (_transport_speed);
-               samples_moved = interpolation.distance (nframes);
-       }
+       assert (_transport_speed == 1.f || _transport_speed == -1.f);
+       samples_moved = (samplecnt_t) nframes * _transport_speed;
 
        if (!_exporting && !timecode_transmission_suspended()) {
                send_midi_time_code_for_cycle (_transport_sample, _transport_sample + samples_moved, nframes);
@@ -927,7 +907,6 @@ Session::process_without_events (pframes_t nframes)
        }
 
        maybe_stop (stop_limit);
-       check_declick_out ();
 
        if (session_needs_butler) {
                DEBUG_TRACE (DEBUG::Butler, "p-without-events: session needs butler, call it\n");
@@ -960,7 +939,7 @@ Session::process_audition (pframes_t nframes)
        /* if using a monitor section, run it because otherwise we don't hear anything */
 
        if (_monitor_out && auditioner->needs_monitor()) {
-               _monitor_out->monitor_run (_transport_sample, _transport_sample + nframes, nframes, false);
+               _monitor_out->monitor_run (_transport_sample, _transport_sample + nframes, nframes);
        }
 
        /* handle pending events */
@@ -1109,17 +1088,6 @@ Session::process_event (SessionEvent* ev)
                del = false;
                break;
 
-       case SessionEvent::AutoLoopDeclick:
-               if (play_loop) {
-                       /* Request a declick fade-out and a fade-in; the fade-out will happen
-                          at the end of the loop, and the fade-in at the start.
-                       */
-                       transport_sub_state |= (PendingLoopDeclickOut | PendingLoopDeclickIn);
-               }
-               remove = false;
-               del = false;
-               break;
-
        case SessionEvent::Locate:
                if (ev->yes_or_no) { /* force locate */
                        /* args: do not roll after locate, do flush, not with loop */