Browse Source

Minor cleanup.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
eab284dddb
3 changed files with 11 additions and 6 deletions
  1. +6
    -4
      Timeline/Audio_Track.C
  2. +1
    -1
      Timeline/Disk_Stream.C
  3. +4
    -1
      Timeline/Engine.C

+ 6
- 4
Timeline/Audio_Track.C View File

@@ -123,6 +123,8 @@ Audio_Track::play ( sample_t *buf, nframes_t frame, nframes_t nframes, int chann
{
sample_t *cbuf = new sample_t[ nframes ];

memset( cbuf, 0, nframes * sizeof( sample_t ) );

/* quick and dirty--let the regions figure out coverage for themselves */
for ( list <Track_Widget *>::const_iterator i = _widgets.begin();
i != _widgets.end(); i++ )
@@ -131,23 +133,23 @@ Audio_Track::play ( sample_t *buf, nframes_t frame, nframes_t nframes, int chann

for ( int i = channels; i--; )
{
// memset( cbuf, 0, nframes * sizeof( sample_t ) );
int nfr;

if ( ! r->read( cbuf, frame, nframes, i ) )
if ( ! ( nfr = r->read( cbuf, frame, nframes, i ) ) )
/* error ? */
continue;

if ( channels == 1 )
{
// memcpy( buf, cbuf, nframes * sizeof( sample_t ) );
for ( unsigned int j = 0; j < nframes; ++j )
for ( unsigned int j = 0; j < nfr; ++j )
buf[ j ] += cbuf[ j ];
}
else
{
/* mix and interleave */
int k = 0;
for ( unsigned int j = i; k < nframes; j += channels )
for ( unsigned int j = i; k < nfr; j += channels )
buf[ j ] += cbuf[ k++ ];
}
}


+ 1
- 1
Timeline/Disk_Stream.C View File

@@ -40,7 +40,7 @@
/* FIXME: needs error handling everywhere! */
/* TODO: handle capture too */

float Disk_Stream::seconds_to_buffer = 1.0f;
float Disk_Stream::seconds_to_buffer = 5.0f;
// size_t Disk_Stream::disk_block_frames = 2048;

Disk_Stream::Disk_Stream ( Track_Header *th, float frame_rate, nframes_t nframes, int channels ) : _th( th )


+ 4
- 1
Timeline/Engine.C View File

@@ -78,7 +78,10 @@ Engine::sync ( jack_transport_state_t state, jack_position_t *pos )
seeking = true;
}

int r = timeline->seek_pending();
int r = true;

if ( timeline )
r = timeline->seek_pending();

if ( ! r )
seeking = false;


Loading…
Cancel
Save