fix up what freeze does with fader settings, gain & pan automation; unfreeze too
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 3 Nov 2008 17:10:00 +0000 (17:10 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 3 Nov 2008 17:10:00 +0000 (17:10 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4088 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/track.h
libs/ardour/audio_track.cc
libs/ardour/crossfade.cc

index f99a29bcd14147c673fd1899a26a9dd570dc72e6..4ba1b88fb754075955abbb9de5a74f9e9b7e11c5 100644 (file)
@@ -129,6 +129,9 @@ class Track : public Route
            vector<FreezeRecordInsertInfo*> insert_info;
            bool                            have_mementos;
            FreezeState                     state;
+           gain_t                          gain;
+           AutoState                       gain_automation_state;
+           AutoState                       pan_automation_state;
        };
 
        struct RecEnableControllable : public PBD::Controllable {
index d3b5e442c7f02d975de2d7d42cae4d00bd0e58c4..595471e7b54286f6aeaa96952bf36fd0efe54be7 100644 (file)
@@ -848,6 +848,10 @@ AudioTrack::freeze (InterThreadInfo& itt)
                }
        }
 
+       _freeze_record.gain = _gain;
+       _freeze_record.gain_automation_state = _gain_automation_curve.automation_state();
+       _freeze_record.pan_automation_state = _panner->automation_state();
+
        new_playlist = PlaylistFactory::create (_session, new_playlist_name, false);
        region_name = new_playlist_name;
 
@@ -866,6 +870,12 @@ AudioTrack::freeze (InterThreadInfo& itt)
        diskstream->use_playlist (boost::dynamic_pointer_cast<AudioPlaylist>(new_playlist));
        diskstream->set_record_enabled (false);
 
+       /* reset stuff that has already been accounted for in the freeze process */
+       
+       set_gain (1.0, this);
+       _gain_automation_curve.set_automation_state (Off);
+       _panner->set_automation_state (Off);
+
        _freeze_record.state = Frozen;
        FreezeChange(); /* EMIT SIGNAL */
 }
@@ -896,6 +906,9 @@ AudioTrack::unfreeze ()
                }
                
                _freeze_record.playlist.reset ();
+               set_gain (_freeze_record.gain, this);
+               _gain_automation_curve.set_automation_state (_freeze_record.gain_automation_state);
+               _panner->set_automation_state (_freeze_record.pan_automation_state);
        }
 
        _freeze_record.state = UnFrozen;
index 7e8307a158e17c8bfef471a5b8a5da7a2c82e970..f0cfb9eeda78441eaa261213f958b77b9267bb7a 100644 (file)
@@ -209,7 +209,8 @@ Crossfade::initialize ()
        _fade_out.freeze ();
        _fade_out.clear ();
 
-#ifdef EQUAL_POWER_MINUS_3DB
+#define EQUAL_POWER_MINUS_3DB
+#ifdef  EQUAL_POWER_MINUS_3DB
 
        _fade_out.add ((_length * 0.000000), 1.000000);
        _fade_out.add ((_length * 0.166667), 0.948859);
@@ -235,7 +236,8 @@ Crossfade::initialize ()
        _fade_in.freeze ();
        _fade_in.clear ();
 
-#ifdef EQUAL_POWER_MINUS_3DB
+#define EQUAL_POWER_MINUS_3DB
+#ifdef  EQUAL_POWER_MINUS_3DB
 
        _fade_in.add ((_length * 0.000000), 0.000000);
        _fade_in.add ((_length * 0.166667), 0.282192);