smooth 0.5 second fade out during quit, plus MIDI panic to turn everything off (someo...
[ardour.git] / libs / ardour / session_process.cc
index 29ce370d7f35098b1337c7148dbb10b444c2edb6..585d0927f27fd0311817ce4edb749d85d9fab74c 100644 (file)
@@ -109,7 +109,7 @@ Session::no_roll (pframes_t nframes)
        
        framepos_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
        int ret = 0;
-       bool declick = get_transport_declick_required();
+       int declick = get_transport_declick_required();
        boost::shared_ptr<RouteList> r = routes.reader ();
 
        if (_click_io) {
@@ -158,7 +158,7 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
 
        const framepos_t start_frame = _transport_frame;
        const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
-
+       
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
                _process_graph->process_routes (nframes, start_frame, end_frame, declick, need_butler);
@@ -1021,6 +1021,17 @@ 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) {
                        // cerr << "forced locate to " << ev->target_frame << endl;