aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/flac/decoderflacfactory.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-27 23:09:03 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-27 23:09:03 +0000
commita3e55825c3f38ae1bc5e67584a7f37955de3fb87 (patch)
treeb695b742e08b3cc735827c1eb389fe1eb702b39a /src/plugins/Input/flac/decoderflacfactory.cpp
parentdc8dac141f57b50a9316131c8491e72b488a2d2c (diff)
downloadqmmp-a3e55825c3f38ae1bc5e67584a7f37955de3fb87.tar.gz
qmmp-a3e55825c3f38ae1bc5e67584a7f37955de3fb87.tar.bz2
qmmp-a3e55825c3f38ae1bc5e67584a7f37955de3fb87.zip
flac plugin: embeded cue support (using cuesheet xiph comment)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@643 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/flac/decoderflacfactory.cpp')
-rw-r--r--src/plugins/Input/flac/decoderflacfactory.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp
index 1843ccac0..2da4c69de 100644
--- a/src/plugins/Input/flac/decoderflacfactory.cpp
+++ b/src/plugins/Input/flac/decoderflacfactory.cpp
@@ -21,7 +21,11 @@
#include <QtGui>
#include <taglib/tag.h>
#include <taglib/fileref.h>
+#include <taglib/flacfile.h>
+#include <taglib/xiphcomment.h>
+#include <taglib/tmap.h>
+#include "cueparser.h"
#include "detailsdialog.h"
#include "decoder_flac.h"
#include "decoderflacfactory.h"
@@ -48,22 +52,23 @@ const DecoderProperties DecoderFLACFactory::properties() const
properties.filter = "*.flac";
properties.description = tr("FLAC Files");
//properties.contentType = ;
+ properties.protocols = "flac";
properties.hasAbout = TRUE;
properties.hasSettings = FALSE;
return properties;
}
Decoder *DecoderFLACFactory::create(QObject *parent, QIODevice *input,
- Output *output, const QString &)
+ Output *output, const QString &path)
{
- return new DecoderFLAC(parent, this, input, output);
+ return new DecoderFLAC(parent, this, input, output, path);
}
QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName)
{
FileInfo *info = new FileInfo(fileName);
- TagLib::FileRef fileRef(fileName.toLocal8Bit ());
+ TagLib::FLAC::File fileRef(fileName.toLocal8Bit ());
TagLib::Tag *tag = fileRef.tag();
if (tag && !tag->isEmpty())
@@ -84,8 +89,19 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName)
if (fileRef.audioProperties())
info->setLength(fileRef.audioProperties()->length());
+
+ //looking for cuesheet comment
+ TagLib::Ogg::XiphComment *xiph_comment = fileRef.xiphComment();
QList <FileInfo*> list;
- list << info;
+ if (xiph_comment && xiph_comment->fieldListMap().contains("CUESHEET"))
+ {
+ qDebug(xiph_comment->fieldListMap()["CUESHEET"].toString().toCString(TRUE));
+ CUEParser parser(xiph_comment->fieldListMap()["CUESHEET"].toString().toCString(TRUE), fileName);
+ list = parser.createPlayList();
+ delete info;
+ }
+ else
+ list << info;
return list;
}