Sayonara Player
Converter.h
1/* Converter.h */
2
3/* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara Indexyer
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef AUDIOCONVERTER_H
22#define AUDIOCONVERTER_H
23
24#include <QObject>
25#include <QProcess>
26#include "Utils/Pimpl.h"
27
28class MetaDataList;
29class MetaData;
30
31class Converter :
32 public QObject
33{
34 Q_OBJECT
35 PIMPL(Converter)
36
37signals:
38 void sigFinished();
39 void sigProgress(int percent);
40
41public:
42 Converter(int quality, QObject* parent=nullptr);
43 virtual ~Converter();
44
45 virtual QStringList supportedInputFormats() const=0;
46 virtual QString binary() const=0;
47
48 QString loggingDirectory() const;
49 QString targetDirectory() const;
50 QString targetFile(const MetaData& md) const;
51 void addMetadata(const MetaDataList& tracks);
52 int errorCount() const;
53 int quality() const;
54 int initialCount() const;
55 int fileCount() const;
56 bool isAvailable() const;
57
58private:
59 bool startProcess(const QString& processName, const QStringList& arguments);
60
61protected:
62 virtual QStringList processEntry(const MetaData& md) const=0;
63 virtual QString extension() const=0;
64
65public slots:
66 void start(int numThreads, const QString& targetDir);
67 void stop();
68
69private slots:
70 void processFinished(int ret, QProcess::ExitStatus status);
71 void errorOccured(QProcess::ProcessError err);
72};
73
74#endif // OGGCONVERTER_H
Definition: Converter.h:33
The MetaDataList class.
Definition: MetaDataList.h:39
The MetaData class.
Definition: MetaData.h:47