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

# include/FLAC/file_decoder.h

Go to the documentation of this file.

    00001 /* libFLAC - Free Lossless Audio Codec library
    00002  * Copyright (C) 2000,2001,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 FLAC__FILE_DECODER_H
    00021 #define FLAC__FILE_DECODER_H
    00022
    00023 #include "export.h"
    00024 #include "seekable_stream_decoder.h"
    00025
    00026 #ifdef __cplusplus
    00027 extern "C" {
    00028 #endif
    00029
    00030
    00109 typedef enum {
    00110
    00111     FLAC__FILE_DECODER_OK = 0,
    00114     FLAC__FILE_DECODER_END_OF_FILE,
    00117     FLAC__FILE_DECODER_ERROR_OPENING_FILE,
    00120     FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
    00123     FLAC__FILE_DECODER_SEEK_ERROR,
    00126     FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR,
    00129     FLAC__FILE_DECODER_ALREADY_INITIALIZED,
    00135     FLAC__FILE_DECODER_INVALID_CALLBACK,
    00140     FLAC__FILE_DECODER_UNINITIALIZED
    00143 } FLAC__FileDecoderState;
    00144
    00150 extern FLAC_API const char * const FLAC__FileDecoderStateString[];
    00151
    00152
    00153 /***********************************************************************
    00154  *
    00155  * class FLAC__FileDecoder : public FLAC__StreamDecoder
    00156  *
    00157  ***********************************************************************/
    00158
    00159 struct FLAC__FileDecoderProtected;
    00160 struct FLAC__FileDecoderPrivate;
    00165 typedef struct {
    00166     struct FLAC__FileDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
    00167     struct FLAC__FileDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
    00168 } FLAC__FileDecoder;
    00169
    00182 typedef FLAC__StreamDecoderWriteStatus (*FLAC__FileDecoderWriteCallback)(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
    00183
    00193 typedef void (*FLAC__FileDecoderMetadataCallback)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
    00194
    00204 typedef void (*FLAC__FileDecoderErrorCallback)(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
    00205
    00206
    00207 /***********************************************************************
    00208  *
    00209  * Class constructor/destructor
    00210  *
    00211  ***********************************************************************/
    00212
    00220 FLAC_API FLAC__FileDecoder *FLAC__file_decoder_new();
    00221
    00228 FLAC_API void FLAC__file_decoder_delete(FLAC__FileDecoder *decoder);
    00229
    00230
    00231 /***********************************************************************
    00232  *
    00233  * Public class method prototypes
    00234  *
    00235  ***********************************************************************/
    00236
    00249 FLAC_API FLAC__bool FLAC__file_decoder_set_md5_checking(FLAC__FileDecoder *decoder, FLAC__bool value);
    00250
    00263 FLAC_API FLAC__bool FLAC__file_decoder_set_filename(FLAC__FileDecoder *decoder, const char *value);
    00264
    00281 FLAC_API FLAC__bool FLAC__file_decoder_set_write_callback(FLAC__FileDecoder *decoder, FLAC__FileDecoderWriteCallback value);
    00282
    00299 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_callback(FLAC__FileDecoder *decoder, FLAC__FileDecoderMetadataCallback value);
    00300
    00317 FLAC_API FLAC__bool FLAC__file_decoder_set_error_callback(FLAC__FileDecoder *decoder, FLAC__FileDecoderErrorCallback value);
    00318
    00331 FLAC_API FLAC__bool FLAC__file_decoder_set_client_data(FLAC__FileDecoder *decoder, void *value);
    00332
    00346 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_respond(FLAC__FileDecoder *decoder, FLAC__MetadataType type);
    00347
    00361 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_respond_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4]);
    00362
    00374 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_respond_all(FLAC__FileDecoder *decoder);
    00375
    00389 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_ignore(FLAC__FileDecoder *decoder, FLAC__MetadataType type);
    00390
    00404 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_ignore_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4]);
    00405
    00417 FLAC_API FLAC__bool FLAC__file_decoder_set_metadata_ignore_all(FLAC__FileDecoder *decoder);
    00418
    00427 FLAC_API FLAC__FileDecoderState FLAC__file_decoder_get_state(const FLAC__FileDecoder *decoder);
    00428
    00439 FLAC_API FLAC__SeekableStreamDecoderState FLAC__file_decoder_get_seekable_stream_decoder_state(const FLAC__FileDecoder *decoder);
    00440
    00452 FLAC_API FLAC__StreamDecoderState FLAC__file_decoder_get_stream_decoder_state(const FLAC__FileDecoder *decoder);
    00453
    00465 FLAC_API const char *FLAC__file_decoder_get_resolved_state_string(const FLAC__FileDecoder *decoder);
    00466
    00477 FLAC_API FLAC__bool FLAC__file_decoder_get_md5_checking(const FLAC__FileDecoder *decoder);
    00478
    00488 FLAC_API unsigned FLAC__file_decoder_get_channels(const FLAC__FileDecoder *decoder);
    00489
    00499 FLAC_API FLAC__ChannelAssignment FLAC__file_decoder_get_channel_assignment(const FLAC__FileDecoder *decoder);
    00500
    00510 FLAC_API unsigned FLAC__file_decoder_get_bits_per_sample(const FLAC__FileDecoder *decoder);
    00511
    00521 FLAC_API unsigned FLAC__file_decoder_get_sample_rate(const FLAC__FileDecoder *decoder);
    00522
    00532 FLAC_API unsigned FLAC__file_decoder_get_blocksize(const FLAC__FileDecoder *decoder);
    00533
    00546 FLAC_API FLAC__bool FLAC__file_decoder_get_decode_position(const FLAC__FileDecoder *decoder, FLAC__uint64 *position);
    00547
    00562 FLAC_API FLAC__FileDecoderState FLAC__file_decoder_init(FLAC__FileDecoder *decoder);
    00563
    00583 FLAC_API FLAC__bool FLAC__file_decoder_finish(FLAC__FileDecoder *decoder);
    00584
    00594 FLAC_API FLAC__bool FLAC__file_decoder_process_single(FLAC__FileDecoder *decoder);
    00595
    00605 FLAC_API FLAC__bool FLAC__file_decoder_process_until_end_of_metadata(FLAC__FileDecoder *decoder);
    00606
    00616 FLAC_API FLAC__bool FLAC__file_decoder_process_until_end_of_file(FLAC__FileDecoder *decoder);
    00617
    00627 FLAC_API FLAC__bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decoder);
    00628
    00640 FLAC_API FLAC__bool FLAC__file_decoder_seek_absolute(FLAC__FileDecoder *decoder, FLAC__uint64 sample);
    00641
    00642 /* \} */
    00643
    00644 #ifdef __cplusplus
    00645 }
    00646 #endif
    00647
    00648 #endif