Take fades into consideration when splitting regions.

Also, fix journalling bug in region splitting.
pull/3/head
Jonathan Moore Liles 2008-07-30 23:03:16 -05:00
parent 840d08aed9
commit 37935df806
2 changed files with 13 additions and 5 deletions

View File

@ -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;

View File

@ -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;