2010-05-03 20:52:35 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TRANSCODEDIALOG_H
|
|
|
|
#define TRANSCODEDIALOG_H
|
|
|
|
|
2010-08-30 15:03:21 +02:00
|
|
|
#include <QBasicTimer>
|
2010-05-03 20:52:35 +02:00
|
|
|
#include <QDialog>
|
2015-02-19 21:09:42 +01:00
|
|
|
#include <QFileInfo>
|
2021-01-24 09:18:03 +01:00
|
|
|
#include <memory>
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
class Transcoder;
|
2010-05-10 23:50:31 +02:00
|
|
|
class Ui_TranscodeDialog;
|
|
|
|
class Ui_TranscodeLogDialog;
|
2010-05-03 20:52:35 +02:00
|
|
|
|
2014-01-11 01:04:59 +01:00
|
|
|
struct TranscoderPreset;
|
|
|
|
|
2010-05-03 20:52:35 +02:00
|
|
|
class TranscodeDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-02-10 16:03:54 +01:00
|
|
|
TranscodeDialog(QWidget* parent = nullptr);
|
2010-05-10 23:50:31 +02:00
|
|
|
~TranscodeDialog();
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
static const char* kSettingsGroup;
|
2010-08-30 15:03:21 +02:00
|
|
|
static const int kProgressInterval;
|
2014-01-11 18:59:54 +01:00
|
|
|
static const int kMaxDestinationItems;
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
void SetFilenames(const QStringList& filenames);
|
|
|
|
|
2010-08-30 15:03:21 +02:00
|
|
|
protected:
|
|
|
|
void timerEvent(QTimerEvent* e);
|
|
|
|
|
2010-05-03 20:52:35 +02:00
|
|
|
private slots:
|
|
|
|
void Add();
|
2014-09-10 01:09:19 +02:00
|
|
|
void Import();
|
2010-05-03 20:52:35 +02:00
|
|
|
void Remove();
|
|
|
|
void Start();
|
|
|
|
void Cancel();
|
2014-11-13 22:31:49 +01:00
|
|
|
void JobComplete(const QString& input, const QString& output, bool success);
|
2010-05-08 17:36:12 +02:00
|
|
|
void LogLine(const QString& message);
|
2010-05-03 20:52:35 +02:00
|
|
|
void AllJobsComplete();
|
2011-04-17 01:04:15 +02:00
|
|
|
void Options();
|
2014-01-11 18:59:54 +01:00
|
|
|
void AddDestination();
|
2021-01-27 07:41:56 +01:00
|
|
|
void PipelineDumpAction(bool checked);
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void SetWorking(bool working);
|
2010-05-08 17:36:12 +02:00
|
|
|
void UpdateStatusText();
|
2010-08-30 15:03:21 +02:00
|
|
|
void UpdateProgress();
|
2015-02-19 21:09:42 +01:00
|
|
|
QString GetOutputFileName(const QFileInfo& input,
|
2014-01-11 18:59:54 +01:00
|
|
|
const TranscoderPreset& preset) const;
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
private:
|
2021-01-24 09:18:03 +01:00
|
|
|
std::unique_ptr<Ui_TranscodeDialog> ui_;
|
|
|
|
std::unique_ptr<Ui_TranscodeLogDialog> details_ui_;
|
|
|
|
QDialog* details_dialog_;
|
2010-05-08 17:36:12 +02:00
|
|
|
|
2010-08-30 15:03:21 +02:00
|
|
|
QBasicTimer progress_timer_;
|
|
|
|
|
2010-05-03 20:52:35 +02:00
|
|
|
QPushButton* start_button_;
|
|
|
|
QPushButton* cancel_button_;
|
|
|
|
QPushButton* close_button_;
|
|
|
|
|
|
|
|
QString last_add_dir_;
|
2014-09-10 01:09:19 +02:00
|
|
|
QString last_import_dir_;
|
2010-05-03 20:52:35 +02:00
|
|
|
|
|
|
|
Transcoder* transcoder_;
|
2010-05-08 17:36:12 +02:00
|
|
|
int queued_;
|
|
|
|
int finished_success_;
|
|
|
|
int finished_failed_;
|
2010-05-03 20:52:35 +02:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // TRANSCODEDIALOG_H
|