OSDN Git Service

Switched the method of how the Designer UI file is used in the CueSheetImport class...
[lamexp/LameXP.git] / src / Dialog_Processing.h
index 44ad371..a427259 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2012 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
 
 #pragma once
 
-#include "../tmp/UIC_ProcessingDialog.h"
-
+#include <QDialog>
 #include <QUuid>
 #include <QSystemTrayIcon>
+#include <QMap>
 
-class QMovie;
-class QMenu;
-class ProgressModel;
-class ProcessThread;
-class FileListModel;
+class AbstractEncoder;
 class AudioFileModel;
-class SettingsModel;
+class CPUObserverThread;
 class DiskObserverThread;
+class FileListModel;
+class ProcessThread;
+class ProgressModel;
+class QActionGroup;
+class QLabel;
+class QMenu;
+class QModelIndex;
+class QMovie;
+class RAMObserverThread;
+class SettingsModel;
 
-class ProcessingDialog : public QDialog, private Ui::ProcessingDialog
+enum shutdownFlag_t
+{
+       shutdownFlag_None = 0,
+       shutdownFlag_TurnPowerOff = 1,
+       shutdownFlag_Hibernate = 2
+};
+
+//UIC forward declartion
+namespace Ui {
+       class ProcessingDialog;
+}
+
+//ProcessingDialog class
+class ProcessingDialog : public QDialog
 {
        Q_OBJECT
 
@@ -43,31 +62,44 @@ public:
        ProcessingDialog(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settings, QWidget *parent = 0);
        ~ProcessingDialog(void);
        
-       bool getShutdownFlag(void) { return m_shutdownFlag; }
+       int getShutdownFlag(void) { return m_shutdownFlag; }
 
 private slots:
        void initEncoding(void);
        void doneEncoding(void);
-       void abortEncoding(void);
-       void processFinished(const QUuid &jobId, const QString &outFileName, bool success);
+       void abortEncoding(bool force = false);
+       void processFinished(const QUuid &jobId, const QString &outFileName, int success);
        void progressModelChanged(void);
        void logViewDoubleClicked(const QModelIndex &index);
+       void logViewSectionSizeChanged(int, int, int);
        void contextMenuTriggered(const QPoint &pos);
        void contextMenuDetailsActionTriggered(void);
        void contextMenuShowFileActionTriggered(void);
+       void contextMenuFilterActionTriggered(void);
        void systemTrayActivated(QSystemTrayIcon::ActivationReason reason);
+       void cpuUsageHasChanged(const double val);
+       void ramUsageHasChanged(const double val);
+       void diskUsageHasChanged(const quint64 val);
+       void progressViewFilterChanged(void);
 
 protected:
        void showEvent(QShowEvent *event);
        void closeEvent(QCloseEvent *event);
        bool eventFilter(QObject *obj, QEvent *event);
+       virtual bool event(QEvent *e);
+       virtual bool winEvent(MSG *message, long *result);
+       virtual void resizeEvent(QResizeEvent *event);
 
 private:
+       Ui::ProcessingDialog *ui; //for Qt UIC
+
        void setCloseButtonEnabled(bool enabled);
        void startNextJob(void);
+       AbstractEncoder *makeEncoder(bool *nativeResampling);
        AudioFileModel updateMetaInfo(const AudioFileModel &audioFile);
        void writePlayList(void);
        bool shutdownComputer(void);
+       QString time2text(const double timeVal) const;
        
        QList<AudioFileModel> m_pendingJobs;
        SettingsModel *m_settings;
@@ -77,13 +109,23 @@ private:
        ProgressModel *m_progressModel;
        QMap<QUuid,QString> m_playList;
        QMenu *m_contextMenu;
+       QActionGroup *m_progressViewFilterGroup;
+       QLabel *m_filterInfoLabel;
+       QLabel *m_filterInfoLabelIcon;
        unsigned int m_runningThreads;
        unsigned int m_currentFile;
        QList<QUuid> m_allJobs;
        QList<QUuid> m_succeededJobs;
        QList<QUuid> m_failedJobs;
+       QList<QUuid> m_skippedJobs;
        bool m_userAborted;
+       bool m_forcedAbort;
+       bool m_firstShow;
        QSystemTrayIcon *m_systemTray;
-       bool m_shutdownFlag;
+       int m_shutdownFlag;
+       CPUObserverThread *m_cpuObserver;
+       RAMObserverThread *m_ramObserver;
        DiskObserverThread *m_diskObserver;
+       qint64 m_timerStart;
+       int m_progressViewFilter;
 };