aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-05-30 19:40:35 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-05-30 19:40:35 +0000
commit4ab1964bb6cd90ef26e6d6060427038b88e0c37f (patch)
tree899db5f25a402732a4a5d3f68cde864af5862cda /src
parent2306ed76a51553786de048e99c4f6bae42fca3ba (diff)
downloadqmmp-4ab1964bb6cd90ef26e6d6060427038b88e0c37f.tar.gz
qmmp-4ab1964bb6cd90ef26e6d6060427038b88e0c37f.tar.bz2
qmmp-4ab1964bb6cd90ef26e6d6060427038b88e0c37f.zip
enabled archive reader
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7981 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/plugins/Input/Input.pro2
-rw-r--r--src/plugins/Input/archive/archiveinputdevice.cpp2
-rw-r--r--src/plugins/Input/archive/archivetagreader.cpp1
-rw-r--r--src/plugins/Input/archive/decoder_archive.cpp2
-rw-r--r--src/plugins/Input/archive/decoder_archive.h3
-rw-r--r--src/plugins/Input/archive/decoderarchivefactory.cpp26
-rw-r--r--src/plugins/Input/archive/decoderarchivefactory.h15
7 files changed, 26 insertions, 25 deletions
diff --git a/src/plugins/Input/Input.pro b/src/plugins/Input/Input.pro
index def47b5be..498c5ff60 100644
--- a/src/plugins/Input/Input.pro
+++ b/src/plugins/Input/Input.pro
@@ -57,7 +57,7 @@ contains(CONFIG, ARCHIVE_PLUGIN){
TAGLIB_VER_MIN = $$member(TAGLIB_VERSION, 1)
greaterThan(TAGLIB_VER_MAJ, 1) | equals(TAGLIB_VER_MAJ, 1) {
- #greaterThan(TAGLIB_VER_MIN, 10):SUBDIRS += archive
+ greaterThan(TAGLIB_VER_MIN, 10):SUBDIRS += archive
} else {
message("Archive plugin requires at least TagLib 1.11")
}
diff --git a/src/plugins/Input/archive/archiveinputdevice.cpp b/src/plugins/Input/archive/archiveinputdevice.cpp
index 8ecc6b3da..6056dca98 100644
--- a/src/plugins/Input/archive/archiveinputdevice.cpp
+++ b/src/plugins/Input/archive/archiveinputdevice.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2016 by Ilya Kotov *
+ * Copyright (C) 2016-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
diff --git a/src/plugins/Input/archive/archivetagreader.cpp b/src/plugins/Input/archive/archivetagreader.cpp
index c9b94c91e..9bcfc4308 100644
--- a/src/plugins/Input/archive/archivetagreader.cpp
+++ b/src/plugins/Input/archive/archivetagreader.cpp
@@ -120,7 +120,6 @@ const QMap<Qmmp::MetaData, QString> ArchiveTagReader::metaData() const
m[Qmmp::YEAR] = QString::number(tag->year());
m[Qmmp::TRACK] = QString::number(tag->track());
}
- m[Qmmp::URL] = m_url;
return m;
}
diff --git a/src/plugins/Input/archive/decoder_archive.cpp b/src/plugins/Input/archive/decoder_archive.cpp
index aeafd98cb..e08e7bad8 100644
--- a/src/plugins/Input/archive/decoder_archive.cpp
+++ b/src/plugins/Input/archive/decoder_archive.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2016 by Ilya Kotov *
+ * Copyright (C) 2016-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
diff --git a/src/plugins/Input/archive/decoder_archive.h b/src/plugins/Input/archive/decoder_archive.h
index 448acadec..9356037b7 100644
--- a/src/plugins/Input/archive/decoder_archive.h
+++ b/src/plugins/Input/archive/decoder_archive.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2016 by Ilya Kotov *
+ * Copyright (C) 2016-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -23,6 +23,7 @@
#include <QString>
#include <archive.h>
+#include <qmmp/decoderfactory.h>
#include <qmmp/decoder.h>
diff --git a/src/plugins/Input/archive/decoderarchivefactory.cpp b/src/plugins/Input/archive/decoderarchivefactory.cpp
index 0badf82f3..bc8588c3a 100644
--- a/src/plugins/Input/archive/decoderarchivefactory.cpp
+++ b/src/plugins/Input/archive/decoderarchivefactory.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2016 by Ilya Kotov *
+ * Copyright (C) 2016-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -55,9 +55,9 @@ Decoder *DecoderArchiveFactory::create(const QString &url, QIODevice *)
return new DecoderArchive(url);
}
-QList<FileInfo *> DecoderArchiveFactory::createPlayList(const QString &path, bool useMetaData, QStringList *)
+QList<TrackInfo *> DecoderArchiveFactory::createPlayList(const QString &path, TrackInfo::Parts parts, QStringList *)
{
- QList <FileInfo *> list;
+ QList<TrackInfo *> list;
struct archive_entry *entry = 0;
struct archive *a = archive_read_new();
@@ -106,7 +106,7 @@ QList<FileInfo *> DecoderArchiveFactory::createPlayList(const QString &path, boo
if(!filtered.isEmpty())
{
- list << new FileInfo(QString("%1://%2#%3")
+ list << new TrackInfo(QString("%1://%2#%3")
.arg(archivePath.section(".", -1)).toLower()
.arg(archivePath)
.arg(filePath));
@@ -114,10 +114,20 @@ QList<FileInfo *> DecoderArchiveFactory::createPlayList(const QString &path, boo
ArchiveInputDevice dev(a, entry, 0);
ArchiveTagReader reader(&dev, list.last()->path());
- if(useMetaData)
- list.last()->setMetaData(reader.metaData());
- if(reader.audioProperties())
- list.last()->setLength(reader.audioProperties()->length());
+ if(parts & TrackInfo::MetaData)
+ list.last()->setValues(reader.metaData());
+
+ TagLib::AudioProperties *ap = reader.audioProperties();
+
+ if((parts & TrackInfo::Properties) && ap)
+ {
+ list.last()->setValue(Qmmp::BITRATE, ap->bitrate());
+ list.last()->setValue(Qmmp::SAMPLERATE, ap->sampleRate());
+ list.last()->setValue(Qmmp::CHANNELS, ap->channels());
+ }
+
+ if(ap)
+ list.last()->setDuration(reader.audioProperties()->lengthInMilliseconds());
}
}
archive_read_data_skip(a);
diff --git a/src/plugins/Input/archive/decoderarchivefactory.h b/src/plugins/Input/archive/decoderarchivefactory.h
index 8306a38d9..804b8db3b 100644
--- a/src/plugins/Input/archive/decoderarchivefactory.h
+++ b/src/plugins/Input/archive/decoderarchivefactory.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2016 by Ilya Kotov *
+ * Copyright (C) 2016-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -21,18 +21,9 @@
#ifndef DECODERARCHIVEFACTORY_H
#define DECODERARCHIVEFACTORY_H
-#include <QObject>
-#include <QString>
-#include <QIODevice>
-#include <QWidget>
-
-#include <qmmp/decoder.h>
-#include <qmmp/output.h>
#include <qmmp/decoderfactory.h>
-#include <qmmp/fileinfo.h>
-class DecoderArchiveFactory : public QObject,
- DecoderFactory
+class DecoderArchiveFactory : public QObject, DecoderFactory
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qmmp.qmmp.DecoderFactoryInterface.1.0")
@@ -42,7 +33,7 @@ public:
bool canDecode(QIODevice *) const;
const DecoderProperties properties() const;
Decoder *create(const QString &url, QIODevice *);
- QList<FileInfo *> createPlayList(const QString &path, bool useMetaData, QStringList *);
+ QList<TrackInfo *> createPlayList(const QString &path, TrackInfo::Parts parts, QStringList *);
MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0);
void showSettings(QWidget *parent);
void showAbout(QWidget *parent);