FLAC 1.3.3

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
FLAC::Decoder::File Class Referenceabstract
FLAC C++ API » FLAC++/decoder.h: decoder classes

`#include <decoder.h>`

Inheritance diagram for FLAC::Decoder::File:

## Public Member Functions
virtual ::FLAC__StreamDecoderInitStatus | init (FILE *file)
virtual ::FLAC__StreamDecoderInitStatus | init (const char *filename)
virtual ::FLAC__StreamDecoderInitStatus | init (const std::string &filename)
virtual ::FLAC__StreamDecoderInitStatus | init_ogg (FILE *file)
virtual ::FLAC__StreamDecoderInitStatus | init_ogg (const char *filename)
virtual ::FLAC__StreamDecoderInitStatus | init_ogg (const std::string &filename)
virtual bool | set_ogg_serial_number (long value)
virtual bool | set_md5_checking (bool value)
virtual bool | set_metadata_respond (::FLAC__MetadataType type)
virtual bool | set_metadata_respond_application (const FLAC__byte id[4])
virtual bool | set_metadata_respond_all ()
virtual bool | set_metadata_ignore (::FLAC__MetadataType type)
virtual bool | set_metadata_ignore_application (const FLAC__byte id[4])
virtual bool | set_metadata_ignore_all ()
State | get_state () const
virtual bool | get_md5_checking () const
virtual FLAC__uint64 | get_total_samples () const
virtual uint32_t | get_channels () const
virtual ::FLAC__ChannelAssignment | get_channel_assignment () const
virtual uint32_t | get_bits_per_sample () const
virtual uint32_t | get_sample_rate () const
virtual uint32_t | get_blocksize () const
virtual bool | get_decode_position (FLAC__uint64 *position) const
virtual ::FLAC__StreamDecoderInitStatus | init ()
virtual ::FLAC__StreamDecoderInitStatus | init_ogg ()
virtual bool | finish ()
virtual bool | flush ()
virtual bool | reset ()
virtual bool | process_single ()
virtual bool | process_until_end_of_metadata ()
virtual bool | process_until_end_of_stream ()
virtual bool | skip_single_frame ()
virtual bool | seek_absolute (FLAC__uint64 sample)
virtual bool | is_valid () const
| operator bool () const

## Protected Member Functions
virtual ::FLAC__StreamDecoderReadStatus | read_callback (FLAC__byte buffer[], size_t *bytes)
virtual ::FLAC__StreamDecoderSeekStatus | seek_callback (FLAC__uint64 absolute_byte_offset)
virtual ::FLAC__StreamDecoderTellStatus | tell_callback (FLAC__uint64 *absolute_byte_offset)
virtual ::FLAC__StreamDecoderLengthStatus | length_callback (FLAC__uint64 *stream_length)
virtual bool | eof_callback ()
virtual ::FLAC__StreamDecoderWriteStatus | write_callback (const ::FLAC__Frame *frame, const FLAC__int32 *const buffer[])=0
virtual void | metadata_callback (const ::FLAC__StreamMetadata *metadata)
virtual void | error_callback (::FLAC__StreamDecoderErrorStatus status)=0

