diff --git a/Timeline/Audio_Region.C b/Timeline/Audio_Region.C index 05d172f..0e677be 100644 --- a/Timeline/Audio_Region.C +++ b/Timeline/Audio_Region.C @@ -678,16 +678,25 @@ Audio_Region::handle ( int m ) { Loggable::block_start(); + nframes_t old_fade_in = _fade_in.length; + _fade_in.length = 256; + Audio_Region *copy = new Audio_Region( *this ); + _fade_in.length = old_fade_in; + trim( RIGHT, X ); copy->trim( LEFT, X ); + _fade_out.length = 256; + sequence()->add( copy ); log_end(); Loggable::block_end(); + + log_start(); } return 0; diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index ac3e9b2..9a64bda 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -601,6 +601,8 @@ Loggable::log_start ( void ) void Loggable::log_end ( void ) { + ASSERT( _old_state, "Programming error: log_end() called before log_start()" ); + if ( --_nest > 0 ) return; @@ -617,11 +619,8 @@ Loggable::log_end ( void ) log_print( _old_state, new_state ); } - if ( new_state ) - delete new_state; - - if ( _old_state ) - delete _old_state; + delete new_state; + delete _old_state; _old_state = NULL;