include/OggFLAC/stream_decoder.h Source File

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  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 "FLAC/stream_decoder.h"
    00024
    00025 #ifdef __cplusplus
    00026 extern "C" {
    00027 #endif
    00028
    00029
    00070 typedef enum {
    00071
    00072     OggFLAC__STREAM_DECODER_OK = 0,
    00075     OggFLAC__STREAM_DECODER_OGG_ERROR,
    00078     OggFLAC__STREAM_DECODER_READ_ERROR,
    00081     OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR,
    00086     OggFLAC__STREAM_DECODER_INVALID_CALLBACK,
    00089     OggFLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
    00092     OggFLAC__STREAM_DECODER_ALREADY_INITIALIZED,
    00098     OggFLAC__STREAM_DECODER_UNINITIALIZED
    00101 } OggFLAC__StreamDecoderState;
    00102
    00108 extern const char * const OggFLAC__StreamDecoderStateString[];
    00109
    00110
    00111 /***********************************************************************
    00112  *
    00113  * class OggFLAC__StreamDecoder
    00114  *
    00115  ***********************************************************************/
    00116
    00117 struct OggFLAC__StreamDecoderProtected;
    00118 struct OggFLAC__StreamDecoderPrivate;
    00123 typedef struct {
    00124     struct OggFLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
    00125     struct OggFLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
    00126 } OggFLAC__StreamDecoder;
    00127
    00141 typedef FLAC__StreamDecoderReadStatus (*OggFLAC__StreamDecoderReadCallback)(const OggFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
    00142
    00155 typedef FLAC__StreamDecoderWriteStatus (*OggFLAC__StreamDecoderWriteCallback)(const OggFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
    00156
    00166 typedef void (*OggFLAC__StreamDecoderMetadataCallback)(const OggFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
    00167
    00177 typedef void (*OggFLAC__StreamDecoderErrorCallback)(const OggFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
    00178
    00179
    00180 /***********************************************************************
    00181  *
    00182  * Class constructor/destructor
    00183  *
    00184  ***********************************************************************/
    00185
    00193 OggFLAC__StreamDecoder *OggFLAC__stream_decoder_new();
    00194
    00201 void OggFLAC__stream_decoder_delete(OggFLAC__StreamDecoder *decoder);
    00202
    00203
    00204 /***********************************************************************
    00205  *
    00206  * Public class method prototypes
    00207  *
    00208  ***********************************************************************/
    00209
    00225 FLAC__bool OggFLAC__stream_decoder_set_read_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderReadCallback value);
    00226
    00242 FLAC__bool OggFLAC__stream_decoder_set_write_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderWriteCallback value);
    00243
    00259 FLAC__bool OggFLAC__stream_decoder_set_metadata_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderMetadataCallback value);
    00260
    00276 FLAC__bool OggFLAC__stream_decoder_set_error_callback(OggFLAC__StreamDecoder *decoder, OggFLAC__StreamDecoderErrorCallback value);
    00277
    00290 FLAC__bool OggFLAC__stream_decoder_set_client_data(OggFLAC__StreamDecoder *decoder, void *value);
    00291
    00305 FLAC__bool OggFLAC__stream_decoder_set_serial_number(OggFLAC__StreamDecoder *decoder, long serial_number);
    00306
    00320 FLAC__bool OggFLAC__stream_decoder_set_metadata_respond(OggFLAC__StreamDecoder *decoder, FLAC__MetadataType type);
    00321
    00336 FLAC__bool OggFLAC__stream_decoder_set_metadata_respond_application(OggFLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
    00337
    00349 FLAC__bool OggFLAC__stream_decoder_set_metadata_respond_all(OggFLAC__StreamDecoder *decoder);
    00350
    00364 FLAC__bool OggFLAC__stream_decoder_set_metadata_ignore(OggFLAC__StreamDecoder *decoder, FLAC__MetadataType type);
    00365
    00380 FLAC__bool OggFLAC__stream_decoder_set_metadata_ignore_application(OggFLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
    00381
    00393 FLAC__bool OggFLAC__stream_decoder_set_metadata_ignore_all(OggFLAC__StreamDecoder *decoder);
    00394
    00403 OggFLAC__StreamDecoderState OggFLAC__stream_decoder_get_state(const OggFLAC__StreamDecoder *decoder);
    00404
    00415 FLAC__StreamDecoderState OggFLAC__stream_decoder_get_FLAC_stream_decoder_state(const OggFLAC__StreamDecoder *decoder);
    00416
    00425 unsigned OggFLAC__stream_decoder_get_channels(const OggFLAC__StreamDecoder *decoder);
    00426
    00435 FLAC__ChannelAssignment OggFLAC__stream_decoder_get_channel_assignment(const OggFLAC__StreamDecoder *decoder);
    00436
    00445 unsigned OggFLAC__stream_decoder_get_bits_per_sample(const OggFLAC__StreamDecoder *decoder);
    00446
    00455 unsigned OggFLAC__stream_decoder_get_sample_rate(const OggFLAC__StreamDecoder *decoder);
    00456
    00465 unsigned OggFLAC__stream_decoder_get_blocksize(const OggFLAC__StreamDecoder *decoder);
    00466
    00482 OggFLAC__StreamDecoderState OggFLAC__stream_decoder_init(OggFLAC__StreamDecoder *decoder);
    00483
    00498 void OggFLAC__stream_decoder_finish(OggFLAC__StreamDecoder *decoder);
    00499
    00509 FLAC__bool OggFLAC__stream_decoder_flush(OggFLAC__StreamDecoder *decoder);
    00510
    00520 FLAC__bool OggFLAC__stream_decoder_reset(OggFLAC__StreamDecoder *decoder);
    00521
    00537 FLAC__bool OggFLAC__stream_decoder_process_single(OggFLAC__StreamDecoder *decoder);
    00538
    00554 FLAC__bool OggFLAC__stream_decoder_process_until_end_of_metadata(OggFLAC__StreamDecoder *decoder);
    00555
    00571 FLAC__bool OggFLAC__stream_decoder_process_until_end_of_stream(OggFLAC__StreamDecoder *decoder);
    00572
    00573 /* \} */
    00574
    00575 #ifdef __cplusplus
    00576 }
    00577 #endif
    00578
    00579 #endif