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

# include/OggFLAC/stream_decoder.h

Go to the documentation of this file.

    00001 /* libOggFLAC - Free Lossless Audio Codec + Ogg library
    00002  * Copyright (C) 2002,2003  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 OggFLAC__STREAM_DECODER_H
    00021 #define OggFLAC__STREAM_DECODER_H
    00022
    00023 #include "export.h"
    00024
    00025 #include "FLAC/stream_decoder.h"
    00026
    00027 #ifdef __cplusplus
    00028 extern "C" {
    00029 #endif
    00030
    00031
    00072 typedef enum {
    00073
    00074     OggFLAC__STREAM_DECODER_OK = 0,
    00077     OggFLAC__STREAM_DECODER_OGG_ERROR,
    00080     OggFLAC__STREAM_DECODER_READ_ERROR,
    00083     OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR,
    00088     OggFLAC__STREAM_DECODER_INVALID_CALLBACK,
    00091     OggFLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
    00094     OggFLAC__STREAM_DECODER_ALREADY_INITIALIZED,
    00100     OggFLAC__STREAM_DECODER_UNINITIALIZED
    00103 } OggFLAC__StreamDecoderState;
    00104
    00110 extern OggFLAC_API const char * const OggFLAC__StreamDecoderStateString[];
    00111
    00112
    00113 /***********************************************************************
    00114  *
    00115  * class OggFLAC__StreamDecoder
    00116  *
    00117  ***********************************************************************/
    00118
    00119 struct OggFLAC__StreamDecoderProtected;
    00120 struct OggFLAC__StreamDecoderPrivate;
    00125 typedef struct {
    00126     struct OggFLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
    00127     struct OggFLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
    00128 } OggFLAC__StreamDecoder;
    00129
    00143 typedef FLAC__StreamDecoderReadStatus (*OggFLAC__StreamDecoderReadCallback)(const OggFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
    00144
    00157 typedef FLAC__StreamDecoderWriteStatus (*OggFLAC__StreamDecoderWriteCallback)(const OggFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
    00158
    00168 typedef void (*OggFLAC__StreamDecoderMetadataCallback)(const OggFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
    00169
    00179 typedef void (*OggFLAC__StreamDecoderErrorCallback)(const OggFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
    00180
    00181
    00182 /***********************************************************************
    00183  *
    00184  * Class constructor/destructor
    00185  *
    00186  ***********************************************************************/
    00187
    00195 OggFLAC_API OggFLAC__StreamDecoder *OggFLAC__stream_decoder_new();
    00196
    00203 OggFLAC_API void OggFLAC__stream_decoder_delete(OggFLAC__StreamDecoder *decoder);
    00204
    00205
    00206 /***********************************************************************
    00207  *
    00208  * Public class method prototypes
    00209  *
    00210  ***********************************************************************/
    00211
    00227 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_read_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderReadCallback value);
    00228
    00244 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_write_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderWriteCallback value);
    00245
    00261 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderMetadataCallback value);
    00262
    00278 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_error_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderErrorCallback value);
    00279
    00292 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_client_data(OggFLAC__StreamDecoder *decoder, void *value);
    00293
    00307 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_serial_number(OggFLAC__StreamDecoder *decoder, long serial_number);
    00308
    00322 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_respond(OggFLAC__StreamDecoder *decoder, FLAC__MetadataType type);
    00323
    00338 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_respond_application(OggFLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
    00339
    00351 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_respond_all(OggFLAC__StreamDecoder *decoder);
    00352
    00366 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_ignore(OggFLAC__StreamDecoder *decoder, FLAC__MetadataType type);
    00367
    00382 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_ignore_application(OggFLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
    00383
    00395 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_set_metadata_ignore_all(OggFLAC__StreamDecoder *decoder);
    00396
    00405 OggFLAC_API OggFLAC__StreamDecoderState OggFLAC__stream_decoder_get_state(const OggFLAC__StreamDecoder *decoder);
    00406
    00417 OggFLAC_API FLAC__StreamDecoderState OggFLAC__stream_decoder_get_FLAC_stream_decoder_state(const OggFLAC__StreamDecoder *decoder);
    00418
    00427 OggFLAC_API unsigned OggFLAC__stream_decoder_get_channels(const OggFLAC__StreamDecoder *decoder);
    00428
    00437 OggFLAC_API FLAC__ChannelAssignment OggFLAC__stream_decoder_get_channel_assignment(const OggFLAC__StreamDecoder *decoder);
    00438
    00447 OggFLAC_API unsigned OggFLAC__stream_decoder_get_bits_per_sample(const OggFLAC__StreamDecoder *decoder);
    00448
    00457 OggFLAC_API unsigned OggFLAC__stream_decoder_get_sample_rate(const OggFLAC__StreamDecoder *decoder);
    00458
    00467 OggFLAC_API unsigned OggFLAC__stream_decoder_get_blocksize(const OggFLAC__StreamDecoder *decoder);
    00468
    00484 OggFLAC_API OggFLAC__StreamDecoderState OggFLAC__stream_decoder_init(OggFLAC__StreamDecoder *decoder);
    00485
    00500 OggFLAC_API void OggFLAC__stream_decoder_finish(OggFLAC__StreamDecoder *decoder);
    00501
    00511 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_flush(OggFLAC__StreamDecoder *decoder);
    00512
    00522 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_reset(OggFLAC__StreamDecoder *decoder);
    00523
    00539 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_process_single(OggFLAC__StreamDecoder *decoder);
    00540
    00556 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_process_until_end_of_metadata(OggFLAC__StreamDecoder *decoder);
    00557
    00573 OggFLAC_API FLAC__bool OggFLAC__stream_decoder_process_until_end_of_stream(OggFLAC__StreamDecoder *decoder);
    00574
    00575 /* \} */
    00576
    00577 #ifdef __cplusplus
    00578 }
    00579 #endif
    00580
    00581 #endif