fix broken compilation after edit-while-stopped fix was applied
[ardour.git] / libs / ardour / track.cc
index 7d19d23007d1e1449a59b84343c2958363b0cd42..1aa917ca9d0830a9e93ba9eb8c5af95aae95d6e6 100644 (file)
@@ -124,7 +124,7 @@ Track::freeze_state() const
 }
 
 Track::RecEnableControllable::RecEnableControllable (Track& s)
-       : Controllable (X_("recenable"), string() /* XXX missing URI */), track (s)
+       : Controllable (X_("recenable")), track (s)
 {
 }
 
@@ -247,11 +247,18 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
        }
 
        if (session_state_changing) {
+               if (_session.transport_speed() != 0.0f) {
+                       /* we're rolling but some state is changing (e.g. our diskstream contents)
+                          so we cannot use them. Be silent till this is over. Don't declick.
 
-               /* XXX is this safe to do against transport state changes? */
-
-               passthru_silence (start_frame, end_frame, nframes, 0);
-               return 0;
+                          XXX note the absurdity of ::no_roll() being called when we ARE rolling!
+                       */
+                       passthru_silence (start_frame, end_frame, nframes, 0);
+                       return 0;
+               }
+               /* we're really not rolling, so we're either delivery silence or actually
+                  monitoring, both of which are safe to do while session_state_changing is true.
+               */
        }
 
        diskstream()->check_record_status (start_frame, nframes, can_record);