include/FLAC/file_decoder.h Source File

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  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 "seekable_stream_decoder.h"
    00024
    00025 #ifdef __cplusplus
    00026 extern "C" {
    00027 #endif
    00028
    00029
    00108 typedef enum {
    00109
    00110     FLAC__FILE_DECODER_OK = 0,
    00113     FLAC__FILE_DECODER_END_OF_FILE,
    00116     FLAC__FILE_DECODER_ERROR_OPENING_FILE,
    00119     FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
    00122     FLAC__FILE_DECODER_SEEK_ERROR,
    00125     FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR,
    00128     FLAC__FILE_DECODER_ALREADY_INITIALIZED,
    00134     FLAC__FILE_DECODER_INVALID_CALLBACK,
    00139     FLAC__FILE_DECODER_UNINITIALIZED
    00142 } FLAC__FileDecoderState;
    00143
    00149 extern const char * const FLAC__FileDecoderStateString[];
    00150
    00151
    00152 /***********************************************************************
    00153  *
    00154  * class FLAC__FileDecoder : public FLAC__StreamDecoder
    00155  *
    00156  ***********************************************************************/
    00157
    00158 struct FLAC__FileDecoderProtected;
    00159 struct FLAC__FileDecoderPrivate;
    00164 typedef struct {
    00165     struct FLAC__FileDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
    00166     struct FLAC__FileDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
    00167 } FLAC__FileDecoder;
    00168
    00181 typedef FLAC__StreamDecoderWriteStatus (*FLAC__FileDecoderWriteCallback)(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
    00182
    00192 typedef void (*FLAC__FileDecoderMetadataCallback)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
    00193
    00203 typedef void (*FLAC__FileDecoderErrorCallback)(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
    00204
    00205
    00206 /***********************************************************************
    00207  *
    00208  * Class constructor/destructor
    00209  *
    00210  ***********************************************************************/
    00211
    00219 FLAC__FileDecoder *FLAC__file_decoder_new();
    00220
    00227 void FLAC__file_decoder_delete(FLAC__FileDecoder *decoder);
    00228
    00229
    00230 /***********************************************************************
    00231  *
    00232  * Public class method prototypes
    00233  *
    00234  ***********************************************************************/
    00235
    00248 FLAC__bool FLAC__file_decoder_set_md5_checking(FLAC__FileDecoder *decoder, FLAC__bool value);
    00249
    00262 FLAC__bool FLAC__file_decoder_set_filename(FLAC__FileDecoder *decoder, const char *value);
    00263
    00280 FLAC__bool FLAC__file_decoder_set_write_callback(FLAC__FileDecoder *decoder, FLAC__FileDecoderWriteCallback value);
    00281
    00298 FLAC__bool FLAC__file_decoder_set_metadata_callback(FLAC__FileDecoder *decoder, FLAC__FileDecoderMetadataCallback value);
    00299
    00316 FLAC__bool FLAC__file_decoder_set_error_callback(FLAC__FileDecoder *decoder, FLAC__FileDecoderErrorCallback value);
    00317
    00330 FLAC__bool FLAC__file_decoder_set_client_data(FLAC__FileDecoder *decoder, void *value);
    00331
    00345 FLAC__bool FLAC__file_decoder_set_metadata_respond(FLAC__FileDecoder *decoder, FLAC__MetadataType type);
    00346
    00360 FLAC__bool FLAC__file_decoder_set_metadata_respond_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4]);
    00361
    00373 FLAC__bool FLAC__file_decoder_set_metadata_respond_all(FLAC__FileDecoder *decoder);
    00374
    00388 FLAC__bool FLAC__file_decoder_set_metadata_ignore(FLAC__FileDecoder *decoder, FLAC__MetadataType type);
    00389
    00403 FLAC__bool FLAC__file_decoder_set_metadata_ignore_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4]);
    00404
    00416 FLAC__bool FLAC__file_decoder_set_metadata_ignore_all(FLAC__FileDecoder *decoder);
    00417
    00426 FLAC__FileDecoderState FLAC__file_decoder_get_state(const FLAC__FileDecoder *decoder);
    00427
    00438 FLAC__SeekableStreamDecoderState FLAC__file_decoder_get_seekable_stream_decoder_state(const FLAC__FileDecoder *decoder);
    00439
    00451 FLAC__StreamDecoderState FLAC__file_decoder_get_stream_decoder_state(const FLAC__FileDecoder *decoder);
    00452
    00463 FLAC__bool FLAC__file_decoder_get_md5_checking(const FLAC__FileDecoder *decoder);
    00464
    00474 unsigned FLAC__file_decoder_get_channels(const FLAC__FileDecoder *decoder);
    00475
    00485 FLAC__ChannelAssignment FLAC__file_decoder_get_channel_assignment(const FLAC__FileDecoder *decoder);
    00486
    00496 unsigned FLAC__file_decoder_get_bits_per_sample(const FLAC__FileDecoder *decoder);
    00497
    00507 unsigned FLAC__file_decoder_get_sample_rate(const FLAC__FileDecoder *decoder);
    00508
    00518 unsigned FLAC__file_decoder_get_blocksize(const FLAC__FileDecoder *decoder);
    00519
    00534 FLAC__FileDecoderState FLAC__file_decoder_init(FLAC__FileDecoder *decoder);
    00535
    00555 FLAC__bool FLAC__file_decoder_finish(FLAC__FileDecoder *decoder);
    00556
    00566 FLAC__bool FLAC__file_decoder_process_single(FLAC__FileDecoder *decoder);
    00567
    00577 FLAC__bool FLAC__file_decoder_process_until_end_of_metadata(FLAC__FileDecoder *decoder);
    00578
    00588 FLAC__bool FLAC__file_decoder_process_until_end_of_file(FLAC__FileDecoder *decoder);
    00589
    00599 FLAC__bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decoder);
    00600
    00612 FLAC__bool FLAC__file_decoder_seek_absolute(FLAC__FileDecoder *decoder, FLAC__uint64 sample);
    00613
    00614 /* \} */
    00615
    00616 #ifdef __cplusplus
    00617 }
    00618 #endif
    00619
    00620 #endif