From e48a196c880d9f92804c6e1e3ea5631ae2017dd1 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 12 Oct 2008 19:48:39 +0000 Subject: enabled all input plugins git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@581 90c681e8-e032-0410-971d-27865f9a5e38 --- .../Input/modplug/decodermodplugfactory.cpp | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/plugins/Input/modplug/decodermodplugfactory.cpp') diff --git a/src/plugins/Input/modplug/decodermodplugfactory.cpp b/src/plugins/Input/modplug/decodermodplugfactory.cpp index 1124abb79..9e13c0b74 100644 --- a/src/plugins/Input/modplug/decodermodplugfactory.cpp +++ b/src/plugins/Input/modplug/decodermodplugfactory.cpp @@ -65,49 +65,53 @@ const DecoderProperties DecoderModPlugFactory::properties() const //properties.contentType = ; properties.hasAbout = TRUE; properties.hasSettings = TRUE; + properties.noInput = TRUE; + properties.protocols = "file"; return properties; } Decoder *DecoderModPlugFactory::create(QObject *parent, QIODevice *input, - Output *output) + Output *output, const QString &path) { - return new DecoderModPlug(parent, this, input, output); + Q_UNUSED(input); + return new DecoderModPlug(parent, this, output, path); } -FileTag *DecoderModPlugFactory::createTag(const QString &source) +QList DecoderModPlugFactory::createPlayList(const QString &fileName) { - FileTag *ftag = new FileTag(); + QList list; QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); if (settings.value("UseFileName", FALSE).toBool()) { - ftag->setValue(FileTag::TITLE, source.section('/',-1)); - return ftag; + list << new FileInfo(fileName); + list.at(0)->setMetaData(Qmmp::TITLE, fileName.section('/',-1)); + return list; } ArchiveReader reader(0); QByteArray buffer; - if (reader.isSupported(source)) + if (reader.isSupported(fileName)) { - buffer = reader.unpack(source); + buffer = reader.unpack(fileName); } else { - QFile file(source); + QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { qWarning("DecoderModPlugFactory: error: %s", qPrintable(file.errorString ())); - return ftag; + return list; } buffer = file.readAll(); file.close(); } CSoundFile* soundFile = new CSoundFile(); soundFile->Create((uchar*) buffer.data(), buffer.size()); - - ftag->setValue(FileTag::LENGTH, (int) soundFile->GetSongTime()); - ftag->setValue(FileTag::TITLE, QString::fromUtf8(soundFile->GetTitle())); + list << new FileInfo(fileName); + list.at(0)->setLength((int) soundFile->GetSongTime()); + list.at(0)->setMetaData(Qmmp::TITLE, QString::fromUtf8(soundFile->GetTitle())); soundFile->Destroy(); delete soundFile; - return ftag; + return list; } QObject* DecoderModPlugFactory::showDetails(QWidget *parent, const QString &path) -- cgit v1.2.3-13-gbd6f