diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-12 19:48:39 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-12 19:48:39 +0000 |
| commit | e48a196c880d9f92804c6e1e3ea5631ae2017dd1 (patch) | |
| tree | 6767f170f669cdfaea23e469050c05ad1f6c67ca /src/plugins/Input/modplug/decodermodplugfactory.cpp | |
| parent | 0a74e1c0e3781afe041ba9acc361461cc3ebda82 (diff) | |
| download | qmmp-e48a196c880d9f92804c6e1e3ea5631ae2017dd1.tar.gz qmmp-e48a196c880d9f92804c6e1e3ea5631ae2017dd1.tar.bz2 qmmp-e48a196c880d9f92804c6e1e3ea5631ae2017dd1.zip | |
enabled all input plugins
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@581 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/modplug/decodermodplugfactory.cpp')
| -rw-r--r-- | src/plugins/Input/modplug/decodermodplugfactory.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
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<FileInfo *> DecoderModPlugFactory::createPlayList(const QString &fileName) { - FileTag *ftag = new FileTag(); + QList <FileInfo*> 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) |
