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,2003,2004  Josh Coalson
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  *
00008  * - Redistributions of source code must retain the above copyright
00009  * notice, this list of conditions and the following disclaimer.
00010  *
00011  * - Redistributions in binary form must reproduce the above copyright
00012  * notice, this list of conditions and the following disclaimer in the
00013  * documentation and/or other materials provided with the distribution.
00014  *
00015  * - Neither the name of the Xiph.org Foundation nor the names of its
00016  * contributors may be used to endorse or promote products derived from
00017  * this software without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00022  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00023  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00024  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00025  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00026  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00027  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00028  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  */
00031 
00032 #ifndef FLAC__SEEKABLE_STREAM_DECODER_H
00033 #define FLAC__SEEKABLE_STREAM_DECODER_H
00034 
00035 #include "export.h"
00036 #include "stream_decoder.h"
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 
00132 typedef enum {
00133 
00134     FLAC__SEEKABLE_STREAM_DECODER_OK = 0,
00137     FLAC__SEEKABLE_STREAM_DECODER_SEEKING,
00140     FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM,
00143     FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
00146     FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR,
00149     FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR,
00152     FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR,
00157     FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED,
00163     FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK,
00168     FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
00171 } FLAC__SeekableStreamDecoderState;
00172 
00178 extern FLAC_API const char * const FLAC__SeekableStreamDecoderStateString[];
00179 
00180 
00183 typedef enum {
00184 
00185     FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK,
00188     FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR
00191 } FLAC__SeekableStreamDecoderReadStatus;
00192 
00198 extern FLAC_API const char * const FLAC__SeekableStreamDecoderReadStatusString[];
00199 
00200 
00203 typedef enum {
00204 
00205     FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK,
00208     FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR
00211 } FLAC__SeekableStreamDecoderSeekStatus;
00212 
00218 extern FLAC_API const char * const FLAC__SeekableStreamDecoderSeekStatusString[];
00219 
00220 
00223 typedef enum {
00224 
00225     FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK,
00228     FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR
00231 } FLAC__SeekableStreamDecoderTellStatus;
00232 
00238 extern FLAC_API const char * const FLAC__SeekableStreamDecoderTellStatusString[];
00239 
00240 
00243 typedef enum {
00244 
00245     FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK,
00248     FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR
00251 } FLAC__SeekableStreamDecoderLengthStatus;
00252 
00258 extern FLAC_API const char * const FLAC__SeekableStreamDecoderLengthStatusString[];
00259 
00260 
00261 /***********************************************************************
00262  *
00263  * class FLAC__SeekableStreamDecoder : public FLAC__StreamDecoder
00264  *
00265  ***********************************************************************/
00266 
00267 struct FLAC__SeekableStreamDecoderProtected;
00268 struct FLAC__SeekableStreamDecoderPrivate;
00274 typedef struct {
00275     struct FLAC__SeekableStreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
00276     struct FLAC__SeekableStreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
00277 } FLAC__SeekableStreamDecoder;
00278 
00292 typedef FLAC__SeekableStreamDecoderReadStatus (*FLAC__SeekableStreamDecoderReadCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
00293 
00305 typedef FLAC__SeekableStreamDecoderSeekStatus (*FLAC__SeekableStreamDecoderSeekCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
00306 
00318 typedef FLAC__SeekableStreamDecoderTellStatus (*FLAC__SeekableStreamDecoderTellCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
00319 
00331 typedef FLAC__SeekableStreamDecoderLengthStatus (*FLAC__SeekableStreamDecoderLengthCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
00332 
00342 typedef FLAC__bool (*FLAC__SeekableStreamDecoderEofCallback)(const FLAC__SeekableStreamDecoder *decoder, void *client_data);
00343 
00356 typedef FLAC__StreamDecoderWriteStatus (*FLAC__SeekableStreamDecoderWriteCallback)(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
00357 
00367 typedef void (*FLAC__SeekableStreamDecoderMetadataCallback)(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
00368 
00378 typedef void (*FLAC__SeekableStreamDecoderErrorCallback)(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
00379 
00380 
00381 /***********************************************************************
00382  *
00383  * Class constructor/destructor
00384  *
00385  ***********************************************************************/
00386 
00395 FLAC_API FLAC__SeekableStreamDecoder *FLAC__seekable_stream_decoder_new();
00396 
00403 FLAC_API void FLAC__seekable_stream_decoder_delete(FLAC__SeekableStreamDecoder *decoder);
00404 
00405 
00406 /***********************************************************************
00407  *
00408  * Public class method prototypes
00409  *
00410  ***********************************************************************/
00411 
00429 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_md5_checking(FLAC__SeekableStreamDecoder *decoder, FLAC__bool value);
00430 
00447 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_read_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderReadCallback value);
00448 
00466 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_seek_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderSeekCallback value);
00467 
00485 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_tell_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderTellCallback value);
00486 
00503 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_length_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderLengthCallback value);
00504 
00521 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_eof_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderEofCallback value);
00522 
00539 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_write_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderWriteCallback value);
00540 
00557 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderMetadataCallback value);
00558 
00575 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_error_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderErrorCallback value);
00576 
00589 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_client_data(FLAC__SeekableStreamDecoder *decoder, void *value);
00590 
00604 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond(FLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type);
00605 
00619 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]);
00620 
00632 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_all(FLAC__SeekableStreamDecoder *decoder);
00633 
00647 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore(FLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type);
00648 
00662 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]);
00663 
00675 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_all(FLAC__SeekableStreamDecoder *decoder);
00676 
00685 FLAC_API FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_get_state(const FLAC__SeekableStreamDecoder *decoder);
00686 
00697 FLAC_API FLAC__StreamDecoderState FLAC__seekable_stream_decoder_get_stream_decoder_state(const FLAC__SeekableStreamDecoder *decoder);
00698 
00710 FLAC_API const char *FLAC__seekable_stream_decoder_get_resolved_state_string(const FLAC__SeekableStreamDecoder *decoder);
00711 
00724 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_get_md5_checking(const FLAC__SeekableStreamDecoder *decoder);
00725 
00735 FLAC_API unsigned FLAC__seekable_stream_decoder_get_channels(const FLAC__SeekableStreamDecoder *decoder);
00736 
00746 FLAC_API FLAC__ChannelAssignment FLAC__seekable_stream_decoder_get_channel_assignment(const FLAC__SeekableStreamDecoder *decoder);
00747 
00757 FLAC_API unsigned FLAC__seekable_stream_decoder_get_bits_per_sample(const FLAC__SeekableStreamDecoder *decoder);
00758 
00768 FLAC_API unsigned FLAC__seekable_stream_decoder_get_sample_rate(const FLAC__SeekableStreamDecoder *decoder);
00769 
00779 FLAC_API unsigned FLAC__seekable_stream_decoder_get_blocksize(const FLAC__SeekableStreamDecoder *decoder);
00780 
00796 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_get_decode_position(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *position);
00797 
00813 FLAC_API FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_init(FLAC__SeekableStreamDecoder *decoder);
00814 
00835 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_finish(FLAC__SeekableStreamDecoder *decoder);
00836 
00849 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_flush(FLAC__SeekableStreamDecoder *decoder);
00850 
00866 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_reset(FLAC__SeekableStreamDecoder *decoder);
00867 
00877 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_process_single(FLAC__SeekableStreamDecoder *decoder);
00878 
00888 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_process_until_end_of_metadata(FLAC__SeekableStreamDecoder *decoder);
00889 
00899 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_process_until_end_of_stream(FLAC__SeekableStreamDecoder *decoder);
00900 
00910 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_skip_single_frame(FLAC__SeekableStreamDecoder *decoder);
00911 
00923 FLAC_API FLAC__bool FLAC__seekable_stream_decoder_seek_absolute(FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 sample);
00924 
00925 /* \} */
00926 
00927 #ifdef __cplusplus
00928 }
00929 #endif
00930 
00931 #endif

Generated on Tue Sep 28 21:19:41 2004 for FLAC by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002