LameXP/src/Dialog_MainWindow.h

251 lines
9.1 KiB
C
Raw Normal View History

2010-11-06 23:04:47 +01:00
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
2015-01-01 18:06:21 +01:00
// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
2010-11-06 23:04:47 +01:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
2013-10-23 20:56:57 +02:00
// (at your option) any later version, but always including the *additional*
// restrictions defined in the "License.txt" file.
2010-11-06 23:04:47 +01:00
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QMainWindow>
2010-11-06 23:04:47 +01:00
//Class declarations
class AbstractEncoder;
class AudioFileModel;
class AudioFileModel_MetaInfo;
class CustomEventFilter;
class DropBox;
class FileListModel;
class MessageHandlerThread;
class MetaInfoModel;
class QActionGroup;
class QButtonGroup;
class QFileSystemModelEx;
class QLabel;
class QMenu;
class QUrl;
class QModelIndex;
class SettingsModel;
class WorkingBanner;
class lamexp_icon_t;
2010-11-06 23:04:47 +01:00
//UIC forward declartion
namespace Ui
{
class MainWindow;
}
//IPC forward declartion
namespace MUtils
{
class IPCChannel;
}
//MainWindow class
class MainWindow: public QMainWindow
2010-11-06 23:04:47 +01:00
{
Q_OBJECT
public:
MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *const fileListModel, AudioFileModel_MetaInfo *const metaInfo, SettingsModel *const settingsModel, QWidget *const parent = 0);
2010-11-06 23:04:47 +01:00
~MainWindow(void);
bool isAccepted() { return m_accepted; }
2010-11-06 23:04:47 +01:00
private slots:
void aboutButtonClicked(void);
void addFileDelayed(const QString &filePath, bool tryASAP = false);
2010-11-06 23:04:47 +01:00
void addFilesButtonClicked(void);
void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false);
void addFavoriteFolderActionTriggered(void);
void addFolderDelayed(const QString &folderPath, bool recursive);
2011-05-21 13:07:17 +02:00
void aftenCodingModeChanged(int value);
void aftenDRCModeChanged(int value);
void aftenFastAllocationChanged(bool checked);
void aftenSearchSizeChanged(int value);
void autoDetectInstancesChanged(bool checked);
void bitrateManagementEnabledChanged(bool checked);
void bitrateManagementMaxChanged(int value);
void bitrateManagementMinChanged(int value);
void browseCustomTempFolderButtonClicked(void);
void centerOutputFolderModel(void);
2012-03-29 19:08:33 +02:00
void centerOutputFolderModel_doAsync(void);
2011-05-21 13:07:17 +02:00
void channelModeChanged(int value);
void checkForBetaUpdatesActionTriggered(bool checked);
void checkUpdatesActionActivated(void);
2010-11-06 23:04:47 +01:00
void clearFilesButtonClicked(void);
2011-05-21 13:07:17 +02:00
void clearMetaButtonClicked(void);
void closeButtonClicked(void);
2012-08-02 23:32:21 +02:00
void compressionTabEventOccurred(QWidget*, QEvent*);
2014-05-04 16:59:06 +02:00
void cornerWidgetEventOccurred(QWidget *sender, QEvent *event);
2011-05-21 13:07:17 +02:00
void customParamsChanged(void);
void customParamsHelpRequested(QWidget *obj, QEvent *event);
2011-05-21 13:07:17 +02:00
void customTempFolderChanged(const QString &text);
void disableNeroAacNotificationsActionTriggered(bool checked);
void disableShellIntegrationActionTriggered(bool);
2011-06-26 15:33:44 +02:00
void disableSlowStartupNotificationsActionTriggered(bool checked);
2011-05-21 13:07:17 +02:00
void disableSoundsActionTriggered(bool checked);
void disableUpdateReminderActionTriggered(bool checked);
void documentActionActivated(void);
void editMetaButtonClicked(void);
void encodeButtonClicked(void);
void exportCsvContextActionTriggered(void);
2010-11-06 23:04:47 +01:00
void fileDownButtonClicked(void);
void fileUpButtonClicked(void);
2011-05-21 13:07:17 +02:00
void findFileContextActionTriggered(void);
void forceStereoDownmixEnabledChanged(bool checked);
2010-11-06 23:04:47 +01:00
void gotoDesktopButtonClicked(void);
void gotoFavoriteFolder(void);
2011-05-21 13:07:17 +02:00
void gotoHomeFolderButtonClicked(void);
2010-11-06 23:04:47 +01:00
void gotoMusicFolderButtonClicked(void);
void goUpFolderContextActionTriggered(void);
void handleDelayedFiles(void);
void handleDroppedFiles(void);
void hibernateComputerActionTriggered(bool checked);
2011-05-21 13:07:17 +02:00
void importCueSheetActionTriggered(bool checked);
void importCsvContextActionTriggered(void);
void initOutputFolderModel(void);
void initOutputFolderModel_doAsync(void);
2011-05-21 13:07:17 +02:00
void languageActionActivated(QAction *action);
void languageFromFileActionActivated(bool checked);
void makeFolderButtonClicked(void);
void metaTagsEnabledChanged(void);
void neroAAC2PassChanged(bool checked);
2011-05-21 13:07:17 +02:00
void neroAACProfileChanged(int value);
void normalizationCoupledChanged(bool checked);
void normalizationDynamicChanged(bool checked);
void normalizationEnabledChanged(bool checked);
void normalizationFilterSizeChanged(int value);
void normalizationFilterSizeFinished(void);
void normalizationMaxVolumeChanged(double volume);
2011-05-21 13:07:17 +02:00
void notifyOtherInstance(void);
void openFolderActionActivated(void);
void opusSettingsChanged(void);
2011-05-21 13:07:17 +02:00
void outputFolderContextMenu(const QPoint &pos);
void outputFolderDirectoryLoaded(const QString &path);
void outputFolderEditFinished(void);
void outputFolderItemExpanded(const QModelIndex &item);
void outputFolderMouseEventOccurred(QWidget *sender, QEvent *event);
void outputFolderViewEventOccurred(QWidget *sender, QEvent *event);
void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
2011-05-21 13:07:17 +02:00
void outputFolderViewClicked(const QModelIndex &index);
void outputFolderViewMoved(const QModelIndex &index);
void overwriteModeChanged(int id);
2011-05-21 13:07:17 +02:00
void playlistEnabledChanged(void);
void prependRelativePathChanged(void);
void previewContextActionTriggered(void);
void refreshFolderContextActionTriggered(void);
2011-05-21 13:07:17 +02:00
void removeFileButtonClicked(void);
void renameOutputEnabledChanged(bool checked);
void renameOutputPatternChanged(void);
void renameOutputPatternChanged(const QString &text, bool silent = false);
2011-05-21 13:07:17 +02:00
void resetAdvancedOptionsButtonClicked(void);
void restoreCursor(void);
void samplingRateChanged(int value);
void saveToSourceFolderChanged(void);
2011-09-18 02:01:45 +02:00
void showAnnounceBox(void);
void showCustomParamsHelpScreen(const QString &toolName, const QString &command);
2011-05-21 13:07:17 +02:00
void showDetailsButtonClicked(void);
void showDropBoxWidgetActionTriggered(bool checked);
void showFolderContextActionTriggered(void);
void showRenameMacros(const QString &text);
2011-05-21 13:07:17 +02:00
void sourceFilesContextMenu(const QPoint &pos);
void sourceFilesScrollbarMoved(int);
2011-05-21 13:07:17 +02:00
void sourceModelChanged(void);
void styleActionActivated(QAction *action);
void tabActionActivated(QAction *action);
void tabPageChanged(int idx, const bool silent = false);
void toneAdjustBassChanged(double value);
void toneAdjustTrebleChanged(double value);
void toneAdjustTrebleReset(void);
2011-05-21 13:07:17 +02:00
void updateBitrate(int value);
void updateEncoder(int id = 0);
2011-05-21 13:07:17 +02:00
void updateLameAlgoQuality(int value);
void updateMaximumInstances(int value);
2011-05-21 13:07:17 +02:00
void updateRCMode(int id);
void useCustomTempFolderChanged(bool checked);
2011-05-21 13:07:17 +02:00
void visitHomepageActionActivated(void);
void windowShown(void);
2010-11-06 23:04:47 +01:00
protected:
virtual void changeEvent(QEvent *e);
virtual void closeEvent(QCloseEvent *event);
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
virtual bool eventFilter(QObject *obj, QEvent *event);
virtual void resizeEvent(QResizeEvent *event);
virtual void showEvent(QShowEvent *event);
virtual void keyPressEvent(QKeyEvent *e);
virtual bool event(QEvent *e);
virtual bool winEvent(MSG *message, long *result);
2010-11-06 23:04:47 +01:00
private:
Ui::MainWindow *ui; //for Qt UIC
void addFiles(const QStringList &files);
void addFolder(const QString &path, bool recursive = false, bool delayed = false);
bool checkForUpdates(void);
void initializeTranslation(void);
void refreshFavorites(void);
void openDocumentLink(QAction *const action);
2011-05-21 13:07:17 +02:00
bool m_accepted;
bool m_firstTimeShown;
uint m_outputFolderViewInitCounter;
bool m_outputFolderViewCentering;
2011-05-21 13:07:17 +02:00
2010-11-06 23:04:47 +01:00
WorkingBanner *m_banner;
QList<QUrl> *m_droppedFileList;
QStringList *m_delayedFileList;
QTimer *m_delayedFileTimer;
2011-05-21 13:07:17 +02:00
DropBox *m_dropBox;
QLabel *m_dropNoteLabel;
FileListModel *m_fileListModel;
QFileSystemModelEx *m_fileSystemModel;
MessageHandlerThread *m_messageHandler;
AudioFileModel_MetaInfo *const m_metaData;
MetaInfoModel *m_metaInfoModel;
2011-05-21 13:07:17 +02:00
QMenu *m_outputFolderContextMenu;
2010-11-12 19:02:01 +01:00
SettingsModel *m_settings;
QMenu *m_sourceFilesContextMenu;
QMenu *m_outputFolderFavoritesMenu;
QLabel *m_outputFolderNoteBox;
2011-05-21 13:07:17 +02:00
QAction *m_findFileContextAction;
QAction *m_previewContextAction;
QAction *m_showDetailsContextAction;
QAction *m_showFolderContextAction;
QAction *m_refreshFolderContextAction;
QAction *m_goUpFolderContextAction;
QAction *m_addFavoriteFolderAction;
QAction *m_exportCsvContextAction;
QAction *m_importCsvContextAction;
2011-05-21 13:07:17 +02:00
QActionGroup *m_languageActionGroup;
QActionGroup *m_styleActionGroup;
QActionGroup *m_tabActionGroup;
QButtonGroup *m_encoderButtonGroup;
QButtonGroup *m_modeButtonGroup;
QButtonGroup *m_overwriteButtonGroup;
2014-05-04 16:59:06 +02:00
CustomEventFilter *m_evenFilterCornerWidget;
CustomEventFilter *m_evenFilterCustumParamsHelp;
CustomEventFilter *m_evenFilterOutputFolderMouse;
CustomEventFilter *m_evenFilterOutputFolderView;
2012-08-02 23:32:21 +02:00
CustomEventFilter *m_evenFilterCompressionTab;
2010-11-06 23:04:47 +01:00
};