00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AUDIO_FILE_COPY_CONVERT_H
00023 #define AUDIO_FILE_COPY_CONVERT_H
00024
00025 #include <QThread>
00026 #include <QQueue>
00027 #include <QMutex>
00028
00029 class ReadSource;
00030 struct ExportSpecification;
00031
00032 class AudioFileCopyConvert : public QThread
00033 {
00034 Q_OBJECT
00035 public:
00036 AudioFileCopyConvert();
00037 void run() {
00038 exec();
00039 }
00040
00041 void enqueue_task(ReadSource* source, ExportSpecification* spec, const QString& dir, const QString& outfilename, int tracknumber, const QString& trackname);
00042 void stop_merging();
00043
00044
00045 private slots:
00046 void dequeue_tasks();
00047
00048 private:
00049 struct CopyTask {
00050 QString outFileName;
00051 QString dir;
00052 QString extension;
00053 int tracknumber;
00054 QString trackname;
00055 ReadSource* readsource;
00056 ExportSpecification* spec;
00057 };
00058
00059 QQueue<CopyTask> m_tasks;
00060 QMutex m_mutex;
00061 bool m_stopProcessing;
00062
00063 void process_task(CopyTask task);
00064
00065 signals:
00066 void dequeueTask();
00067 void progress(int);
00068 void taskStarted(QString);
00069 void taskFinished(QString, int, QString);
00070 void processingStopped();
00071 };
00072
00073 #endif