OSDN Git Service

Merge branch 'master' of github.com:lordmulder/LameXP
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2011 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 windowShown(void);
51         void aboutButtonClicked(void);
52         void encodeButtonClicked(void);
53         void closeButtonClicked(void);
54         void addFilesButtonClicked(void);
55         void clearFilesButtonClicked(void);
56         void removeFileButtonClicked(void);
57         void fileDownButtonClicked(void);
58         void fileUpButtonClicked(void);
59         void showDetailsButtonClicked(void);
60         void tabPageChanged(int idx);
61         void tabActionActivated(QAction *action);
62         void styleActionActivated(QAction *action);
63         void languageActionActivated(QAction *action);
64         void languageFromFileActionActivated(bool checked);
65         void outputFolderViewClicked(const QModelIndex &index);
66         void outputFolderViewMoved(const QModelIndex &index);
67         void makeFolderButtonClicked(void);
68         void gotoHomeFolderButtonClicked(void);
69         void gotoDesktopButtonClicked(void);
70         void gotoMusicFolderButtonClicked(void);
71         void checkUpdatesActionActivated(void);
72         void visitHomepageActionActivated(void);
73         void documentActionActivated(void);
74         void openFolderActionActivated(void);
75         void notifyOtherInstance(void);
76         void addFileDelayed(const QString &filePath);
77         void handleDelayedFiles(void);
78         void editMetaButtonClicked(void);
79         void clearMetaButtonClicked(void);
80         void updateEncoder(int id);
81         void updateRCMode(int id);
82         void updateBitrate(int value);
83         void updateLameAlgoQuality(int value);
84         void bitrateManagementEnabledChanged(bool checked);
85         void bitrateManagementMinChanged(int value);
86         void bitrateManagementMaxChanged(int value);
87         void samplingRateChanged(int value);
88         void channelModeChanged(int value);
89         void neroAACProfileChanged(int value);
90         void neroAAC2PassChanged(bool checked);
91         void aftenCodingModeChanged(int value);
92         void aftenDRCModeChanged(int value);
93         void aftenSearchSizeChanged(int value);
94         void aftenFastAllocationChanged(bool checked);
95         void normalizationEnabledChanged(bool checked);
96         void normalizationMaxVolumeChanged(double volume);
97         void toneAdjustBassChanged(double value);
98         void toneAdjustTrebleChanged(double value);
99         void toneAdjustTrebleReset(void);
100         void customParamsChanged(void);
101         void updateMaximumInstances(int value);
102         void autoDetectInstancesChanged(bool checked);
103         void browseCustomTempFolderButtonClicked(void);
104         void customTempFolderChanged(const QString &text);
105         void useCustomTempFolderChanged(bool checked);
106         void resetAdvancedOptionsButtonClicked(void);
107         void sourceModelChanged(void);
108         void metaTagsEnabledChanged(void);
109         void playlistEnabledChanged(void);
110         void saveToSourceFolderChanged(void);
111         void prependRelativePathChanged(void);
112         void restoreCursor(void);
113         void sourceFilesContextMenu(const QPoint &pos);
114         void previewContextActionTriggered(void);
115         void findFileContextActionTriggered(void);
116         void disableUpdateReminderActionTriggered(bool checked);
117         void disableSoundsActionTriggered(bool checked);
118         void outputFolderContextMenu(const QPoint &pos);
119         void showFolderContextActionTriggered(void);
120         void installWMADecoderActionTriggered(bool checked);
121         void disableNeroAacNotificationsActionTriggered(bool checked);
122         void disableWmaDecoderNotificationsActionTriggered(bool checked);
123         void showDropBoxWidgetActionTriggered(bool checked);
124         void checkForBetaUpdatesActionTriggered(bool checked);
125         void disableShellIntegrationActionTriggered(bool);
126
127 protected:
128         void showEvent(QShowEvent *event);
129         void dragEnterEvent(QDragEnterEvent *event);
130         void dropEvent(QDropEvent *event);
131         void closeEvent(QCloseEvent *event);
132         void resizeEvent(QResizeEvent *event);
133         bool eventFilter(QObject *obj, QEvent *event);
134         void changeEvent(QEvent *e);
135
136 private:
137         void addFiles(const QStringList &files);
138         void addFolder(const QString &path, bool recursive = false);
139         bool installWMADecoder(void);
140         bool checkForUpdates(void);
141
142         bool m_accepted;
143         bool m_firstTimeShown;
144         FileListModel *m_fileListModel;
145         QFileSystemModelEx *m_fileSystemModel;
146         QActionGroup *m_tabActionGroup;
147         QActionGroup *m_styleActionGroup;
148         QActionGroup *m_languageActionGroup;
149         QButtonGroup *m_encoderButtonGroup;
150         QButtonGroup *m_modeButtonGroup;
151         QAction *m_showDetailsContextAction;
152         QAction *m_previewContextAction;
153         QAction *m_findFileContextAction;
154         QAction *m_showFolderContextAction;
155         WorkingBanner *m_banner;
156         MessageHandlerThread *m_messageHandler;
157         QStringList *m_delayedFileList;
158         QTimer *m_delayedFileTimer;
159         AudioFileModel *m_metaData;
160         MetaInfoModel *m_metaInfoModel;
161         SettingsModel *m_settings;
162         QLabel *m_dropNoteLabel;
163         QMenu *m_sourceFilesContextMenu;
164         QMenu *m_outputFolderContextMenu;
165         DropBox *m_dropBox;
166 };