1 /* libFLAC - Free Lossless Audio Coder library
2 * Copyright (C) 2000 Josh Coalson
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef FLAC__FILE_DECODER_H
21 #define FLAC__FILE_DECODER_H
23 #include "stream_decoder.h"
26 FLAC__FILE_DECODER_OK = 0,
27 FLAC__FILE_DECODER_SEEKING,
28 FLAC__FILE_DECODER_END_OF_FILE,
29 FLAC__FILE_DECODER_ERROR_OPENING_FILE,
30 FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
31 FLAC__FILE_DECODER_SEEK_ERROR,
32 FLAC__FILE_DECODER_STREAM_ERROR,
33 FLAC__FILE_DECODER_UNINITIALIZED
34 } FLAC__FileDecoderState;
35 extern const char *FLAC__FileDecoderStateString[];
37 struct FLAC__FileDecoderPrivate;
39 FLAC__FileDecoderState state; /* must be FLAC__FILE_DECODER_UNINITIALIZED when passed to FLAC__file_decoder_init() */
40 struct FLAC__FileDecoderPrivate *guts; /* must be 0 when passed to FLAC__file_decoder_init() */
43 FLAC__FileDecoder *FLAC__file_decoder_get_new_instance();
44 void FLAC__file_decoder_free_instance(FLAC__FileDecoder *decoder);
45 FLAC__FileDecoderState FLAC__file_decoder_init(
46 FLAC__FileDecoder *decoder,
48 FLAC__StreamDecoderWriteStatus (*write_callback)(const FLAC__FileDecoder *decoder, const FLAC__FrameHeader *header, const int32 *buffer[], void *client_data),
49 void (*metadata_callback)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data),
50 void (*error_callback)(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data),
53 void FLAC__file_decoder_finish(FLAC__FileDecoder *decoder);
54 bool FLAC__file_decoder_process_whole_file(FLAC__FileDecoder *decoder);
55 bool FLAC__file_decoder_process_metadata(FLAC__FileDecoder *decoder);
56 bool FLAC__file_decoder_process_one_frame(FLAC__FileDecoder *decoder);
57 bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decoder);
58 bool FLAC__file_decoder_seek_absolute(FLAC__FileDecoder *decoder, uint64 sample);