Browse Source

Timeline: Fix peak display while recording.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
c351700be0
2 changed files with 12 additions and 10 deletions
  1. +8
    -9
      timeline/src/Audio_Region.C
  2. +4
    -1
      timeline/src/Engine/Peaks.C

+ 8
- 9
timeline/src/Audio_Region.C View File

@@ -602,20 +602,19 @@ Audio_Region::draw ( void )


if ( start != ostart || end != oend ) if ( start != ostart || end != oend )
{ {
if ( _clip->peaks()->peakfile_ready() )
{
if ( _clip->read_peaks( timeline->fpp(),
_clip->peaks()->peakfile_ready();
if ( _clip->read_peaks( timeline->fpp(),
start, start,
end, end,
&peaks, &pbuf, &channels ) ) &peaks, &pbuf, &channels ) )
{
Waveform::scale( pbuf, peaks * channels, _scale );
{
Waveform::scale( pbuf, peaks * channels, _scale );
ostart = start;
oend = end;
}
ostart = start;
oend = end;
} }
if ( _clip->peaks()->needs_more_peaks() && ! transport->rolling ) if ( _clip->peaks()->needs_more_peaks() && ! transport->rolling )
{ {
/* maybe create a thread to make the peaks */ /* maybe create a thread to make the peaks */


+ 4
- 1
timeline/src/Engine/Peaks.C View File

@@ -429,7 +429,7 @@ Peaks::peakfile_ready ( void ) const
_rescan_needed = false; _rescan_needed = false;
} }


return current() && ! _first_block_pending;
return _first_block_pending || current();
} }


/** start building peaks and/or peak mipmap in another thread. It is /** start building peaks and/or peak mipmap in another thread. It is
@@ -640,6 +640,7 @@ Peaks::prepare_for_writing ( void )


char *pn = peakname( _clip->filename() ); char *pn = peakname( _clip->filename() );


_first_block_pending = true;
_peak_writer = new Peaks::Streamer( pn, _clip->channels(), cache_minimum ); _peak_writer = new Peaks::Streamer( pn, _clip->channels(), cache_minimum );


free( pn ); free( pn );
@@ -652,6 +653,8 @@ Peaks::finish_writing ( void )


delete _peak_writer; delete _peak_writer;
_peak_writer = NULL; _peak_writer = NULL;

_first_block_pending = false;
} }


void void


Loading…
Cancel
Save