more MTC debugging
[ardour.git] / libs / ardour / track.cc
index acf0c50e1881995c21a0398fe9ad7674bad2a8aa..1aa917ca9d0830a9e93ba9eb8c5af95aae95d6e6 100644 (file)
@@ -16,9 +16,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 #include "pbd/error.h"
-#include <sigc++/retype.h>
-#include <sigc++/retype_return.h>
-#include <sigc++/bind.h>
 
 #include "ardour/amp.h"
 #include "ardour/audioplaylist.h"
@@ -66,12 +63,6 @@ Track::~Track ()
        DEBUG_TRACE (DEBUG::Destruction, string_compose ("track %1 destructor\n", _name));
 }
 
-void
-Track::set_meter_point (MeterPoint p, void *src)
-{
-       Route::set_meter_point (p, src);
-}
-
 XMLNode&
 Track::get_state ()
 {
@@ -192,17 +183,15 @@ Track::set_record_enable (bool yn, void *src)
 
        _diskstream->set_record_enabled (yn);
 
-#if 0
        if (_diskstream->record_enabled()) {
-               set_meter_point (MeterInput, this);
+               if (_meter_point != MeterCustom) {
+                       set_meter_point (MeterInput, this);
+               }
        } else {
                set_meter_point (_saved_meter_point, this);
        }
-#endif
 
-       cerr << "4\n";
        _rec_enable_control->Changed ();
-       cerr << "5\n";
 }
 
 
@@ -258,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);