kwave
18.07.70
|
#include <MP3Encoder.h>
Public Member Functions | |
MP3Encoder () | |
virtual | ~MP3Encoder () |
virtual Kwave::Encoder * | instance () |
virtual bool | encode (QWidget *widget, Kwave::MultiTrackReader &src, QIODevice &dst, const Kwave::MetaDataList &meta_data) |
virtual QList< Kwave::FileProperty > | supportedProperties () |
![]() | |
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 Slots | |
void | dataAvailable () |
Private Member Functions | |
void | encodeID3Tags (const Kwave::MetaDataList &meta_data, ID3_Tag &tag) |
Private Attributes | |
ID3_PropertyMap | m_property_map |
QMutex | m_lock |
QIODevice * | m_dst |
QProcess | m_process |
QString | m_program |
QStringList | m_params |
quint8 | m_write_buffer [PIPE_BUF] |
char | m_read_buffer [PIPE_BUF] |
Definition at line 42 of file MP3Encoder.h.
Kwave::MP3Encoder::MP3Encoder | ( | ) |
Constructor
Definition at line 52 of file MP3Encoder.cpp.
References Kwave::connect(), dataAvailable(), m_process, REGISTER_COMPRESSION_TYPES, and REGISTER_MIME_TYPES.
Referenced by instance().
|
virtual |
|
privateslot |
called when data from the external process is available
Definition at line 569 of file MP3Encoder.cpp.
References m_dst, m_lock, m_process, and m_read_buffer.
Referenced by MP3Encoder().
|
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 265 of file MP3Encoder.cpp.
References _, Kwave::FileInfo::bits(), Kwave::SampleArray::constData(), Kwave::FileInfo::contains(), DBG, encodeID3Tags(), Kwave::SampleReader::eof(), Kwave::MessageBox::error(), Kwave::MultiTrackReader::first(), Kwave::FileInfo::get(), Kwave::INF_BITRATE_LOWER, Kwave::INF_BITRATE_NOMINAL, Kwave::INF_BITRATE_UPPER, Kwave::INF_COPYRIGHTED, Kwave::INF_MPEG_EMPHASIS, Kwave::INF_ORIGINAL, Kwave::MultiTrackReader::isCanceled(), Kwave::MultiTrackReader::last(), Kwave::MP3EncoderSettings::load(), Kwave::MP3EncoderSettings::m_bits_per_sample, m_dst, Kwave::MP3EncoderSettings::m_format, m_lock, m_params, Kwave::MP3EncoderSettings::m_path, m_process, m_program, Kwave::MP3EncoderSettings::m_sample_rate, m_write_buffer, OPTION, OPTION_P, Kwave::FileInfo::rate(), Kwave::toUint(), Kwave::MultiTrackSource< SOURCE, INITIALIZE >::tracks(), and Kwave::MessageBox::warningContinueCancel().
Referenced by Kwave::MP3EncoderDialog::testSettings().
|
private |
encode all meta data into ID3 tags
meta_data | reference to the meta data to encode |
tag | the ID3 tag to receive the ID3 frames |
Definition at line 86 of file MP3Encoder.cpp.
References _, Kwave::FileInfo::contains(), DBG, Kwave::ID3_PropertyMap::ENC_COMMENT, Kwave::ID3_PropertyMap::ENC_GENRE_TYPE, Kwave::ID3_PropertyMap::ENC_LENGTH, Kwave::ID3_PropertyMap::ENC_NONE, Kwave::ID3_PropertyMap::ENC_TERMS_OF_USE, Kwave::ID3_PropertyMap::ENC_TEXT, Kwave::ID3_PropertyMap::ENC_TEXT_PARTINSET, Kwave::ID3_PropertyMap::ENC_TEXT_SLASH, Kwave::ID3_PropertyMap::ENC_TEXT_TIMESTAMP, Kwave::ID3_PropertyMap::ENC_TEXT_URL, Kwave::ID3_PropertyMap::ENC_TRACK_NUM, Kwave::ID3_PropertyMap::encoding(), Kwave::ID3_PropertyMap::findProperty(), Kwave::GenreType::fromID3(), Kwave::FileInfo::get(), Kwave::INF_CD, Kwave::INF_CDS, Kwave::INF_TRACK, Kwave::INF_TRACKS, Kwave::FileInfo::length(), m_property_map, Kwave::GenreType::name(), Kwave::FileInfo::properties(), Kwave::FileInfo::rate(), and Kwave::string2date().
Referenced by encode().
|
virtual |
Returns a new instance of the encoder
Implements Kwave::Encoder.
Definition at line 74 of file MP3Encoder.cpp.
References MP3Encoder().
|
virtual |
Returns a list of supported file properties
Reimplemented from Kwave::Encoder.
Definition at line 80 of file MP3Encoder.cpp.
References m_property_map, and Kwave::ID3_PropertyMap::properties().
|
private |
pointer to the QIODevice for storing, used while encoding
Definition at line 95 of file MP3Encoder.h.
Referenced by dataAvailable(), and encode().
|
private |
lock for protecting m_dst and m_process
Definition at line 92 of file MP3Encoder.h.
Referenced by dataAvailable(), and encode().
|
private |
list with commandline parameters
Definition at line 104 of file MP3Encoder.h.
Referenced by encode().
|
private |
the external process with the encoder
Definition at line 98 of file MP3Encoder.h.
Referenced by dataAvailable(), encode(), and MP3Encoder().
|
private |
|
private |
property - to - ID3 mapping
Definition at line 89 of file MP3Encoder.h.
Referenced by encodeID3Tags(), and supportedProperties().
|
private |
buffer for reading from the encoder (size is not critical)
Definition at line 119 of file MP3Encoder.h.
Referenced by dataAvailable().
|
private |
buffer for writing to the encoder
Definition at line 116 of file MP3Encoder.h.
Referenced by encode().