Merge branch 'patch-1' of https://github.com/globin/ardour
[ardour.git] / libs / ardour / session_process.cc
index 8719279d6081e4ad149b9db8bb2c6ae4391a2826..067a91da48f45449933c1960cdc3482fe7681e3e 100644 (file)
@@ -116,11 +116,7 @@ Session::no_roll (pframes_t nframes)
                _click_io->silence (nframes);
        }
 
-#ifdef HAVE_LTC
-       if (!_engine.freewheeling()) {
-               ltc_tx_send_time_code_for_cycle (_transport_frame, end_frame, _target_transport_speed, _transport_speed, nframes);
-       }
-#endif
+       ltc_tx_send_time_code_for_cycle (_transport_frame, end_frame, _target_transport_speed, _transport_speed, nframes);
 
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
@@ -129,7 +125,7 @@ Session::no_roll (pframes_t nframes)
                PT_TIMING_CHECK (10);
                for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
 
-                       if ((*i)->is_hidden()) {
+                       if ((*i)->is_auditioner()) {
                                continue;
                        }
 
@@ -174,7 +170,7 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
 
                        int ret;
 
-                       if ((*i)->is_hidden()) {
+                       if ((*i)->is_auditioner()) {
                                continue;
                        }
 
@@ -214,7 +210,7 @@ Session::silent_process_routes (pframes_t nframes, bool& need_butler)
 
                        int ret;
 
-                       if ((*i)->is_hidden()) {
+                       if ((*i)->is_auditioner()) {
                                continue;
                        }
 
@@ -519,7 +515,9 @@ Session::follow_slave (pframes_t nframes)
                slave_speed = 0.0f;
        }
 
-       if (_slave->is_always_synced() || Config->get_timecode_source_is_synced()) {
+       if (_slave->is_always_synced() ||
+                       (Config->get_timecode_source_is_synced() && (dynamic_cast<TimecodeSlave*>(_slave)) != 0)
+                       ) {
 
                /* if the TC source is synced, then we assume that its
                   speed is binary: 0.0 or 1.0
@@ -547,7 +545,9 @@ Session::follow_slave (pframes_t nframes)
                                                   _slave_state, slave_transport_frame, slave_speed, this_delta, average_slave_delta));
 
 
-       if (_slave_state == Running && !_slave->is_always_synced() && !Config->get_timecode_source_is_synced()) {
+       if (_slave_state == Running && !_slave->is_always_synced() &&
+                       !(Config->get_timecode_source_is_synced() && (dynamic_cast<TimecodeSlave*>(_slave)) != 0)
+                       ) {
 
                if (_transport_speed != 0.0f) {
 
@@ -795,9 +795,7 @@ Session::process_without_events (pframes_t nframes)
 
        if (!_exporting && _slave) {
                if (!follow_slave (nframes)) {
-#ifdef HAVE_LTC
                        ltc_tx_send_time_code_for_cycle (_transport_frame, _transport_frame, 0, 0 , nframes);
-#endif
                        return;
                }
        }
@@ -819,11 +817,7 @@ Session::process_without_events (pframes_t nframes)
                send_midi_time_code_for_cycle (_transport_frame, _transport_frame + frames_moved, nframes);
        }
 
-#ifdef HAVE_LTC
-       if (!_exporting) {
-               ltc_tx_send_time_code_for_cycle (_transport_frame, _transport_frame + frames_moved, _target_transport_speed, _transport_speed, nframes);
-       }
-#endif
+       ltc_tx_send_time_code_for_cycle (_transport_frame, _transport_frame + frames_moved, _target_transport_speed, _transport_speed, nframes);
 
        framepos_t const stop_limit = compute_stop_limit ();
 
@@ -869,7 +863,7 @@ Session::process_audition (pframes_t nframes)
        boost::shared_ptr<RouteList> r = routes.reader ();
 
        for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
-               if (!(*i)->is_hidden()) {
+               if (!(*i)->is_auditioner()) {
                        (*i)->silence (nframes);
                }
        }
@@ -883,7 +877,7 @@ Session::process_audition (pframes_t nframes)
        /* if using a monitor section, run it because otherwise we don't hear anything */
 
        if (auditioner->needs_monitor()) {
-               _monitor_out->passthru (_transport_frame, _transport_frame + nframes, nframes, false);
+               _monitor_out->monitor_run (_transport_frame, _transport_frame + nframes, nframes, false);
        }
 
        /* handle pending events */
@@ -1183,6 +1177,11 @@ Session::compute_stop_limit () const
        if (!Config->get_stop_at_session_end ()) {
                return max_framepos;
        }
+
+       if (_slave) {
+               return max_framepos;
+       }
+
        
        bool const punching_in = (config.get_punch_in () && _locations->auto_punch_location());
        bool const punching_out = (config.get_punch_out () && _locations->auto_punch_location());