kwave
18.07.70
|
#include <VorbisDecoder.h>
Public Member Functions | |
VorbisDecoder (QIODevice *source, ogg_sync_state &oy, ogg_stream_state &os, ogg_page &og, ogg_packet &op) | |
virtual | ~VorbisDecoder () Q_DECL_OVERRIDE |
virtual int | open (QWidget *widget, Kwave::FileInfo &info) Q_DECL_OVERRIDE |
virtual int | decode (Kwave::MultiWriter &dst) Q_DECL_OVERRIDE |
virtual void | reset () Q_DECL_OVERRIDE |
virtual void | close (Kwave::FileInfo &info) Q_DECL_OVERRIDE |
![]() | |
virtual | ~OggSubDecoder () |
Protected Member Functions | |
void | parseTag (Kwave::FileInfo &info, const char *tag, Kwave::FileProperty property) |
Private Attributes | |
QIODevice * | m_source |
qint64 | m_stream_start_pos |
sample_index_t | m_samples_written |
ogg_sync_state & | m_oy |
ogg_stream_state & | m_os |
ogg_page & | m_og |
ogg_packet & | m_op |
vorbis_info | m_vi |
vorbis_comment | m_vc |
vorbis_dsp_state | m_vd |
vorbis_block | m_vb |
Definition at line 36 of file VorbisDecoder.h.
|
explicit |
Constructor
source | pointer to a QIODevice to read from, must not be null |
oy | sync and verify incoming physical bitstream |
os | take physical pages, weld into a logical stream of packets |
og | one Ogg bitstream page, Vorbis packets are inside |
op | one raw packet of data for decode |
Definition at line 45 of file VorbisDecoder.cpp.
|
inlinevirtual |
destructor
Definition at line 55 of file VorbisDecoder.h.
References close(), decode(), open(), parseTag(), and reset().
|
virtual |
finish the decoding, last chance to fix up some file info
info | reference to a FileInfo to fill |
Implements Kwave::OggSubDecoder.
Definition at line 307 of file VorbisDecoder.cpp.
References Kwave::FileInfo::contains(), DEFAULT_BITRATE, Kwave::INF_BITRATE_NOMINAL, Kwave::INF_VBR_QUALITY, Kwave::StandardBitrates::instance(), m_samples_written, m_source, m_stream_start_pos, Kwave::StandardBitrates::nearest(), Kwave::FileInfo::rate(), Kwave::FileInfo::set(), Kwave::toInt(), and Kwave::toUint().
Referenced by ~VorbisDecoder().
|
virtual |
decode received ogg data
dst | a MultiWriter to be used as sink |
Implements Kwave::OggSubDecoder.
Definition at line 267 of file VorbisDecoder.cpp.
References decodeFrame(), Kwave::MultiWriter::last(), m_op, m_samples_written, m_vb, and m_vd.
Referenced by ~VorbisDecoder().
|
virtual |
parse the header of the stream and initialize the decoder
widget | a QWidget to be used as parent for error messages |
info | reference to a FileInfo to fill |
convert the date property to a QDate
Implements Kwave::OggSubDecoder.
Definition at line 73 of file VorbisDecoder.cpp.
References _, Kwave::FileInfo::contains(), DEFAULT_BITRATE, Kwave::MessageBox::error(), Kwave::FileInfo::get(), Kwave::INF_ALBUM, Kwave::INF_AUTHOR, Kwave::INF_BITRATE_LOWER, Kwave::INF_BITRATE_NOMINAL, Kwave::INF_BITRATE_UPPER, Kwave::INF_COMPRESSION, Kwave::INF_CONTACT, Kwave::INF_COPYRIGHT, Kwave::INF_CREATION_DATE, Kwave::INF_ESTIMATED_LENGTH, Kwave::INF_GENRE, Kwave::INF_ISRC, Kwave::INF_LICENSE, Kwave::INF_NAME, Kwave::INF_ORGANIZATION, Kwave::INF_PERFORMER, Kwave::INF_SOFTWARE, Kwave::INF_SOURCE, Kwave::INF_SUBJECT, Kwave::INF_TRACK, Kwave::INF_VBR_QUALITY, Kwave::INF_VERSION, m_og, m_op, m_os, m_oy, m_source, m_stream_start_pos, m_vb, m_vc, m_vd, m_vi, Kwave::Compression::OGG_VORBIS, parseTag(), Kwave::FileInfo::set(), Kwave::FileInfo::setRate(), Kwave::FileInfo::setTracks(), and Kwave::toInt().
Referenced by ~VorbisDecoder().
|
protected |
Searches for a vorbis comment and renders it into Kwave's FileInfo. If more than one occurrence is found, they are concatenated as a semicolon separated list.
info | the file info object to add the tag value |
tag | name of the field to search for |
property | specifies the FileProperty for storing the result |
Definition at line 57 of file VorbisDecoder.cpp.
References _, m_vc, and Kwave::FileInfo::set().
Referenced by open(), and ~VorbisDecoder().
|
virtual |
reset the stream info
Implements Kwave::OggSubDecoder.
Definition at line 295 of file VorbisDecoder.cpp.
References m_vb, m_vc, m_vd, and m_vi.
Referenced by ~VorbisDecoder().
|
private |
one Ogg bitstream page. Vorbis packets are inside
Definition at line 111 of file VorbisDecoder.h.
Referenced by open().
|
private |
one raw packet of data for decode
Definition at line 114 of file VorbisDecoder.h.
|
private |
take physical pages, weld into a logical stream of packets
Definition at line 108 of file VorbisDecoder.h.
Referenced by open().
|
private |
sync and verify incoming physical bitstream
Definition at line 105 of file VorbisDecoder.h.
Referenced by open().
|
private |
last known position in the output stream [samples]
Definition at line 102 of file VorbisDecoder.h.
|
private |
IO device to read from
Definition at line 96 of file VorbisDecoder.h.
|
private |
first stream with audio data
Definition at line 99 of file VorbisDecoder.h.
|
private |
local working space for packet->PCM decode
Definition at line 126 of file VorbisDecoder.h.
|
private |
struct that stores all the bitstream user comments
Definition at line 120 of file VorbisDecoder.h.
Referenced by open(), parseTag(), and reset().
|
private |
central working state for the packet->PCM decoder
Definition at line 123 of file VorbisDecoder.h.
|
private |
struct that stores all the static vorbis bitstream settings
Definition at line 117 of file VorbisDecoder.h.