OSDN Git Service

Happy New Year 2012!
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
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.
14 //
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.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #pragma once
23
24 #include "../tmp/UIC_MainWindow.h"
25
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;
38
39 class MainWindow: public QMainWindow, private Ui::MainWindow
40 {
41         Q_OBJECT
42
43 public:
44         MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
45         ~MainWindow(void);
46
47         bool isAccepted() { return m_accepted; }
48
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 channelModeChanged(int value);
66         void checkForBetaUpdatesActionTriggered(bool checked);
67         void checkUpdatesActionActivated(void);
68         void clearFilesButtonClicked(void);
69         void clearMetaButtonClicked(void);
70         void closeButtonClicked(void);
71         void customParamsChanged(void);
72         void customTempFolderChanged(const QString &text);
73         void disableNeroAacNotificationsActionTriggered(bool checked);
74         void disableShellIntegrationActionTriggered(bool);
75         void disableSlowStartupNotificationsActionTriggered(bool checked);
76         void disableSoundsActionTriggered(bool checked);
77         void disableUpdateReminderActionTriggered(bool checked);
78         void documentActionActivated(void);
79         void editMetaButtonClicked(void);
80         void encodeButtonClicked(void);
81         void fileDownButtonClicked(void);
82         void fileUpButtonClicked(void);
83         void findFileContextActionTriggered(void);
84         void forceStereoDownmixEnabledChanged(bool checked);
85         void gotoDesktopButtonClicked(void);
86         void gotoFavoriteFolder(void);
87         void gotoHomeFolderButtonClicked(void);
88         void gotoMusicFolderButtonClicked(void);
89         void handleDelayedFiles(void);
90         void hibernateComputerActionTriggered(bool checked);
91         void importCueSheetActionTriggered(bool checked);
92         void initOutputFolderModel(void);
93         void languageActionActivated(QAction *action);
94         void languageFromFileActionActivated(bool checked);
95         void makeFolderButtonClicked(void);
96         void metaTagsEnabledChanged(void);
97         void neroAAC2PassChanged(bool checked);
98         void neroAACProfileChanged(int value);
99         void normalizationEnabledChanged(bool checked);
100         void normalizationMaxVolumeChanged(double volume);
101         void normalizationModeChanged(int mode);
102         void notifyOtherInstance(void);
103         void openFolderActionActivated(void);
104         void outputFolderContextMenu(const QPoint &pos);
105         void outputFolderViewClicked(const QModelIndex &index);
106         void outputFolderViewMoved(const QModelIndex &index);
107         void playlistEnabledChanged(void);
108         void prependRelativePathChanged(void);
109         void previewContextActionTriggered(void);
110         void removeFileButtonClicked(void);
111         void renameOutputEnabledChanged(bool checked);
112         void renameOutputPatternChanged(void);
113         void renameOutputPatternChanged(const QString &text);
114         void resetAdvancedOptionsButtonClicked(void);
115         void restoreCursor(void);
116         void samplingRateChanged(int value);
117         void saveToSourceFolderChanged(void);
118         void showAnnounceBox(void);
119         void showDetailsButtonClicked(void);
120         void showDropBoxWidgetActionTriggered(bool checked);
121         void showFolderContextActionTriggered(void);
122         void showRenameMacros(const QString &text);
123         void sourceFilesContextMenu(const QPoint &pos);
124         void sourceFilesScrollbarMoved(int);
125         void sourceModelChanged(void);
126         void styleActionActivated(QAction *action);
127         void tabActionActivated(QAction *action);
128         void tabPageChanged(int idx);
129         void toneAdjustBassChanged(double value);
130         void toneAdjustTrebleChanged(double value);
131         void toneAdjustTrebleReset(void);
132         void updateBitrate(int value);
133         void updateEncoder(int id);
134         void updateLameAlgoQuality(int value);
135         void updateMaximumInstances(int value);
136         void updateRCMode(int id);
137         void useCustomTempFolderChanged(bool checked);
138         void visitHomepageActionActivated(void);
139         void windowShown(void);
140
141 protected:
142         virtual void changeEvent(QEvent *e);
143         virtual void closeEvent(QCloseEvent *event);
144         virtual void dragEnterEvent(QDragEnterEvent *event);
145         virtual void dropEvent(QDropEvent *event);
146         virtual bool eventFilter(QObject *obj, QEvent *event);
147         virtual void resizeEvent(QResizeEvent *event);
148         virtual void showEvent(QShowEvent *event);
149         virtual bool event(QEvent *e);
150         virtual bool winEvent(MSG *message, long *result);
151
152 private:
153         void addFiles(const QStringList &files);
154         void addFolder(const QString &path, bool recursive = false, bool delayed = false);
155         bool checkForUpdates(void);
156         void refreshFavorites(void);
157         
158         bool m_accepted;
159         bool m_firstTimeShown;
160         bool m_OutputFolderViewInitialized;
161
162         const bool m_neroEncoderAvailable;
163         const bool m_fhgEncoderAvailable;
164         const bool m_qaacEncoderAvailable;
165
166         WorkingBanner *m_banner;
167         QStringList *m_delayedFileList;
168         QTimer *m_delayedFileTimer;
169         DropBox *m_dropBox;
170         QLabel *m_dropNoteLabel;
171         FileListModel *m_fileListModel;
172         QFileSystemModelEx *m_fileSystemModel;
173         MessageHandlerThread *m_messageHandler;
174         AudioFileModel *m_metaData;
175         MetaInfoModel *m_metaInfoModel;
176         QMenu *m_outputFolderContextMenu;
177         SettingsModel *m_settings;
178         QMenu *m_sourceFilesContextMenu;
179         QMenu *m_outputFolderFavoritesMenu;
180
181         QAction *m_findFileContextAction;
182         QAction *m_previewContextAction;
183         QAction *m_showDetailsContextAction;
184         QAction *m_showFolderContextAction;
185         QAction *m_addFavoriteFolderAction;
186         QActionGroup *m_languageActionGroup;
187         QActionGroup *m_styleActionGroup;
188         QActionGroup *m_tabActionGroup;
189         QButtonGroup *m_encoderButtonGroup;
190         QButtonGroup *m_modeButtonGroup;
191 };