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;
39 class MainWindow: public QMainWindow, private Ui::MainWindow
44 MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
47 bool isAccepted() { return m_accepted; }
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 opusSettingsChanged(void);
110 void outputFolderContextMenu(const QPoint &pos);
111 void outputFolderDirectoryLoaded(const QString &path);
112 void outputFolderEditFinished(void);
113 void outputFolderItemExpanded(const QModelIndex &item);
114 void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
115 void outputFolderViewClicked(const QModelIndex &index);
116 void outputFolderViewMoved(const QModelIndex &index);
117 void playlistEnabledChanged(void);
118 void prependRelativePathChanged(void);
119 void previewContextActionTriggered(void);
120 void refreshFolderContextActionTriggered(void);
121 void removeFileButtonClicked(void);
122 void renameOutputEnabledChanged(bool checked);
123 void renameOutputPatternChanged(void);
124 void renameOutputPatternChanged(const QString &text);
125 void resetAdvancedOptionsButtonClicked(void);
126 void restoreCursor(void);
127 void samplingRateChanged(int value);
128 void saveToSourceFolderChanged(void);
129 void showAnnounceBox(void);
130 void showDetailsButtonClicked(void);
131 void showDropBoxWidgetActionTriggered(bool checked);
132 void showFolderContextActionTriggered(void);
133 void showRenameMacros(const QString &text);
134 void sourceFilesContextMenu(const QPoint &pos);
135 void sourceFilesScrollbarMoved(int);
136 void sourceModelChanged(void);
137 void styleActionActivated(QAction *action);
138 void tabActionActivated(QAction *action);
139 void tabPageChanged(int idx);
140 void toneAdjustBassChanged(double value);
141 void toneAdjustTrebleChanged(double value);
142 void toneAdjustTrebleReset(void);
143 void updateBitrate(int value);
144 void updateEncoder(int id);
145 void updateLameAlgoQuality(int value);
146 void updateMaximumInstances(int value);
147 void updateRCMode(int id);
148 void useCustomTempFolderChanged(bool checked);
149 void visitHomepageActionActivated(void);
150 void windowShown(void);
153 virtual void changeEvent(QEvent *e);
154 virtual void closeEvent(QCloseEvent *event);
155 virtual void dragEnterEvent(QDragEnterEvent *event);
156 virtual void dropEvent(QDropEvent *event);
157 virtual bool eventFilter(QObject *obj, QEvent *event);
158 virtual void resizeEvent(QResizeEvent *event);
159 virtual void showEvent(QShowEvent *event);
160 virtual void keyPressEvent(QKeyEvent *e);
161 virtual bool event(QEvent *e);
162 virtual bool winEvent(MSG *message, long *result);
165 void addFiles(const QStringList &files);
166 void addFolder(const QString &path, bool recursive = false, bool delayed = false);
167 bool checkForUpdates(void);
168 void refreshFavorites(void);
171 bool m_firstTimeShown;
172 uint m_outputFolderViewInitCounter;
173 bool m_outputFolderViewCentering;
175 const bool m_neroEncoderAvailable;
176 const bool m_fhgEncoderAvailable;
177 const bool m_qaacEncoderAvailable;
179 WorkingBanner *m_banner;
180 QStringList *m_delayedFileList;
181 QTimer *m_delayedFileTimer;
183 QLabel *m_dropNoteLabel;
184 FileListModel *m_fileListModel;
185 QFileSystemModelEx *m_fileSystemModel;
186 MessageHandlerThread *m_messageHandler;
187 AudioFileModel *m_metaData;
188 MetaInfoModel *m_metaInfoModel;
189 QMenu *m_outputFolderContextMenu;
190 SettingsModel *m_settings;
191 QMenu *m_sourceFilesContextMenu;
192 QMenu *m_outputFolderFavoritesMenu;
193 QLabel *m_outputFolderNoteBox;
195 QAction *m_findFileContextAction;
196 QAction *m_previewContextAction;
197 QAction *m_showDetailsContextAction;
198 QAction *m_showFolderContextAction;
199 QAction *m_refreshFolderContextAction;
200 QAction *m_addFavoriteFolderAction;
201 QAction *m_exportCsvContextAction;
202 QAction *m_importCsvContextAction;
203 QActionGroup *m_languageActionGroup;
204 QActionGroup *m_styleActionGroup;
205 QActionGroup *m_tabActionGroup;
206 QButtonGroup *m_encoderButtonGroup;
207 QButtonGroup *m_modeButtonGroup;