268
268
guint chunk_read_array(ChunkHandle *handle, off_t sampleno, guint size,
269
void *buffer, int dither_mode);
269
void *buffer, int dither_mode, off_t *clipcount);
283
283
guint chunk_read_array_fp(ChunkHandle *handle, off_t sampleno, guint samples,
284
sample_t *buffer, int dither_mode);
284
sample_t *buffer, int dither_mode, off_t *clipcount);
287
287
/* Frees the resources used by a ChunkHandle. All handles should be freed when
347
347
int dither_mode, StatusBar *bar);
352
/* Creates a new Chunk with a mix of the original chunk's channels.
353
* channels_out determines the number of output channels
354
* map is a (chunk->channels x channels_out)-matrix;
355
* If map[src*channels_out + dst], then channel <src> from chunk will be
356
* copied into channel <dst> of the result. Output channels with no assigned
357
* inputs will be silent, output channels with more than one assigned input
360
Chunk *chunk_remap_channels(Chunk *chunk, int channels_out, gboolean *map,
361
int dither_mode, StatusBar *bar);
350
364
/* Creates a new chunk containing a mix of two chunk's data. The chunks must
351
365
* have the same format but need not be of the same length. */
353
367
Chunk *chunk_mix(Chunk *c1, Chunk *c2, int dither_mode, StatusBar *bar);
370
off_t chunk_zero_crossing_any_forward(
371
Chunk *c, StatusBar *bar, off_t cursorpos);
372
off_t chunk_zero_crossing_any_reverse(
373
Chunk *c, StatusBar *bar, off_t cursorpos);
374
off_t chunk_zero_crossing_all_forward(
375
Chunk *c, StatusBar *bar, off_t cursorpos);
376
off_t chunk_zero_crossing_all_reverse(
377
Chunk *c, StatusBar *bar, off_t cursorpos);
357
380
/* Returns the maximum absolute value of all the samples in the chunk.
358
381
* Returns negative value if anything failed. */
387
410
/* Create a new chunk of the same length and format as the input chunk,
388
411
* consisting of a linear interpolation between the input chunk's two
389
412
* endpoints. Returns NULL on failure.
414
* If falldown_mode is TRUE and the chunk is long, the endpoints will
415
*be ramped down to zero and the middle part will be constant zero.
392
Chunk *chunk_interpolate_endpoints(Chunk *chunk, int dither_mode, StatusBar *bar);
418
Chunk *chunk_interpolate_endpoints(Chunk *chunk, gboolean falldown_mode,
419
int dither_mode, StatusBar *bar);
459
486
* the same time, if FALSE one channel at a time will be sent.
460
487
* convert - If TRUE the samples will be sent as sample_t (floating point)
461
488
* values, otherwise they will be sent in raw format.
489
* samplepos - The location within the chunk that parsing should start at.
490
* reverse - If TRUE, parsing will move backward through the chunk; if FALSE
491
* parsing will move forward through the chunk.
463
493
* returns - FALSE on success, TRUE if proc returned TRUE or a read error
467
497
gboolean chunk_parse(Chunk *chunk, chunk_parse_proc proc, gboolean allchannels,
468
498
gboolean convert, int dither_mode,
469
StatusBar *bar, gchar *title);
499
StatusBar *bar, gchar *title, off_t samplepos, gboolean reverse);