Updated FLAC encoder/decoder binaries to v1.3.1 (2014-11-26), compiled with ICL 15.0.
[LameXP.git] / src / Dialog_MainWindow.h
blobf17785df47e741b60198c943880f5a95877c6d4f
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2015 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, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #pragma once
25 #include <QMainWindow>
27 //Class declarations
28 class AbstractEncoder;
29 class AudioFileModel;
30 class AudioFileModel_MetaInfo;
31 class CustomEventFilter;
32 class DropBox;
33 class FileListModel;
34 class MessageHandlerThread;
35 class MetaInfoModel;
36 class QActionGroup;
37 class QButtonGroup;
38 class QFileSystemModelEx;
39 class QLabel;
40 class QMenu;
41 class QUrl;
42 class QModelIndex;
43 class SettingsModel;
44 class WorkingBanner;
45 class lamexp_icon_t;
47 //UIC forward declartion
48 namespace Ui
50 class MainWindow;
53 //IPC forward declartion
54 namespace MUtils
56 class IPCChannel;
59 //MainWindow class
60 class MainWindow: public QMainWindow
62 Q_OBJECT
64 public:
65 MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *const fileListModel, AudioFileModel_MetaInfo *const metaInfo, SettingsModel *const settingsModel, QWidget *const parent = 0);
66 ~MainWindow(void);
68 bool isAccepted() { return m_accepted; }
70 private slots:
71 void aboutButtonClicked(void);
72 void addFileDelayed(const QString &filePath, bool tryASAP = false);
73 void addFilesButtonClicked(void);
74 void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false);
75 void addFavoriteFolderActionTriggered(void);
76 void addFolderDelayed(const QString &folderPath, bool recursive);
77 void aftenCodingModeChanged(int value);
78 void aftenDRCModeChanged(int value);
79 void aftenFastAllocationChanged(bool checked);
80 void aftenSearchSizeChanged(int value);
81 void autoDetectInstancesChanged(bool checked);
82 void bitrateManagementEnabledChanged(bool checked);
83 void bitrateManagementMaxChanged(int value);
84 void bitrateManagementMinChanged(int value);
85 void browseCustomTempFolderButtonClicked(void);
86 void centerOutputFolderModel(void);
87 void centerOutputFolderModel_doAsync(void);
88 void channelModeChanged(int value);
89 void checkForBetaUpdatesActionTriggered(bool checked);
90 void checkUpdatesActionActivated(void);
91 void clearFilesButtonClicked(void);
92 void clearMetaButtonClicked(void);
93 void closeButtonClicked(void);
94 void compressionTabEventOccurred(QWidget*, QEvent*);
95 void cornerWidgetEventOccurred(QWidget *sender, QEvent *event);
96 void customParamsChanged(void);
97 void customParamsHelpRequested(QWidget *obj, QEvent *event);
98 void customTempFolderChanged(const QString &text);
99 void disableNeroAacNotificationsActionTriggered(bool checked);
100 void disableShellIntegrationActionTriggered(bool);
101 void disableSlowStartupNotificationsActionTriggered(bool checked);
102 void disableSoundsActionTriggered(bool checked);
103 void disableUpdateReminderActionTriggered(bool checked);
104 void documentActionActivated(void);
105 void editMetaButtonClicked(void);
106 void encodeButtonClicked(void);
107 void exportCsvContextActionTriggered(void);
108 void fileDownButtonClicked(void);
109 void fileUpButtonClicked(void);
110 void findFileContextActionTriggered(void);
111 void forceStereoDownmixEnabledChanged(bool checked);
112 void gotoDesktopButtonClicked(void);
113 void gotoFavoriteFolder(void);
114 void gotoHomeFolderButtonClicked(void);
115 void gotoMusicFolderButtonClicked(void);
116 void goUpFolderContextActionTriggered(void);
117 void handleDelayedFiles(void);
118 void handleDroppedFiles(void);
119 void hibernateComputerActionTriggered(bool checked);
120 void importCueSheetActionTriggered(bool checked);
121 void importCsvContextActionTriggered(void);
122 void initOutputFolderModel(void);
123 void initOutputFolderModel_doAsync(void);
124 void languageActionActivated(QAction *action);
125 void languageFromFileActionActivated(bool checked);
126 void makeFolderButtonClicked(void);
127 void metaTagsEnabledChanged(void);
128 void neroAAC2PassChanged(bool checked);
129 void neroAACProfileChanged(int value);
130 void normalizationEnabledChanged(bool checked);
131 void normalizationMaxVolumeChanged(double volume);
132 void normalizationModeChanged(int mode);
133 void notifyOtherInstance(void);
134 void openFolderActionActivated(void);
135 void opusSettingsChanged(void);
136 void outputFolderContextMenu(const QPoint &pos);
137 void outputFolderDirectoryLoaded(const QString &path);
138 void outputFolderEditFinished(void);
139 void outputFolderItemExpanded(const QModelIndex &item);
140 void outputFolderMouseEventOccurred(QWidget *sender, QEvent *event);
141 void outputFolderViewEventOccurred(QWidget *sender, QEvent *event);
142 void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
143 void outputFolderViewClicked(const QModelIndex &index);
144 void outputFolderViewMoved(const QModelIndex &index);
145 void overwriteModeChanged(int id);
146 void playlistEnabledChanged(void);
147 void prependRelativePathChanged(void);
148 void previewContextActionTriggered(void);
149 void refreshFolderContextActionTriggered(void);
150 void removeFileButtonClicked(void);
151 void renameOutputEnabledChanged(bool checked);
152 void renameOutputPatternChanged(void);
153 void renameOutputPatternChanged(const QString &text, bool silent = false);
154 void resetAdvancedOptionsButtonClicked(void);
155 void restoreCursor(void);
156 void samplingRateChanged(int value);
157 void saveToSourceFolderChanged(void);
158 void showAnnounceBox(void);
159 void showCustomParamsHelpScreen(const QString &toolName, const QString &command);
160 void showDetailsButtonClicked(void);
161 void showDropBoxWidgetActionTriggered(bool checked);
162 void showFolderContextActionTriggered(void);
163 void showRenameMacros(const QString &text);
164 void sourceFilesContextMenu(const QPoint &pos);
165 void sourceFilesScrollbarMoved(int);
166 void sourceModelChanged(void);
167 void styleActionActivated(QAction *action);
168 void tabActionActivated(QAction *action);
169 void tabPageChanged(int idx, const bool silent = false);
170 void toneAdjustBassChanged(double value);
171 void toneAdjustTrebleChanged(double value);
172 void toneAdjustTrebleReset(void);
173 void updateBitrate(int value);
174 void updateEncoder(int id = 0);
175 void updateLameAlgoQuality(int value);
176 void updateMaximumInstances(int value);
177 void updateRCMode(int id);
178 void useCustomTempFolderChanged(bool checked);
179 void visitHomepageActionActivated(void);
180 void windowShown(void);
182 protected:
183 virtual void changeEvent(QEvent *e);
184 virtual void closeEvent(QCloseEvent *event);
185 virtual void dragEnterEvent(QDragEnterEvent *event);
186 virtual void dropEvent(QDropEvent *event);
187 virtual bool eventFilter(QObject *obj, QEvent *event);
188 virtual void resizeEvent(QResizeEvent *event);
189 virtual void showEvent(QShowEvent *event);
190 virtual void keyPressEvent(QKeyEvent *e);
191 virtual bool event(QEvent *e);
192 virtual bool winEvent(MSG *message, long *result);
194 private:
195 Ui::MainWindow *ui; //for Qt UIC
197 void addFiles(const QStringList &files);
198 void addFolder(const QString &path, bool recursive = false, bool delayed = false);
199 bool checkForUpdates(void);
200 void initializeTranslation(void);
201 void refreshFavorites(void);
202 void openDocumentLink(QAction *const action);
204 bool m_accepted;
205 bool m_firstTimeShown;
206 uint m_outputFolderViewInitCounter;
207 bool m_outputFolderViewCentering;
209 WorkingBanner *m_banner;
210 QList<QUrl> *m_droppedFileList;
211 QStringList *m_delayedFileList;
212 QTimer *m_delayedFileTimer;
213 DropBox *m_dropBox;
214 QLabel *m_dropNoteLabel;
215 FileListModel *m_fileListModel;
216 QFileSystemModelEx *m_fileSystemModel;
217 MessageHandlerThread *m_messageHandler;
218 AudioFileModel_MetaInfo *const m_metaData;
219 MetaInfoModel *m_metaInfoModel;
220 QMenu *m_outputFolderContextMenu;
221 SettingsModel *m_settings;
222 QMenu *m_sourceFilesContextMenu;
223 QMenu *m_outputFolderFavoritesMenu;
224 QLabel *m_outputFolderNoteBox;
226 QAction *m_findFileContextAction;
227 QAction *m_previewContextAction;
228 QAction *m_showDetailsContextAction;
229 QAction *m_showFolderContextAction;
230 QAction *m_refreshFolderContextAction;
231 QAction *m_goUpFolderContextAction;
232 QAction *m_addFavoriteFolderAction;
233 QAction *m_exportCsvContextAction;
234 QAction *m_importCsvContextAction;
235 QActionGroup *m_languageActionGroup;
236 QActionGroup *m_styleActionGroup;
237 QActionGroup *m_tabActionGroup;
238 QButtonGroup *m_encoderButtonGroup;
239 QButtonGroup *m_modeButtonGroup;
240 QButtonGroup *m_overwriteButtonGroup;
242 CustomEventFilter *m_evenFilterCornerWidget;
243 CustomEventFilter *m_evenFilterCustumParamsHelp;
244 CustomEventFilter *m_evenFilterOutputFolderMouse;
245 CustomEventFilter *m_evenFilterOutputFolderView;
246 CustomEventFilter *m_evenFilterCompressionTab;