kwave
18.07.70
|
#include <WavEncoder.h>
Public Member Functions | |
WavEncoder () | |
virtual | ~WavEncoder () Q_DECL_OVERRIDE |
virtual Encoder * | instance () Q_DECL_OVERRIDE |
virtual bool | encode (QWidget *widget, Kwave::MultiTrackReader &src, QIODevice &dst, const Kwave::MetaDataList &meta_data) Q_DECL_OVERRIDE |
virtual QList< Kwave::FileProperty > | supportedProperties () Q_DECL_OVERRIDE |
![]() | |
Encoder () | |
virtual | ~Encoder () |
virtual QList< Kwave::FileProperty > | unsupportedProperties (const QList< Kwave::FileProperty > &properties_to_check) |
![]() | |
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) |
Private Member Functions | |
void | writeInfoChunk (QIODevice &dst, Kwave::FileInfo &info) |
void | writeLabels (QIODevice &dst, const Kwave::LabelList &labels) |
void | fixAudiofileBrokenHeaderBug (QIODevice &dst, Kwave::FileInfo &info, unsigned int frame_size) |
Private Attributes | |
Kwave::WavPropertyMap | m_property_map |
Definition at line 37 of file WavEncoder.h.
Kwave::WavEncoder::WavEncoder | ( | ) |
Constructor
Definition at line 44 of file WavEncoder.cpp.
References REGISTER_COMPRESSION_TYPES, and REGISTER_MIME_TYPES.
|
virtual |
|
virtual |
Encodes a signal into a stream of bytes.
widget | a widget that can be used for displaying message boxes or dialogs |
src | MultiTrackReader used as source of the audio data |
dst | file or other source to receive a stream of bytes |
meta_data | meta data of the file to save |
Implements Kwave::Encoder.
Definition at line 307 of file WavEncoder.cpp.
References Kwave::SampleFormat::assign(), Kwave::FileInfo::bits(), Kwave::VirtualAudioFile::close(), Kwave::FileInfo::contains(), Kwave::SampleFormat::Double, Kwave::SampleReader::eof(), Kwave::MessageBox::error(), fixAudiofileBrokenHeaderBug(), Kwave::SampleFormat::Float, Kwave::SampleFormat::fromInt(), Kwave::Compression::fromInt(), Kwave::Compression::G711_ALAW, Kwave::Compression::G711_ULAW, Kwave::FileInfo::get(), Kwave::VirtualAudioFile::handle(), Kwave::INF_COMPRESSION, Kwave::INF_SAMPLE_FORMAT, Kwave::MultiTrackReader::isCanceled(), Kwave::VirtualAudioFile::lastError(), Kwave::FileInfo::length(), Kwave::Compression::NONE, Kwave::VirtualAudioFile::open(), Kwave::FileInfo::rate(), SAMPLE_BITS, SAMPLE_STORAGE_BITS, Kwave::FileInfo::set(), Kwave::FileInfo::setBits(), Kwave::SampleFormat::Signed, Kwave::Compression::toAudiofile(), Kwave::SampleFormat::toInt(), Kwave::toInt(), Kwave::toUint(), Kwave::MultiTrackSource< SOURCE, INITIALIZE >::tracks(), Kwave::FileInfo::tracks(), Kwave::SampleFormat::Unsigned, Kwave::MessageBox::warningYesNoCancel(), writeInfoChunk(), and writeLabels().
|
private |
Fix the size of the "data" and the "RIFF" chunk, as libaudiofile is sometimes really buggy due to internal calculations done with "float" as data type. This can lead to broken files as the data and also the RIFF chunk sizes are too small.
dst | file or other source to receive a stream of bytes |
info | information about the file to be saved |
frame_size | number of bytes per sample |
Definition at line 69 of file WavEncoder.cpp.
References Kwave::FileInfo::contains(), Kwave::FileInfo::get(), Kwave::INF_COMPRESSION, Kwave::FileInfo::length(), Kwave::Compression::NONE, and Kwave::toUint().
Referenced by encode().
|
virtual |
Returns a new instance of the encoder
Implements Kwave::Encoder.
Definition at line 57 of file WavEncoder.cpp.
|
virtual |
Returns a list of supported file properties
Reimplemented from Kwave::Encoder.
Definition at line 63 of file WavEncoder.cpp.
References m_property_map, and Kwave::WavPropertyMap::properties().
|
private |
write the INFO chunk with all known file properties
dst | file or other source to receive a stream of bytes |
info | information about the file to be saved |
Definition at line 120 of file WavEncoder.cpp.
References Kwave::WavPropertyMap::containsProperty(), Kwave::WavPropertyMap::findProperty(), m_property_map, name, Kwave::FileInfo::properties(), and zero().
Referenced by encode().
|
private |
write the 'cue list' and the label names (if any)
dst | file or other source to receive a stream of bytes |
labels | a list of labels |
Definition at line 185 of file WavEncoder.cpp.
References Kwave::MetaData::isNull(), Kwave::Label::name(), name, Kwave::Label::pos(), and Kwave::toUint().
Referenced by encode().
|
private |
map for translating chunk names to FileInfo properties
Definition at line 101 of file WavEncoder.h.
Referenced by supportedProperties(), and writeInfoChunk().