Bump version.
[LameXP.git] / src / Dialog_MainWindow.h
blob3e721e85c49514aadb5f724922140aa120c28418
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2012 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.
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.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
22 #pragma once
24 #include "../tmp/UIC_MainWindow.h"
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;
39 class MainWindow: public QMainWindow, private Ui::MainWindow
41 Q_OBJECT
43 public:
44 MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
45 ~MainWindow(void);
47 bool isAccepted() { return m_accepted; }
49 private slots:
50 void aboutButtonClicked(void);
51 void addFileDelayed(const QString &filePath, bool tryASAP = false);
52 void addFilesButtonClicked(void);
53 void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false);
54 void addFavoriteFolderActionTriggered(void);
55 void addFolderDelayed(const QString &folderPath, bool recursive);
56 void aftenCodingModeChanged(int value);
57 void aftenDRCModeChanged(int value);
58 void aftenFastAllocationChanged(bool checked);
59 void aftenSearchSizeChanged(int value);
60 void autoDetectInstancesChanged(bool checked);
61 void bitrateManagementEnabledChanged(bool checked);
62 void bitrateManagementMaxChanged(int value);
63 void bitrateManagementMinChanged(int value);
64 void browseCustomTempFolderButtonClicked(void);
65 void centerOutputFolderModel(void);
66 void centerOutputFolderModel_doAsync(void);
67 void channelModeChanged(int value);
68 void checkForBetaUpdatesActionTriggered(bool checked);
69 void checkUpdatesActionActivated(void);
70 void clearFilesButtonClicked(void);
71 void clearMetaButtonClicked(void);
72 void closeButtonClicked(void);
73 void customParamsChanged(void);
74 void customTempFolderChanged(const QString &text);
75 void disableNeroAacNotificationsActionTriggered(bool checked);
76 void disableShellIntegrationActionTriggered(bool);
77 void disableSlowStartupNotificationsActionTriggered(bool checked);
78 void disableSoundsActionTriggered(bool checked);
79 void disableUpdateReminderActionTriggered(bool checked);
80 void documentActionActivated(void);
81 void editMetaButtonClicked(void);
82 void encodeButtonClicked(void);
83 void exportCsvContextActionTriggered(void);
84 void fileDownButtonClicked(void);
85 void fileUpButtonClicked(void);
86 void findFileContextActionTriggered(void);
87 void forceStereoDownmixEnabledChanged(bool checked);
88 void gotoDesktopButtonClicked(void);
89 void gotoFavoriteFolder(void);
90 void gotoHomeFolderButtonClicked(void);
91 void gotoMusicFolderButtonClicked(void);
92 void handleDelayedFiles(void);
93 void hibernateComputerActionTriggered(bool checked);
94 void importCueSheetActionTriggered(bool checked);
95 void importCsvContextActionTriggered(void);
96 void initOutputFolderModel(void);
97 void initOutputFolderModel_doAsync(void);
98 void languageActionActivated(QAction *action);
99 void languageFromFileActionActivated(bool checked);
100 void makeFolderButtonClicked(void);
101 void metaTagsEnabledChanged(void);
102 void neroAAC2PassChanged(bool checked);
103 void neroAACProfileChanged(int value);
104 void normalizationEnabledChanged(bool checked);
105 void normalizationMaxVolumeChanged(double volume);
106 void normalizationModeChanged(int mode);
107 void notifyOtherInstance(void);
108 void openFolderActionActivated(void);
109 void outputFolderContextMenu(const QPoint &pos);
110 void outputFolderDirectoryLoaded(const QString &path);
111 void outputFolderEditFinished(void);
112 void outputFolderItemExpanded(const QModelIndex &item);
113 void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
114 void outputFolderViewClicked(const QModelIndex &index);
115 void outputFolderViewMoved(const QModelIndex &index);
116 void playlistEnabledChanged(void);
117 void prependRelativePathChanged(void);
118 void previewContextActionTriggered(void);
119 void refreshFolderContextActionTriggered(void);
120 void removeFileButtonClicked(void);
121 void renameOutputEnabledChanged(bool checked);
122 void renameOutputPatternChanged(void);
123 void renameOutputPatternChanged(const QString &text);
124 void resetAdvancedOptionsButtonClicked(void);
125 void restoreCursor(void);
126 void samplingRateChanged(int value);
127 void saveToSourceFolderChanged(void);
128 void showAnnounceBox(void);
129 void showDetailsButtonClicked(void);
130 void showDropBoxWidgetActionTriggered(bool checked);
131 void showFolderContextActionTriggered(void);
132 void showRenameMacros(const QString &text);
133 void sourceFilesContextMenu(const QPoint &pos);
134 void sourceFilesScrollbarMoved(int);
135 void sourceModelChanged(void);
136 void styleActionActivated(QAction *action);
137 void tabActionActivated(QAction *action);
138 void tabPageChanged(int idx);
139 void toneAdjustBassChanged(double value);
140 void toneAdjustTrebleChanged(double value);
141 void toneAdjustTrebleReset(void);
142 void updateBitrate(int value);
143 void updateEncoder(int id);
144 void updateLameAlgoQuality(int value);
145 void updateMaximumInstances(int value);
146 void updateRCMode(int id);
147 void useCustomTempFolderChanged(bool checked);
148 void visitHomepageActionActivated(void);
149 void windowShown(void);
151 protected:
152 virtual void changeEvent(QEvent *e);
153 virtual void closeEvent(QCloseEvent *event);
154 virtual void dragEnterEvent(QDragEnterEvent *event);
155 virtual void dropEvent(QDropEvent *event);
156 virtual bool eventFilter(QObject *obj, QEvent *event);
157 virtual void resizeEvent(QResizeEvent *event);
158 virtual void showEvent(QShowEvent *event);
159 virtual void keyPressEvent(QKeyEvent *e);
160 virtual bool event(QEvent *e);
161 virtual bool winEvent(MSG *message, long *result);
163 private:
164 void addFiles(const QStringList &files);
165 void addFolder(const QString &path, bool recursive = false, bool delayed = false);
166 bool checkForUpdates(void);
167 void refreshFavorites(void);
169 bool m_accepted;
170 bool m_firstTimeShown;
171 uint m_outputFolderViewInitCounter;
172 bool m_outputFolderViewCentering;
174 const bool m_neroEncoderAvailable;
175 const bool m_fhgEncoderAvailable;
176 const bool m_qaacEncoderAvailable;
178 WorkingBanner *m_banner;
179 QStringList *m_delayedFileList;
180 QTimer *m_delayedFileTimer;
181 DropBox *m_dropBox;
182 QLabel *m_dropNoteLabel;
183 FileListModel *m_fileListModel;
184 QFileSystemModelEx *m_fileSystemModel;
185 MessageHandlerThread *m_messageHandler;
186 AudioFileModel *m_metaData;
187 MetaInfoModel *m_metaInfoModel;
188 QMenu *m_outputFolderContextMenu;
189 SettingsModel *m_settings;
190 QMenu *m_sourceFilesContextMenu;
191 QMenu *m_outputFolderFavoritesMenu;
192 QLabel *m_outputFolderNoteBox;
194 QAction *m_findFileContextAction;
195 QAction *m_previewContextAction;
196 QAction *m_showDetailsContextAction;
197 QAction *m_showFolderContextAction;
198 QAction *m_refreshFolderContextAction;
199 QAction *m_addFavoriteFolderAction;
200 QAction *m_exportCsvContextAction;
201 QAction *m_importCsvContextAction;
202 QActionGroup *m_languageActionGroup;
203 QActionGroup *m_styleActionGroup;
204 QActionGroup *m_tabActionGroup;
205 QButtonGroup *m_encoderButtonGroup;
206 QButtonGroup *m_modeButtonGroup;