kwave
18.07.70
|
#include <FlacDecoder.h>
Public Member Functions | |
FlacDecoder () | |
virtual | ~FlacDecoder () Q_DECL_OVERRIDE |
virtual Kwave::Decoder * | instance () Q_DECL_OVERRIDE |
virtual bool | open (QWidget *widget, QIODevice &source) Q_DECL_OVERRIDE |
virtual bool | decode (QWidget *widget, Kwave::MultiWriter &dst) Q_DECL_OVERRIDE |
virtual void | close () Q_DECL_OVERRIDE |
![]() | |
Decoder () | |
virtual | ~Decoder () |
virtual Kwave::MetaDataList & | metaData () |
![]() | |
CodecBase () | |
virtual | ~CodecBase () |
virtual bool | supports (const QMimeType &mimetype) |
virtual bool | supports (const QString &mimetype_name) |
virtual QStringList | extensions (const QString &mimetype_name) const |
virtual const QList< CodecBase::MimeType > | mimeTypes () |
virtual const QList< Kwave::Compression::Type > | compressionTypes () |
virtual void | addMimeType (const char *name, const QString &description, const char *patterns) |
virtual void | addCompression (Kwave::Compression::Type compression) |
virtual QString | mimeTypeOf (const QUrl &url) |
Protected Member Functions | |
void | parseStreamInfo (const FLAC::Metadata::StreamInfo &stream_info) |
void | parseVorbisComments (const FLAC::Metadata::VorbisComment &vorbis_comments) |
virtual ::FLAC__StreamDecoderReadStatus | read_callback (FLAC__byte buffer[], size_t *bytes) Q_DECL_OVERRIDE |
virtual ::FLAC__StreamDecoderWriteStatus | write_callback (const ::FLAC__Frame *frame, const FLAC__int32 *const buffer[]) Q_DECL_OVERRIDE |
virtual void | metadata_callback (const ::FLAC__StreamMetadata *metadata) Q_DECL_OVERRIDE |
virtual void | error_callback (::FLAC__StreamDecoderErrorStatus status) Q_DECL_OVERRIDE |
Private Attributes | |
QIODevice * | m_source |
Kwave::MultiWriter * | m_dest |
Kwave::VorbisCommentMap | m_vorbis_comment_map |
Additional Inherited Members | |
![]() | |
void | sourceProcessed (quint64 pos) |
![]() | |
Kwave::MetaDataList | m_meta_data |
Definition at line 42 of file FlacDecoder.h.
Kwave::FlacDecoder::FlacDecoder | ( | ) |
Constructor
Definition at line 35 of file FlacDecoder.cpp.
References REGISTER_COMPRESSION_TYPES, and REGISTER_MIME_TYPES.
|
virtual |
Destructor
Definition at line 47 of file FlacDecoder.cpp.
References close(), and m_source.
|
virtual |
Closes the source.
Implements Kwave::Decoder.
Definition at line 326 of file FlacDecoder.cpp.
References m_source.
Referenced by ~FlacDecoder().
|
virtual |
Decodes a stream of bytes into a MultiWriter
widget | a widget that can be used for displaying message boxes or dialogs |
dst | MultiWriter that receives the audio data |
Implements Kwave::Decoder.
Definition at line 304 of file FlacDecoder.cpp.
References Kwave::MultiWriter::last(), m_dest, m_source, Kwave::Decoder::metaData(), Kwave::MetaDataList::replace(), and Kwave::FileInfo::setLength().
|
protectedvirtual |
FLAC decoder interface: error callback.
status | the FLAC status |
Definition at line 250 of file FlacDecoder.cpp.
|
virtual |
Returns a new instance of the decoder
Implements Kwave::Decoder.
Definition at line 53 of file FlacDecoder.cpp.
|
protectedvirtual |
FLAC decoder interface: callback for processing meta data.
metadata | the FLAC meta data to be parsed |
Definition at line 212 of file FlacDecoder.cpp.
References parseStreamInfo(), and parseVorbisComments().
|
virtual |
Opens the source and decodes the header information.
widget | a widget that can be used for displaying message boxes or dialogs |
source | file or other source with a stream of bytes |
Implements Kwave::Decoder.
Definition at line 256 of file FlacDecoder.cpp.
References _, DEFAULT_MIME_TYPE, Kwave::MessageBox::error(), Kwave::Compression::FLAC, Kwave::INF_COMPRESSION, Kwave::INF_MIMETYPE, m_source, Kwave::Decoder::metaData(), Kwave::MetaDataList::replace(), and Kwave::FileInfo::set().
|
protected |
Parse information about the stream, like sample rate, resolution, channels etc...
stream_info | FLAC metadata with stream information |
Definition at line 141 of file FlacDecoder.cpp.
References Kwave::Decoder::metaData(), and Kwave::MetaDataList::replace().
Referenced by metadata_callback().
|
protected |
Parse vorbis comments
vorbis_comments | list of vorbis comments, can be empty |
Definition at line 163 of file FlacDecoder.cpp.
References Kwave::FileInfo::contains(), DBG, Kwave::FileInfo::get(), Kwave::INF_CREATION_DATE, Kwave::INF_SOFTWARE, m_vorbis_comment_map, Kwave::Decoder::metaData(), name, Kwave::MetaDataList::replace(), and Kwave::FileInfo::set().
Referenced by metadata_callback().
|
protected |
FLAC decoder interface: read callback.
buffer | the byte buffer to be filled |
bytes | pointer with the number of bytes to be read, can be modified |
Definition at line 59 of file FlacDecoder.cpp.
References m_source.
|
protected |
FLAC decoder interface: write callback.
frame | a FLAC frame structure |
buffer | a buffer that contains the decoded samples |
Definition at line 84 of file FlacDecoder.cpp.
References Kwave::FileInfo::bits(), Kwave::SampleArray::data(), Kwave::MultiWriter::isCanceled(), m_dest, Kwave::Decoder::metaData(), SAMPLE_BITS, and Kwave::FileInfo::tracks().
|
private |
destination of the audio data
Definition at line 141 of file FlacDecoder.h.
Referenced by decode(), and write_callback().
|
private |
source of the audio data
Definition at line 138 of file FlacDecoder.h.
Referenced by close(), decode(), open(), read_callback(), and ~FlacDecoder().
|
private |
map for translating vorbis comments to FileInfo properties
Definition at line 144 of file FlacDecoder.h.
Referenced by parseVorbisComments().