2010-11-06 23:04:47 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
2018-01-17 21:18:10 +01:00
|
|
|
// Copyright (C) 2004-2018 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
|
|
|
|
|
2012-12-04 01:35:48 +01:00
|
|
|
#include <QMainWindow>
|
2010-11-06 23:04:47 +01:00
|
|
|
|
|
|
|
//Class declarations
|
2012-12-04 01:35:48 +01:00
|
|
|
class AbstractEncoder;
|
2010-11-10 19:44:51 +01:00
|
|
|
class AudioFileModel;
|
2013-10-13 00:21:37 +02:00
|
|
|
class AudioFileModel_MetaInfo;
|
2012-12-04 01:35:48 +01:00
|
|
|
class CustomEventFilter;
|
|
|
|
class DropBox;
|
|
|
|
class FileListModel;
|
|
|
|
class MessageHandlerThread;
|
2010-11-10 19:44:51 +01:00
|
|
|
class MetaInfoModel;
|
2012-12-04 01:35:48 +01:00
|
|
|
class QActionGroup;
|
2010-11-15 04:42:06 +01:00
|
|
|
class QButtonGroup;
|
2012-12-04 01:35:48 +01:00
|
|
|
class QFileSystemModelEx;
|
|
|
|
class QLabel;
|
2010-11-25 20:41:59 +01:00
|
|
|
class QMenu;
|
2013-11-29 01:20:59 +01:00
|
|
|
class QUrl;
|
2012-12-04 01:35:48 +01:00
|
|
|
class QModelIndex;
|
2015-05-23 12:43:06 +02:00
|
|
|
class QEventLoop;
|
2012-12-04 01:35:48 +01:00
|
|
|
class SettingsModel;
|
|
|
|
class WorkingBanner;
|
2010-11-06 23:04:47 +01:00
|
|
|
|
2012-12-04 01:35:48 +01:00
|
|
|
//UIC forward declartion
|
2014-12-13 23:27:47 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
2012-12-04 01:35:48 +01:00
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
2014-12-13 23:27:47 +01:00
|
|
|
//IPC forward declartion
|
|
|
|
namespace MUtils
|
|
|
|
{
|
|
|
|
class IPCChannel;
|
|
|
|
}
|
|
|
|
|
2012-12-04 01:35:48 +01:00
|
|
|
//MainWindow class
|
|
|
|
class MainWindow: public QMainWindow
|
2010-11-06 23:04:47 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-12-13 23:27:47 +01:00
|
|
|
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);
|
|
|
|
|
2010-11-19 21:11:54 +01:00
|
|
|
bool isAccepted() { return m_accepted; }
|
|
|
|
|
2010-11-06 23:04:47 +01:00
|
|
|
private slots:
|
|
|
|
void aboutButtonClicked(void);
|
2011-06-11 17:18:30 +02:00
|
|
|
void addFileDelayed(const QString &filePath, bool tryASAP = false);
|
2010-11-06 23:04:47 +01:00
|
|
|
void addFilesButtonClicked(void);
|
2011-06-11 17:18:30 +02:00
|
|
|
void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false);
|
2011-08-08 20:26:30 +02:00
|
|
|
void addFavoriteFolderActionTriggered(void);
|
2011-06-11 17:18:30 +02:00
|
|
|
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);
|
2017-10-13 17:28:39 +02:00
|
|
|
void autoDetectInstancesChanged(const bool checked);
|
2011-05-21 13:07:17 +02:00
|
|
|
void bitrateManagementEnabledChanged(bool checked);
|
|
|
|
void bitrateManagementMaxChanged(int value);
|
|
|
|
void bitrateManagementMinChanged(int value);
|
|
|
|
void browseCustomTempFolderButtonClicked(void);
|
2012-03-28 02:21:34 +02:00
|
|
|
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);
|
2012-07-30 21:44:44 +02:00
|
|
|
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);
|
2012-01-04 03:23:07 +01:00
|
|
|
void exportCsvContextActionTriggered(void);
|
2010-11-06 23:04:47 +01:00
|
|
|
void fileDownButtonClicked(void);
|
2015-05-10 16:34:07 +02:00
|
|
|
void fileExtAddButtonClicked();
|
|
|
|
void fileExtModelChanged();
|
|
|
|
void fileExtRemoveButtonClicked();
|
2010-11-06 23:04:47 +01:00
|
|
|
void fileUpButtonClicked(void);
|
2011-05-21 13:07:17 +02:00
|
|
|
void findFileContextActionTriggered(void);
|
2011-08-05 21:52:43 +02:00
|
|
|
void forceStereoDownmixEnabledChanged(bool checked);
|
2010-11-06 23:04:47 +01:00
|
|
|
void gotoDesktopButtonClicked(void);
|
2011-08-08 20:26:30 +02:00
|
|
|
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);
|
2012-12-14 23:50:56 +01:00
|
|
|
void goUpFolderContextActionTriggered(void);
|
2010-11-08 21:47:35 +01:00
|
|
|
void handleDelayedFiles(void);
|
2013-11-29 01:20:59 +01:00
|
|
|
void handleDroppedFiles(void);
|
2011-10-22 01:13:28 +02:00
|
|
|
void hibernateComputerActionTriggered(bool checked);
|
2011-05-21 13:07:17 +02:00
|
|
|
void importCueSheetActionTriggered(bool checked);
|
2012-01-04 21:10:33 +01:00
|
|
|
void importCsvContextActionTriggered(void);
|
2011-06-04 22:43:14 +02:00
|
|
|
void initOutputFolderModel(void);
|
2012-03-30 03:35:43 +02:00
|
|
|
void initOutputFolderModel_doAsync(void);
|
2015-11-07 21:39:33 +01:00
|
|
|
void keepOriginalDateTimeChanged(bool checked);
|
2011-05-21 13:07:17 +02:00
|
|
|
void languageActionActivated(QAction *action);
|
|
|
|
void languageFromFileActionActivated(bool checked);
|
|
|
|
void makeFolderButtonClicked(void);
|
|
|
|
void metaTagsEnabledChanged(void);
|
2011-01-22 22:19:20 +01:00
|
|
|
void neroAAC2PassChanged(bool checked);
|
2011-05-21 13:07:17 +02:00
|
|
|
void neroAACProfileChanged(int value);
|
2015-03-21 19:06:55 +01:00
|
|
|
void normalizationCoupledChanged(bool checked);
|
|
|
|
void normalizationDynamicChanged(bool checked);
|
2011-01-24 01:13:08 +01:00
|
|
|
void normalizationEnabledChanged(bool checked);
|
2015-03-21 19:06:55 +01:00
|
|
|
void normalizationFilterSizeChanged(int value);
|
|
|
|
void normalizationFilterSizeFinished(void);
|
2011-01-24 01:13:08 +01:00
|
|
|
void normalizationMaxVolumeChanged(double volume);
|
2011-05-21 13:07:17 +02:00
|
|
|
void notifyOtherInstance(void);
|
|
|
|
void openFolderActionActivated(void);
|
2012-07-21 19:16:12 +02:00
|
|
|
void opusSettingsChanged(void);
|
2011-05-21 13:07:17 +02:00
|
|
|
void outputFolderContextMenu(const QPoint &pos);
|
2012-03-29 01:32:47 +02:00
|
|
|
void outputFolderDirectoryLoaded(const QString &path);
|
2012-03-26 22:02:11 +02:00
|
|
|
void outputFolderEditFinished(void);
|
2012-03-29 01:32:47 +02:00
|
|
|
void outputFolderItemExpanded(const QModelIndex &item);
|
2012-07-30 21:44:44 +02:00
|
|
|
void outputFolderMouseEventOccurred(QWidget *sender, QEvent *event);
|
|
|
|
void outputFolderViewEventOccurred(QWidget *sender, QEvent *event);
|
2012-03-29 03:22:24 +02:00
|
|
|
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);
|
2012-11-08 00:42:55 +01:00
|
|
|
void overwriteModeChanged(int id);
|
2011-05-21 13:07:17 +02:00
|
|
|
void playlistEnabledChanged(void);
|
|
|
|
void prependRelativePathChanged(void);
|
|
|
|
void previewContextActionTriggered(void);
|
2012-04-05 15:24:45 +02:00
|
|
|
void refreshFolderContextActionTriggered(void);
|
2011-05-21 13:07:17 +02:00
|
|
|
void removeFileButtonClicked(void);
|
2015-05-09 17:28:56 +02:00
|
|
|
void renameButtonClicked(bool checked);
|
2015-05-09 23:33:07 +02:00
|
|
|
void renameOutputEnabledChanged(const bool &checked);
|
2011-08-04 23:26:38 +02:00
|
|
|
void renameOutputPatternChanged(void);
|
2015-05-09 23:33:07 +02:00
|
|
|
void renameOutputPatternChanged(const QString &text, const bool &silent = false);
|
|
|
|
void renameRegExpEnabledChanged(const bool &checked);
|
|
|
|
void renameRegExpValueChanged(void);
|
|
|
|
void renameRegExpSearchChanged (const QString &text, const bool &silent = false);
|
|
|
|
void renameRegExpReplaceChanged(const QString &text, const 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);
|
2012-07-30 21:44:44 +02:00
|
|
|
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);
|
2011-08-05 02:33:32 +02:00
|
|
|
void showRenameMacros(const QString &text);
|
2011-05-21 13:07:17 +02:00
|
|
|
void sourceFilesContextMenu(const QPoint &pos);
|
2011-08-23 17:01:11 +02:00
|
|
|
void sourceFilesScrollbarMoved(int);
|
2011-05-21 13:07:17 +02:00
|
|
|
void sourceModelChanged(void);
|
|
|
|
void styleActionActivated(QAction *action);
|
|
|
|
void tabActionActivated(QAction *action);
|
2013-10-28 00:26:54 +01:00
|
|
|
void tabPageChanged(int idx, const bool silent = false);
|
2011-01-26 20:16:46 +01:00
|
|
|
void toneAdjustBassChanged(double value);
|
|
|
|
void toneAdjustTrebleChanged(double value);
|
2011-02-09 23:36:17 +01:00
|
|
|
void toneAdjustTrebleReset(void);
|
2011-05-21 13:07:17 +02:00
|
|
|
void updateBitrate(int value);
|
2013-07-14 18:14:26 +02:00
|
|
|
void updateEncoder(int id = 0);
|
2011-05-21 13:07:17 +02:00
|
|
|
void updateLameAlgoQuality(int value);
|
2017-10-13 17:28:39 +02:00
|
|
|
void updateMaximumInstances(const int value);
|
2011-05-21 13:07:17 +02:00
|
|
|
void updateRCMode(int id);
|
2011-02-25 22:03:39 +01:00
|
|
|
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
|
|
|
|
2010-11-08 19:29:36 +01:00
|
|
|
protected:
|
2011-12-29 14:42:20 +01:00
|
|
|
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);
|
2012-04-05 15:24:45 +02:00
|
|
|
virtual void keyPressEvent(QKeyEvent *e);
|
2011-12-29 14:42:20 +01:00
|
|
|
virtual bool event(QEvent *e);
|
|
|
|
virtual bool winEvent(MSG *message, long *result);
|
2010-11-08 19:29:36 +01:00
|
|
|
|
2010-11-06 23:04:47 +01:00
|
|
|
private:
|
2012-12-04 01:35:48 +01:00
|
|
|
Ui::MainWindow *ui; //for Qt UIC
|
|
|
|
|
2010-11-11 19:37:16 +01:00
|
|
|
void addFiles(const QStringList &files);
|
2015-05-14 13:55:09 +02:00
|
|
|
void addFolder(const QString &path, bool recursive = false, bool delayed = false, QString filter = QString());
|
2011-02-18 00:53:36 +01:00
|
|
|
bool checkForUpdates(void);
|
2012-10-14 22:21:57 +02:00
|
|
|
void initializeTranslation(void);
|
2011-08-08 20:26:30 +02:00
|
|
|
void refreshFavorites(void);
|
2014-12-26 00:42:53 +01:00
|
|
|
void openDocumentLink(QAction *const action);
|
2015-05-24 21:32:34 +02:00
|
|
|
void moveSelectedFiles(const bool &up);
|
|
|
|
|
2015-05-23 12:43:06 +02:00
|
|
|
void showBanner(const QString &text);
|
|
|
|
void showBanner(const QString &text, QThread *const thread);
|
|
|
|
void showBanner(const QString &text, QEventLoop *const eventLoop);
|
|
|
|
void showBanner(const QString &text, bool &flag, const bool &test);
|
|
|
|
|
2010-11-19 21:11:54 +01:00
|
|
|
bool m_accepted;
|
2010-11-20 22:14:10 +01:00
|
|
|
bool m_firstTimeShown;
|
2012-04-05 15:24:45 +02:00
|
|
|
uint m_outputFolderViewInitCounter;
|
2012-03-29 01:32:47 +02:00
|
|
|
bool m_outputFolderViewCentering;
|
2011-05-21 13:07:17 +02:00
|
|
|
|
2015-05-22 19:37:45 +02:00
|
|
|
FileListModel *const m_fileListModel;
|
|
|
|
AudioFileModel_MetaInfo *const m_metaData;
|
|
|
|
SettingsModel *const m_settings;
|
|
|
|
|
|
|
|
QScopedPointer<WorkingBanner> m_banner;
|
|
|
|
QScopedPointer<MetaInfoModel> m_metaInfoModel;
|
|
|
|
QScopedPointer<QFileSystemModelEx> m_fileSystemModel;
|
|
|
|
|
2015-05-23 12:43:06 +02:00
|
|
|
QScopedPointer<QList<QUrl>> m_droppedFileList;
|
|
|
|
QScopedPointer<QStringList> m_delayedFileList;
|
|
|
|
QScopedPointer<QTimer> m_delayedFileTimer;
|
|
|
|
QScopedPointer<DropBox> m_dropBox;
|
|
|
|
QScopedPointer<QLabel> m_dropNoteLabel;
|
|
|
|
|
|
|
|
QScopedPointer<MessageHandlerThread> m_messageHandler;
|
|
|
|
QScopedPointer<QLabel> m_outputFolderNoteBox;
|
|
|
|
|
|
|
|
QScopedPointer<QMenu> m_outputFolderContextMenu;
|
|
|
|
QScopedPointer<QMenu> m_sourceFilesContextMenu;
|
|
|
|
QScopedPointer<QMenu> m_outputFolderFavoritesMenu;
|
2011-05-21 13:07:17 +02:00
|
|
|
|
2015-05-22 19:37:45 +02:00
|
|
|
QScopedPointer<QActionGroup> m_languageActionGroup;
|
|
|
|
QScopedPointer<QActionGroup> m_styleActionGroup;
|
|
|
|
QScopedPointer<QActionGroup> m_tabActionGroup;
|
|
|
|
QScopedPointer<QButtonGroup> m_encoderButtonGroup;
|
|
|
|
QScopedPointer<QButtonGroup> m_modeButtonGroup;
|
|
|
|
QScopedPointer<QButtonGroup> m_overwriteButtonGroup;
|
|
|
|
|
2011-05-21 13:07:17 +02:00
|
|
|
QAction *m_findFileContextAction;
|
|
|
|
QAction *m_previewContextAction;
|
|
|
|
QAction *m_showDetailsContextAction;
|
|
|
|
QAction *m_showFolderContextAction;
|
2012-04-05 15:24:45 +02:00
|
|
|
QAction *m_refreshFolderContextAction;
|
2012-12-14 23:50:56 +01:00
|
|
|
QAction *m_goUpFolderContextAction;
|
2011-08-08 20:26:30 +02:00
|
|
|
QAction *m_addFavoriteFolderAction;
|
2012-01-04 03:23:07 +01:00
|
|
|
QAction *m_exportCsvContextAction;
|
2012-01-04 21:10:33 +01:00
|
|
|
QAction *m_importCsvContextAction;
|
2012-07-29 22:55:02 +02:00
|
|
|
|
2015-05-22 19:37:45 +02:00
|
|
|
QScopedPointer<CustomEventFilter> m_evenFilterCornerWidget;
|
|
|
|
QScopedPointer<CustomEventFilter> m_evenFilterCustumParamsHelp;
|
|
|
|
QScopedPointer<CustomEventFilter> m_evenFilterOutputFolderMouse;
|
|
|
|
QScopedPointer<CustomEventFilter> m_evenFilterOutputFolderView;
|
|
|
|
QScopedPointer<CustomEventFilter> m_evenFilterCompressionTab;
|
2010-11-06 23:04:47 +01:00
|
|
|
};
|