fixes for endemic (compiler?) issues with virtual inheritance of sigc::trackable...
[ardour.git] / libs / ardour / io.cc
index 34070f3dff1c88ee41f2b69be2acb606602c3d17..a9751268ffba557dd9b110683f6d504f4d503375 100644 (file)
@@ -61,7 +61,6 @@ using namespace PBD;
 
 static float current_automation_version_number = 1.0;
 
-nframes_t IO::_automation_interval = 0;
 const string IO::state_node_name = "IO";
 bool         IO::connecting_legal = false;
 bool         IO::ports_legal = false;
@@ -126,9 +125,8 @@ IO::IO (Session& s, string name,
        deferred_state = 0;
 
        apply_gain_automation = false;
-
-       last_automation_snapshot = 0;
-
+       _ignore_gain_on_deliver = false;
+       
        _gain_automation_state = Off;
        _gain_automation_style = Absolute;
 
@@ -434,7 +432,7 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nfr
        gain_t dg;
        gain_t old_gain = _gain;
 
-       if (apply_gain_automation) {
+       if (apply_gain_automation || _ignore_gain_on_deliver) {
 
                /* gain has already been applied by automation code. do nothing here except
                   speed quietning.
@@ -501,7 +499,7 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nfr
                _gain = dg;
        }
 
-       if (apply_gain_automation) {
+       if (apply_gain_automation || _ignore_gain_on_deliver) {
                _gain = old_gain;
        }
 }
@@ -2315,6 +2313,7 @@ IO::setup_peak_meters ()
        }
 }
 
+#ifdef STATE_MANAGER
 UndoAction
 IO::get_memento() const
 {
@@ -2333,6 +2332,7 @@ IO::state_factory (std::string why) const
        StateManager::State* state = new StateManager::State (why);
        return state;
 }
+#endif
 
 /**
     Update the peak meters.
@@ -2490,7 +2490,9 @@ IO::load_automation (const string& path)
                }
        }
 
+#ifdef STATE_MANAGER
        _gain_automation_curve.save_state (_("loaded from disk"));
+#endif
 
        return 0;
 }
@@ -2513,7 +2515,6 @@ IO::set_gain_automation_state (AutoState state)
 
                if (state != _gain_automation_curve.automation_state()) {
                        changed = true;
-                       last_automation_snapshot = 0;
                        _gain_automation_curve.set_automation_state (state);
                        
                        if (state != Off) {
@@ -2611,21 +2612,6 @@ IO::end_pan_touch (uint32_t which)
 
 }
 
-void
-IO::automation_snapshot (nframes_t now)
-{
-       if (last_automation_snapshot > now || (now - last_automation_snapshot) > _automation_interval) {
-
-               if (gain_automation_recording()) {
-                       _gain_automation_curve.rt_add (now, gain());
-               }
-               
-               _panner->snapshot (now);
-
-               last_automation_snapshot = now;
-       }
-}
-
 void
 IO::transport_stopped (nframes_t frame)
 {
@@ -2633,9 +2619,11 @@ IO::transport_stopped (nframes_t frame)
 
        if (_gain_automation_curve.automation_state() != Off) {
                
+#ifdef STATE_MANAGER
                if (gain_automation_recording()) {
                        _gain_automation_curve.save_state (_("automation write/touch"));
                }
+#endif
 
                /* the src=0 condition is a special signal to not propagate 
                   automation gain changes into the mix group when locating.