include/FLAC/seekable_stream_decoder.h Source File

Main Page Modules Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# include/FLAC/seekable_stream_decoder.h

Go to the documentation of this file.

    00001 /* libFLAC - Free Lossless Audio Codec library
    00002  * Copyright (C) 2000,2001,2002  Josh Coalson
    00003  *
    00004  * This library is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU Library General Public
    00006  * License as published by the Free Software Foundation; either
    00007  * version 2 of the License, or (at your option) any later version.
    00008  *
    00009  * This library is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012  * Library General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Library General Public
    00015  * License along with this library; if not, write to the
    00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017  * Boston, MA  02111-1307, USA.
    00018  */
    00019
    00020 #ifndef FLAC__SEEKABLE_STREAM_DECODER_H
    00021 #define FLAC__SEEKABLE_STREAM_DECODER_H
    00022
    00023 #include "stream_decoder.h"
    00024
    00025 #ifdef __cplusplus
    00026 extern "C" {
    00027 #endif
    00028
    00029
    00119 typedef enum {
    00120
    00121     FLAC__SEEKABLE_STREAM_DECODER_OK = 0,
    00124     FLAC__SEEKABLE_STREAM_DECODER_SEEKING,
    00127     FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM,
    00130     FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
    00133     FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR,
    00136     FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR,
    00139     FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR,
    00144     FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED,
    00150     FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK,
    00155     FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
    00158 } FLAC__SeekableStreamDecoderState;
    00159
    00165 extern const char * const FLAC__SeekableStreamDecoderStateString[];
    00166
    00167
    00170 typedef enum {
    00171
    00172     FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK,
    00175     FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR
    00178 } FLAC__SeekableStreamDecoderReadStatus;
    00179
    00185 extern const char * const FLAC__SeekableStreamDecoderReadStatusString[];
    00186
    00187
    00190 typedef enum {
    00191
    00192     FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK,
    00195     FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR
    00198 } FLAC__SeekableStreamDecoderSeekStatus;
    00199
    00205 extern const char * const FLAC__SeekableStreamDecoderSeekStatusString[];
    00206
    00207
    00210 typedef enum {
    00211
    00212     FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK,
    00215     FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR
    00218 } FLAC__SeekableStreamDecoderTellStatus;
    00219
    00225 extern const char * const FLAC__SeekableStreamDecoderTellStatusString[];
    00226
    00227
    00230 typedef enum {
    00231
    00232     FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK,
    00235     FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR
    00238 } FLAC__SeekableStreamDecoderLengthStatus;
    00239
    00245 extern const char * const FLAC__SeekableStreamDecoderLengthStatusString[];
    00246
    00247
    00248 /***********************************************************************
    00249  *
    00250  * class FLAC__SeekableStreamDecoder : public FLAC__StreamDecoder
    00251  *
    00252  ***********************************************************************/
    00253
    00254 struct FLAC__SeekableStreamDecoderProtected;
    00255 struct FLAC__SeekableStreamDecoderPrivate;
    00261 typedef struct {
    00262     struct FLAC__SeekableStreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
    00263     struct FLAC__SeekableStreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
    00264 } FLAC__SeekableStreamDecoder;
    00265
    00279 typedef FLAC__SeekableStreamDecoderReadStatus (*FLAC__SeekableStreamDecoderReadCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
    00280
    00292 typedef FLAC__SeekableStreamDecoderSeekStatus (*FLAC__SeekableStreamDecoderSeekCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
    00293
    00305 typedef FLAC__SeekableStreamDecoderTellStatus (*FLAC__SeekableStreamDecoderTellCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
    00306
    00318 typedef FLAC__SeekableStreamDecoderLengthStatus (*FLAC__SeekableStreamDecoderLengthCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
    00319
    00329 typedef FLAC__bool (*FLAC__SeekableStreamDecoderEofCallback)(const FLAC__SeekableStreamDecoder *decoder, void *client_data);
    00330
    00343 typedef FLAC__StreamDecoderWriteStatus (*FLAC__SeekableStreamDecoderWriteCallback)(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
    00344
    00354 typedef void (*FLAC__SeekableStreamDecoderMetadataCallback)(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
    00355
    00365 typedef void (*FLAC__SeekableStreamDecoderErrorCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
    00366
    00367
    00368 /***********************************************************************
    00369  *
    00370  * Class constructor/destructor
    00371  *
    00372  ***********************************************************************/
    00373
    00382 FLAC__SeekableStreamDecoder *FLAC__seekable_stream_decoder_new();
    00383
    00390 void FLAC__seekable_stream_decoder_delete(FLAC__SeekableStreamDecoder *decoder);
    00391
    00392
    00393 /***********************************************************************
    00394  *
    00395  * Public class method prototypes
    00396  *
    00397  ***********************************************************************/
    00398
    00416 FLAC__bool FLAC__seekable_stream_decoder_set_md5_checking(FLAC__SeekableStreamDecoder *decoder, FLAC__bool value);
    00417
    00434 FLAC__bool FLAC__seekable_stream_decoder_set_read_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderReadCallback value);
    00435
    00453 FLAC__bool FLAC__seekable_stream_decoder_set_seek_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderSeekCallback value);
    00454
    00472 FLAC__bool FLAC__seekable_stream_decoder_set_tell_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderTellCallback value);
    00473
    00490 FLAC__bool FLAC__seekable_stream_decoder_set_length_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderLengthCallback value);
    00491
    00508 FLAC__bool FLAC__seekable_stream_decoder_set_eof_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderEofCallback value);
    00509
    00526 FLAC__bool FLAC__seekable_stream_decoder_set_write_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderWriteCallback value);
    00527
    00544 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderMetadataCallback value);
    00545
    00562 FLAC__bool FLAC__seekable_stream_decoder_set_error_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderErrorCallback value);
    00563
    00576 FLAC__bool FLAC__seekable_stream_decoder_set_client_data(FLAC__SeekableStreamDecoder *decoder, void *value);
    00577
    00591 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond(FLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type);
    00592
    00606 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]);
    00607
    00619 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_all(FLAC__SeekableStreamDecoder *decoder);
    00620
    00634 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore(FLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type);
    00635
    00649 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]);
    00650
    00662 FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_all(FLAC__SeekableStreamDecoder *decoder);
    00663
    00672 FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_get_state(const FLAC__SeekableStreamDecoder *decoder);
    00673
    00684 FLAC__StreamDecoderState FLAC__seekable_stream_decoder_get_stream_decoder_state(const FLAC__SeekableStreamDecoder *decoder);
    00685
    00698 FLAC__bool FLAC__seekable_stream_decoder_get_md5_checking(const FLAC__SeekableStreamDecoder *decoder);
    00699
    00709 unsigned FLAC__seekable_stream_decoder_get_channels(const FLAC__SeekableStreamDecoder *decoder);
    00710
    00720 FLAC__ChannelAssignment FLAC__seekable_stream_decoder_get_channel_assignment(const FLAC__SeekableStreamDecoder *decoder);
    00721
    00731 unsigned FLAC__seekable_stream_decoder_get_bits_per_sample(const FLAC__SeekableStreamDecoder *decoder);
    00732
    00742 unsigned FLAC__seekable_stream_decoder_get_sample_rate(const FLAC__SeekableStreamDecoder *decoder);
    00743
    00753 unsigned FLAC__seekable_stream_decoder_get_blocksize(const FLAC__SeekableStreamDecoder *decoder);
    00754
    00770 FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_init(FLAC__SeekableStreamDecoder *decoder);
    00771
    00792 FLAC__bool FLAC__seekable_stream_decoder_finish(FLAC__SeekableStreamDecoder *decoder);
    00793
    00806 FLAC__bool FLAC__seekable_stream_decoder_flush(FLAC__SeekableStreamDecoder *decoder);
    00807
    00823 FLAC__bool FLAC__seekable_stream_decoder_reset(FLAC__SeekableStreamDecoder *decoder);
    00824
    00834 FLAC__bool FLAC__seekable_stream_decoder_process_single(FLAC__SeekableStreamDecoder *decoder);
    00835
    00845 FLAC__bool FLAC__seekable_stream_decoder_process_until_end_of_metadata(FLAC__SeekableStreamDecoder *decoder);
    00846
    00856 FLAC__bool FLAC__seekable_stream_decoder_process_until_end_of_stream(FLAC__SeekableStreamDecoder *decoder);
    00857
    00869 FLAC__bool FLAC__seekable_stream_decoder_seek_absolute(FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 sample);
    00870
    00871 /* \} */
    00872
    00873 #ifdef __cplusplus
    00874 }
    00875 #endif
    00876
    00877 #endif