Browse Source

Oops. Finalize peak capture in the right place!

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
f0704d7f90
3 changed files with 13 additions and 9 deletions
  1. +1
    -3
      Timeline/Audio_Region.C
  2. +4
    -5
      Timeline/Peaks.C
  3. +8
    -1
      Timeline/Track.C

+ 1
- 3
Timeline/Audio_Region.C View File

@@ -867,14 +867,12 @@ Audio_Region::finalize ( nframes_t frame )
{
log_end();

_clip->finalize();

_clip->close();
_clip->open();

/* FIXME: should we attempt to truncate the file? */

_range.length = frame - _range.start - _range.offset;
_range.length = frame - _range.start;

redraw();



+ 4
- 5
Timeline/Peaks.C View File

@@ -568,11 +568,10 @@ Peaks::prepare_for_writing ( void )
void
Peaks::finish_writing ( void )
{
if ( _peak_writer )
{
delete _peak_writer;
_peak_writer = NULL;
}
assert( _peak_writer );

delete _peak_writer;
_peak_writer = NULL;

/* now fill in the rest of the cache */
make_peaks_mipmap();


+ 8
- 1
Timeline/Track.C View File

@@ -769,12 +769,14 @@ uuid ( void )
void
Track::record ( nframes_t frame )
{
assert( _capture == NULL );
assert( ! _capture );
assert( ! _capture_af );

char pat[256];

snprintf( pat, sizeof( pat ), "%s-%llu", name(), uuid() );


_capture_af = Audio_File_SF::create( pat, engine->sample_rate(), input.size(), Track::capture_format );

if ( ! _capture_af )
@@ -810,4 +812,9 @@ Track::stop ( nframes_t frame )
_capture->finalize( frame );

_capture = NULL;

_capture_af->finalize();

delete _capture_af;
_capture_af = NULL;
}

Loading…
Cancel
Save