1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
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.
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 ///////////////////////////////////////////////////////////////////////////////
24 #include <QMainWindow>
27 class AbstractEncoder;
29 class CustomEventFilter;
32 class MessageHandlerThread;
36 class QFileSystemModelEx;
43 //UIC forward declartion
49 class MainWindow: public QMainWindow
54 MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
57 bool isAccepted() { return m_accepted; }
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);
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);
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);
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);
182 Ui::MainWindow *ui; //for Qt UIC
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);
191 bool m_firstTimeShown;
192 uint m_outputFolderViewInitCounter;
193 bool m_outputFolderViewCentering;
195 const bool m_neroEncoderAvailable;
196 const bool m_fhgEncoderAvailable;
197 const bool m_qaacEncoderAvailable;
199 WorkingBanner *m_banner;
200 QStringList *m_delayedFileList;
201 QTimer *m_delayedFileTimer;
203 QLabel *m_dropNoteLabel;
204 FileListModel *m_fileListModel;
205 QFileSystemModelEx *m_fileSystemModel;
206 MessageHandlerThread *m_messageHandler;
207 AudioFileModel *m_metaData;
208 MetaInfoModel *m_metaInfoModel;
209 QMenu *m_outputFolderContextMenu;
210 SettingsModel *m_settings;
211 QMenu *m_sourceFilesContextMenu;
212 QMenu *m_outputFolderFavoritesMenu;
213 QLabel *m_outputFolderNoteBox;
215 QAction *m_findFileContextAction;
216 QAction *m_previewContextAction;
217 QAction *m_showDetailsContextAction;
218 QAction *m_showFolderContextAction;
219 QAction *m_refreshFolderContextAction;
220 QAction *m_goUpFolderContextAction;
221 QAction *m_addFavoriteFolderAction;
222 QAction *m_exportCsvContextAction;
223 QAction *m_importCsvContextAction;
224 QActionGroup *m_languageActionGroup;
225 QActionGroup *m_styleActionGroup;
226 QActionGroup *m_tabActionGroup;
227 QButtonGroup *m_encoderButtonGroup;
228 QButtonGroup *m_modeButtonGroup;
229 QButtonGroup *m_overwriteButtonGroup;
231 CustomEventFilter *m_evenFilterCustumParamsHelp;
232 CustomEventFilter *m_evenFilterOutputFolderMouse;
233 CustomEventFilter *m_evenFilterOutputFolderView;
234 CustomEventFilter *m_evenFilterCompressionTab;