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