Adding sends/port inserts to MIDI tracks (not actually working yet though)
[ardour.git] / libs / ardour / route.cc
index 757c40452f481ff520d9755f4f94287d02e11f25..e0b890340ac2e6d36ccdaad7cfb8325a5fb9f662 100644 (file)
@@ -114,7 +114,6 @@ Route::init ()
 
 Route::~Route ()
 {
-       GoingAway (); /* EMIT SIGNAL */
        clear_redirects (this);
 
        if (_control_outs) {
@@ -653,7 +652,8 @@ Route::process_output_buffers (BufferSet& bufs,
 ChanCount
 Route::n_process_buffers ()
 {
-       return max (n_inputs(), redirect_max_outs);
+       //return max (n_inputs(), redirect_max_outs);
+       return n_inputs(); // FIXME?
 }
 
 void
@@ -679,6 +679,12 @@ Route::passthru (jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nfra
 #undef meter_stream
 }
 
+void
+Route::passthru_silence (jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t nframes, jack_nframes_t offset, int declick, bool meter)
+{
+       process_output_buffers (_session.get_silent_buffers (n_process_buffers()), start_frame, end_frame, nframes, offset, true, declick, meter);
+}
+
 void
 Route::set_solo (bool yn, void *src)
 {
@@ -753,6 +759,8 @@ Route::add_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t*
                boost::shared_ptr<PluginInsert> pi;
                boost::shared_ptr<PortInsert> porti;
 
+               redirect->set_default_type(_default_type);
+
                ChanCount potential_max_streams;
 
                if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redirect)) != 0) {
@@ -779,7 +787,7 @@ Route::add_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t*
                           
                        */
 
-                       porti->ensure_io (n_outputs ().get(DataType::AUDIO), n_inputs().get(DataType::AUDIO), false, this);
+                       porti->ensure_io (n_outputs (), n_inputs(), false, this);
                }
 
                // Ensure peak vector sizes before the plugin is activated
@@ -1724,10 +1732,10 @@ Route::set_control_outs (const vector<string>& ports)
        _control_outs = new IO (_session, coutname);
 
        /* our control outs need as many outputs as we
-          have outputs. we track the changes in ::output_change_handler().
+          have audio outputs. we track the changes in ::output_change_handler().
        */
 
-       _control_outs->ensure_io (0, n_outputs().get(DataType::AUDIO), true, this);
+       _control_outs->ensure_io (ChanCount::ZERO, ChanCount(DataType::AUDIO, n_outputs().get(DataType::AUDIO)), true, this);
  
        return 0;
 }      
@@ -1956,7 +1964,7 @@ Route::output_change_handler (IOChange change, void *ignored)
 {
        if (change & ConfigurationChanged) {
                if (_control_outs) {
-                       _control_outs->ensure_io (0, n_outputs().get(DataType::AUDIO), true, this);
+                       _control_outs->ensure_io (ChanCount::ZERO, ChanCount(DataType::AUDIO, n_outputs().get(DataType::AUDIO)), true, this);
                }
                
                reset_plugin_counts (0);
@@ -2078,7 +2086,7 @@ void
 Route::toggle_monitor_input ()
 {
        for (PortSet::iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
-               i->request_monitor_input( ! i->monitoring_input());
+               i->ensure_monitor_input( ! i->monitoring_input());
        }
 }