aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/converter/converter.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-01-20 13:01:00 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-01-20 13:01:00 +0000
commit58eacba4daf81e8b24201c81125c97ff55742869 (patch)
treea8b5d89e573cef8ed72e00f654dd495a6a35264b /src/plugins/General/converter/converter.h
parent30efd053e33c54a63d009d938dedbc2679f4dcdb (diff)
downloadqmmp-58eacba4daf81e8b24201c81125c97ff55742869.tar.gz
qmmp-58eacba4daf81e8b24201c81125c97ff55742869.tar.bz2
qmmp-58eacba4daf81e8b24201c81125c97ff55742869.zip
converter: multi-thread support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6068 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/converter/converter.h')
-rw-r--r--src/plugins/General/converter/converter.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/General/converter/converter.h b/src/plugins/General/converter/converter.h
index fcb69f7c9..e2f58d22e 100644
--- a/src/plugins/General/converter/converter.h
+++ b/src/plugins/General/converter/converter.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2011 by Ilya Kotov *
+ * Copyright (C) 2011-2016 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -21,7 +21,8 @@
#ifndef CONVERTER_H
#define CONVERTER_H
-#include <QThread>
+#include <QRunnable>
+#include <QObject>
#include <QQueue>
#include <QHash>
#include <QVariantMap>
@@ -33,30 +34,31 @@
/**
@author Ilya Kotov <forkotov02@hotmail.ru>
*/
-class Converter : public QThread
+class Converter : public QObject, public QRunnable
{
Q_OBJECT
public:
explicit Converter(QObject *parent = 0);
virtual ~Converter();
- void add(const QStringList &urls, const QVariantMap &preset);
- void add(const QString &url, const QVariantMap &preset);
+ bool prepare(const QString &url, const QVariantMap &preset);
public slots:
void stop();
signals:
void progress(int percent);
- void desriptionChanged(QString text);
- void error(QString text);
+ void finished(Converter *converter);
private:
void run();
bool convert(Decoder *decoder, FILE *file, bool use16bit);
- QQueue <Decoder*> m_decoders;
- QHash <Decoder*, InputSource*> m_inputs;
- QHash <Decoder*, QVariantMap> m_presets;
+ //QQueue <Decoder*> m_decoders;
+ //QHash <Decoder*, InputSource*> m_inputs;
+ //QHash <Decoder*, QVariantMap> m_presets;
+ Decoder *m_decoder;
+ InputSource *m_input;
+ QVariantMap m_preset;
QMutex m_mutex;
bool m_user_stop;