more realtime automation fixes: only do realtime automation while rolling, and never...
authorBen Loftis <ben@glw.com>
Thu, 22 Apr 2010 15:54:12 +0000 (15:54 +0000)
committerBen Loftis <ben@glw.com>
Thu, 22 Apr 2010 15:54:12 +0000 (15:54 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6965 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/io.h
libs/ardour/insert.cc
libs/ardour/io.cc
libs/ardour/panner.cc

index 6ae917b9d4ce96882f6a5b2c467046609e89a67c..7c0c0e1e78c29eaf1a6ac55cdfd05af4b304f6ec 100644 (file)
@@ -244,9 +244,7 @@ class IO : public PBD::StatefulDestructible
         
         void clear_automation ();
         
-        bool gain_automation_recording() const { 
-                return (_gain_automation_curve.automation_state() & (Auto_Write|Auto_Touch));
-        }
+        bool gain_automation_recording();
         
         bool gain_automation_playback() const {
                 return (_gain_automation_curve.automation_state() & Auto_Play) ||
index 035d344ab677ea279ac6eff6bba06be090efab59..1dd6cff83d9ab4be3acbbbaafb9a442de07c2a25 100644 (file)
@@ -340,7 +340,7 @@ PluginInsert::automation_snapshot (nframes_t now, bool force)
                
                AutomationList *alist = *li;
 
-               if (alist && alist->automation_write ()) {
+               if (alist && alist->automation_write () && _session.transport_rolling()) {
                        
                        float val = _plugins[0]->get_parameter (n);
                        alist->rt_add (now, val);
@@ -361,7 +361,7 @@ PluginInsert::transport_stopped (nframes_t now)
 
                if (alist) {
                        alist->reposition_for_rt_add (now);
-                       if (alist->automation_state() != Auto_Off) {
+                       if (alist->automation_state() == Auto_Touch || alist->automation_state() == Auto_Play) {
                                _plugins[0]->set_parameter (n, alist->eval (now));
                        }
                }
@@ -423,7 +423,7 @@ PluginInsert::set_parameter (uint32_t port, float val)
        
        _plugins[0]->set_parameter (port, val);
        
-       if (automation_list (port).automation_write()) {
+       if (automation_list (port).automation_write() && _session.transport_rolling()) {
                if ( desc.toggled )  //store the previous value just before this so any interpolation works right 
                        automation_list (port).add (_session.audible_frame()-1, last_val);
                automation_list (port).add (_session.audible_frame(), val);
index 2fe72a276cabc5b15ec747c373b52588483a0efa..35d0df9e9ff9e5e97bd0dea35015b8841aa16a96 100644 (file)
@@ -2567,6 +2567,13 @@ IO::meter ()
        }
 }
 
+bool
+IO::gain_automation_recording ()
+{ 
+       return (_session.transport_rolling() && _gain_automation_curve.automation_write() );
+}
+
+
 void
 IO::clear_automation ()
 {
@@ -2719,7 +2726,7 @@ IO::transport_stopped (nframes_t frame)
 {
        _gain_automation_curve.reposition_for_rt_add (frame);
 
-       if (_gain_automation_curve.automation_state() != Auto_Off) {
+       if (_gain_automation_curve.automation_state() == Auto_Touch || _gain_automation_curve.automation_state() == Auto_Play) {
                
                /* the src=0 condition is a special signal to not propagate 
                   automation gain changes into the mix group when locating.
index 25ce8b22778a65043e3f61dde49c1954a7c62620..511a4778d5e9a3b3b8b831973ddd008601bf00eb 100644 (file)
@@ -198,7 +198,7 @@ BaseStereoPanner::~BaseStereoPanner ()
 void
 BaseStereoPanner::snapshot (nframes_t now)
 {
-       if (_automation.automation_state() == Auto_Write || _automation.automation_state() == Auto_Touch) {
+       if (_automation.automation_write () && parent.session().transport_rolling()) {
                _automation.rt_add (now, x);
        }
 }
@@ -206,7 +206,7 @@ BaseStereoPanner::snapshot (nframes_t now)
 void
 BaseStereoPanner::transport_stopped (nframes_t frame)
 {
-       if (_automation.automation_state() != Auto_Off) {
+       if (_automation.automation_state() == Auto_Touch || _automation.automation_state() == Auto_Play) {
                set_position (_automation.eval (frame));
        }