remove InputConfigurationChange from session events, since it is a no-op in this...
[ardour.git] / libs / ardour / session_process.cc
index 7788eb2b978fd260aa16bc0a5dd6d8e4480d0eba..a162303d428980e6f6358962c76fb13feb21c487 100644 (file)
@@ -40,6 +40,8 @@
 #include "ardour/slave.h"
 #include "ardour/ticker.h"
 #include "ardour/types.h"
+#include "ardour/vca.h"
+#include "ardour/vca_manager.h"
 
 #include "midi++/mmc.h"
 
@@ -142,6 +144,11 @@ Session::no_roll (pframes_t nframes)
 
        ltc_tx_send_time_code_for_cycle (_transport_frame, end_frame, _target_transport_speed, _transport_speed, nframes);
 
+       VCAList v = _vca_manager->vcas ();
+       for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
+               (*i)->automation_run (_transport_frame, nframes);
+       }
+
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
                _process_graph->routes_no_roll( nframes, _transport_frame, end_frame, non_realtime_work_pending(), declick);
@@ -180,6 +187,11 @@ 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);
 
+       VCAList v = _vca_manager->vcas ();
+       for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
+               (*i)->automation_run (start_frame, nframes);
+       }
+
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
                if (_process_graph->process_routes (nframes, start_frame, end_frame, declick, need_butler) < 0) {
@@ -206,6 +218,7 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
                        }
 
                        if (b) {
+                               DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 rolled and needs butler\n", (*i)->name()));
                                need_butler = true;
                        }
                }
@@ -225,6 +238,11 @@ Session::silent_process_routes (pframes_t nframes, bool& need_butler)
        const framepos_t start_frame = _transport_frame;
        const framepos_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
 
+       VCAList v = _vca_manager->vcas ();
+       for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
+               (*i)->automation_run (start_frame, nframes);
+       }
+
        if (_process_graph) {
                _process_graph->silent_process_routes (nframes, start_frame, end_frame, need_butler);
        } else {
@@ -531,6 +549,7 @@ Session::process_with_events (pframes_t nframes)
        } /* implicit release of route lock */
 
        if (session_needs_butler) {
+               DEBUG_TRACE (DEBUG::Butler, "p-with-events: session needs butler, call it\n");
                _butler->summon ();
        }
 }
@@ -842,6 +861,7 @@ Session::follow_slave_silently (pframes_t nframes, float slave_speed)
                get_track_statistics ();
 
                if (need_butler) {
+                       DEBUG_TRACE (DEBUG::Butler, "f-slave-silently: session needs butler, call it\n");
                        _butler->summon ();
                }
 
@@ -925,6 +945,7 @@ Session::process_without_events (pframes_t nframes)
        check_declick_out ();
 
        if (session_needs_butler) {
+               DEBUG_TRACE (DEBUG::Butler, "p-without-events: session needs butler, call it\n");
                _butler->summon ();
        }
 }
@@ -947,6 +968,7 @@ Session::process_audition (pframes_t nframes)
        /* run the auditioner, and if it says we need butler service, ask for it */
 
        if (auditioner->play_audition (nframes) > 0) {
+               DEBUG_TRACE (DEBUG::Butler, "auditioner needs butler, call it\n");
                _butler->summon ();
        }
 
@@ -1033,6 +1055,7 @@ Session::queue_event (SessionEvent* ev)
        } else if (_state_of_the_state & Loading) {
                merge_event (ev);
        } else {
+               Glib::Threads::Mutex::Lock lm (rb_write_lock);
                pending_events.write (&ev, 1);
        }
 }
@@ -1208,10 +1231,6 @@ Session::process_event (SessionEvent* ev)
                overwrite_some_buffers (static_cast<Track*>(ev->ptr));
                break;
 
-       case SessionEvent::SetTrackSpeed:
-               set_track_speed (static_cast<Track*> (ev->ptr), ev->speed);
-               break;
-
        case SessionEvent::SetSyncSource:
                DEBUG_TRACE (DEBUG::Slave, "seen request for new slave\n");
                use_sync_source (ev->slave);
@@ -1223,11 +1242,6 @@ Session::process_event (SessionEvent* ev)
                ev->region.reset ();
                break;
 
-       case SessionEvent::InputConfigurationChange:
-               add_post_transport_work (PostTransportInputChange);
-               _butler->schedule_transport_work ();
-               break;
-
        case SessionEvent::SetPlayAudioRange:
                set_play_range (ev->audio_range, (ev->speed == 1.0f));
                break;