OSDN Git Service

Implemented logging and added a log file view.
[lamexp/LameXP.git] / src / Dialog_Processing.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #pragma once
23
24 #include "../tmp/UIC_ProcessingDialog.h"
25
26 #include <QUuid>
27
28 class QMovie;
29 class ProgressModel;
30 class ProcessThread;
31 class FileListModel;
32 class AudioFileModel;
33 class SettingsModel;
34
35 class ProcessingDialog : public QDialog, private Ui::ProcessingDialog
36 {
37         Q_OBJECT
38
39 public:
40         ProcessingDialog(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settings, QWidget *parent = 0);
41         ~ProcessingDialog(void);
42
43 private slots:
44         void initEncoding(void);
45         void doneEncoding(void);
46         void abortEncoding(void);
47         void processFinished(const QUuid &jobId, const QString &outFileName, bool success);
48         void progressModelChanged(void);
49         void logViewDoubleClicked(const QModelIndex &index);
50
51 protected:
52         void showEvent(QShowEvent *event);
53         void closeEvent(QCloseEvent *event);
54         bool eventFilter(QObject *obj, QEvent *event);
55
56 private:
57         void setCloseButtonEnabled(bool enabled);
58         void startNextJob(void);
59         AudioFileModel updateMetaInfo(const AudioFileModel &audioFile);
60         void writePlayList(void);
61         
62         QList<AudioFileModel> m_pendingJobs;
63         SettingsModel *m_settings;
64         AudioFileModel *m_metaInfo;
65         QList<ProcessThread*> m_threadList;
66         QMovie *m_progressIndicator;
67         ProgressModel *m_progressModel;
68         QStringList m_playList;
69         unsigned int m_runningThreads;
70         unsigned int m_currentFile;
71         unsigned int m_succeededFiles;
72         unsigned int m_failedFiles;
73         bool m_userAborted;
74 };