Timeline: Fix logging of region split at playhead.

This commit is contained in:
Jonathan Moore Liles 2015-09-09 17:18:42 -07:00
parent 8fbcb4eb79
commit 40e7b77420
1 changed files with 15 additions and 20 deletions

View File

@ -235,15 +235,7 @@ Audio_Region::menu_cb ( const Fl_Menu_ *m )
box_color( fl_show_colormap( box_color() ) ); box_color( fl_show_colormap( box_color() ) );
else if ( ! strcmp( picked, "/Split at mouse" ) ) else if ( ! strcmp( picked, "/Split at mouse" ) )
{ {
Loggable::block_start();
split( timeline->x_to_offset( Fl::event_x() ) ); split( timeline->x_to_offset( Fl::event_x() ) );
log_end();
Loggable::block_end();
log_start();
} }
else if ( ! strcmp( picked, "/Crop to range" ) ) else if ( ! strcmp( picked, "/Crop to range" ) )
{ {
@ -307,6 +299,7 @@ Audio_Region::menu_cb ( const Fl_Menu_ *m )
else if ( ! strcmp( picked, "/Split at playhead" ) ) else if ( ! strcmp( picked, "/Split at playhead" ) )
{ {
redraw(); redraw();
split( transport->frame ); split( transport->frame );
} }
else if ( ! strcmp( picked, "/Loop point at playhead" ) ) else if ( ! strcmp( picked, "/Loop point at playhead" ) )
@ -759,12 +752,15 @@ Audio_Region::draw_label ( void )
void void
Audio_Region::split ( nframes_t where ) Audio_Region::split ( nframes_t where )
{ {
block_start();
nframes_t old_fade_in = _fade_in.length; nframes_t old_fade_in = _fade_in.length;
_fade_in.length = 256; _fade_in.length = 256;
Audio_Region *copy = new Audio_Region( *this ); Audio_Region *copy = new Audio_Region( *this );
{
Logger _log( copy ); Logger _log( copy );
_fade_in.length = old_fade_in; _fade_in.length = old_fade_in;
@ -773,6 +769,13 @@ Audio_Region::split ( nframes_t where )
Sequence_Region::split( copy, where ); Sequence_Region::split( copy, where );
} }
log_end();
block_end();
log_start();
}
int int
Audio_Region::handle ( int m ) Audio_Region::handle ( int m )
{ {
@ -833,15 +836,7 @@ Audio_Region::handle ( int m )
/* split */ /* split */
if ( ! copied ) if ( ! copied )
{ {
Loggable::block_start();
split( timeline->x_to_offset( X ) ); split( timeline->x_to_offset( X ) );
log_end();
Loggable::block_end();
log_start();
} }
return 0; return 0;