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 customParamsChanged(void);
75 void customParamsHelpRequested(QObject*);
76 void customTempFolderChanged(const QString &text);
77 void disableNeroAacNotificationsActionTriggered(bool checked);
78 void disableShellIntegrationActionTriggered(bool);
79 void disableSlowStartupNotificationsActionTriggered(bool checked);
80 void disableSoundsActionTriggered(bool checked);
81 void disableUpdateReminderActionTriggered(bool checked);
82 void documentActionActivated(void);
83 void editMetaButtonClicked(void);
84 void encodeButtonClicked(void);
85 void exportCsvContextActionTriggered(void);
86 void fileDownButtonClicked(void);
87 void fileUpButtonClicked(void);
88 void findFileContextActionTriggered(void);
89 void forceStereoDownmixEnabledChanged(bool checked);
90 void gotoDesktopButtonClicked(void);
91 void gotoFavoriteFolder(void);
92 void gotoHomeFolderButtonClicked(void);
93 void gotoMusicFolderButtonClicked(void);
94 void handleDelayedFiles(void);
95 void hibernateComputerActionTriggered(bool checked);
96 void importCueSheetActionTriggered(bool checked);
97 void importCsvContextActionTriggered(void);
98 void initOutputFolderModel(void);
99 void initOutputFolderModel_doAsync(void);
100 void languageActionActivated(QAction *action);
101 void languageFromFileActionActivated(bool checked);
102 void makeFolderButtonClicked(void);
103 void metaTagsEnabledChanged(void);
104 void neroAAC2PassChanged(bool checked);
105 void neroAACProfileChanged(int value);
106 void normalizationEnabledChanged(bool checked);
107 void normalizationMaxVolumeChanged(double volume);
108 void normalizationModeChanged(int mode);
109 void notifyOtherInstance(void);
110 void openFolderActionActivated(void);
111 void opusSettingsChanged(void);
112 void outputFolderContextMenu(const QPoint &pos);
113 void outputFolderDirectoryLoaded(const QString &path);
114 void outputFolderEditFinished(void);
115 void outputFolderItemExpanded(const QModelIndex &item);
116 void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
117 void outputFolderViewClicked(const QModelIndex &index);
118 void outputFolderViewMoved(const QModelIndex &index);
119 void playlistEnabledChanged(void);
120 void prependRelativePathChanged(void);
121 void previewContextActionTriggered(void);
122 void refreshFolderContextActionTriggered(void);
123 void removeFileButtonClicked(void);
124 void renameOutputEnabledChanged(bool checked);
125 void renameOutputPatternChanged(void);
126 void renameOutputPatternChanged(const QString &text);
127 void resetAdvancedOptionsButtonClicked(void);
128 void restoreCursor(void);
129 void samplingRateChanged(int value);
130 void saveToSourceFolderChanged(void);
131 void showAnnounceBox(void);
132 void showDetailsButtonClicked(void);
133 void showDropBoxWidgetActionTriggered(bool checked);
134 void showFolderContextActionTriggered(void);
135 void showRenameMacros(const QString &text);
136 void sourceFilesContextMenu(const QPoint &pos);
137 void sourceFilesScrollbarMoved(int);
138 void sourceModelChanged(void);
139 void styleActionActivated(QAction *action);
140 void tabActionActivated(QAction *action);
141 void tabPageChanged(int idx);
142 void toneAdjustBassChanged(double value);
143 void toneAdjustTrebleChanged(double value);
144 void toneAdjustTrebleReset(void);
145 void updateBitrate(int value);
146 void updateEncoder(int id);
147 void updateLameAlgoQuality(int value);
148 void updateMaximumInstances(int value);
149 void updateRCMode(int id);
150 void useCustomTempFolderChanged(bool checked);
151 void visitHomepageActionActivated(void);
152 void windowShown(void);
155 virtual void changeEvent(QEvent *e);
156 virtual void closeEvent(QCloseEvent *event);
157 virtual void dragEnterEvent(QDragEnterEvent *event);
158 virtual void dropEvent(QDropEvent *event);
159 virtual bool eventFilter(QObject *obj, QEvent *event);
160 virtual void resizeEvent(QResizeEvent *event);
161 virtual void showEvent(QShowEvent *event);
162 virtual void keyPressEvent(QKeyEvent *e);
163 virtual bool event(QEvent *e);
164 virtual bool winEvent(MSG *message, long *result);
167 void addFiles(const QStringList &files);
168 void addFolder(const QString &path, bool recursive = false, bool delayed = false);
169 bool checkForUpdates(void);
170 void refreshFavorites(void);
173 bool m_firstTimeShown;
174 uint m_outputFolderViewInitCounter;
175 bool m_outputFolderViewCentering;
177 const bool m_neroEncoderAvailable;
178 const bool m_fhgEncoderAvailable;
179 const bool m_qaacEncoderAvailable;
181 WorkingBanner *m_banner;
182 QStringList *m_delayedFileList;
183 QTimer *m_delayedFileTimer;
185 QLabel *m_dropNoteLabel;
186 FileListModel *m_fileListModel;
187 QFileSystemModelEx *m_fileSystemModel;
188 MessageHandlerThread *m_messageHandler;
189 AudioFileModel *m_metaData;
190 MetaInfoModel *m_metaInfoModel;
191 QMenu *m_outputFolderContextMenu;
192 SettingsModel *m_settings;
193 QMenu *m_sourceFilesContextMenu;
194 QMenu *m_outputFolderFavoritesMenu;
195 QLabel *m_outputFolderNoteBox;
197 QAction *m_findFileContextAction;
198 QAction *m_previewContextAction;
199 QAction *m_showDetailsContextAction;
200 QAction *m_showFolderContextAction;
201 QAction *m_refreshFolderContextAction;
202 QAction *m_addFavoriteFolderAction;
203 QAction *m_exportCsvContextAction;
204 QAction *m_importCsvContextAction;
205 QActionGroup *m_languageActionGroup;
206 QActionGroup *m_styleActionGroup;
207 QActionGroup *m_tabActionGroup;
208 QButtonGroup *m_encoderButtonGroup;
209 QButtonGroup *m_modeButtonGroup;
211 CustomEventFilter *m_evenFilterCustumParamsHelp;