2002-08-05 06:49:45 +00:00
|
|
|
/* libOggFLAC - Free Lossless Audio Codec + Ogg library
|
|
|
|
|
* Copyright (C) 2002 Josh Coalson
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Library General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef OggFLAC__FILE_DECODER_H
|
|
|
|
|
#define OggFLAC__FILE_DECODER_H
|
|
|
|
|
|
2002-10-16 22:18:32 +00:00
|
|
|
#include "export.h"
|
|
|
|
|
|
2002-08-05 06:49:45 +00:00
|
|
|
#include "FLAC/file_decoder.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** \file include/OggFLAC/file_decoder.h
|
|
|
|
|
*
|
|
|
|
|
* \brief
|
|
|
|
|
* This module contains the functions which implement the file
|
|
|
|
|
* decoder.
|
|
|
|
|
*
|
|
|
|
|
* See the detailed documentation in the
|
|
|
|
|
* \link oggflac_file_decoder file decoder \endlink module.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** \defgroup oggflac_file_decoder OggFLAC/file_decoder.h: file decoder interface
|
|
|
|
|
* \ingroup oggflac_decoder
|
|
|
|
|
*
|
|
|
|
|
* \brief
|
|
|
|
|
* This module contains the functions which implement the file
|
|
|
|
|
* decoder.
|
|
|
|
|
*
|
2002-08-06 05:38:55 +00:00
|
|
|
* The interface here is identical to FLAC's file decoder. See the
|
|
|
|
|
* defaults, including the callbacks. See the \link flac_file_decoder
|
|
|
|
|
* FLAC file decoder module \endlink for full documentation.
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** State values for an OggFLAC__FileDecoder
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* The decoder's state can be obtained by calling OggFLAC__file_decoder_get_state().
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
OggFLAC__FILE_DECODER_OK = 0,
|
2002-08-05 06:49:45 +00:00
|
|
|
/**< The decoder is in the normal OK state. */
|
|
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
OggFLAC__FILE_DECODER_FLAC_FILE_DECODER_ERROR,
|
|
|
|
|
/**< An error occurred in the underlying FLAC file decoder;
|
|
|
|
|
* check OggFLAC__file_decoder_get_FLAC_file_decoder_state().
|
|
|
|
|
*/
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
OggFLAC__FILE_DECODER_INVALID_CALLBACK,
|
|
|
|
|
/**< The decoder was initialized before setting all the required callbacks. */
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
OggFLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
|
|
|
|
|
/**< Memory allocation failed. */
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
OggFLAC__FILE_DECODER_ALREADY_INITIALIZED,
|
|
|
|
|
/**< OggFLAC__file_decoder_init() was called when the decoder was
|
|
|
|
|
* already initialized, usually because
|
|
|
|
|
* OggFLAC__file_decoder_finish() was not called.
|
2002-08-05 06:49:45 +00:00
|
|
|
*/
|
|
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
OggFLAC__FILE_DECODER_UNINITIALIZED
|
2002-08-05 06:49:45 +00:00
|
|
|
/**< The decoder is in the uninitialized state. */
|
|
|
|
|
|
|
|
|
|
} OggFLAC__FileDecoderState;
|
|
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** Maps an OggFLAC__FileDecoderState to a C string.
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
2002-08-06 05:38:55 +00:00
|
|
|
* Using an OggFLAC__FileDecoderState as the index to this array
|
2002-08-05 06:49:45 +00:00
|
|
|
* will give the string equivalent. The contents should not be modified.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
extern OggFLAC_API const char * const OggFLAC__FileDecoderStateString[];
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
*
|
2002-08-06 05:38:55 +00:00
|
|
|
* class OggFLAC__FileDecoder : public FLAC__FileDecoder
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
|
|
struct OggFLAC__FileDecoderProtected;
|
|
|
|
|
struct OggFLAC__FileDecoderPrivate;
|
|
|
|
|
/** The opaque structure definition for the file decoder type. See the
|
|
|
|
|
* \link oggflac_file_decoder file decoder module \endlink for a detailed
|
|
|
|
|
* description.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
|
|
|
|
struct OggFLAC__FileDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
|
|
|
|
|
struct OggFLAC__FileDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
|
|
|
|
|
} OggFLAC__FileDecoder;
|
|
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
typedef FLAC__StreamDecoderWriteStatus (*OggFLAC__FileDecoderWriteCallback)(const OggFLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
|
|
|
|
|
typedef void (*OggFLAC__FileDecoderMetadataCallback)(const OggFLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
|
|
|
|
|
typedef void (*OggFLAC__FileDecoderErrorCallback)(const OggFLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
*
|
|
|
|
|
* Class constructor/destructor
|
|
|
|
|
*
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
|
|
/** Create a new file decoder instance. The instance is created with
|
|
|
|
|
* default settings; see the individual OggFLAC__file_decoder_set_*()
|
|
|
|
|
* functions for each setting's default.
|
|
|
|
|
*
|
|
|
|
|
* \retval OggFLAC__FileDecoder*
|
|
|
|
|
* \c NULL if there was an error allocating memory, else the new instance.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API OggFLAC__FileDecoder *OggFLAC__file_decoder_new();
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Free a decoder instance. Deletes the object pointed to by \a decoder.
|
|
|
|
|
*
|
|
|
|
|
* \param decoder A pointer to an existing decoder.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API void OggFLAC__file_decoder_delete(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
*
|
|
|
|
|
* Public class method prototypes
|
|
|
|
|
*
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
2002-09-04 07:52:58 +00:00
|
|
|
/*@@@inherit set_serial_number*/
|
|
|
|
|
|
2002-08-05 06:49:45 +00:00
|
|
|
/** Set the "MD5 signature checking" flag.
|
2002-08-06 05:38:55 +00:00
|
|
|
* This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_md5_checking().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default \c false
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param value See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_md5_checking(OggFLAC__FileDecoder *decoder, FLAC__bool value);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Set the input file name to decode.
|
2002-08-06 05:38:55 +00:00
|
|
|
* This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_filename().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default \c "-"
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param value The input file name, or "-" for \c stdin.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \code value != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, or there was a memory
|
|
|
|
|
* allocation error, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_filename(OggFLAC__FileDecoder *decoder, const char *value);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Set the write callback.
|
2002-08-06 05:38:55 +00:00
|
|
|
* This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_write_callback().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \note
|
|
|
|
|
* The callback is mandatory and must be set before initialization.
|
|
|
|
|
*
|
|
|
|
|
* \default \c NULL
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param value See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \code value != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_write_callback(OggFLAC__FileDecoder *decoder, OggFLAC__FileDecoderWriteCallback value);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Set the metadata callback.
|
2002-08-06 05:38:55 +00:00
|
|
|
* This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_callback().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \note
|
|
|
|
|
* The callback is mandatory and must be set before initialization.
|
|
|
|
|
*
|
|
|
|
|
* \default \c NULL
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param value See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \code value != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_callback(OggFLAC__FileDecoder *decoder, OggFLAC__FileDecoderMetadataCallback value);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Set the error callback.
|
2002-08-06 05:38:55 +00:00
|
|
|
* This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_error_callback().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \note
|
|
|
|
|
* The callback is mandatory and must be set before initialization.
|
|
|
|
|
*
|
|
|
|
|
* \default \c NULL
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param value See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \code value != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_error_callback(OggFLAC__FileDecoder *decoder, OggFLAC__FileDecoderErrorCallback value);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Set the client data to be passed back to callbacks.
|
|
|
|
|
* This value will be supplied to callbacks in their \a client_data
|
|
|
|
|
* argument.
|
|
|
|
|
*
|
|
|
|
|
* \default \c NULL
|
2002-09-04 07:52:58 +00:00
|
|
|
* \param decoder A decoder instance to set.
|
2002-08-05 06:49:45 +00:00
|
|
|
* \param value See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_client_data(OggFLAC__FileDecoder *decoder, void *value);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_respond().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default By default, only the \c STREAMINFO block is returned via the
|
|
|
|
|
* metadata callback.
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param type See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \a type is valid
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_respond(OggFLAC__FileDecoder *decoder, OggFLAC__MetadataType type);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_respond_application().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default By default, only the \c STREAMINFO block is returned via the
|
|
|
|
|
* metadata callback.
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param id See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \code id != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_respond_application(OggFLAC__FileDecoder *decoder, const FLAC__byte id[4]);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_respond_all().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default By default, only the \c STREAMINFO block is returned via the
|
|
|
|
|
* metadata callback.
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_respond_all(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_ignore().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default By default, only the \c STREAMINFO block is returned via the
|
|
|
|
|
* metadata callback.
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param type See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \a type is valid
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_ignore(OggFLAC__FileDecoder *decoder, OggFLAC__MetadataType type);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_ignore_application().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default By default, only the \c STREAMINFO block is returned via the
|
|
|
|
|
* metadata callback.
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \param id See above.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \code id != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_ignore_application(OggFLAC__FileDecoder *decoder, const FLAC__byte id[4]);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_set_metadata_ignore_all().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \default By default, only the \c STREAMINFO block is returned via the
|
|
|
|
|
* metadata callback.
|
|
|
|
|
* \param decoder A decoder instance to set.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if the decoder is already initialized, else \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_set_metadata_ignore_all(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Get the current decoder state.
|
|
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval OggFLAC__FileDecoderState
|
|
|
|
|
* The current decoder state.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API OggFLAC__FileDecoderState OggFLAC__file_decoder_get_state(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** Get the state of the underlying FLAC file decoder.
|
|
|
|
|
* Useful when the file decoder state is
|
|
|
|
|
* \c OggFLAC__FILE_DECODER_FLAC_FILE_DECODER_ERROR.
|
|
|
|
|
*
|
2002-09-04 07:52:58 +00:00
|
|
|
* \param decoder A decoder instance to query.
|
2002-08-06 05:38:55 +00:00
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__FileDecoderState
|
|
|
|
|
* The FLAC file decoder state.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__FileDecoderState OggFLAC__file_decoder_get_FLAC_file_decoder_state(const OggFLAC__FileDecoder *decoder);
|
2002-08-06 05:38:55 +00:00
|
|
|
|
|
|
|
|
/** Get the state of the underlying FLAC file decoder's seekable stream decoder.
|
2002-08-05 06:49:45 +00:00
|
|
|
* Useful when the file decoder state is
|
2002-08-06 05:38:55 +00:00
|
|
|
* \c OggFLAC__FILE_DECODER_FLAC_FILE_DECODER_ERROR and the FLAC file decoder state is
|
|
|
|
|
* \c FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR.
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
2002-09-04 07:52:58 +00:00
|
|
|
* \param decoder A decoder instance to query.
|
2002-08-05 06:49:45 +00:00
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
2002-08-06 05:38:55 +00:00
|
|
|
* \retval FLAC__SeekableStreamDecoderState
|
|
|
|
|
* The FLAC seekable stream decoder state.
|
2002-08-05 06:49:45 +00:00
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__SeekableStreamDecoderState OggFLAC__file_decoder_get_FLAC_seekable_stream_decoder_state(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** Get the state of the underlying FLAC file decoder's stream decoder.
|
2002-08-05 06:49:45 +00:00
|
|
|
* Useful when the file decoder state is
|
2002-08-06 05:38:55 +00:00
|
|
|
* \c OggFLAC__FILE_DECODER_FLAC_FILE_DECODER_ERROR and the FLAC file decoder state is
|
|
|
|
|
* \c FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR and the
|
|
|
|
|
* FLAC seekable stream decoder state is \c FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR.
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
2002-09-04 07:52:58 +00:00
|
|
|
* \param decoder A decoder instance to query.
|
2002-08-05 06:49:45 +00:00
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
2002-08-06 05:38:55 +00:00
|
|
|
* \retval FLAC__StreamDecoderState
|
|
|
|
|
* The FLAC stream decoder state.
|
2002-08-05 06:49:45 +00:00
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__StreamDecoderState OggFLAC__file_decoder_get_FLAC_stream_decoder_state(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_get_md5_checking().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_get_md5_checking(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_get_channels().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval unsigned
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API unsigned OggFLAC__file_decoder_get_channels(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_get_channel_assignment().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval OggFLAC__ChannelAssignment
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API OggFLAC__ChannelAssignment OggFLAC__file_decoder_get_channel_assignment(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_get_bits_per_sample().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval unsigned
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API unsigned OggFLAC__file_decoder_get_bits_per_sample(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_get_sample_rate().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval unsigned
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API unsigned OggFLAC__file_decoder_get_sample_rate(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_get_blocksize().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance to query.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval unsigned
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API unsigned OggFLAC__file_decoder_get_blocksize(const OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Initialize the decoder instance.
|
|
|
|
|
* Should be called after OggFLAC__file_decoder_new() and
|
|
|
|
|
* OggFLAC__file_decoder_set_*() but before any of the
|
|
|
|
|
* OggFLAC__file_decoder_process_*() functions. Will set and return
|
|
|
|
|
* the decoder state, which will be OggFLAC__FILE_DECODER_OK if
|
|
|
|
|
* initialization succeeded.
|
|
|
|
|
*
|
|
|
|
|
* \param decoder An uninitialized decoder instance.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval OggFLAC__FileDecoderState
|
|
|
|
|
* \c OggFLAC__FILE_DECODER_OK if initialization was successful; see
|
|
|
|
|
* OggFLAC__FileDecoderState for the meanings of other return values.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API OggFLAC__FileDecoderState OggFLAC__file_decoder_init(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/** Finish the decoding process.
|
|
|
|
|
* Flushes the decoding buffer, releases resources, resets the decoder
|
|
|
|
|
* settings to their defaults, and returns the decoder state to
|
|
|
|
|
* OggFLAC__FILE_DECODER_UNINITIALIZED.
|
|
|
|
|
*
|
|
|
|
|
* In the event of a prematurely-terminated decode, it is not strictly
|
|
|
|
|
* necessary to call this immediately before OggFLAC__file_decoder_delete()
|
|
|
|
|
* but it is good practice to match every OggFLAC__file_decoder_init() with
|
2002-08-06 05:38:55 +00:00
|
|
|
* an OggFLAC__file_decoder_finish().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder An uninitialized decoder instance.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c false if MD5 checking is on AND a STREAMINFO block was available
|
|
|
|
|
* AND the MD5 signature in the STREAMINFO block was non-zero AND the
|
|
|
|
|
* signature does not match the one computed by the decoder; else
|
|
|
|
|
* \c true.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_finish(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_process_single().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_process_single(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_process_until_end_of_metadata().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_process_until_end_of_metadata(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_process_until_end_of_stream().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_process_until_end_of_file(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_process_remaining_frames().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* See above.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_process_remaining_frames(OggFLAC__FileDecoder *decoder);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
2002-08-06 05:38:55 +00:00
|
|
|
/** This is inherited from FLAC__FileDecoder; see
|
|
|
|
|
* FLAC__file_decoder_seek_absolute().
|
2002-08-05 06:49:45 +00:00
|
|
|
*
|
|
|
|
|
* \param decoder A decoder instance.
|
|
|
|
|
* \param sample The target sample number to seek to.
|
|
|
|
|
* \assert
|
|
|
|
|
* \code decoder != NULL \endcode
|
|
|
|
|
* \retval FLAC__bool
|
|
|
|
|
* \c true if successful, else \c false.
|
|
|
|
|
*/
|
2002-10-16 22:18:32 +00:00
|
|
|
OggFLAC_API FLAC__bool OggFLAC__file_decoder_seek_absolute(OggFLAC__FileDecoder *decoder, FLAC__uint64 sample);
|
2002-08-05 06:49:45 +00:00
|
|
|
|
|
|
|
|
/* \} */
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|