OSDN Git Service

Added more advanced options: MP3 channel mode, sampling rate, Nero AAC profile, Nero...
[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 openFolderActionActivated(void);
74         void notifyOtherInstance(void);
75         void addFileDelayed(const QString &filePath);
76         void handleDelayedFiles(void);
77         void editMetaButtonClicked(void);
78         void clearMetaButtonClicked(void);
79         void updateEncoder(int id);
80         void updateRCMode(int id);
81         void updateBitrate(int value);
82         void updateLameAlgoQuality(int value);
83         void bitrateManagementEnabledChanged(bool checked);
84         void bitrateManagementMinChanged(int value);
85         void bitrateManagementMaxChanged(int value);
86         void samplingRateChanged(int value);
87         void channelModeChanged(int value);
88         void neroAACProfileChanged(int value);
89         void neroAAC2PassChanged(bool checked);
90         void sourceModelChanged(void);
91         void metaTagsEnabledChanged(void);
92         void playlistEnabledChanged(void);
93         void saveToSourceFolderChanged(void);
94         void prependRelativePathChanged(void);
95         void restoreCursor(void);
96         void sourceFilesContextMenu(const QPoint &pos);
97         void previewContextActionTriggered(void);
98         void findFileContextActionTriggered(void);
99         void disableUpdateReminderActionTriggered(bool checked);
100         void disableSoundsActionTriggered(bool checked);
101         void outputFolderContextMenu(const QPoint &pos);
102         void showFolderContextActionTriggered(void);
103         void installWMADecoderActionTriggered(bool checked);
104         void disableNeroAacNotificationsActionTriggered(bool checked);
105         void disableWmaDecoderNotificationsActionTriggered(bool checked);
106         void showDropBoxWidgetActionTriggered(bool checked);
107
108 protected:
109         void showEvent(QShowEvent *event);
110         void dragEnterEvent(QDragEnterEvent *event);
111         void dropEvent(QDropEvent *event);
112         void closeEvent(QCloseEvent *event);
113         void resizeEvent(QResizeEvent *event);
114         bool eventFilter(QObject *obj, QEvent *event);
115         void changeEvent(QEvent *e);
116
117 private:
118         void addFiles(const QStringList &files);
119
120         bool m_accepted;
121         bool m_firstTimeShown;
122         FileListModel *m_fileListModel;
123         QFileSystemModelEx *m_fileSystemModel;
124         QActionGroup *m_tabActionGroup;
125         QActionGroup *m_styleActionGroup;
126         QActionGroup *m_languageActionGroup;
127         QButtonGroup *m_encoderButtonGroup;
128         QButtonGroup *m_modeButtonGroup;
129         QAction *m_showDetailsContextAction;
130         QAction *m_previewContextAction;
131         QAction *m_findFileContextAction;
132         QAction *m_showFolderContextAction;
133         WorkingBanner *m_banner;
134         MessageHandlerThread *m_messageHandler;
135         QStringList *m_delayedFileList;
136         QTimer *m_delayedFileTimer;
137         AudioFileModel *m_metaData;
138         MetaInfoModel *m_metaInfoModel;
139         SettingsModel *m_settings;
140         QLabel *m_dropNoteLabel;
141         QMenu *m_sourceFilesContextMenu;
142         QMenu *m_outputFolderContextMenu;
143         DropBox *m_dropBox;
144 };