OSDN Git Service

Implemented late initialization of the QFileSystemModel. Should make the first switch...
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2011 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_MainWindow.h"
25
26 //Class declarations
27 class QFileSystemModelEx;
28 class WorkingBanner;
29 class MessageHandlerThread;
30 class AudioFileModel;
31 class MetaInfoModel;
32 class SettingsModel;
33 class QButtonGroup;
34 class FileListModel;
35 class AbstractEncoder;
36 class QMenu;
37 class DropBox;
38
39 class MainWindow: public QMainWindow, private Ui::MainWindow
40 {
41         Q_OBJECT
42
43 public:
44         MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
45         ~MainWindow(void);
46
47         bool isAccepted() { return m_accepted; }
48
49 private slots:
50         void aboutButtonClicked(void);
51         void addFileDelayed(const QString &filePath);
52         void addFilesButtonClicked(void);
53         void aftenCodingModeChanged(int value);
54         void aftenDRCModeChanged(int value);
55         void aftenFastAllocationChanged(bool checked);
56         void aftenSearchSizeChanged(int value);
57         void autoDetectInstancesChanged(bool checked);
58         void bitrateManagementEnabledChanged(bool checked);
59         void bitrateManagementMaxChanged(int value);
60         void bitrateManagementMinChanged(int value);
61         void browseCustomTempFolderButtonClicked(void);
62         void channelModeChanged(int value);
63         void checkForBetaUpdatesActionTriggered(bool checked);
64         void checkUpdatesActionActivated(void);
65         void clearFilesButtonClicked(void);
66         void clearMetaButtonClicked(void);
67         void closeButtonClicked(void);
68         void customParamsChanged(void);
69         void customTempFolderChanged(const QString &text);
70         void disableNeroAacNotificationsActionTriggered(bool checked);
71         void disableShellIntegrationActionTriggered(bool);
72         void disableSoundsActionTriggered(bool checked);
73         void disableUpdateReminderActionTriggered(bool checked);
74         void disableWmaDecoderNotificationsActionTriggered(bool checked);
75         void documentActionActivated(void);
76         void editMetaButtonClicked(void);
77         void encodeButtonClicked(void);
78         void fileDownButtonClicked(void);
79         void fileUpButtonClicked(void);
80         void findFileContextActionTriggered(void);
81         void gotoDesktopButtonClicked(void);
82         void gotoHomeFolderButtonClicked(void);
83         void gotoMusicFolderButtonClicked(void);
84         void handleDelayedFiles(void);
85         void importCueSheetActionTriggered(bool checked);
86         void initOutputFolderModel(void);
87         void installWMADecoderActionTriggered(bool checked);
88         void languageActionActivated(QAction *action);
89         void languageFromFileActionActivated(bool checked);
90         void makeFolderButtonClicked(void);
91         void metaTagsEnabledChanged(void);
92         void neroAAC2PassChanged(bool checked);
93         void neroAACProfileChanged(int value);
94         void normalizationEnabledChanged(bool checked);
95         void normalizationMaxVolumeChanged(double volume);
96         void notifyOtherInstance(void);
97         void openFolderActionActivated(void);
98         void outputFolderContextMenu(const QPoint &pos);
99         void outputFolderViewClicked(const QModelIndex &index);
100         void outputFolderViewMoved(const QModelIndex &index);
101         void playlistEnabledChanged(void);
102         void prependRelativePathChanged(void);
103         void previewContextActionTriggered(void);
104         void removeFileButtonClicked(void);
105         void resetAdvancedOptionsButtonClicked(void);
106         void restoreCursor(void);
107         void samplingRateChanged(int value);
108         void saveToSourceFolderChanged(void);
109         void showDetailsButtonClicked(void);
110         void showDropBoxWidgetActionTriggered(bool checked);
111         void showFolderContextActionTriggered(void);
112         void sourceFilesContextMenu(const QPoint &pos);
113         void sourceModelChanged(void);
114         void styleActionActivated(QAction *action);
115         void tabActionActivated(QAction *action);
116         void tabPageChanged(int idx);
117         void toneAdjustBassChanged(double value);
118         void toneAdjustTrebleChanged(double value);
119         void toneAdjustTrebleReset(void);
120         void updateBitrate(int value);
121         void updateEncoder(int id);
122         void updateLameAlgoQuality(int value);
123         void updateMaximumInstances(int value);
124         void updateRCMode(int id);
125         void useCustomTempFolderChanged(bool checked);
126         void visitHomepageActionActivated(void);
127         void windowShown(void);
128
129 protected:
130         void changeEvent(QEvent *e);
131         void closeEvent(QCloseEvent *event);
132         void dragEnterEvent(QDragEnterEvent *event);
133         void dropEvent(QDropEvent *event);
134         bool eventFilter(QObject *obj, QEvent *event);
135         void resizeEvent(QResizeEvent *event);
136         void showEvent(QShowEvent *event);
137
138 private:
139         void addFiles(const QStringList &files);
140         void addFolder(const QString &path, bool recursive = false);
141         bool checkForUpdates(void);
142         bool installWMADecoder(void);
143         
144         bool m_accepted;
145         bool m_firstTimeShown;
146         bool m_OutputFolderViewInitialized;
147
148         const bool m_neroEncoderAvailable;
149
150         WorkingBanner *m_banner;
151         QStringList *m_delayedFileList;
152         QTimer *m_delayedFileTimer;
153         DropBox *m_dropBox;
154         QLabel *m_dropNoteLabel;
155         FileListModel *m_fileListModel;
156         QFileSystemModelEx *m_fileSystemModel;
157         MessageHandlerThread *m_messageHandler;
158         AudioFileModel *m_metaData;
159         MetaInfoModel *m_metaInfoModel;
160         QMenu *m_outputFolderContextMenu;
161         SettingsModel *m_settings;
162         QMenu *m_sourceFilesContextMenu;
163
164         QAction *m_findFileContextAction;
165         QAction *m_previewContextAction;
166         QAction *m_showDetailsContextAction;
167         QAction *m_showFolderContextAction;
168         QActionGroup *m_languageActionGroup;
169         QActionGroup *m_styleActionGroup;
170         QActionGroup *m_tabActionGroup;
171         QButtonGroup *m_encoderButtonGroup;
172         QButtonGroup *m_modeButtonGroup;
173 };