diff options
Diffstat (limited to 'src/plugins')
22 files changed, 564 insertions, 549 deletions
diff --git a/src/plugins/Input/cue/decoder_cue.h b/src/plugins/Input/cue/decoder_cue.h index 6ff6e85a1..cb77e2c3c 100644 --- a/src/plugins/Input/cue/decoder_cue.h +++ b/src/plugins/Input/cue/decoder_cue.h @@ -50,7 +50,6 @@ private: qint64 length_in_bytes; qint64 m_totalBytes; QString m_path; - QString m_nextURL; CUEParser *m_parser; int m_track; char *m_buf; //buffer for remainig data diff --git a/src/plugins/Input/flac/CMakeLists.txt b/src/plugins/Input/flac/CMakeLists.txt index 5a4694d97..5585a747a 100644 --- a/src/plugins/Input/flac/CMakeLists.txt +++ b/src/plugins/Input/flac/CMakeLists.txt @@ -39,14 +39,14 @@ link_directories(${FLAC_LIBRARY_DIRS} ${TAGLIB_LIBRARY_DIRS}) SET(libflac_SRCS decoder_flac.cpp decoderflacfactory.cpp - detailsdialog.cpp + flacmetadatamodel.cpp cueparser.cpp ) SET(libflac_MOC_HDRS decoderflacfactory.h decoder_flac.h - detailsdialog.h + flacmetadatamodel.h cueparser.h ) diff --git a/src/plugins/Input/flac/cueparser.cpp b/src/plugins/Input/flac/cueparser.cpp index 873beb7b5..9272cec19 100644 --- a/src/plugins/Input/flac/cueparser.cpp +++ b/src/plugins/Input/flac/cueparser.cpp @@ -152,6 +152,11 @@ FileInfo *CUEParser::info(int track) return &m_infoList[track - 1]; } +const QString CUEParser::trackURL(int track) +{ + return m_infoList[track - 1].path(); +} + QStringList CUEParser::splitLine(const QString &line) { //qDebug("row string = %s",qPrintable(line)); diff --git a/src/plugins/Input/flac/cueparser.h b/src/plugins/Input/flac/cueparser.h index b30b87bfa..7491cf05d 100644 --- a/src/plugins/Input/flac/cueparser.h +++ b/src/plugins/Input/flac/cueparser.h @@ -45,6 +45,7 @@ public: qint64 length(int track); int count(); FileInfo *info(int track); + const QString trackURL(int track); private: QString m_filePath; diff --git a/src/plugins/Input/flac/decoder_flac.cpp b/src/plugins/Input/flac/decoder_flac.cpp index 9c104d5ec..ff865a68b 100644 --- a/src/plugins/Input/flac/decoder_flac.cpp +++ b/src/plugins/Input/flac/decoder_flac.cpp @@ -257,15 +257,20 @@ static void flac_callback_error (const FLAC__StreamDecoder *, // Decoder class -DecoderFLAC::DecoderFLAC(QObject *parent, DecoderFactory *d, QIODevice *i, Output *o, const QString &path) - : Decoder(parent, d, i, o) +DecoderFLAC::DecoderFLAC(const QString &path, QIODevice *i) + : Decoder(i) { m_data = 0; m_path = path; m_data = new flac_data; m_data->decoder = NULL; data()->input = i; - m_cue_parser = 0; + m_parser = 0; + length_in_bytes = 0; + m_totalBytes = 0; + m_sz = 0; + m_buf = 0; + m_offset = 0; } @@ -279,6 +284,9 @@ DecoderFLAC::~DecoderFLAC() delete data(); m_data = 0; } + if(m_buf) + delete[] m_buf; + m_buf = 0; } bool DecoderFLAC::initialize() @@ -303,26 +311,18 @@ bool DecoderFLAC::initialize() if (xiph_comment && xiph_comment->fieldListMap().contains("CUESHEET")) { qDebug("DecoderFLAC: using cuesheet xiph comment."); - m_cue_parser = new CUEParser(xiph_comment->fieldListMap()["CUESHEET"].toString() + m_parser = new CUEParser(xiph_comment->fieldListMap()["CUESHEET"].toString() .toCString(TRUE), p); - int track = m_path.section("#", -1).toInt(); - if(track > m_cue_parser->count()) + m_track = m_path.section("#", -1).toInt(); + if(m_track > m_parser->count()) { qWarning("DecoderFLAC: invalid cuesheet xiph comment"); return FALSE; } data()->input = new QFile(p); - //send metadata - QMap<Qmmp::MetaData, QString> metaData = m_cue_parser->info(track)->metaData(); - StateHandler::instance()->dispatch(metaData); - - connect(stateHandler(),SIGNAL(aboutToFinish()),SLOT(processFinish())); - //next url - m_nextUrl.clear(); - if(track <= m_cue_parser->count() - 1) - m_nextUrl = m_cue_parser->info(track + 1)->path(); - m_totalTime = m_cue_parser->length(track); - setFragment(m_cue_parser->offset(track), m_cue_parser->length(track)); + data()->input->open(QIODevice::ReadOnly); + QMap<Qmmp::MetaData, QString> metaData = m_parser->info(m_track)->metaData(); + StateHandler::instance()->dispatch(metaData); //send metadata } else { @@ -339,19 +339,10 @@ bool DecoderFLAC::initialize() if (!data()->input->isOpen()) { - if (!data()->input->open(QIODevice::ReadOnly)) - { - return FALSE; - } + qWarning("DecoderFLAC: unable to open input file"); + return FALSE; } - if (! data()->input->isOpen()) - { - if (! data()->input->open(QIODevice::ReadOnly)) - { - return FALSE; - } - } m_data->bitrate = -1; m_data->abort = 0; m_data->sample_buffer_fill = 0; @@ -388,8 +379,18 @@ bool DecoderFLAC::initialize() configure(data()->sample_rate, data()->channels, 32); else configure(data()->sample_rate, data()->channels, data()->bits_per_sample); - if(!m_cue_parser) - m_totalTime = data()->length; + + if(m_parser) + { + m_length = m_parser->length(m_track); + m_offset = m_parser->offset(m_track); + length_in_bytes = audioParameters().sampleRate() * + audioParameters().channels() * + audioParameters().bits() * m_length/8000; + seek(0); + } + m_totalBytes = 0; + m_sz = audioParameters().bits() * audioParameters().channels()/8; qDebug("DecoderFLAC: initialize succes"); return TRUE; @@ -397,7 +398,9 @@ bool DecoderFLAC::initialize() qint64 DecoderFLAC::totalTime() { - return m_totalTime; + if(m_parser) + return m_length; + return data()->length; } int DecoderFLAC::bitrate() @@ -405,16 +408,65 @@ int DecoderFLAC::bitrate() return data()->bitrate; } -void DecoderFLAC::seekAudio(qint64 time) +void DecoderFLAC::seek(qint64 time) { + m_totalBytes = audioParameters().sampleRate() * + audioParameters().channels() * + audioParameters().bits() * time/8000; + if(m_parser) + time += m_offset; FLAC__uint64 target_sample; - target_sample = (FLAC__uint64)((time/(double)data()->length) * (double)data()->total_samples); + target_sample = (FLAC__uint64)(((time) * data()->total_samples /data()->length)); FLAC__stream_decoder_seek_absolute(data()->decoder, target_sample); + } -qint64 DecoderFLAC::readAudio(char *data, qint64 maxSize) +qint64 DecoderFLAC::read(char *data, qint64 size) { - return flac_decode (this, (char *) (data), maxSize); + if(m_parser) + { + if(length_in_bytes - m_totalBytes < m_sz) //end of cue track + return 0; + + qint64 len = 0; + + if(m_buf) //read remaining data first + { + len = qMin(m_buf_size, size); + memmove(data, m_buf, len); + if(size >= m_buf_size) + { + delete[] m_buf; + m_buf = 0; + m_buf_size = 0; + } + else + memmove(m_buf, m_buf + len, size - len); + } + else + len = flac_decode (this, data, size); + + if(len <= 0) //end of file + return 0; + + if(len + m_totalBytes <= length_in_bytes) + { + m_totalBytes += len; + return len; + } + + qint64 len2 = qMax(qint64(0), length_in_bytes - m_totalBytes); + len2 = (len2 / m_sz) * m_sz; //returned size must contain integer number of samples + m_totalBytes += len2; + //save data of the next track + if(m_buf) + delete[] m_buf; + m_buf_size = len - len2; + m_buf = new char[m_buf_size]; + memmove(m_buf, data + len2, m_buf_size); + return len2; + } + return flac_decode (this, data, size); } void DecoderFLAC::deinit() @@ -428,35 +480,30 @@ void DecoderFLAC::deinit() delete data()->input; data()->input = 0; }; - if(m_cue_parser) - delete m_cue_parser; - m_cue_parser = 0; + if(m_parser) + delete m_parser; + m_parser = 0; +} + +const QString DecoderFLAC::nextURL() +{ + if(m_parser && m_track +1 <= m_parser->count()) + return m_parser->trackURL(m_track + 1); + else + return QString(); } -void DecoderFLAC::processFinish() +void DecoderFLAC::next() { - if(m_cue_parser && nextUrlRequest(m_nextUrl)) + if(m_parser && m_track +1 <= m_parser->count()) { - qDebug("DecoderFLAC: going to next track"); - int track = m_nextUrl.section("#", -1).toInt(); - QString p = QUrl(m_nextUrl).path(); - p.replace(QString(QUrl::toPercentEncoding("#")), "#"); - p.replace(QString(QUrl::toPercentEncoding("%")), "%"); - //update current fragment - mutex()->lock(); - setFragment(m_cue_parser->offset(track), m_cue_parser->length(track)); - m_totalTime = m_cue_parser->length(track); - output()->seek(0); //reset time counter - mutex()->unlock(); - // find next track - m_nextUrl.clear(); - if(track <= m_cue_parser->count() - 1) - m_nextUrl = m_cue_parser->info(track + 1)->path(); - //change track - emit playbackFinished(); - //send metadata - QMap<Qmmp::MetaData, QString> metaData = m_cue_parser->info(track)->metaData(); - stateHandler()->dispatch(metaData); + m_track++; + m_offset = m_parser->length(m_track); + m_length = m_parser->length(m_track); + length_in_bytes = audioParameters().sampleRate() * + audioParameters().channels() * + audioParameters().bits() * m_length/8000; + StateHandler::instance()->dispatch(m_parser->info(m_track)->metaData()); + m_totalBytes = 0; } } - diff --git a/src/plugins/Input/flac/decoder_flac.h b/src/plugins/Input/flac/decoder_flac.h index a00860ec4..ea66a652f 100644 --- a/src/plugins/Input/flac/decoder_flac.h +++ b/src/plugins/Input/flac/decoder_flac.h @@ -25,9 +25,8 @@ #include <FLAC/all.h> -#define MAX_SUPPORTED_CHANNELS 2 - -#define SAMPLES_PER_WRITE 512 +#define MAX_SUPPORTED_CHANNELS 2 +#define SAMPLES_PER_WRITE 512 #define SAMPLE_BUFFER_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * MAX_SUPPORTED_CHANNELS * (32/8)) class CUEParser; @@ -60,40 +59,44 @@ struct flac_data class DecoderFLAC : public Decoder { -Q_OBJECT public: - DecoderFLAC(QObject *, DecoderFactory *, QIODevice *, Output *, const QString &path); + DecoderFLAC(const QString &path, QIODevice *i); virtual ~DecoderFLAC(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); + qint64 read(char *data, qint64 maxSize); + void seek(qint64 time); + const QString nextURL(); + void next(); struct flac_data *data() { return m_data; } -private slots: - void processFinish(); - private: - // Standard Decoder API - qint64 readAudio(char *data, qint64 maxSize); - void seekAudio(qint64 time); - struct flac_data *m_data; // helper functions void deinit(); // FLAC Decoder FLAC__StreamDecoder *m_flacDecoder; + struct flac_data *m_data; qint64 m_totalTime; + qint64 length_in_bytes; + qint64 m_totalBytes; + qint64 m_offset; + qint64 m_length; QString m_path; - CUEParser *m_cue_parser; - QString m_nextUrl; + CUEParser *m_parser; + int m_track; + char *m_buf; //buffer for remainig data + qint64 m_buf_size; + qint64 m_sz; //sample size }; diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp index 54224eeab..af1f1ad86 100644 --- a/src/plugins/Input/flac/decoderflacfactory.cpp +++ b/src/plugins/Input/flac/decoderflacfactory.cpp @@ -26,8 +26,8 @@ #include <taglib/tmap.h> #include "cueparser.h" -#include "detailsdialog.h" #include "decoder_flac.h" +#include "flacmetadatamodel.h" #include "decoderflacfactory.h" @@ -35,7 +35,6 @@ bool DecoderFLACFactory::supports(const QString &source) const { - return (source.right(5).toLower() == ".flac"); } @@ -59,10 +58,9 @@ const DecoderProperties DecoderFLACFactory::properties() const return properties; } -Decoder *DecoderFLACFactory::create(QObject *parent, QIODevice *input, - Output *output, const QString &path) +Decoder *DecoderFLACFactory::create(const QString &path, QIODevice *i) { - return new DecoderFLAC(parent, this, input, output, path); + return new DecoderFLAC(path, i); } QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bool useMetaData) @@ -120,11 +118,9 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bo return list; } -QObject* DecoderFLACFactory::showDetails(QWidget *parent, const QString &path) +MetaDataModel*DecoderFLACFactory::createMetaDataModel(const QString &path, QObject *parent) { - DetailsDialog *d = new DetailsDialog(parent, path); - d -> show(); - return d; + return new FLACMetaDataModel(path, parent); } void DecoderFLACFactory::showSettings(QWidget *) @@ -145,4 +141,4 @@ QTranslator *DecoderFLACFactory::createTranslator(QObject *parent) return translator; } -Q_EXPORT_PLUGIN(DecoderFLACFactory) +Q_EXPORT_PLUGIN2(flac,DecoderFLACFactory) diff --git a/src/plugins/Input/flac/decoderflacfactory.h b/src/plugins/Input/flac/decoderflacfactory.h index 7fd7dcb42..696fe6208 100644 --- a/src/plugins/Input/flac/decoderflacfactory.h +++ b/src/plugins/Input/flac/decoderflacfactory.h @@ -39,9 +39,9 @@ public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; - Decoder *create(QObject *, QIODevice *, Output *, const QString &); + Decoder *create(const QString &, QIODevice *); QList<FileInfo *> createPlayList(const QString &fileName, bool useMetaData); - QObject* showDetails(QWidget *parent, const QString &path); + MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); diff --git a/src/plugins/Input/flac/detailsdialog.cpp b/src/plugins/Input/flac/detailsdialog.cpp deleted file mode 100644 index a3740b3f9..000000000 --- a/src/plugins/Input/flac/detailsdialog.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include <taglib/tag.h> -#include <taglib/fileref.h> -#include <taglib/flacfile.h> -#include <taglib/xiphcomment.h> -#include <taglib/tmap.h> - -#include <QFile> -#include <QFileInfo> - -#include "detailsdialog.h" - -#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) -#define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(TRUE)).trimmed() - -DetailsDialog::DetailsDialog(QWidget *parent, const QString &path) - : AbstractDetailsDialog(parent) -{ - m_path = path; - if (QFile::exists(m_path)) - { - loadFLACInfo(); - loadTags(); - blockSaveButton(!QFileInfo(m_path).isWritable()); - } - else - blockSaveButton(); -} - -DetailsDialog::~DetailsDialog() -{} - -void DetailsDialog::loadFLACInfo() -{ - TagLib::FLAC::File f (m_path.toLocal8Bit()); - QMap <QString, QString> ap; - QString text = QString("%1").arg(f.audioProperties()->length()/60); - text +=":"+QString("%1").arg(f.audioProperties()->length()%60,2,10,QChar('0')); - ap.insert(tr("Length"), text); - ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(f.audioProperties()->sampleRate())); - ap.insert(tr("Channels"), QString("%1").arg(f.audioProperties()->channels())); - ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(f.audioProperties()->bitrate())); - ap.insert(tr("Sample width"), QString("%1 "+tr("bits")).arg(f.audioProperties()->sampleWidth())); - ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(f.length()/1024)); - setAudioProperties(ap); -} - -void DetailsDialog::loadTags() -{ - TagLib::FileRef f (m_path.toLocal8Bit()); - setMetaData(Qmmp::TITLE, TStringToQString_qt4(f.tag()->title())); - setMetaData(Qmmp::ARTIST, TStringToQString_qt4(f.tag()->artist())); - setMetaData(Qmmp::ALBUM, TStringToQString_qt4(f.tag()->album())); - setMetaData(Qmmp::COMMENT, TStringToQString_qt4(f.tag()->comment())); - setMetaData(Qmmp::GENRE, TStringToQString_qt4(f.tag()->genre())); - setMetaData(Qmmp::YEAR, f.tag()->year()); - setMetaData(Qmmp::TRACK, f.tag()->track()); - setMetaData(Qmmp::URL, m_path); - TagLib::FLAC::File *file = dynamic_cast< TagLib::FLAC::File *>(f.file()); - TagLib::StringList fld; - if(file->xiphComment() && !(fld = file->xiphComment()->fieldListMap()["COMPOSER"]).isEmpty()) - setMetaData(Qmmp::COMPOSER, TStringToQString_qt4(fld.toString())); - if(file->xiphComment() && !(fld = file->xiphComment()->fieldListMap()["DISCNUMBER"]).isEmpty()) - setMetaData(Qmmp::DISCNUMBER, TStringToQString_qt4(fld.toString())); -} - -void DetailsDialog::writeTags() -{ - TagLib::FileRef f (m_path.toLocal8Bit()); - f.tag()->setTitle(QStringToTString_qt4(strMetaData(Qmmp::TITLE))); - f.tag()->setArtist(QStringToTString_qt4(strMetaData(Qmmp::ARTIST))); - f.tag()->setAlbum(QStringToTString_qt4(strMetaData(Qmmp::ALBUM))); - f.tag()->setComment(QStringToTString_qt4(strMetaData(Qmmp::COMMENT))); - f.tag()->setGenre(QStringToTString_qt4(strMetaData(Qmmp::GENRE))); - f.tag()->setYear(intMetaData(Qmmp::YEAR)); - f.tag()->setTrack(intMetaData(Qmmp::TRACK)); - TagLib::FLAC::File *file = dynamic_cast< TagLib::FLAC::File *>(f.file()); - strMetaData(Qmmp::COMPOSER).isEmpty() ? - file->xiphComment()->removeField("COMPOSER"): - file->xiphComment()->addField("COMPOSER", QStringToTString_qt4(strMetaData(Qmmp::COMPOSER)), TRUE); - intMetaData(Qmmp::DISCNUMBER) == 0 ? - file->xiphComment()->removeField("DISCNUMBER"): - file->xiphComment()->addField("DISCNUMBER", - QStringToTString_qt4(strMetaData(Qmmp::DISCNUMBER)), TRUE); - f.save(); -} diff --git a/src/plugins/Input/flac/flac.pro b/src/plugins/Input/flac/flac.pro index 3f13de9c0..7a8573c38 100644 --- a/src/plugins/Input/flac/flac.pro +++ b/src/plugins/Input/flac/flac.pro @@ -2,12 +2,12 @@ include(../../plugins.pri) FORMS += HEADERS += decoderflacfactory.h \ decoder_flac.h \ - detailsdialog.h \ - cueparser.h + cueparser.h \ + flacmetadatamodel.h SOURCES += decoder_flac.cpp \ decoderflacfactory.cpp \ - detailsdialog.cpp \ - cueparser.cpp + cueparser.cpp \ + flacmetadatamodel.cpp TARGET = $$PLUGINS_PREFIX/Input/flac QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libflac.so INCLUDEPATH += ../../../ diff --git a/src/plugins/Input/flac/flacmetadatamodel.cpp b/src/plugins/Input/flac/flacmetadatamodel.cpp new file mode 100644 index 000000000..d18048f29 --- /dev/null +++ b/src/plugins/Input/flac/flacmetadatamodel.cpp @@ -0,0 +1,155 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <taglib/tag.h> +#include <taglib/fileref.h> +#include <taglib/tmap.h> +#include "flacmetadatamodel.h" + +#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) +#define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(TRUE)).trimmed() + +FLACMetaDataModel::FLACMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) +{ + m_path = path; + m_tags << new VorbisCommentModel(path); +} + +FLACMetaDataModel::~FLACMetaDataModel() +{ + while(!m_tags.isEmpty()) + delete m_tags.takeFirst(); +} + +QHash<QString, QString> FLACMetaDataModel::audioProperties() +{ + QHash<QString, QString> ap; + TagLib::FLAC::File f (m_path.toLocal8Bit()); + QString text = QString("%1").arg(f.audioProperties()->length()/60); + text +=":"+QString("%1").arg(f.audioProperties()->length()%60,2,10,QChar('0')); + ap.insert(tr("Length"), text); + ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(f.audioProperties()->sampleRate())); + ap.insert(tr("Channels"), QString("%1").arg(f.audioProperties()->channels())); + ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(f.audioProperties()->bitrate())); + ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(f.length()/1024)); + return ap; +} + +QList<TagModel* > FLACMetaDataModel::tags() +{ + return m_tags; +} + +VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) +{ + m_file = new TagLib::FLAC::File (path.toLocal8Bit().constData()); + m_tag = m_file->xiphComment(); +} + +VorbisCommentModel::~VorbisCommentModel() +{ + delete m_file; +} + +const QString VorbisCommentModel::name() +{ + return "Vorbis Comment"; +} + +const QString VorbisCommentModel::value(Qmmp::MetaData key) +{ + if(!m_tag) + return QString(); + switch((int) key) + { + case Qmmp::TITLE: + return TStringToQString_qt4(m_tag->title()); + case Qmmp::ARTIST: + return TStringToQString_qt4(m_tag->artist()); + case Qmmp::ALBUM: + return TStringToQString_qt4(m_tag->album()); + case Qmmp::COMMENT: + return TStringToQString_qt4(m_tag->comment()); + case Qmmp::GENRE: + return TStringToQString_qt4(m_tag->genre()); + case Qmmp::COMPOSER: + if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) + return QString(); + else + return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); + case Qmmp::YEAR: + return QString::number(m_tag->year()); + case Qmmp::TRACK: + return QString::number(m_tag->track()); + case Qmmp::DISCNUMBER: + if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) + return QString(); + else + return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); + } + return QString(); +} + +void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value) +{ + if(!m_tag) + return; + + TagLib::String str = QStringToTString_qt4(value); + + switch((int) key) + { + case Qmmp::TITLE: + m_tag->setTitle(str); + return; + case Qmmp::ARTIST: + m_tag->setArtist(str); + return; + case Qmmp::ALBUM: + m_tag->setAlbum(str); + return; + case Qmmp::COMMENT: + m_tag->setComment(str); + return; + case Qmmp::GENRE: + m_tag->setGenre(str); + return; + case Qmmp::COMPOSER: + value.isEmpty() ? + m_tag->removeField("COMPOSER"): + m_tag->addField("COMPOSER", str, TRUE); + return; + case Qmmp::TRACK: + m_tag->setTrack(value.toInt()); + return; + case Qmmp::YEAR: + m_tag->setYear(value.toInt()); + return; + case Qmmp::DISCNUMBER: + value == "0" ? + m_tag->removeField("DISCNUMBER"): + m_tag->addField("DISCNUMBER", str, TRUE); + } +} + +void VorbisCommentModel::save() +{ + m_file->save(); +} diff --git a/src/plugins/Input/flac/detailsdialog.h b/src/plugins/Input/flac/flacmetadatamodel.h index 97069306a..4a5310c90 100644 --- a/src/plugins/Input/flac/detailsdialog.h +++ b/src/plugins/Input/flac/flacmetadatamodel.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * + * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -17,28 +17,41 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef DETAILSDIALOG_H -#define DETAILSDIALOG_H -#include <qmmp/abstractdetailsdialog.h> +#ifndef FLACMETADATAMODEL_H +#define FLACMETADATAMODEL_H -/** - @author Ilya Kotov <forkotov02@hotmail.ru> -*/ -class DetailsDialog : public AbstractDetailsDialog +#include <taglib/flacfile.h> +#include <taglib/xiphcomment.h> +#include <qmmp/metadatamodel.h> + +class FLACMetaDataModel : public MetaDataModel { Q_OBJECT public: - DetailsDialog(QWidget *parent = 0, const QString &path = 0); - - ~DetailsDialog(); + FLACMetaDataModel(const QString &path, QObject *parent); + ~FLACMetaDataModel(); + QHash<QString, QString> audioProperties(); + QList<TagModel* > tags(); -private: - void loadFLACInfo(); - void loadTags(); - void writeTags(); +private: QString m_path; + QList<TagModel* > m_tags; +}; + +class VorbisCommentModel : public TagModel +{ +public: + VorbisCommentModel(const QString &path); + ~VorbisCommentModel(); + const QString name(); + const QString value(Qmmp::MetaData key); + void setValue(Qmmp::MetaData key, const QString &value); + void save(); +private: + TagLib::FLAC::File *m_file; + TagLib::Ogg::XiphComment *m_tag; }; -#endif +#endif // FLACMETADATAMODEL_H diff --git a/src/plugins/Input/flac/translations/flac_plugin_cs.ts b/src/plugins/Input/flac/translations/flac_plugin_cs.ts index ad9443290..d1b2068d0 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_cs.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_cs.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>Modul FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>Soubory FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="135"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>O modulu FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="136"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Vstupní modul Qmmp FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="137"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>kbps</source> - <translation>kbps</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="57"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> - <translation>Délka</translation> + <translation type="unfinished">Délka</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> - <translation>Vzorkovací frekvence</translation> + <translation type="unfinished">Vzorkovací frekvence</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Channels</source> - <translation>Počet kanálů</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>Bitrate</source> - <translation>Datový tok</translation> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> + <translation type="unfinished">Počet kanálů</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="61"/> - <source>Sample width</source> - <translation>Šířka vzorku</translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>Bitrate</source> + <translation type="unfinished">Datový tok</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="62"/> - <source>KB</source> - <translation>KB</translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>kbps</source> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="62"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>File size</source> - <translation>Velikost souboru</translation> + <translation type="unfinished">Velikost souboru</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="61"/> - <source>bits</source> - <translation>bitů</translation> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>KB</source> + <translation type="unfinished">KB</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_de.ts b/src/plugins/Input/flac/translations/flac_plugin_de.ts index 3987e5284..733872d4b 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_de.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_de.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>FLAC-Modul</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>FLAC-Dateien</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>Über FLAC-Audio-Modul</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Qmmp FLAC-Audio-Modul</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>kbps</source> - <translation>kbps</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> - <translation>Länge</translation> + <translation type="unfinished">Länge</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> - <translation>Abtastrate</translation> + <translation type="unfinished">Abtastrate</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation>Kanäle</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>Bitrate</source> - <translation>Bitrate</translation> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> + <translation type="unfinished">Kanäle</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> - <translation>Abtastauflösung</translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>Bitrate</source> + <translation type="unfinished">Bitrate</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>KB</source> - <translation>KB</translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>kbps</source> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>File size</source> - <translation>Dateigröße</translation> + <translation type="unfinished">Dateigröße</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>Bits</translation> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>KB</source> + <translation type="unfinished">KB</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_it.ts b/src/plugins/Input/flac/translations/flac_plugin_it.ts index 1f6de5dca..511145393 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_it.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_it.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>Modulo FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>Brani FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>Info sul modulo audio FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Modulo Audio FLAC per Qmmp</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autore: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>kbps</source> - <translation>kbps</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation type="unfinished"></translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>Bitrate</source> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>Bitrate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>KB</source> - <translation>KB</translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>kbps</source> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>File size</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>Bits</translation> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>KB</source> + <translation type="unfinished">KB</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_lt.ts b/src/plugins/Input/flac/translations/flac_plugin_lt.ts index 38508cc5f..633d57ad8 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_lt.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_lt.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>FLAC įskiepis</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>FLAC bylos</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>Apie FLAC audio įskiepį</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Qmmp FLAC audio įskiepis</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Sukūrė: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation type="unfinished"></translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>Bitrate</source> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>bitai</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>Bitrate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>kbps</source> - <translation>kbps</translation> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation>KB</translation> + <translation type="unfinished">KB</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_pl.ts b/src/plugins/Input/flac/translations/flac_plugin_pl.ts index 95ad83ef3..6bb2070e8 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_pl.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_pl.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>Wtyczka FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>Pliki FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>O wtyczce FLAC Audio</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Wtyczka FLAC Audio dla Qmmp</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> - <translation>Długość</translation> + <translation type="unfinished">Długość</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation></translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> - <translation>Próbkowanie</translation> + <translation type="unfinished">Próbkowanie</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation>Kanały</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>kbps</source> - <translation></translation> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> + <translation type="unfinished">Kanały</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>Bitrate</source> - <translation>Szybkość transmisji</translation> + <translation type="unfinished">Szybkość transmisji</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation></translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>kbps</source> + <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> - <translation>Długość próbkowania</translation> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> + <translation type="unfinished">Wielkość pliku</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation></translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> - <translation>Wielkość pliku</translation> + <translation type="unfinished"></translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_ru.ts b/src/plugins/Input/flac/translations/flac_plugin_ru.ts index 41f3bd331..1064e6b40 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_ru.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_ru.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>Модуль FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>Файлы FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>Об аудио-модуле FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Аудио-модуль FLAC для Qmmp</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Разработчик: Илья Котов <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> <translation>Длительность</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Гц</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Sample rate</source> + <translation>Дискретизация</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Sample rate</source> - <translation>Частота сэмплов</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation>Гц</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> + <location filename="../flacmetadatamodel.cpp" line="49"/> <source>Channels</source> <translation>Каналов</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>Bitrate</source> <translation>Битовая частота</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>бит</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> - <translation>Размер файла</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>kbps</source> <translation>Кб/с</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> - <translation>Ширина кадра</translation> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> + <translation>Размер файла</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation>Кб</translation> + <translation>КБ</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_tr.ts b/src/plugins/Input/flac/translations/flac_plugin_tr.ts index f36b6c819..70c9bda89 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_tr.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_tr.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>FLAC Eklentisi</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>FLAC Dosyaları</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>FLAC Ses Eklentisi Hakkında</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Qmmp FLAC Ses Eklentisi</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Yazan: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation type="unfinished"></translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>kbps</source> - <translation>kbps</translation> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> + <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>Bitrate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>bits</translation> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>kbps</source> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation>KB</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> - <translation type="unfinished"></translation> + <translation type="unfinished">KB</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_uk_UA.ts b/src/plugins/Input/flac/translations/flac_plugin_uk_UA.ts index da7922687..a78ae5fde 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_uk_UA.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_uk_UA.ts @@ -1,85 +1,75 @@ <?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS><TS version="1.1" language="uk"> -<defaultcodec></defaultcodec> +<!DOCTYPE TS> +<TS version="2.0" language="uk"> <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>Модуль FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>Файли FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>Про аудіо-модуль FLAC</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Аудіо-модуль FLAC для Qmmp</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Розробник: Ілля Котов <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> - <translation>Тривалість</translation> + <translation type="unfinished">Тривалість</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Гц</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Sample rate</source> + <translation type="unfinished">Частота</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Sample rate</source> - <translation>Частота</translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Гц</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> + <location filename="../flacmetadatamodel.cpp" line="49"/> <source>Channels</source> - <translation>Канали</translation> + <translation type="unfinished">Канали</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>Bitrate</source> - <translation>Бітрейт</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>біт</translation> + <translation type="unfinished">Бітрейт</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> - <translation>Розмір файлу</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>kbps</source> - <translation>Кб/с</translation> + <translation type="unfinished">Кб/с</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> - <translation>Ширина кадру</translation> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> + <translation type="unfinished">Розмір файлу</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation>Кб</translation> + <translation type="unfinished">Кб</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_zh_CN.ts b/src/plugins/Input/flac/translations/flac_plugin_zh_CN.ts index 23850e0f4..fc059781a 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_zh_CN.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_zh_CN.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>FLAC 插件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>FLAC 文件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>关于 FLAC 音频插件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Qmmp FLAC 音频插件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>作者:Ilya Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation type="unfinished"></translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>Bitrate</source> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>位</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>Bitrate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>kbps</source> - <translation>kbps</translation> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation>KB</translation> + <translation type="unfinished">KB</translation> </message> </context> </TS> diff --git a/src/plugins/Input/flac/translations/flac_plugin_zh_TW.ts b/src/plugins/Input/flac/translations/flac_plugin_zh_TW.ts index 5d7773275..5b7e41732 100644 --- a/src/plugins/Input/flac/translations/flac_plugin_zh_TW.ts +++ b/src/plugins/Input/flac/translations/flac_plugin_zh_TW.ts @@ -4,82 +4,72 @@ <context> <name>DecoderFLACFactory</name> <message> - <location filename="../decoderflacfactory.cpp" line="51"/> + <location filename="../decoderflacfactory.cpp" line="50"/> <source>FLAC Plugin</source> <translation>FLAC 插件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="53"/> + <location filename="../decoderflacfactory.cpp" line="52"/> <source>FLAC Files</source> <translation>FLAC 檔案</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="120"/> + <location filename="../decoderflacfactory.cpp" line="131"/> <source>About FLAC Audio Plugin</source> <translation>關於 FLAC 聲訊插件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="121"/> + <location filename="../decoderflacfactory.cpp" line="132"/> <source>Qmmp FLAC Audio Plugin</source> <translation>Qmmp FLAC 聲訊插件</translation> </message> <message> - <location filename="../decoderflacfactory.cpp" line="122"/> + <location filename="../decoderflacfactory.cpp" line="133"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>作者:Ilya Kotov <forkotov02@hotmail.ru></translation> </message> </context> <context> - <name>DetailsDialog</name> + <name>FLACMetaDataModel</name> <message> - <location filename="../detailsdialog.cpp" line="55"/> + <location filename="../flacmetadatamodel.cpp" line="47"/> <source>Length</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="56"/> - <source>Hz</source> - <translation>Hz</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="56"/> + <location filename="../flacmetadatamodel.cpp" line="48"/> <source>Sample rate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="57"/> - <source>Channels</source> - <translation type="unfinished"></translation> + <location filename="../flacmetadatamodel.cpp" line="48"/> + <source>Hz</source> + <translation type="unfinished">Hz</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> - <source>Bitrate</source> + <location filename="../flacmetadatamodel.cpp" line="49"/> + <source>Channels</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>bits</source> - <translation>位</translation> - </message> - <message> - <location filename="../detailsdialog.cpp" line="60"/> - <source>File size</source> + <location filename="../flacmetadatamodel.cpp" line="50"/> + <source>Bitrate</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="58"/> + <location filename="../flacmetadatamodel.cpp" line="50"/> <source>kbps</source> - <translation>kbps</translation> + <translation type="unfinished">kbps</translation> </message> <message> - <location filename="../detailsdialog.cpp" line="59"/> - <source>Sample width</source> + <location filename="../flacmetadatamodel.cpp" line="51"/> + <source>File size</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../detailsdialog.cpp" line="60"/> + <location filename="../flacmetadatamodel.cpp" line="51"/> <source>KB</source> - <translation>KB</translation> + <translation type="unfinished">KB</translation> </message> </context> </TS> |
