OSDN Git Service

Implemented AbstractEncoderInfo for some more encoders. Remaining encoders not yet...
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2013 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 <QMainWindow>
25
26 //Class declarations
27 class AbstractEncoder;
28 class AudioFileModel;
29 class CustomEventFilter;
30 class DropBox;
31 class FileListModel;
32 class MessageHandlerThread;
33 class MetaInfoModel;
34 class QActionGroup;
35 class QButtonGroup;
36 class QFileSystemModelEx;
37 class QLabel;
38 class QMenu;
39 class QModelIndex;
40 class SettingsModel;
41 class WorkingBanner;
42
43 //UIC forward declartion
44 namespace Ui {
45         class MainWindow;
46 }
47
48 //MainWindow class
49 class MainWindow: public QMainWindow
50 {
51         Q_OBJECT
52
53 public:
54         MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
55         ~MainWindow(void);
56
57         bool isAccepted() { return m_accepted; }
58
59 private slots:
60         void aboutButtonClicked(void);
61         void addFileDelayed(const QString &filePath, bool tryASAP = false);
62         void addFilesButtonClicked(void);
63         void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false);
64         void addFavoriteFolderActionTriggered(void);
65         void addFolderDelayed(const QString &folderPath, bool recursive);
66         void aftenCodingModeChanged(int value);
67         void aftenDRCModeChanged(int value);
68         void aftenFastAllocationChanged(bool checked);
69         void aftenSearchSizeChanged(int value);
70         void autoDetectInstancesChanged(bool checked);
71         void bitrateManagementEnabledChanged(bool checked);
72         void bitrateManagementMaxChanged(int value);
73         void bitrateManagementMinChanged(int value);
74         void browseCustomTempFolderButtonClicked(void);
75         void centerOutputFolderModel(void);
76         void centerOutputFolderModel_doAsync(void);
77         void channelModeChanged(int value);
78         void checkForBetaUpdatesActionTriggered(bool checked);
79         void checkUpdatesActionActivated(void);
80         void clearFilesButtonClicked(void);
81         void clearMetaButtonClicked(void);
82         void closeButtonClicked(void);
83         void compressionTabEventOccurred(QWidget*, QEvent*);
84         void customParamsChanged(void);
85         void customParamsHelpRequested(QWidget *obj, QEvent *event);
86         void customTempFolderChanged(const QString &text);
87         void disableNeroAacNotificationsActionTriggered(bool checked);
88         void disableShellIntegrationActionTriggered(bool);
89         void disableSlowStartupNotificationsActionTriggered(bool checked);
90         void disableSoundsActionTriggered(bool checked);
91         void disableUpdateReminderActionTriggered(bool checked);
92         void documentActionActivated(void);
93         void editMetaButtonClicked(void);
94         void encodeButtonClicked(void);
95         void exportCsvContextActionTriggered(void);
96         void fileDownButtonClicked(void);
97         void fileUpButtonClicked(void);
98         void findFileContextActionTriggered(void);
99         void forceStereoDownmixEnabledChanged(bool checked);
100         void gotoDesktopButtonClicked(void);
101         void gotoFavoriteFolder(void);
102         void gotoHomeFolderButtonClicked(void);
103         void gotoMusicFolderButtonClicked(void);
104         void goUpFolderContextActionTriggered(void);
105         void handleDelayedFiles(void);
106         void hibernateComputerActionTriggered(bool checked);
107         void importCueSheetActionTriggered(bool checked);
108         void importCsvContextActionTriggered(void);
109         void initOutputFolderModel(void);
110         void initOutputFolderModel_doAsync(void);
111         void languageActionActivated(QAction *action);
112         void languageFromFileActionActivated(bool checked);
113         void makeFolderButtonClicked(void);
114         void metaTagsEnabledChanged(void);
115         void neroAAC2PassChanged(bool checked);
116         void neroAACProfileChanged(int value);
117         void normalizationEnabledChanged(bool checked);
118         void normalizationMaxVolumeChanged(double volume);
119         void normalizationModeChanged(int mode);
120         void notifyOtherInstance(void);
121         void openFolderActionActivated(void);
122         void opusSettingsChanged(void);
123         void outputFolderContextMenu(const QPoint &pos);
124         void outputFolderDirectoryLoaded(const QString &path);
125         void outputFolderEditFinished(void);
126         void outputFolderItemExpanded(const QModelIndex &item);
127         void outputFolderMouseEventOccurred(QWidget *sender, QEvent *event);
128         void outputFolderViewEventOccurred(QWidget *sender, QEvent *event);
129         void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
130         void outputFolderViewClicked(const QModelIndex &index);
131         void outputFolderViewMoved(const QModelIndex &index);
132         void overwriteModeChanged(int id);
133         void playlistEnabledChanged(void);
134         void prependRelativePathChanged(void);
135         void previewContextActionTriggered(void);
136         void refreshFolderContextActionTriggered(void);
137         void removeFileButtonClicked(void);
138         void renameOutputEnabledChanged(bool checked);
139         void renameOutputPatternChanged(void);
140         void renameOutputPatternChanged(const QString &text, bool silent = false);
141         void resetAdvancedOptionsButtonClicked(void);
142         void restoreCursor(void);
143         void samplingRateChanged(int value);
144         void saveToSourceFolderChanged(void);
145         void showAnnounceBox(void);
146         void showCustomParamsHelpScreen(const QString &toolName, const QString &command);
147         void showDetailsButtonClicked(void);
148         void showDropBoxWidgetActionTriggered(bool checked);
149         void showFolderContextActionTriggered(void);
150         void showRenameMacros(const QString &text);
151         void sourceFilesContextMenu(const QPoint &pos);
152         void sourceFilesScrollbarMoved(int);
153         void sourceModelChanged(void);
154         void styleActionActivated(QAction *action);
155         void tabActionActivated(QAction *action);
156         void tabPageChanged(int idx);
157         void toneAdjustBassChanged(double value);
158         void toneAdjustTrebleChanged(double value);
159         void toneAdjustTrebleReset(void);
160         void updateBitrate(int value);
161         void updateEncoder(int id = 0);
162         void updateLameAlgoQuality(int value);
163         void updateMaximumInstances(int value);
164         void updateRCMode(int id);
165         void useCustomTempFolderChanged(bool checked);
166         void visitHomepageActionActivated(void);
167         void windowShown(void);
168
169 protected:
170         virtual void changeEvent(QEvent *e);
171         virtual void closeEvent(QCloseEvent *event);
172         virtual void dragEnterEvent(QDragEnterEvent *event);
173         virtual void dropEvent(QDropEvent *event);
174         virtual bool eventFilter(QObject *obj, QEvent *event);
175         virtual void resizeEvent(QResizeEvent *event);
176         virtual void showEvent(QShowEvent *event);
177         virtual void keyPressEvent(QKeyEvent *e);
178         virtual bool event(QEvent *e);
179         virtual bool winEvent(MSG *message, long *result);
180
181 private:
182         Ui::MainWindow *ui; //for Qt UIC
183
184         void addFiles(const QStringList &files);
185         void addFolder(const QString &path, bool recursive = false, bool delayed = false);
186         bool checkForUpdates(void);
187         void initializeTranslation(void);
188         void refreshFavorites(void);
189         
190         bool m_accepted;
191         bool m_firstTimeShown;
192         uint m_outputFolderViewInitCounter;
193         bool m_outputFolderViewCentering;
194
195         WorkingBanner *m_banner;
196         QStringList *m_delayedFileList;
197         QTimer *m_delayedFileTimer;
198         DropBox *m_dropBox;
199         QLabel *m_dropNoteLabel;
200         FileListModel *m_fileListModel;
201         QFileSystemModelEx *m_fileSystemModel;
202         MessageHandlerThread *m_messageHandler;
203         AudioFileModel *m_metaData;
204         MetaInfoModel *m_metaInfoModel;
205         QMenu *m_outputFolderContextMenu;
206         SettingsModel *m_settings;
207         QMenu *m_sourceFilesContextMenu;
208         QMenu *m_outputFolderFavoritesMenu;
209         QLabel *m_outputFolderNoteBox;
210
211         QAction *m_findFileContextAction;
212         QAction *m_previewContextAction;
213         QAction *m_showDetailsContextAction;
214         QAction *m_showFolderContextAction;
215         QAction *m_refreshFolderContextAction;
216         QAction *m_goUpFolderContextAction;
217         QAction *m_addFavoriteFolderAction;
218         QAction *m_exportCsvContextAction;
219         QAction *m_importCsvContextAction;
220         QActionGroup *m_languageActionGroup;
221         QActionGroup *m_styleActionGroup;
222         QActionGroup *m_tabActionGroup;
223         QButtonGroup *m_encoderButtonGroup;
224         QButtonGroup *m_modeButtonGroup;
225         QButtonGroup *m_overwriteButtonGroup;
226
227         CustomEventFilter *m_evenFilterCustumParamsHelp;
228         CustomEventFilter *m_evenFilterOutputFolderMouse;
229         CustomEventFilter *m_evenFilterOutputFolderView;
230         CustomEventFilter *m_evenFilterCompressionTab;
231 };