## Static Protected Member Functions
::FLAC__StreamDecoderReadStatus | read_callback_ (const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
::FLAC__StreamDecoderSeekStatus | seek_callback_ (const ::FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
::FLAC__StreamDecoderTellStatus | tell_callback_ (const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
::FLAC__StreamDecoderLengthStatus | length_callback_ (const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
static FLAC__bool | eof_callback_ (const ::FLAC__StreamDecoder *decoder, void *client_data)
::FLAC__StreamDecoderWriteStatus | write_callback_ (const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data)
static void | metadata_callback_ (const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data)
static void | error_callback_ (const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data)

## Protected Attributes
::FLAC__StreamDecoder * | decoder_

## Detailed Description

This class wraps the FLAC__StreamDecoder. If you are not decoding from a file, you may need to use FLAC::Decoder::Stream.

The usage of this class is similar to FLAC__StreamDecoder, except instead of providing callbacks to FLAC__stream_decoder_init*_FILE() or FLAC__stream_decoder_init*_file(), you will inherit from this class and override the virtual callback functions with your own implementations, then call init() or init_off(). The rest of the calls work the same as in the C layer.

Only the write, and error callbacks from FLAC::Decoder::Stream are mandatory. The others are optional; this class provides full working implementations for all other callbacks and supports seeking.

## Member Function Documentation

## ◆ init() [1/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::File::init | ( | FILE * | file | ) |

See FLAC__stream_decoder_init_FILE()

## ◆ init() [2/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::File::init | ( | const char * | filename | ) |

See FLAC__stream_decoder_init_file()

## ◆ init() [3/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::File::init | ( | const std::string & | filename | ) |

See FLAC__stream_decoder_init_file()

## ◆ init_ogg() [1/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::File::init_ogg | ( | FILE * | file | ) |

See FLAC__stream_decoder_init_ogg_FILE()

## ◆ init_ogg() [2/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::File::init_ogg | ( | const char * | filename | ) |

See FLAC__stream_decoder_init_ogg_file()

## ◆ init_ogg() [3/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::File::init_ogg | ( | const std::string & | filename | ) |

See FLAC__stream_decoder_init_ogg_file()

## ◆ read_callback()

virtual ::FLAC__StreamDecoderReadStatus FLAC::Decoder::File::read_callback | ( | FLAC__byte | buffer[],
|  | size_t * | bytes
| ) |  |
| protected virtual

see FLAC__StreamDecoderReadCallback

Implements FLAC::Decoder::Stream.

## ◆ is_valid()

virtual bool FLAC::Decoder::Stream::is_valid | ( |  | ) | const
| virtual inherited

Call after construction to check that the object was created successfully. If not, use get_state() to find out why not.

## ◆ operator bool()

FLAC::Decoder::Stream::operator bool | ( |  | ) | const
| inline inherited

See is_valid()

## ◆ set_ogg_serial_number()

virtual bool FLAC::Decoder::Stream::set_ogg_serial_number | ( | long | value | ) |
| virtual inherited

See FLAC__stream_decoder_set_ogg_serial_number()

## ◆ set_md5_checking()

virtual bool FLAC::Decoder::Stream::set_md5_checking | ( | bool | value | ) |
| virtual inherited

See FLAC__stream_decoder_set_md5_checking()

## ◆ set_metadata_respond()

virtual bool FLAC::Decoder::Stream::set_metadata_respond | ( | ::FLAC__MetadataType | type | ) |
| virtual inherited

See FLAC__stream_decoder_set_metadata_respond()

## ◆ set_metadata_respond_application()

virtual bool FLAC::Decoder::Stream::set_metadata_respond_application | ( | const FLAC__byte | id[4] | ) |
| virtual inherited

See FLAC__stream_decoder_set_metadata_respond_application()

## ◆ set_metadata_respond_all()

virtual bool FLAC::Decoder::Stream::set_metadata_respond_all | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_set_metadata_respond_all()

## ◆ set_metadata_ignore()

virtual bool FLAC::Decoder::Stream::set_metadata_ignore | ( | ::FLAC__MetadataType | type | ) |
| virtual inherited

See FLAC__stream_decoder_set_metadata_ignore()

## ◆ set_metadata_ignore_application()

virtual bool FLAC::Decoder::Stream::set_metadata_ignore_application | ( | const FLAC__byte | id[4] | ) |
| virtual inherited

See FLAC__stream_decoder_set_metadata_ignore_application()

## ◆ set_metadata_ignore_all()

virtual bool FLAC::Decoder::Stream::set_metadata_ignore_all | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_set_metadata_ignore_all()

## ◆ get_state()

State FLAC::Decoder::Stream::get_state | ( |  | ) | const
| inherited

See FLAC__stream_decoder_get_state()

## ◆ get_md5_checking()

virtual bool FLAC::Decoder::Stream::get_md5_checking | ( |  | ) | const
| virtual inherited

See FLAC__stream_decoder_get_md5_checking()

## ◆ get_total_samples()

virtual FLAC__uint64 FLAC::Decoder::Stream::get_total_samples | ( |  | ) | const
| virtual inherited

See FLAC__stream_decoder_get_total_samples()

## ◆ get_channels()

virtual uint32_t FLAC::Decoder::Stream::get_channels | ( |  | ) | const
| virtual inherited

See FLAC__stream_decoder_get_channels()

## ◆ get_channel_assignment()

virtual ::FLAC__ChannelAssignment FLAC::Decoder::Stream::get_channel_assignment | ( |  | ) | const
| inherited

See FLAC__stream_decoder_get_channel_assignment()

## ◆ get_bits_per_sample()

virtual uint32_t FLAC::Decoder::Stream::get_bits_per_sample | ( |  | ) | const
| virtual inherited

See FLAC__stream_decoder_get_bits_per_sample()

## ◆ get_sample_rate()

virtual uint32_t FLAC::Decoder::Stream::get_sample_rate | ( |  | ) | const
| virtual inherited

See FLAC__stream_decoder_get_sample_rate()

## ◆ get_blocksize()

virtual uint32_t FLAC::Decoder::Stream::get_blocksize | ( |  | ) | const
| virtual inherited

See FLAC__stream_decoder_get_blocksize()

## ◆ get_decode_position()

virtual bool FLAC::Decoder::Stream::get_decode_position | ( | FLAC__uint64 * | position | ) | const
| virtual inherited

See FLAC__stream_decoder_get_decode_position()

## ◆ init() [4/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::Stream::init | ( |  | ) |
| inherited

Seek FLAC__stream_decoder_init_stream()

## ◆ init_ogg() [4/4]

virtual ::FLAC__StreamDecoderInitStatus FLAC::Decoder::Stream::init_ogg | ( |  | ) |
| inherited

Seek FLAC__stream_decoder_init_ogg_stream()

## ◆ finish()

virtual bool FLAC::Decoder::Stream::finish | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_finish()

## ◆ flush()

virtual bool FLAC::Decoder::Stream::flush | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_flush()

## ◆ reset()

virtual bool FLAC::Decoder::Stream::reset | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_reset()

## ◆ process_single()

virtual bool FLAC::Decoder::Stream::process_single | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_process_single()

## ◆ process_until_end_of_metadata()

virtual bool FLAC::Decoder::Stream::process_until_end_of_metadata | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_process_until_end_of_metadata()

## ◆ process_until_end_of_stream()

virtual bool FLAC::Decoder::Stream::process_until_end_of_stream | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_process_until_end_of_stream()

## ◆ skip_single_frame()

virtual bool FLAC::Decoder::Stream::skip_single_frame | ( |  | ) |
| virtual inherited

See FLAC__stream_decoder_skip_single_frame()

## ◆ seek_absolute()

virtual bool FLAC::Decoder::Stream::seek_absolute | ( | FLAC__uint64 | sample | ) |
| virtual inherited

See FLAC__stream_decoder_seek_absolute()

## ◆ seek_callback()

virtual ::FLAC__StreamDecoderSeekStatus FLAC::Decoder::Stream::seek_callback | ( | FLAC__uint64 | absolute_byte_offset | ) |
| protected inherited

see FLAC__StreamDecoderSeekCallback

## ◆ tell_callback()

virtual ::FLAC__StreamDecoderTellStatus FLAC::Decoder::Stream::tell_callback | ( | FLAC__uint64 * | absolute_byte_offset | ) |
| protected inherited

see FLAC__StreamDecoderTellCallback

## ◆ length_callback()

virtual ::FLAC__StreamDecoderLengthStatus FLAC::Decoder::Stream::length_callback | ( | FLAC__uint64 * | stream_length | ) |
| protected inherited

see FLAC__StreamDecoderLengthCallback

## ◆ eof_callback()

virtual bool FLAC::Decoder::Stream::eof_callback | ( |  | ) |
| protected virtual inherited

see FLAC__StreamDecoderEofCallback

## ◆ write_callback()

virtual ::FLAC__StreamDecoderWriteStatus FLAC::Decoder::Stream::write_callback | ( | const ::FLAC__Frame * | frame,
|  | const FLAC__int32 *const | buffer[]
| ) |  |
| protected pure virtual inherited

see FLAC__StreamDecoderWriteCallback

## ◆ metadata_callback()

virtual void FLAC::Decoder::Stream::metadata_callback | ( | const ::FLAC__StreamMetadata * | metadata | ) |
| protected virtual inherited

see FLAC__StreamDecoderMetadataCallback

## ◆ error_callback()

virtual void FLAC::Decoder::Stream::error_callback | ( | ::FLAC__StreamDecoderErrorStatus | status | ) |
| protected pure virtual inherited

see FLAC__StreamDecoderErrorCallback

The documentation for this class was generated from the following file:

- include/FLAC++/decoder.h

Copyright (c) 2000-2009 Josh Coalson Copyright (c) 2011-2016 Xiph.Org Foundation |