2010-11-17 19:35:50 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
|
|
|
// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
|
|
|
|
//
|
|
|
|
// This program 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 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program 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 this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../tmp/UIC_ProcessingDialog.h"
|
|
|
|
|
2010-11-20 22:14:10 +01:00
|
|
|
#include <QUuid>
|
2010-12-10 22:17:44 +01:00
|
|
|
#include <QSystemTrayIcon>
|
2010-11-20 22:14:10 +01:00
|
|
|
|
2010-11-17 19:35:50 +01:00
|
|
|
class QMovie;
|
2010-11-24 21:00:59 +01:00
|
|
|
class QMenu;
|
2010-11-18 00:32:46 +01:00
|
|
|
class ProgressModel;
|
|
|
|
class ProcessThread;
|
2010-11-19 21:11:54 +01:00
|
|
|
class FileListModel;
|
|
|
|
class AudioFileModel;
|
2010-11-20 02:14:22 +01:00
|
|
|
class SettingsModel;
|
2010-11-17 19:35:50 +01:00
|
|
|
|
|
|
|
class ProcessingDialog : public QDialog, private Ui::ProcessingDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-11-20 19:16:04 +01:00
|
|
|
ProcessingDialog(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settings, QWidget *parent = 0);
|
2010-11-17 19:35:50 +01:00
|
|
|
~ProcessingDialog(void);
|
|
|
|
|
2010-11-18 00:32:46 +01:00
|
|
|
private slots:
|
|
|
|
void initEncoding(void);
|
|
|
|
void doneEncoding(void);
|
|
|
|
void abortEncoding(void);
|
2010-11-20 22:14:10 +01:00
|
|
|
void processFinished(const QUuid &jobId, const QString &outFileName, bool success);
|
2010-11-21 21:51:22 +01:00
|
|
|
void progressModelChanged(void);
|
2010-11-22 21:45:00 +01:00
|
|
|
void logViewDoubleClicked(const QModelIndex &index);
|
2010-11-24 21:00:59 +01:00
|
|
|
void contextMenuTriggered(const QPoint &pos);
|
|
|
|
void contextMenuActionTriggered(void);
|
2010-12-10 22:17:44 +01:00
|
|
|
void systemTrayActivated(QSystemTrayIcon::ActivationReason reason);
|
2010-11-18 00:32:46 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
2010-11-17 19:35:50 +01:00
|
|
|
private:
|
2010-11-18 00:32:46 +01:00
|
|
|
void setCloseButtonEnabled(bool enabled);
|
2010-11-20 19:16:04 +01:00
|
|
|
void startNextJob(void);
|
|
|
|
AudioFileModel updateMetaInfo(const AudioFileModel &audioFile);
|
2010-11-20 22:14:10 +01:00
|
|
|
void writePlayList(void);
|
2010-11-18 00:32:46 +01:00
|
|
|
|
2010-11-19 21:11:54 +01:00
|
|
|
QList<AudioFileModel> m_pendingJobs;
|
2010-11-20 02:14:22 +01:00
|
|
|
SettingsModel *m_settings;
|
2010-11-20 19:16:04 +01:00
|
|
|
AudioFileModel *m_metaInfo;
|
2010-11-19 21:11:54 +01:00
|
|
|
QList<ProcessThread*> m_threadList;
|
2010-11-17 19:35:50 +01:00
|
|
|
QMovie *m_progressIndicator;
|
2010-11-18 00:32:46 +01:00
|
|
|
ProgressModel *m_progressModel;
|
2010-12-10 21:24:42 +01:00
|
|
|
QMap<QUuid,QString> m_playList;
|
2010-11-24 21:00:59 +01:00
|
|
|
QMenu *m_contextMenu;
|
2010-11-19 21:11:54 +01:00
|
|
|
unsigned int m_runningThreads;
|
2010-11-20 19:16:04 +01:00
|
|
|
unsigned int m_currentFile;
|
2010-12-10 21:24:42 +01:00
|
|
|
QList<QUuid> m_allJobs;
|
|
|
|
QList<QUuid> m_succeededJobs;
|
|
|
|
QList<QUuid> m_failedJobs;
|
2010-11-19 21:11:54 +01:00
|
|
|
bool m_userAborted;
|
2010-12-10 22:17:44 +01:00
|
|
|
QSystemTrayIcon *m_systemTray;
|
2010-11-17 19:35:50 +01:00
|
|
|
};
|