Try harder to avoid redrawing capture regions.

This commit is contained in:
Jonathan Moore Liles 2008-04-29 18:48:11 -05:00
parent 981f92bc69
commit c99b2f1424
2 changed files with 21 additions and 8 deletions

View File

@ -67,12 +67,13 @@ Record_DS::disk_thread ( void )
for ( int i = channels(); i--; ) for ( int i = channels(); i--; )
{ {
while ( jack_ringbuffer_read_space( _rb[ i ] ) < block_size )
{ /* while ( jack_ringbuffer_read_space( _rb[ i ] ) < block_size ) */
printf( "IO: disk buffer underrun!\n" ); /* { */
/* FIXME: is this *really* the right thing to do? */ /* printf( "IO: disk buffer underrun!\n" ); */
usleep( 2000 ); /* /\* FIXME: is this *really* the right thing to do? *\/ */
} /* usleep( 2000 ); */
/* } */
/* FIXME: avoid this copy */ /* FIXME: avoid this copy */

View File

@ -883,11 +883,21 @@ Region::write ( nframes_t nframes )
if ( 0 == ( timeline->ts_to_x( _range.end ) % 20 ) ) if ( 0 == ( timeline->ts_to_x( _range.end ) % 20 ) )
{ {
/* FIXME: hack to get new size */ nframes_t oldl = _clip->length();
/* FIXME: hack */
_clip->close(); _clip->close();
_clip->open(); _clip->open();
redraw(); int W = timeline->ts_to_x( _clip->length() - oldl );
/* why - 1? */
if ( W )
{
++W;
track()->damage( FL_DAMAGE_EXPOSE, x() + w() - W, y(), W, h() );
}
} }
return nframes; return nframes;
@ -912,5 +922,7 @@ Region::finalize ( void )
_clip->close(); _clip->close();
_clip->open(); _clip->open();
_range.end = _clip->length();
return true; return true;
} }