OSDN Git Service

Moved more functions into MUtils library, especially all the Qt initialization code...
[lamexp/LameXP.git] / src / Dialog_MainWindow.cpp
index cd203be..d687204 100644 (file)
@@ -1,11 +1,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // 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
-// (at your option) any later version.
+// (at your option) any later version, but always including the *additional*
+// restrictions defined in the "License.txt" file.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include "Dialog_MainWindow.h"
 
 //UIC includes
-#include "../tmp/UIC_MainWindow.h"
+#include "UIC_MainWindow.h"
 
 //LameXP includes
 #include "Global.h"
-#include "Resource.h"
 #include "Dialog_WorkingBanner.h"
 #include "Dialog_MetaInfo.h"
 #include "Dialog_About.h"
 #include "Dialog_CueImport.h"
 #include "Dialog_LogView.h"
 #include "Thread_FileAnalyzer.h"
-#include "Thread_FileAnalyzer_ST.h"
 #include "Thread_MessageHandler.h"
 #include "Model_MetaInfo.h"
 #include "Model_Settings.h"
 #include "Model_FileList.h"
 #include "Model_FileSystem.h"
 #include "WinSevenTaskbar.h"
+#include "Registry_Encoder.h"
 #include "Registry_Decoder.h"
+#include "Encoder_Abstract.h"
 #include "ShellIntegration.h"
 #include "CustomEventFilter.h"
 
+//Mutils includes
+#include <MUtils/Global.h>
+#include <MUtils/OSSupport.h>
+#include <MUtils/GUI.h>
+#include <MUtils/Version.h>
+
 //Qt includes
 #include <QMessageBox>
 #include <QTimer>
 #include <QResource>
 #include <QScrollBar>
 
-//System includes
-#include <MMSystem.h>
-#include <ShellAPI.h>
-
 ////////////////////////////////////////////////////////////
 // Helper macros
 ////////////////////////////////////////////////////////////
 
+#define BANNER_VISIBLE ((m_banner != NULL) && m_banner->isVisible())
+
+#define INIT_BANNER() do \
+{ \
+       if(m_banner == NULL) \
+       { \
+               m_banner = new WorkingBanner(this); \
+       } \
+} \
+while(0)
+
+#define SHOW_BANNER(TXT) do \
+{ \
+       INIT_BANNER(); \
+       m_banner->show((TXT)); \
+} \
+while(0)
+
+#define SHOW_BANNER_ARG(TXT, ARG) do \
+{ \
+       INIT_BANNER(); \
+       m_banner->show((TXT), (ARG)); \
+} \
+while(0)
+
+
+#define SHOW_BANNER_CONDITIONALLY(FLAG, TEST, TXT) do \
+{ \
+       if((!(FLAG)) && ((TEST))) \
+       { \
+               INIT_BANNER(); \
+               m_banner->show((TXT)); \
+               FLAG = true; \
+       } \
+} \
+while(0)
+
 #define ABORT_IF_BUSY do \
 { \
-       if(m_banner->isVisible() || m_delayedFileTimer->isActive()) \
+       if(BANNER_VISIBLE || m_delayedFileTimer->isActive() || (QApplication::activeModalWidget() != NULL)) \
        { \
-               MessageBeep(MB_ICONEXCLAMATION); \
+               lamexp_beep(lamexp_beep_warning); \
                return; \
        } \
 } \
@@ -119,7 +159,7 @@ while(0)
 { \
        QItemSelectionModel *_tmp = (VIEW)->selectionModel(); \
        (VIEW)->setModel(MODEL); \
-       LAMEXP_DELETE(_tmp); \
+       MUTILS_DELETE(_tmp); \
 } \
 while(0)
 
@@ -150,28 +190,50 @@ while(0)
 } \
 while(0)
 
+#define WITH_BLOCKED_SIGNALS(WIDGET, CMD, ...) do \
+{ \
+       const bool _flag = (WIDGET)->blockSignals(true); \
+       (WIDGET)->CMD(__VA_ARGS__); \
+       if(!(_flag)) { (WIDGET)->blockSignals(false); } \
+} \
+while(0)
+
+#define PLAY_SOUND_OPTIONAL(NAME, ASYNC) do \
+{ \
+       if(m_settings->soundsEnabled()) lamexp_play_sound((NAME), (ASYNC)); \
+} \
+while(0)
+
+#define SHOW_CORNER_WIDGET(FLAG) do \
+{ \
+       if(QWidget *cornerWidget = ui->menubar->cornerWidget()) \
+       { \
+               cornerWidget->setVisible((FLAG)); \
+       } \
+} \
+while(0)
+
 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "&minus;"))
 #define FSLINK(PATH) QString("<a href=\"file:///%1\">%2</a>").arg(PATH).arg(QString(PATH).replace("-", "&minus;"))
-//#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP))
 #define CENTER_CURRENT_OUTPUT_FOLDER_DELAYED QTimer::singleShot(125, this, SLOT(centerOutputFolderModel()))
 
-static const DWORD IDM_ABOUTBOX = 0xEFF0;
+static const unsigned int IDM_ABOUTBOX = 0xEFF0;
+static const char *g_hydrogen_audio_url = "http://wiki.hydrogenaud.io/index.php?title=Main_Page";
 
 ////////////////////////////////////////////////////////////
 // Constructor
 ////////////////////////////////////////////////////////////
 
-MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent)
+MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel_MetaInfo *metaInfo, SettingsModel *settingsModel, QWidget *parent)
 :
        QMainWindow(parent),
        ui(new Ui::MainWindow),
        m_fileListModel(fileListModel),
        m_metaData(metaInfo),
        m_settings(settingsModel),
+       m_windowIcon(NULL),
        m_fileSystemModel(NULL),
-       m_neroEncoderAvailable(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")),
-       m_fhgEncoderAvailable(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll") && lamexp_check_tool("nsutil.dll") && lamexp_check_tool("libmp4v2.dll")),
-       m_qaacEncoderAvailable(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")),
+       m_banner(NULL),
        m_accepted(false),
        m_firstTimeShown(true),
        m_outputFolderViewCentering(false),
@@ -180,25 +242,35 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        //Init the dialog, from the .ui file
        ui->setupUi(this);
        setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
-       
+
+       //Create window icon
+       m_windowIcon = lamexp_set_window_icon(this, lamexp_app_icon(), true);
+
        //Register meta types
        qRegisterMetaType<AudioFileModel>("AudioFileModel");
 
        //Enabled main buttons
        connect(ui->buttonAbout, SIGNAL(clicked()), this, SLOT(aboutButtonClicked()));
        connect(ui->buttonStart, SIGNAL(clicked()), this, SLOT(encodeButtonClicked()));
-       connect(ui->buttonQuit, SIGNAL(clicked()), this, SLOT(closeButtonClicked()));
+       connect(ui->buttonQuit,  SIGNAL(clicked()), this, SLOT(closeButtonClicked()));
 
        //Setup tab widget
        ui->tabWidget->setCurrentIndex(0);
        connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabPageChanged(int)));
 
        //Add system menu
-       if(HMENU hMenu = ::GetSystemMenu(winId(), FALSE))
-       {
-               AppendMenuW(hMenu, MF_SEPARATOR, 0, 0);
-               AppendMenuW(hMenu, MF_STRING, IDM_ABOUTBOX, L"About...");
-       }
+       lamexp_append_sysmenu(this, IDM_ABOUTBOX, "About...");
+
+       //Setup corner widget
+       QLabel *cornerWidget = new QLabel(ui->menubar);
+       m_evenFilterCornerWidget = new CustomEventFilter;
+       cornerWidget->setText("N/A");
+       cornerWidget->setFixedHeight(ui->menubar->height());
+       cornerWidget->setCursor(QCursor(Qt::PointingHandCursor));
+       cornerWidget->hide();
+       cornerWidget->installEventFilter(m_evenFilterCornerWidget);
+       connect(m_evenFilterCornerWidget, SIGNAL(eventOccurred(QWidget*, QEvent*)), this, SLOT(cornerWidgetEventOccurred(QWidget*, QEvent*)));
+       ui->menubar->setCornerWidget(cornerWidget);
 
        //--------------------------------
        // Setup "Source" tab
@@ -221,23 +293,24 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        m_exportCsvContextAction = m_sourceFilesContextMenu->addAction(QIcon(":/icons/table_save.png"), "N/A");
        m_importCsvContextAction = m_sourceFilesContextMenu->addAction(QIcon(":/icons/folder_table.png"), "N/A");
        SET_FONT_BOLD(m_showDetailsContextAction, true);
-       connect(ui->buttonAddFiles, SIGNAL(clicked()), this, SLOT(addFilesButtonClicked()));
-       connect(ui->buttonRemoveFile, SIGNAL(clicked()), this, SLOT(removeFileButtonClicked()));
-       connect(ui->buttonClearFiles, SIGNAL(clicked()), this, SLOT(clearFilesButtonClicked()));
-       connect(ui->buttonFileUp, SIGNAL(clicked()), this, SLOT(fileUpButtonClicked()));
-       connect(ui->buttonFileDown, SIGNAL(clicked()), this, SLOT(fileDownButtonClicked()));
-       connect(ui->buttonShowDetails, SIGNAL(clicked()), this, SLOT(showDetailsButtonClicked()));
-       connect(m_fileListModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(sourceModelChanged()));
-       connect(m_fileListModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(sourceModelChanged()));
-       connect(m_fileListModel, SIGNAL(modelReset()), this, SLOT(sourceModelChanged()));
-       connect(ui->sourceFileView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(sourceFilesContextMenu(QPoint)));
-       connect(ui->sourceFileView->verticalScrollBar(), SIGNAL(sliderMoved(int)), this, SLOT(sourceFilesScrollbarMoved(int)));
-       connect(ui->sourceFileView->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(sourceFilesScrollbarMoved(int)));
-       connect(m_showDetailsContextAction, SIGNAL(triggered(bool)), this, SLOT(showDetailsButtonClicked()));
-       connect(m_previewContextAction, SIGNAL(triggered(bool)), this, SLOT(previewContextActionTriggered()));
-       connect(m_findFileContextAction, SIGNAL(triggered(bool)), this, SLOT(findFileContextActionTriggered()));
-       connect(m_exportCsvContextAction, SIGNAL(triggered(bool)), this, SLOT(exportCsvContextActionTriggered()));
-       connect(m_importCsvContextAction, SIGNAL(triggered(bool)), this, SLOT(importCsvContextActionTriggered()));
+
+       connect(ui->buttonAddFiles,                      SIGNAL(clicked()),                          this, SLOT(addFilesButtonClicked()));
+       connect(ui->buttonRemoveFile,                    SIGNAL(clicked()),                          this, SLOT(removeFileButtonClicked()));
+       connect(ui->buttonClearFiles,                    SIGNAL(clicked()),                          this, SLOT(clearFilesButtonClicked()));
+       connect(ui->buttonFileUp,                        SIGNAL(clicked()),                          this, SLOT(fileUpButtonClicked()));
+       connect(ui->buttonFileDown,                      SIGNAL(clicked()),                          this, SLOT(fileDownButtonClicked()));
+       connect(ui->buttonShowDetails,                   SIGNAL(clicked()),                          this, SLOT(showDetailsButtonClicked()));
+       connect(m_fileListModel,                         SIGNAL(rowsInserted(QModelIndex,int,int)),  this, SLOT(sourceModelChanged()));
+       connect(m_fileListModel,                         SIGNAL(rowsRemoved(QModelIndex,int,int)),   this, SLOT(sourceModelChanged()));
+       connect(m_fileListModel,                         SIGNAL(modelReset()),                       this, SLOT(sourceModelChanged()));
+       connect(ui->sourceFileView,                      SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(sourceFilesContextMenu(QPoint)));
+       connect(ui->sourceFileView->verticalScrollBar(), SIGNAL(sliderMoved(int)),                   this, SLOT(sourceFilesScrollbarMoved(int)));
+       connect(ui->sourceFileView->verticalScrollBar(), SIGNAL(valueChanged(int)),                  this, SLOT(sourceFilesScrollbarMoved(int)));
+       connect(m_showDetailsContextAction,              SIGNAL(triggered(bool)),                    this, SLOT(showDetailsButtonClicked()));
+       connect(m_previewContextAction,                  SIGNAL(triggered(bool)),                    this, SLOT(previewContextActionTriggered()));
+       connect(m_findFileContextAction,                 SIGNAL(triggered(bool)),                    this, SLOT(findFileContextActionTriggered()));
+       connect(m_exportCsvContextAction,                SIGNAL(triggered(bool)),                    this, SLOT(exportCsvContextActionTriggered()));
+       connect(m_importCsvContextAction,                SIGNAL(triggered(bool)),                    this, SLOT(importCsvContextActionTriggered()));
 
        //--------------------------------
        // Setup "Output" tab
@@ -314,7 +387,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        // Setup "Meta Data" tab
        //--------------------------------
 
-       m_metaInfoModel = new MetaInfoModel(m_metaData, 6);
+       m_metaInfoModel = new MetaInfoModel(m_metaData);
        m_metaInfoModel->clearData();
        m_metaInfoModel->setData(m_metaInfoModel->index(4, 1), m_settings->metaInfoPosition());
        ui->metaDataView->setModel(m_metaInfoModel);
@@ -338,31 +411,32 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        m_encoderButtonGroup->addButton(ui->radioButtonEncoderAAC, SettingsModel::AACEncoder);
        m_encoderButtonGroup->addButton(ui->radioButtonEncoderAC3, SettingsModel::AC3Encoder);
        m_encoderButtonGroup->addButton(ui->radioButtonEncoderFLAC, SettingsModel::FLACEncoder);
+       m_encoderButtonGroup->addButton(ui->radioButtonEncoderAPE, SettingsModel::MACEncoder);
        m_encoderButtonGroup->addButton(ui->radioButtonEncoderOpus, SettingsModel::OpusEncoder);
        m_encoderButtonGroup->addButton(ui->radioButtonEncoderDCA, SettingsModel::DCAEncoder);
        m_encoderButtonGroup->addButton(ui->radioButtonEncoderPCM, SettingsModel::PCMEncoder);
 
+       const int aacEncoder = EncoderRegistry::getAacEncoder();
+       ui->radioButtonEncoderAAC->setEnabled(aacEncoder > SettingsModel::AAC_ENCODER_NONE);
+
        m_modeButtonGroup = new QButtonGroup(this);
        m_modeButtonGroup->addButton(ui->radioButtonModeQuality, SettingsModel::VBRMode);
        m_modeButtonGroup->addButton(ui->radioButtonModeAverageBitrate, SettingsModel::ABRMode);
        m_modeButtonGroup->addButton(ui->radioButtonConstBitrate, SettingsModel::CBRMode);
 
-       ui->radioButtonEncoderAAC->setEnabled(m_neroEncoderAvailable || m_fhgEncoderAvailable || m_qaacEncoderAvailable);
-       ui->radioButtonEncoderMP3->setChecked(m_settings->compressionEncoder() == SettingsModel::MP3Encoder);
-       ui->radioButtonEncoderVorbis->setChecked(m_settings->compressionEncoder() == SettingsModel::VorbisEncoder);
-       ui->radioButtonEncoderAAC->setChecked((m_settings->compressionEncoder() == SettingsModel::AACEncoder) && (m_neroEncoderAvailable || m_fhgEncoderAvailable || m_qaacEncoderAvailable));
-       ui->radioButtonEncoderAC3->setChecked(m_settings->compressionEncoder() == SettingsModel::AC3Encoder);
-       ui->radioButtonEncoderFLAC->setChecked(m_settings->compressionEncoder() == SettingsModel::FLACEncoder);
-       ui->radioButtonEncoderOpus->setChecked(m_settings->compressionEncoder() == SettingsModel::OpusEncoder);
-       ui->radioButtonEncoderDCA->setChecked(m_settings->compressionEncoder() == SettingsModel::DCAEncoder);
-       ui->radioButtonEncoderPCM->setChecked(m_settings->compressionEncoder() == SettingsModel::PCMEncoder);
-       ui->radioButtonModeQuality->setChecked(m_settings->compressionRCMode() == SettingsModel::VBRMode);
-       ui->radioButtonModeAverageBitrate->setChecked(m_settings->compressionRCMode() == SettingsModel::ABRMode);
-       ui->radioButtonConstBitrate->setChecked(m_settings->compressionRCMode() == SettingsModel::CBRMode);
-       ui->sliderBitrate->setValue(m_settings->compressionBitrate());
-       
+       ui->radioButtonEncoderMP3->setChecked(true);
+       foreach(QAbstractButton *currentButton, m_encoderButtonGroup->buttons())
+       {
+               if(currentButton->isEnabled() && (m_encoderButtonGroup->id(currentButton) == m_settings->compressionEncoder()))
+               {
+                       currentButton->setChecked(true);
+                       break;
+               }
+       }
+
        m_evenFilterCompressionTab = new CustomEventFilter();
        ui->labelCompressionHelp->installEventFilter(m_evenFilterCompressionTab);
+       ui->labelResetEncoders ->installEventFilter(m_evenFilterCompressionTab);
 
        connect(m_encoderButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(updateEncoder(int)));
        connect(m_modeButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(updateRCMode(int)));
@@ -391,8 +465,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        ui->comboBoxAACProfile->setCurrentIndex(m_settings->aacEncProfile());
        ui->comboBoxAftenCodingMode->setCurrentIndex(m_settings->aftenAudioCodingMode());
        ui->comboBoxAftenDRCMode->setCurrentIndex(m_settings->aftenDynamicRangeCompression());
-       ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEqualizationMode());
-       //comboBoxOpusOptimize->setCurrentIndex(m_settings->opusOptimizeFor());
+       ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEQMode());
        ui->comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesize());
        
        SET_CHECKBOX_STATE(ui->checkBoxBitrateManagement, m_settings->bitrateManagementEnabled());
@@ -404,16 +477,16 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabled());
        SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmix());
        SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResample());
-       ui->checkBoxNeroAAC2PassMode->setEnabled(!(m_fhgEncoderAvailable || m_qaacEncoderAvailable));
+       ui->checkBoxNeroAAC2PassMode->setEnabled(aacEncoder == SettingsModel::AAC_ENCODER_NERO);
        
-       ui->lineEditCustomParamLAME->setText(m_settings->customParametersLAME());
-       ui->lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc());
-       ui->lineEditCustomParamNeroAAC->setText(m_settings->customParametersAacEnc());
-       ui->lineEditCustomParamFLAC->setText(m_settings->customParametersFLAC());
-       ui->lineEditCustomParamAften->setText(m_settings->customParametersAften());
-       ui->lineEditCustomParamOpus->setText(m_settings->customParametersOpus());
-       ui->lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPath()));
-       ui->lineEditRenamePattern->setText(m_settings->renameOutputFilesPattern());
+       ui->lineEditCustomParamLAME   ->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::MP3Encoder));
+       ui->lineEditCustomParamOggEnc ->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::VorbisEncoder));
+       ui->lineEditCustomParamNeroAAC->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::AACEncoder));
+       ui->lineEditCustomParamFLAC   ->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::FLACEncoder));
+       ui->lineEditCustomParamAften  ->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::AC3Encoder));
+       ui->lineEditCustomParamOpus   ->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::OpusEncoder));
+       ui->lineEditCustomTempFolder  ->setText(QDir::toNativeSeparators(m_settings->customTempPath()));
+       ui->lineEditRenamePattern     ->setText(m_settings->renameOutputFilesPattern());
        
        m_evenFilterCustumParamsHelp = new CustomEventFilter();
        ui->helpCustomParamLAME->installEventFilter(m_evenFilterCustumParamsHelp);
@@ -568,15 +641,21 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        connect(ui->actionImportCueSheet, SIGNAL(triggered(bool)), this, SLOT(importCueSheetActionTriggered(bool)));
                
        //Activate help menu actions
-       ui->actionVisitHomepage->setData(QString::fromLatin1(lamexp_website_url()));
-       ui->actionVisitSupport->setData(QString::fromLatin1(lamexp_support_url()));
-       ui->actionDocumentFAQ->setData(QString("%1/FAQ.html").arg(QApplication::applicationDirPath()));
+       ui->actionVisitHomepage    ->setData(QString::fromLatin1(lamexp_website_url()));
+       ui->actionVisitSupport     ->setData(QString::fromLatin1(lamexp_support_url()));
+       ui->actionVisitMuldersSite ->setData(QString::fromLatin1(lamexp_mulders_url()));
+       ui->actionVisitTracker     ->setData(QString::fromLatin1(lamexp_tracker_url()));
+       ui->actionVisitHAK         ->setData(QString::fromLatin1(g_hydrogen_audio_url));
+       ui->actionDocumentFAQ      ->setData(QString("%1/FAQ.html").arg(QApplication::applicationDirPath()));
        ui->actionDocumentChangelog->setData(QString("%1/Changelog.html").arg(QApplication::applicationDirPath()));
        ui->actionDocumentTranslate->setData(QString("%1/Translate.html").arg(QApplication::applicationDirPath()));
-       connect(ui->actionCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdatesActionActivated()));
-       connect(ui->actionVisitHomepage, SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
-       connect(ui->actionVisitSupport, SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
-       connect(ui->actionDocumentFAQ, SIGNAL(triggered()), this, SLOT(documentActionActivated()));
+       connect(ui->actionCheckUpdates,      SIGNAL(triggered()), this, SLOT(checkUpdatesActionActivated()));
+       connect(ui->actionVisitSupport,      SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
+       connect(ui->actionVisitTracker,      SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
+       connect(ui->actionVisitHomepage,     SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
+       connect(ui->actionVisitMuldersSite,  SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
+       connect(ui->actionVisitHAK,          SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated()));
+       connect(ui->actionDocumentFAQ,       SIGNAL(triggered()), this, SLOT(documentActionActivated()));
        connect(ui->actionDocumentChangelog, SIGNAL(triggered()), this, SLOT(documentActionActivated()));
        connect(ui->actionDocumentTranslate, SIGNAL(triggered()), this, SLOT(documentActionActivated()));
        
@@ -590,9 +669,6 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        move((desktopRect.width() - thisRect.width()) / 2, (desktopRect.height() - thisRect.height()) / 2);
        setMinimumSize(thisRect.width(), thisRect.height());
 
-       //Create banner
-       m_banner = new WorkingBanner(this);
-
        //Create DropBox widget
        m_dropBox = new DropBox(this, m_fileListModel, m_settings);
        connect(m_fileListModel, SIGNAL(modelReset()), m_dropBox, SLOT(modelChanged()));
@@ -602,17 +678,19 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
 
        //Create message handler thread
        m_messageHandler = new MessageHandlerThread();
-       m_delayedFileList = new QStringList();
-       m_delayedFileTimer = new QTimer();
-       m_delayedFileTimer->setSingleShot(true);
-       m_delayedFileTimer->setInterval(5000);
        connect(m_messageHandler, SIGNAL(otherInstanceDetected()), this, SLOT(notifyOtherInstance()), Qt::QueuedConnection);
        connect(m_messageHandler, SIGNAL(fileReceived(QString)), this, SLOT(addFileDelayed(QString)), Qt::QueuedConnection);
        connect(m_messageHandler, SIGNAL(folderReceived(QString, bool)), this, SLOT(addFolderDelayed(QString, bool)), Qt::QueuedConnection);
        connect(m_messageHandler, SIGNAL(killSignalReceived()), this, SLOT(close()), Qt::QueuedConnection);
-       connect(m_delayedFileTimer, SIGNAL(timeout()), this, SLOT(handleDelayedFiles()));
        m_messageHandler->start();
 
+       //Init delayed file handling
+       m_delayedFileList = new QStringList();
+       m_delayedFileTimer = new QTimer();
+       m_delayedFileTimer->setSingleShot(true);
+       m_delayedFileTimer->setInterval(5000);
+       connect(m_delayedFileTimer, SIGNAL(timeout()), this, SLOT(handleDelayedFiles()));
+
        //Load translation
        initializeTranslation();
 
@@ -621,6 +699,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
        changeEvent(&languageChangeEvent);
 
        //Enable Drag & Drop
+       m_droppedFileList = new QList<QUrl>();
        this->setAcceptDrops(true);
 }
 
@@ -647,29 +726,38 @@ MainWindow::~MainWindow(void)
        SET_MODEL(ui->metaDataView, NULL);
 
        //Free memory
-       LAMEXP_DELETE(m_tabActionGroup);
-       LAMEXP_DELETE(m_styleActionGroup);
-       LAMEXP_DELETE(m_languageActionGroup);
-       LAMEXP_DELETE(m_banner);
-       LAMEXP_DELETE(m_fileSystemModel);
-       LAMEXP_DELETE(m_messageHandler);
-       LAMEXP_DELETE(m_delayedFileList);
-       LAMEXP_DELETE(m_delayedFileTimer);
-       LAMEXP_DELETE(m_metaInfoModel);
-       LAMEXP_DELETE(m_encoderButtonGroup);
-       LAMEXP_DELETE(m_modeButtonGroup);
-       LAMEXP_DELETE(m_overwriteButtonGroup);
-       LAMEXP_DELETE(m_sourceFilesContextMenu);
-       LAMEXP_DELETE(m_outputFolderFavoritesMenu);
-       LAMEXP_DELETE(m_outputFolderContextMenu);
-       LAMEXP_DELETE(m_dropBox);
-       LAMEXP_DELETE(m_evenFilterCustumParamsHelp);
-       LAMEXP_DELETE(m_evenFilterOutputFolderMouse);
-       LAMEXP_DELETE(m_evenFilterOutputFolderView);
-       LAMEXP_DELETE(m_evenFilterCompressionTab);
+       MUTILS_DELETE(m_tabActionGroup);
+       MUTILS_DELETE(m_styleActionGroup);
+       MUTILS_DELETE(m_languageActionGroup);
+       MUTILS_DELETE(m_banner);
+       MUTILS_DELETE(m_fileSystemModel);
+       MUTILS_DELETE(m_messageHandler);
+       MUTILS_DELETE(m_droppedFileList);
+       MUTILS_DELETE(m_delayedFileList);
+       MUTILS_DELETE(m_delayedFileTimer);
+       MUTILS_DELETE(m_metaInfoModel);
+       MUTILS_DELETE(m_encoderButtonGroup);
+       MUTILS_DELETE(m_modeButtonGroup);
+       MUTILS_DELETE(m_overwriteButtonGroup);
+       MUTILS_DELETE(m_sourceFilesContextMenu);
+       MUTILS_DELETE(m_outputFolderFavoritesMenu);
+       MUTILS_DELETE(m_outputFolderContextMenu);
+       MUTILS_DELETE(m_dropBox);
+       MUTILS_DELETE(m_evenFilterCornerWidget);
+       MUTILS_DELETE(m_evenFilterCustumParamsHelp);
+       MUTILS_DELETE(m_evenFilterOutputFolderMouse);
+       MUTILS_DELETE(m_evenFilterOutputFolderView);
+       MUTILS_DELETE(m_evenFilterCompressionTab);
        
+       //Free window icon
+       if(m_windowIcon)
+       {
+               lamexp_free_window_icon(m_windowIcon);
+               m_windowIcon = NULL;
+       }
+
        //Un-initialize the dialog
-       LAMEXP_DELETE(ui);
+       MUTILS_DELETE(ui);
 }
 
 ////////////////////////////////////////////////////////////
@@ -686,9 +774,12 @@ void MainWindow::addFiles(const QStringList &files)
                return;
        }
 
-       ui->tabWidget->setCurrentIndex(0);
+       WITH_BLOCKED_SIGNALS(ui->tabWidget, setCurrentIndex, 0);
+       tabPageChanged(ui->tabWidget->currentIndex(), true);
 
+       INIT_BANNER();
        FileAnalyzer *analyzer = new FileAnalyzer(files);
+
        connect(analyzer, SIGNAL(fileSelected(QString)), m_banner, SLOT(setText(QString)), Qt::QueuedConnection);
        connect(analyzer, SIGNAL(progressValChanged(unsigned int)), m_banner, SLOT(setProgressVal(unsigned int)), Qt::QueuedConnection);
        connect(analyzer, SIGNAL(progressMaxChanged(unsigned int)), m_banner, SLOT(setProgressMax(unsigned int)), Qt::QueuedConnection);
@@ -730,7 +821,7 @@ void MainWindow::addFiles(const QStringList &files)
                QMessageBox::warning(this, tr("Files Rejected"), QString("%1<br>%2").arg(NOBR(tr("%n file(s) have been rejected, because the file format could not be recognized!", "", analyzer->filesRejected())), NOBR(tr("This usually means the file is damaged or the file format is not supported."))));
        }
 
-       LAMEXP_DELETE(analyzer);
+       MUTILS_DELETE(analyzer);
        m_banner->close();
 }
 
@@ -743,16 +834,16 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed)
        folderInfoList << QFileInfo(path);
        QStringList fileList;
        
-       m_banner->show(tr("Scanning folder(s) for files, please wait..."));
+       SHOW_BANNER(tr("Scanning folder(s) for files, please wait..."));
        
        QApplication::processEvents();
-       GetAsyncKeyState(VK_ESCAPE);
+       lamexp_check_escape_state();
 
        while(!folderInfoList.isEmpty())
        {
-               if(GetAsyncKeyState(VK_ESCAPE) & 0x0001)
+               if(lamexp_check_escape_state())
                {
-                       MessageBeep(MB_ICONERROR);
+                       lamexp_beep(lamexp_beep_error);
                        qWarning("Operation cancelled by user!");
                        fileList.clear();
                        break;
@@ -766,7 +857,7 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed)
                        fileList << fileInfoList.takeFirst().canonicalFilePath();
                }
 
-               QApplication::processEvents();
+               QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 
                if(recursive)
                {
@@ -803,11 +894,12 @@ bool MainWindow::checkForUpdates(void)
 
        if(updateDialog->getSuccess())
        {
+               SHOW_CORNER_WIDGET(false);
                m_settings->autoUpdateLastCheck(QDate::currentDate().toString(Qt::ISODate));
                bReadyToInstall = updateDialog->updateReadyToInstall();
        }
 
-       LAMEXP_DELETE(updateDialog);
+       MUTILS_DELETE(updateDialog);
        return bReadyToInstall;
 }
 
@@ -825,7 +917,7 @@ void MainWindow::refreshFavorites(void)
                QAction *currentItem = folderList.takeFirst();
                if(currentItem->isSeparator()) break;
                m_outputFolderFavoritesMenu->removeAction(currentItem);
-               LAMEXP_DELETE(currentItem);
+               MUTILS_DELETE(currentItem);
        }
 
        QAction *lastItem = m_outputFolderFavoritesMenu->actions().first();
@@ -916,12 +1008,13 @@ void MainWindow::initializeTranslation(void)
 void MainWindow::showEvent(QShowEvent *event)
 {
        m_accepted = false;
-       m_dropNoteLabel->setGeometry(0, 0, ui->sourceFileView->width(), ui->sourceFileView->height());
+       resizeEvent(NULL);
        sourceModelChanged();
-       
+
        if(!event->spontaneous())
        {
-               ui->tabWidget->setCurrentIndex(0);
+               WITH_BLOCKED_SIGNALS(ui->tabWidget, setCurrentIndex, 0);
+               tabPageChanged(ui->tabWidget->currentIndex(), true);
        }
 
        if(m_firstTimeShown)
@@ -943,79 +1036,93 @@ void MainWindow::showEvent(QShowEvent *event)
  */
 void MainWindow::changeEvent(QEvent *e)
 {
-       if(e->type() == QEvent::LanguageChange)
+       QMainWindow::changeEvent(e);
+       if(e->type() != QEvent::LanguageChange)
        {
-               int comboBoxIndex[8];
+               return;
+       }
+
+       int comboBoxIndex[8];
                
-               //Backup combobox indices, as retranslateUi() resets
-               comboBoxIndex[0] = ui->comboBoxMP3ChannelMode->currentIndex();
-               comboBoxIndex[1] = ui->comboBoxSamplingRate->currentIndex();
-               comboBoxIndex[2] = ui->comboBoxAACProfile->currentIndex();
-               comboBoxIndex[3] = ui->comboBoxAftenCodingMode->currentIndex();
-               comboBoxIndex[4] = ui->comboBoxAftenDRCMode->currentIndex();
-               comboBoxIndex[5] = ui->comboBoxNormalizationMode->currentIndex();
-               comboBoxIndex[6] = 0; //comboBoxOpusOptimize->currentIndex();
-               comboBoxIndex[7] = ui->comboBoxOpusFramesize->currentIndex();
+       //Backup combobox indices, as retranslateUi() resets
+       comboBoxIndex[0] = ui->comboBoxMP3ChannelMode->currentIndex();
+       comboBoxIndex[1] = ui->comboBoxSamplingRate->currentIndex();
+       comboBoxIndex[2] = ui->comboBoxAACProfile->currentIndex();
+       comboBoxIndex[3] = ui->comboBoxAftenCodingMode->currentIndex();
+       comboBoxIndex[4] = ui->comboBoxAftenDRCMode->currentIndex();
+       comboBoxIndex[5] = ui->comboBoxNormalizationMode->currentIndex();
+       comboBoxIndex[6] = 0; //comboBoxOpusOptimize->currentIndex();
+       comboBoxIndex[7] = ui->comboBoxOpusFramesize->currentIndex();
                
-               //Re-translate from UIC
-               ui->retranslateUi(this);
-
-               //Restore combobox indices
-               ui->comboBoxMP3ChannelMode->setCurrentIndex(comboBoxIndex[0]);
-               ui->comboBoxSamplingRate->setCurrentIndex(comboBoxIndex[1]);
-               ui->comboBoxAACProfile->setCurrentIndex(comboBoxIndex[2]);
-               ui->comboBoxAftenCodingMode->setCurrentIndex(comboBoxIndex[3]);
-               ui->comboBoxAftenDRCMode->setCurrentIndex(comboBoxIndex[4]);
-               ui->comboBoxNormalizationMode->setCurrentIndex(comboBoxIndex[5]);
-               //comboBoxOpusOptimize->setCurrentIndex(comboBoxIndex[6]);
-               ui->comboBoxOpusFramesize->setCurrentIndex(comboBoxIndex[7]);
-
-               //Update the window title
-               if(LAMEXP_DEBUG)
-               {
-                       setWindowTitle(QString("%1 [!!! DEBUG BUILD !!!]").arg(windowTitle()));
-               }
-               else if(lamexp_version_demo())
-               {
-                       setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION")));
-               }
+       //Re-translate from UIC
+       ui->retranslateUi(this);
 
-               //Manually re-translate widgets that UIC doesn't handle
-               m_dropNoteLabel->setText(QString("» %1 Â«").arg(tr("You can drop in audio files here!")));
-               m_outputFolderNoteBox->setText(tr("Initializing directory outline, please be patient..."));
-               m_showDetailsContextAction->setText(tr("Show Details"));
-               m_previewContextAction->setText(tr("Open File in External Application"));
-               m_findFileContextAction->setText(tr("Browse File Location"));
-               m_showFolderContextAction->setText(tr("Browse Selected Folder"));
-               m_refreshFolderContextAction->setText(tr("Refresh Directory Outline"));
-               m_goUpFolderContextAction->setText(tr("Go To Parent Directory"));
-               m_addFavoriteFolderAction->setText(tr("Bookmark Current Output Folder"));
-               m_exportCsvContextAction->setText(tr("Export Meta Tags to CSV File"));
-               m_importCsvContextAction->setText(tr("Import Meta Tags from CSV File"));
-
-               //Force GUI update
-               m_metaInfoModel->clearData();
-               m_metaInfoModel->setData(m_metaInfoModel->index(4, 1), m_settings->metaInfoPosition());
-               updateEncoder(m_settings->compressionEncoder());
-               updateLameAlgoQuality(ui->sliderLameAlgoQuality->value());
-               updateMaximumInstances(ui->sliderMaxInstances->value());
-               renameOutputPatternChanged(ui->lineEditRenamePattern->text());
-
-               //Re-install shell integration
-               if(m_settings->shellIntegrationEnabled())
-               {
-                       ShellIntegration::install();
-               }
+       //Restore combobox indices
+       ui->comboBoxMP3ChannelMode->setCurrentIndex(comboBoxIndex[0]);
+       ui->comboBoxSamplingRate->setCurrentIndex(comboBoxIndex[1]);
+       ui->comboBoxAACProfile->setCurrentIndex(comboBoxIndex[2]);
+       ui->comboBoxAftenCodingMode->setCurrentIndex(comboBoxIndex[3]);
+       ui->comboBoxAftenDRCMode->setCurrentIndex(comboBoxIndex[4]);
+       ui->comboBoxNormalizationMode->setCurrentIndex(comboBoxIndex[5]);
+       //comboBoxOpusOptimize->setCurrentIndex(comboBoxIndex[6]);
+       ui->comboBoxOpusFramesize->setCurrentIndex(comboBoxIndex[7]);
+
+       //Update the window title
+       if(MUTILS_DEBUG)
+       {
+               setWindowTitle(QString("%1 [!!! DEBUG BUILD !!!]").arg(windowTitle()));
+       }
+       else if(lamexp_version_demo())
+       {
+               setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION")));
+       }
+
+       //Manually re-translate widgets that UIC doesn't handle
+       m_outputFolderNoteBox->setText(tr("Initializing directory outline, please be patient..."));
+       m_dropNoteLabel->setText(QString("<br><img src=\":/images/DropZone.png\"><br><br>%1").arg(tr("You can drop in audio files here!")));
+       if(QLabel *cornerWidget = dynamic_cast<QLabel*>(ui->menubar->cornerWidget()))
+       {
+               cornerWidget->setText(QString("<nobr><img src=\":/icons/exclamation_small.png\">&nbsp;<b style=\"color:darkred\">%1</b>&nbsp;&nbsp;&nbsp;</nobr>").arg(tr("Check for Updates")));
+       }
+       m_showDetailsContextAction->setText(tr("Show Details"));
+       m_previewContextAction->setText(tr("Open File in External Application"));
+       m_findFileContextAction->setText(tr("Browse File Location"));
+       m_showFolderContextAction->setText(tr("Browse Selected Folder"));
+       m_refreshFolderContextAction->setText(tr("Refresh Directory Outline"));
+       m_goUpFolderContextAction->setText(tr("Go To Parent Directory"));
+       m_addFavoriteFolderAction->setText(tr("Bookmark Current Output Folder"));
+       m_exportCsvContextAction->setText(tr("Export Meta Tags to CSV File"));
+       m_importCsvContextAction->setText(tr("Import Meta Tags from CSV File"));
+
+       //Force GUI update
+       m_metaInfoModel->clearData();
+       m_metaInfoModel->setData(m_metaInfoModel->index(4, 1), m_settings->metaInfoPosition());
+       updateEncoder(m_settings->compressionEncoder());
+       updateLameAlgoQuality(ui->sliderLameAlgoQuality->value());
+       updateMaximumInstances(ui->sliderMaxInstances->value());
+       renameOutputPatternChanged(ui->lineEditRenamePattern->text(), true);
+
+       //Re-install shell integration
+       if(m_settings->shellIntegrationEnabled())
+       {
+               ShellIntegration::install();
+       }
 
-               //Translate system menu
-               if(HMENU hMenu = ::GetSystemMenu(winId(), FALSE))
+       //Translate system menu
+       lamexp_update_sysmenu(this, IDM_ABOUTBOX, ui->buttonAbout->text());
+       
+       //Force resize event
+       QApplication::postEvent(this, new QResizeEvent(this->size(), QSize()));
+       for(QObjectList::ConstIterator iter = this->children().constBegin(); iter != this->children().constEnd(); iter++)
+       {
+               if(QWidget *child = dynamic_cast<QWidget*>(*iter))
                {
-                       ModifyMenu(hMenu, IDM_ABOUTBOX, MF_STRING | MF_BYCOMMAND, IDM_ABOUTBOX, QWCHAR(ui->buttonAbout->text()));
+                       QApplication::postEvent(child, new QResizeEvent(child->size(), QSize()));
                }
-                       
-               //Force resize, if needed
-               tabPageChanged(ui->tabWidget->currentIndex());
        }
+
+       //Force tabe page change
+       tabPageChanged(ui->tabWidget->currentIndex(), true);
 }
 
 /*
@@ -1036,51 +1143,12 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event)
  */
 void MainWindow::dropEvent(QDropEvent *event)
 {
-       ABORT_IF_BUSY;
-
-       QStringList droppedFiles;
-       QList<QUrl> urls = event->mimeData()->urls();
-
-       while(!urls.isEmpty())
+       m_droppedFileList->clear();
+       (*m_droppedFileList) << event->mimeData()->urls();
+       if(!m_droppedFileList->isEmpty())
        {
-               QUrl currentUrl = urls.takeFirst();
-               QFileInfo file(currentUrl.toLocalFile());
-               if(!file.exists())
-               {
-                       continue;
-               }
-               if(file.isFile())
-               {
-                       qDebug("Dropped File: %s", file.canonicalFilePath().toUtf8().constData());
-                       droppedFiles << file.canonicalFilePath();
-                       continue;
-               }
-               if(file.isDir())
-               {
-                       qDebug("Dropped Folder: %s", file.canonicalFilePath().toUtf8().constData());
-                       QList<QFileInfo> list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Files | QDir::NoSymLinks);
-                       if(list.count() > 0)
-                       {
-                               for(int j = 0; j < list.count(); j++)
-                               {
-                                       droppedFiles << list.at(j).canonicalFilePath();
-                               }
-                       }
-                       else
-                       {
-                               list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
-                               for(int j = 0; j < list.count(); j++)
-                               {
-                                       qDebug("Descending to Folder: %s", list.at(j).canonicalFilePath().toUtf8().constData());
-                                       urls.prepend(QUrl::fromLocalFile(list.at(j).canonicalFilePath()));
-                               }
-                       }
-               }
-       }
-       
-       if(!droppedFiles.isEmpty())
-       {
-               addFilesDelayed(droppedFiles, true);
+               PLAY_SOUND_OPTIONAL("drop", true);
+               QTimer::singleShot(0, this, SLOT(handleDroppedFiles()));
        }
 }
 
@@ -1089,9 +1157,9 @@ void MainWindow::dropEvent(QDropEvent *event)
  */
 void MainWindow::closeEvent(QCloseEvent *event)
 {
-       if(m_banner->isVisible() || m_delayedFileTimer->isActive())
+       if(BANNER_VISIBLE || m_delayedFileTimer->isActive())
        {
-               MessageBeep(MB_ICONEXCLAMATION);
+               lamexp_beep(lamexp_beep_warning);
                event->ignore();
        }
        
@@ -1107,11 +1175,15 @@ void MainWindow::closeEvent(QCloseEvent *event)
 void MainWindow::resizeEvent(QResizeEvent *event)
 {
        if(event) QMainWindow::resizeEvent(event);
-       m_dropNoteLabel->setGeometry(0, 0, ui->sourceFileView->width(), ui->sourceFileView->height());
+
+       if(QWidget *port = ui->sourceFileView->viewport())
+       {
+               m_dropNoteLabel->setGeometry(port->geometry());
+       }
 
        if(QWidget *port = ui->outputFolderView->viewport())
        {
-               m_outputFolderNoteBox->setGeometry(16, (port->height() - 64) / 2, port->width() - 32,  64);
+               m_outputFolderNoteBox->setGeometry(16, (port->height() - 64) / 2, port->width() - 32, 64);
        }
 }
 
@@ -1132,7 +1204,7 @@ void MainWindow::keyPressEvent(QKeyEvent *e)
        if(e->modifiers().testFlag(Qt::ControlModifier) && (e->key() == Qt::Key_F5))
        {
                initializeTranslation();
-               MessageBeep(MB_ICONINFORMATION);
+               lamexp_beep(lamexp_beep_info);
                return;
        }
 
@@ -1169,12 +1241,12 @@ bool MainWindow::event(QEvent *e)
 {
        switch(e->type())
        {
-       case lamexp_event_queryendsession:
+       case MUtils::GUI::USER_EVENT_QUERYENDSESSION:
                qWarning("System is shutting down, main window prepares to close...");
-               if(m_banner->isVisible()) m_banner->close();
+               if(BANNER_VISIBLE) m_banner->close();
                if(m_delayedFileTimer->isActive()) m_delayedFileTimer->stop();
                return true;
-       case lamexp_event_endsession:
+       case MUtils::GUI::USER_EVENT_ENDSESSION:
                qWarning("System is shutting down, main window will close now...");
                if(isVisible())
                {
@@ -1197,7 +1269,7 @@ bool MainWindow::event(QEvent *e)
 
 bool MainWindow::winEvent(MSG *message, long *result)
 {
-       if((message->message == WM_SYSCOMMAND) && ((message->wParam & 0xFFF0) == IDM_ABOUTBOX))
+       if(lamexp_check_sysmenu_msg(message, IDM_ABOUTBOX))
        {
                QTimer::singleShot(0, ui->buttonAbout, SLOT(click()));
                *result = 0;
@@ -1219,7 +1291,10 @@ bool MainWindow::winEvent(MSG *message, long *result)
  */
 void MainWindow::windowShown(void)
 {
-       const QStringList &arguments = lamexp_arguments(); //QApplication::arguments();
+       const QStringList &arguments = MUtils::OS::arguments(); //QApplication::arguments();
+
+       //Force resize event
+       resizeEvent(NULL);
 
        //First run?
        bool firstRun = false;
@@ -1239,7 +1314,7 @@ void MainWindow::windowShown(void)
                        AboutDialog *about = new AboutDialog(m_settings, this, true);
                        iAccepted = about->exec();
                        if(iAccepted <= 0) iAccepted = -2;
-                       LAMEXP_DELETE(about);
+                       MUTILS_DELETE(about);
                }
 
                if(iAccepted <= 0)
@@ -1247,7 +1322,7 @@ void MainWindow::windowShown(void)
                        m_settings->licenseAccepted(++iAccepted);
                        m_settings->syncNow();
                        QApplication::processEvents();
-                       PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
+                       lamexp_play_sound("whammy", false);
                        QMessageBox::critical(this, tr("License Declined"), tr("You have declined the license. Consequently the application will exit now!"), tr("Goodbye!"));
                        QFileInfo uninstallerInfo = QFileInfo(QString("%1/Uninstall.exe").arg(QApplication::applicationDirPath()));
                        if(uninstallerInfo.exists())
@@ -1256,15 +1331,14 @@ void MainWindow::windowShown(void)
                                QString uninstallerPath = uninstallerInfo.canonicalFilePath();
                                for(int i = 0; i < 3; i++)
                                {
-                                       HINSTANCE res = ShellExecuteW(reinterpret_cast<HWND>(this->winId()), L"open", QWCHAR(QDir::toNativeSeparators(uninstallerPath)), L"/Force", QWCHAR(QDir::toNativeSeparators(uninstallerDir)), SW_SHOWNORMAL);
-                                       if(reinterpret_cast<int>(res) > 32) break;
+                                       if(lamexp_exec_shell(this, QDir::toNativeSeparators(uninstallerPath), "/Force", QDir::toNativeSeparators(uninstallerDir))) break;
                                }
                        }
                        QApplication::quit();
                        return;
                }
                
-               PlaySound(MAKEINTRESOURCE(IDR_WAVE_WOOHOO), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
+               lamexp_play_sound("woohoo", false);
                m_settings->licenseAccepted(1);
                m_settings->syncNow();
                if(lamexp_version_demo()) showAnnounceBox();
@@ -1273,10 +1347,10 @@ void MainWindow::windowShown(void)
        //Check for expiration
        if(lamexp_version_demo())
        {
-               if(lamexp_current_date_safe() >= lamexp_version_expires())
+               if(MUtils::OS::current_date() >= lamexp_version_expires())
                {
                        qWarning("Binary has expired !!!");
-                       PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
+                       lamexp_play_sound("whammy", false);
                        if(QMessageBox::warning(this, tr("LameXP - Expired"), QString("%1<br>%2").arg(NOBR(tr("This demo (pre-release) version of LameXP has expired at %1.").arg(lamexp_version_expires().toString(Qt::ISODate))), NOBR(tr("LameXP is free software and release versions won't expire."))), tr("Check for Updates"), tr("Exit Program")) == 0)
                        {
                                checkForUpdates();
@@ -1300,9 +1374,10 @@ void MainWindow::windowShown(void)
        }
 
        //Update reminder
-       if(lamexp_current_date_safe() >= lamexp_version_date().addYears(1))
+       if(MUtils::OS::current_date() >= MUtils::Version::app_build_date().addYears(1))
        {
                qWarning("Binary is more than a year old, time to update!");
+               SHOW_CORNER_WIDGET(true);
                int ret = QMessageBox::warning(this, tr("Urgent Update"), NOBR(tr("Your version of LameXP is more than a year old. Time for an update!")), tr("Check for Updates"), tr("Exit Program"), tr("Ignore"));
                switch(ret)
                {
@@ -1318,29 +1393,34 @@ void MainWindow::windowShown(void)
                        return;
                default:
                        QEventLoop loop; QTimer::singleShot(7000, &loop, SLOT(quit()));
-                       PlaySound(MAKEINTRESOURCE(IDR_WAVE_WAITING), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
-                       m_banner->show(tr("Skipping update check this time, please be patient..."), &loop);
+                       lamexp_play_sound("waiting", true);
+                       SHOW_BANNER_ARG(tr("Skipping update check this time, please be patient..."), &loop);
                        break;
                }
        }
-       else if(m_settings->autoUpdateEnabled())
+       else
        {
                QDate lastUpdateCheck = QDate::fromString(m_settings->autoUpdateLastCheck(), Qt::ISODate);
-               if(!firstRun && (!lastUpdateCheck.isValid() || lamexp_current_date_safe() >= lastUpdateCheck.addDays(14)))
+               if((!firstRun) && ((!lastUpdateCheck.isValid()) || (MUtils::OS::current_date() >= lastUpdateCheck.addDays(14))))
                {
-                       if(QMessageBox::information(this, tr("Update Reminder"), NOBR(lastUpdateCheck.isValid() ? tr("Your last update check was more than 14 days ago. Check for updates now?") : tr("Your did not check for LameXP updates yet. Check for updates now?")), tr("Check for Updates"), tr("Postpone")) == 0)
+                       SHOW_CORNER_WIDGET(true);
+                       if(m_settings->autoUpdateEnabled())
                        {
-                               if(checkForUpdates())
+                               if(QMessageBox::information(this, tr("Update Reminder"), NOBR(lastUpdateCheck.isValid() ? tr("Your last update check was more than 14 days ago. Check for updates now?") : tr("Your did not check for LameXP updates yet. Check for updates now?")), tr("Check for Updates"), tr("Postpone")) == 0)
                                {
-                                       QApplication::quit();
-                                       return;
+                                       if(checkForUpdates())
+                                       {
+                                               QApplication::quit();
+                                               return;
+                                       }
                                }
                        }
                }
        }
 
        //Check for AAC support
-       if(m_neroEncoderAvailable)
+       const int aacEncoder = EncoderRegistry::getAacEncoder();
+       if(aacEncoder == SettingsModel::AAC_ENCODER_NERO)
        {
                if(m_settings->neroAacNotificationsEnabled())
                {
@@ -1358,7 +1438,7 @@ void MainWindow::windowShown(void)
        }
        else
        {
-               if(m_settings->neroAacNotificationsEnabled() && (!(m_fhgEncoderAvailable || m_qaacEncoderAvailable)))
+               if(m_settings->neroAacNotificationsEnabled() && (aacEncoder <= SettingsModel::AAC_ENCODER_NONE))
                {
                        QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
                        if(appPath.isEmpty()) appPath = QCoreApplication::applicationDirPath();
@@ -1384,7 +1464,7 @@ void MainWindow::windowShown(void)
                if(!arguments[i].compare("--add", Qt::CaseInsensitive))
                {
                        QFileInfo currentFile(arguments[++i].trimmed());
-                       qDebug("Adding file from CLI: %s", currentFile.absoluteFilePath().toUtf8().constData());
+                       qDebug("Adding file from CLI: %s", MUTILS_UTF8(currentFile.absoluteFilePath()));
                        addedFiles.append(currentFile.absoluteFilePath());
                }
                if(!addedFiles.isEmpty())
@@ -1399,13 +1479,13 @@ void MainWindow::windowShown(void)
                if(!arguments[i].compare("--add-folder", Qt::CaseInsensitive))
                {
                        QFileInfo currentFile(arguments[++i].trimmed());
-                       qDebug("Adding folder from CLI: %s", currentFile.absoluteFilePath().toUtf8().constData());
+                       qDebug("Adding folder from CLI: %s", MUTILS_UTF8(currentFile.absoluteFilePath()));
                        addFolder(currentFile.absoluteFilePath(), false, true);
                }
                if(!arguments[i].compare("--add-recursive", Qt::CaseInsensitive))
                {
                        QFileInfo currentFile(arguments[++i].trimmed());
-                       qDebug("Adding folder recursively from CLI: %s", currentFile.absoluteFilePath().toUtf8().constData());
+                       qDebug("Adding folder recursively from CLI: %s", MUTILS_UTF8(currentFile.absoluteFilePath()));
                        addFolder(currentFile.absoluteFilePath(), true, true);
                }
        }
@@ -1475,10 +1555,10 @@ void MainWindow::showAnnounceBox(void)
        for(unsigned int i = 0; i < timeout; i++)
        {
                timers[i]->stop();
-               LAMEXP_DELETE(timers[i]);
+               MUTILS_DELETE(timers[i]);
        }
 
-       LAMEXP_DELETE(announceBox);
+       MUTILS_DELETE(announceBox);
 }
 
 // =========================================================
@@ -1503,7 +1583,7 @@ void MainWindow::encodeButtonClicked(void)
                return;
        }
        
-       QString tempFolder = m_settings->customTempPathEnabled() ? m_settings->customTempPath() : lamexp_temp_folder2();
+       QString tempFolder = m_settings->customTempPathEnabled() ? m_settings->customTempPath() : MUtils::temp_folder();
        if(!QFileInfo(tempFolder).exists() || !QFileInfo(tempFolder).isDir())
        {
                if(QMessageBox::warning(this, tr("Not Found"), QString("%1<br><tt>%2</tt>").arg(NOBR(tr("Your currently selected TEMP folder does not exist anymore:")), NOBR(QDir::toNativeSeparators(tempFolder))), tr("Restore Default"), tr("Cancel")) == 0)
@@ -1520,7 +1600,7 @@ void MainWindow::encodeButtonClicked(void)
        {
                QStringList tempFolderParts = tempFolder.split("/", QString::SkipEmptyParts, Qt::CaseInsensitive);
                tempFolderParts.takeLast();
-               if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
+               PLAY_SOUND_OPTIONAL("whammy", false);
                QString lowDiskspaceMsg = QString("%1<br>%2<br><br>%3<br>%4<br>").arg
                (
                        NOBR(tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.").arg(QString::number(minimumFreeDiskspaceMultiplier))),
@@ -1531,7 +1611,7 @@ void MainWindow::encodeButtonClicked(void)
                switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), lowDiskspaceMsg, tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore")))
                {
                case 1:
-                       QProcess::startDetached(QString("%1/cleanmgr.exe").arg(lamexp_known_folder(lamexp_folder_systemfolder)), QStringList() << "/D" << tempFolderParts.first());
+                       QProcess::startDetached(QString("%1/cleanmgr.exe").arg(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEMFOLDER)), QStringList() << "/D" << tempFolderParts.first());
                case 0:
                        return;
                        break;
@@ -1550,6 +1630,7 @@ void MainWindow::encodeButtonClicked(void)
        case SettingsModel::FLACEncoder:
        case SettingsModel::OpusEncoder:
        case SettingsModel::DCAEncoder:
+       case SettingsModel::MACEncoder:
        case SettingsModel::PCMEncoder:
                break;
        default:
@@ -1560,7 +1641,7 @@ void MainWindow::encodeButtonClicked(void)
 
        if(!m_settings->outputToSourceDir())
        {
-               QFile writeTest(QString("%1/~%2.txt").arg(m_settings->outputDir(), lamexp_rand_str()));
+               QFile writeTest(QString("%1/~%2.txt").arg(m_settings->outputDir(), MUtils::rand_str()));
                if(!(writeTest.open(QIODevice::ReadWrite) && (writeTest.write(writeTestBuffer) == strlen(writeTestBuffer))))
                {
                        QMessageBox::warning(this, tr("LameXP"), QString("%1<br><nobr>%2</nobr><br><br>%3").arg(tr("Cannot write to the selected output directory."), m_settings->outputDir(), tr("Please choose a different directory!")));
@@ -1573,7 +1654,7 @@ void MainWindow::encodeButtonClicked(void)
                        writeTest.remove();
                }
        }
-               
+
        m_accepted = true;
        close();
 }
@@ -1589,7 +1670,7 @@ void MainWindow::aboutButtonClicked(void)
        (
                AboutDialog *aboutBox = new AboutDialog(m_settings, this);
                aboutBox->exec();
-               LAMEXP_DELETE(aboutBox);
+               MUTILS_DELETE(aboutBox);
        );
 }
 
@@ -1609,10 +1690,11 @@ void MainWindow::closeButtonClicked(void)
 /*
  * Tab page changed
  */
-void MainWindow::tabPageChanged(int idx)
+void MainWindow::tabPageChanged(int idx, const bool silent)
 {
        resizeEvent(NULL);
        
+       //Update "view" menu
        QList<QAction*> actions = m_tabActionGroup->actions();
        for(int i = 0; i < actions.count(); i++)
        {
@@ -1624,6 +1706,12 @@ void MainWindow::tabPageChanged(int idx)
                }
        }
 
+       //Play tick sound
+       if(!silent)
+       {
+               PLAY_SOUND_OPTIONAL("tick", true);
+       }
+
        int initialWidth = this->width();
        int maximumWidth = QApplication::desktop()->availableGeometry().width();
 
@@ -1691,6 +1779,21 @@ void MainWindow::tabActionActivated(QAction *action)
 }
 
 // =========================================================
+// Menubar slots
+// =========================================================
+
+/*
+ * Handle corner widget Event
+ */
+void MainWindow::cornerWidgetEventOccurred(QWidget *sender, QEvent *event)
+{
+       if(event->type() == QEvent::MouseButtonPress)
+       {
+               QTimer::singleShot(0, this, SLOT(checkUpdatesActionActivated()));
+       }
+}
+
+// =========================================================
 // View menu slots
 // =========================================================
 
@@ -1751,13 +1854,17 @@ void MainWindow::styleActionActivated(QAction *action)
        if(QEvent *e = new QEvent(QEvent::LanguageChange))
        {
                changeEvent(e);
-               LAMEXP_DELETE(e);
+               MUTILS_DELETE(e);
        }
 
        //Make transparent
        const type_info &styleType = typeid(*qApp->style());
        const bool bTransparent = ((typeid(QWindowsVistaStyle) == styleType) || (typeid(QWindowsXPStyle) == styleType));
        MAKE_TRANSPARENT(ui->scrollArea, bTransparent);
+
+       //Also force a re-size event
+       QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+       resizeEvent(NULL);
 }
 
 /*
@@ -1952,7 +2059,16 @@ void MainWindow::importCueSheetActionTriggered(bool checked)
                                m_settings->mostRecentInputPath(QFileInfo(selectedCueFile).canonicalPath());
                                CueImportDialog *cueImporter  = new CueImportDialog(this, m_fileListModel, selectedCueFile, m_settings);
                                result = cueImporter->exec();
-                               LAMEXP_DELETE(cueImporter);
+                               MUTILS_DELETE(cueImporter);
+                       }
+
+                       if(result == QDialog::Accepted)
+                       {
+                               qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+                               ui->sourceFileView->update();
+                               qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+                               ui->sourceFileView->scrollToBottom();
+                               qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
                        }
 
                        if(result != (-1)) break;
@@ -1970,6 +2086,7 @@ void MainWindow::showDropBoxWidgetActionTriggered(bool checked)
        if(!m_dropBox->isVisible())
        {
                m_dropBox->show();
+               QTimer::singleShot(2500, m_dropBox, SLOT(showToolTip()));
        }
        
        lamexp_blink_window(m_dropBox);
@@ -2109,7 +2226,7 @@ void MainWindow::documentActionActivated(void)
                        else
                        {
                                QFile source(resource.filePath());
-                               QFile output(QString("%1/%2.%3.html").arg(lamexp_temp_folder2(), document.baseName(), lamexp_rand_str().left(8)));
+                               QFile output(QString("%1/%2.%3.html").arg(MUtils::temp_folder(), document.baseName(), MUtils::rand_str().left(8)));
                                if(source.open(QIODevice::ReadOnly) && output.open(QIODevice::ReadWrite))
                                {
                                        output.write(source.readAll());
@@ -2298,6 +2415,7 @@ void MainWindow::showDetailsButtonClicked(void)
                        iResult = metaInfoDialog->exec(file, index.row() > 0, index.row() < m_fileListModel->rowCount() - 1);
                );
                
+               //Copy all info to Meta Info tab
                if(iResult == INT_MAX)
                {
                        m_metaInfoModel->assignInfoFrom(file);
@@ -2308,7 +2426,7 @@ void MainWindow::showDetailsButtonClicked(void)
                if(!iResult) break;
        }
 
-       LAMEXP_DELETE(metaInfoDialog);
+       MUTILS_DELETE(metaInfoDialog);
        QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
        sourceFilesScrollbarMoved(0);
 }
@@ -2343,45 +2461,17 @@ void MainWindow::sourceFilesScrollbarMoved(int)
  */
 void MainWindow::previewContextActionTriggered(void)
 {
-       const static char *appNames[3] = {"smplayer_portable.exe", "smplayer.exe", "mplayer.exe"};
-       const static wchar_t *registryKey = L"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}";
-       
        QModelIndex index = ui->sourceFileView->currentIndex();
        if(!index.isValid())
        {
                return;
        }
 
-       QString mplayerPath;
-       HKEY registryKeyHandle;
-
-       if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, registryKey, 0, KEY_READ, &registryKeyHandle) == ERROR_SUCCESS)
+       if(!lamexp_open_media_file(m_fileListModel->getFile(index).filePath()))
        {
-               wchar_t Buffer[4096];
-               DWORD BuffSize = sizeof(wchar_t*) * 4096;
-               if(RegQueryValueExW(registryKeyHandle, L"InstallLocation", 0, 0, reinterpret_cast<BYTE*>(Buffer), &BuffSize) == ERROR_SUCCESS)
-               {
-                       mplayerPath = QString::fromUtf16(reinterpret_cast<const unsigned short*>(Buffer));
-               }
+               qDebug("Player not found, falling back to default application...");
+               QDesktopServices::openUrl(QString("file:///").append(m_fileListModel->getFile(index).filePath()));
        }
-
-       if(!mplayerPath.isEmpty())
-       {
-               QDir mplayerDir(mplayerPath);
-               if(mplayerDir.exists())
-               {
-                       for(int i = 0; i < 3; i++)
-                       {
-                               if(mplayerDir.exists(appNames[i]))
-                               {
-                                       QProcess::startDetached(mplayerDir.absoluteFilePath(appNames[i]), QStringList() << QDir::toNativeSeparators(m_fileListModel->getFile(index).filePath()));
-                                       return;
-                               }
-                       }
-               }
-       }
-       
-       QDesktopServices::openUrl(QString("file:///").append(m_fileListModel->getFile(index).filePath()));
 }
 
 /*
@@ -2394,7 +2484,7 @@ void MainWindow::findFileContextActionTriggered(void)
        {
                QString systemRootPath;
 
-               QDir systemRoot(lamexp_known_folder(lamexp_folder_systemfolder));
+               QDir systemRoot(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEMFOLDER));
                if(systemRoot.exists() && systemRoot.cdUp())
                {
                        systemRootPath = systemRoot.canonicalPath();
@@ -2417,6 +2507,73 @@ void MainWindow::findFileContextActionTriggered(void)
 }
 
 /*
+ * Add all dropped files
+ */
+void MainWindow::handleDroppedFiles(void)
+{
+       ABORT_IF_BUSY;
+
+       static const int MIN_COUNT = 16;
+       const QString bannerText = tr("Loading dropped files or folders, please wait...");
+       bool bUseBanner = false;
+
+       SHOW_BANNER_CONDITIONALLY(bUseBanner, (m_droppedFileList->count() >= MIN_COUNT), bannerText);
+
+       QStringList droppedFiles;
+       while(!m_droppedFileList->isEmpty())
+       {
+               QFileInfo file(m_droppedFileList->takeFirst().toLocalFile());
+               QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+
+               if(!file.exists())
+               {
+                       continue;
+               }
+
+               if(file.isFile())
+               {
+                       qDebug("Dropped File: %s", MUTILS_UTF8(file.canonicalFilePath()));
+                       droppedFiles << file.canonicalFilePath();
+                       continue;
+               }
+
+               if(file.isDir())
+               {
+                       qDebug("Dropped Folder: %s", MUTILS_UTF8(file.canonicalFilePath()));
+                       QFileInfoList list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks);
+                       if(list.count() > 0)
+                       {
+                               SHOW_BANNER_CONDITIONALLY(bUseBanner, (list.count() >= MIN_COUNT), bannerText);
+                               for(QFileInfoList::ConstIterator iter = list.constBegin(); iter != list.constEnd(); iter++)
+                               {
+                                       droppedFiles << (*iter).canonicalFilePath();
+                               }
+                       }
+                       else
+                       {
+                               list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
+                               SHOW_BANNER_CONDITIONALLY(bUseBanner, (list.count() >= MIN_COUNT), bannerText);
+                               for(QFileInfoList::ConstIterator iter = list.constBegin(); iter != list.constEnd(); iter++)
+                               {
+                                       qDebug("Descending to Folder: %s", MUTILS_UTF8((*iter).canonicalFilePath()));
+                                       m_droppedFileList->prepend(QUrl::fromLocalFile((*iter).canonicalFilePath()));
+                               }
+                       }
+               }
+       }
+       
+       if(bUseBanner)
+       {
+               m_banner->close();
+       }
+
+       if(!droppedFiles.isEmpty())
+       {
+               addFiles(droppedFiles);
+       }
+}
+
+/*
  * Add all pending files
  */
 void MainWindow::handleDelayedFiles(void)
@@ -2428,15 +2585,16 @@ void MainWindow::handleDelayedFiles(void)
                return;
        }
 
-       if(m_banner->isVisible())
+       if(BANNER_VISIBLE)
        {
                m_delayedFileTimer->start(5000);
                return;
        }
-
+       
+       WITH_BLOCKED_SIGNALS(ui->tabWidget, setCurrentIndex, 0);
+       tabPageChanged(ui->tabWidget->currentIndex(), true);
+       
        QStringList selectedFiles;
-       ui->tabWidget->setCurrentIndex(0);
-
        while(!m_delayedFileList->isEmpty())
        {
                QFileInfo currentFile = QFileInfo(m_delayedFileList->takeFirst());
@@ -2703,7 +2861,7 @@ void MainWindow::gotoFavoriteFolder(void)
                }
                else
                {
-                       MessageBeep(MB_ICONERROR);
+                       lamexp_beep(lamexp_beep_error);
                        m_outputFolderFavoritesMenu->removeAction(item);
                        item->deleteLater();
                }
@@ -2726,36 +2884,38 @@ void MainWindow::makeFolderButtonClicked(void)
        QDir basePath(m_fileSystemModel->fileInfo(ui->outputFolderView->currentIndex()).absoluteFilePath());
        QString suggestedName = tr("New Folder");
 
-       if(!m_metaData->fileArtist().isEmpty() && !m_metaData->fileAlbum().isEmpty())
+       if(!m_metaData->artist().isEmpty() && !m_metaData->album().isEmpty())
        {
-               suggestedName = QString("%1 - %2").arg(m_metaData->fileArtist(), m_metaData->fileAlbum());
+               suggestedName = QString("%1 - %2").arg(m_metaData->artist(),m_metaData->album());
        }
-       else if(!m_metaData->fileArtist().isEmpty())
+       else if(!m_metaData->artist().isEmpty())
        {
-               suggestedName = m_metaData->fileArtist();
+               suggestedName = m_metaData->artist();
        }
-       else if(!m_metaData->fileAlbum().isEmpty())
+       else if(!m_metaData->album().isEmpty())
        {
-               suggestedName = m_metaData->fileAlbum();
+               suggestedName =m_metaData->album();
        }
        else
        {
                for(int i = 0; i < m_fileListModel->rowCount(); i++)
                {
-                       AudioFileModel audioFile = m_fileListModel->getFile(m_fileListModel->index(i, 0));
-                       if(!audioFile.fileAlbum().isEmpty() || !audioFile.fileArtist().isEmpty())
+                       const AudioFileModel &audioFile = m_fileListModel->getFile(m_fileListModel->index(i, 0));
+                       const AudioFileModel_MetaInfo &fileMetaInfo = audioFile.metaInfo();
+
+                       if(!fileMetaInfo.album().isEmpty() || !fileMetaInfo.artist().isEmpty())
                        {
-                               if(!audioFile.fileArtist().isEmpty() && !audioFile.fileAlbum().isEmpty())
+                               if(!fileMetaInfo.artist().isEmpty() && !fileMetaInfo.album().isEmpty())
                                {
-                                       suggestedName = QString("%1 - %2").arg(audioFile.fileArtist(), audioFile.fileAlbum());
+                                       suggestedName = QString("%1 - %2").arg(fileMetaInfo.artist(), fileMetaInfo.album());
                                }
-                               else if(!audioFile.fileArtist().isEmpty())
+                               else if(!fileMetaInfo.artist().isEmpty())
                                {
-                                       suggestedName = audioFile.fileArtist();
+                                       suggestedName = fileMetaInfo.artist();
                                }
-                               else if(!audioFile.fileAlbum().isEmpty())
+                               else if(!fileMetaInfo.album().isEmpty())
                                {
-                                       suggestedName = audioFile.fileAlbum();
+                                       suggestedName = fileMetaInfo.album();
                                }
                                break;
                        }
@@ -2775,7 +2935,7 @@ void MainWindow::makeFolderButtonClicked(void)
 
                        if(folderName.isEmpty())
                        {
-                               MessageBeep(MB_ICONERROR);
+                               lamexp_beep(lamexp_beep_error);
                                continue;
                        }
 
@@ -2850,7 +3010,7 @@ void MainWindow::showFolderContextActionTriggered(void)
 
        QString path = QDir::toNativeSeparators(m_fileSystemModel->filePath(ui->outputFolderView->currentIndex()));
        if(!path.endsWith(QDir::separator())) path.append(QDir::separator());
-       ShellExecuteW(reinterpret_cast<HWND>(this->winId()), L"explore", QWCHAR(path), NULL, NULL, SW_SHOW);
+       lamexp_exec_shell(this, path, true);
 }
 
 /*
@@ -2879,7 +3039,7 @@ void MainWindow::goUpFolderContextActionTriggered(void)
                }
                else
                {
-                       MessageBeep(MB_ICONWARNING);
+                       lamexp_beep(lamexp_beep_warning);
                }
                CENTER_CURRENT_OUTPUT_FOLDER_DELAYED;
        }
@@ -2900,7 +3060,7 @@ void MainWindow::addFavoriteFolderActionTriggered(void)
        }
        else
        {
-               MessageBeep(MB_ICONWARNING);
+               lamexp_beep(lamexp_beep_warning);
        }
 
        m_settings->favoriteOutputFolders(favorites.join("|"));
@@ -2966,7 +3126,7 @@ void MainWindow::outputFolderEditFinished(void)
        ui->outputFolderLabel->setVisible(true);
        ui->outputFolderView->setEnabled(true);
 
-       if(!ok) MessageBeep(MB_ICONERROR);
+       if(!ok) lamexp_beep(lamexp_beep_error);
        CENTER_CURRENT_OUTPUT_FOLDER_DELAYED;
 }
 
@@ -2984,7 +3144,7 @@ void MainWindow::initOutputFolderModel(void)
                if(m_fileSystemModel)
                {
                        SET_MODEL(ui->outputFolderView, NULL);
-                       LAMEXP_DELETE(m_fileSystemModel);
+                       MUTILS_DELETE(m_fileSystemModel);
                        ui->outputFolderView->repaint();
                }
 
@@ -3121,7 +3281,7 @@ void MainWindow::outputFolderMouseEventOccurred(QWidget *sender, QEvent *event)
                        {
                                QString path = ui->outputFolderLabel->text();
                                if(!path.endsWith(QDir::separator())) path.append(QDir::separator());
-                               ShellExecuteW(reinterpret_cast<HWND>(this->winId()), L"explore", QWCHAR(path), NULL, NULL, SW_SHOW);
+                               lamexp_exec_shell(this, path, true);
                        }
                        break;
                case QEvent::Enter:
@@ -3182,7 +3342,7 @@ void MainWindow::outputFolderMouseEventOccurred(QWidget *sender, QEvent *event)
                                }
                                else
                                {
-                                       throw "Oups, this is not supposed to happen!";
+                                       THROW("Oups, this is not supposed to happen!");
                                }
                        }
                }
@@ -3208,7 +3368,7 @@ void MainWindow::editMetaButtonClicked(void)
        
                if(index.row() == 4)
                {
-                       m_settings->metaInfoPosition(m_metaData->filePosition());
+                       m_settings->metaInfoPosition(m_metaData->position());
                }
        }
 }
@@ -3247,71 +3407,44 @@ void MainWindow::playlistEnabledChanged(void)
  */
 void MainWindow::updateEncoder(int id)
 {
+       /*qWarning("\nupdateEncoder(%d)", id);*/
+
        m_settings->compressionEncoder(id);
+       const AbstractEncoderInfo *info = EncoderRegistry::getEncoderInfo(id);
 
-       switch(m_settings->compressionEncoder())
+       //Update UI controls
+       ui->radioButtonModeQuality       ->setEnabled(info->isModeSupported(SettingsModel::VBRMode));
+       ui->radioButtonModeAverageBitrate->setEnabled(info->isModeSupported(SettingsModel::ABRMode));
+       ui->radioButtonConstBitrate      ->setEnabled(info->isModeSupported(SettingsModel::CBRMode));
+       
+       //Initialize checkbox state
+       if(ui->radioButtonModeQuality->isEnabled())             ui->radioButtonModeQuality->setChecked(true);
+       else if(ui->radioButtonModeAverageBitrate->isEnabled()) ui->radioButtonModeAverageBitrate->setChecked(true);
+       else if(ui->radioButtonConstBitrate->isEnabled())       ui->radioButtonConstBitrate->setChecked(true);
+       else THROW("It appears that the encoder does not support *any* RC mode!");
+
+       //Apply current RC mode
+       const int currentRCMode = EncoderRegistry::loadEncoderMode(m_settings, id);
+       switch(currentRCMode)
        {
-       case SettingsModel::VorbisEncoder:
-               ui->radioButtonModeQuality->setEnabled(true);
-               ui->radioButtonModeAverageBitrate->setEnabled(true);
-               ui->radioButtonConstBitrate->setEnabled(false);
-               if(ui->radioButtonConstBitrate->isChecked()) ui->radioButtonModeQuality->setChecked(true);
-               ui->sliderBitrate->setEnabled(true);
-               break;
-       case SettingsModel::AC3Encoder:
-               ui->radioButtonModeQuality->setEnabled(true);
-               ui->radioButtonModeQuality->setChecked(true);
-               ui->radioButtonModeAverageBitrate->setEnabled(false);
-               ui->radioButtonConstBitrate->setEnabled(true);
-               ui->sliderBitrate->setEnabled(true);
-               break;
-       case SettingsModel::FLACEncoder:
-               ui->radioButtonModeQuality->setEnabled(false);
-               ui->radioButtonModeQuality->setChecked(true);
-               ui->radioButtonModeAverageBitrate->setEnabled(false);
-               ui->radioButtonConstBitrate->setEnabled(false);
-               ui->sliderBitrate->setEnabled(true);
-               break;
-       case SettingsModel::PCMEncoder:
-               ui->radioButtonModeQuality->setEnabled(false);
-               ui->radioButtonModeQuality->setChecked(true);
-               ui->radioButtonModeAverageBitrate->setEnabled(false);
-               ui->radioButtonConstBitrate->setEnabled(false);
-               ui->sliderBitrate->setEnabled(false);
-               break;
-       case SettingsModel::AACEncoder:
-               ui->radioButtonModeQuality->setEnabled(true);
-               ui->radioButtonModeAverageBitrate->setEnabled(!m_fhgEncoderAvailable);
-               if(m_fhgEncoderAvailable && ui->radioButtonModeAverageBitrate->isChecked()) ui->radioButtonConstBitrate->setChecked(true);
-               ui->radioButtonConstBitrate->setEnabled(true);
-               ui->sliderBitrate->setEnabled(true);
-               break;
-       case SettingsModel::DCAEncoder:
-               ui->radioButtonModeQuality->setEnabled(false);
-               ui->radioButtonModeAverageBitrate->setEnabled(false);
-               ui->radioButtonConstBitrate->setEnabled(true);
-               ui->radioButtonConstBitrate->setChecked(true);
-               ui->sliderBitrate->setEnabled(true);
-               break;
-       default:
-               ui->radioButtonModeQuality->setEnabled(true);
-               ui->radioButtonModeAverageBitrate->setEnabled(true);
-               ui->radioButtonConstBitrate->setEnabled(true);
-               ui->sliderBitrate->setEnabled(true);
-               break;
+               case SettingsModel::VBRMode: if(ui->radioButtonModeQuality->isEnabled())        ui->radioButtonModeQuality->setChecked(true);        break;
+               case SettingsModel::ABRMode: if(ui->radioButtonModeAverageBitrate->isEnabled()) ui->radioButtonModeAverageBitrate->setChecked(true); break;
+               case SettingsModel::CBRMode: if(ui->radioButtonConstBitrate->isEnabled())       ui->radioButtonConstBitrate->setChecked(true);       break;
+               default: THROW("updateEncoder(): Unknown rc-mode encountered!");
        }
 
-       if(m_settings->compressionEncoder() == SettingsModel::AACEncoder)
+       //Display encoder description
+       if(const char* description = info->description())
        {
-               const QString encoderName = m_qaacEncoderAvailable ? tr("QAAC (Apple)") : (m_fhgEncoderAvailable ? tr("FHG AAC (Winamp)") : (m_neroEncoderAvailable ? tr("Nero AAC") : tr("Not available!")));
                ui->labelEncoderInfo->setVisible(true);
-               ui->labelEncoderInfo->setText(tr("Current AAC Encoder: %1").arg(encoderName));
+               ui->labelEncoderInfo->setText(tr("Current Encoder: %1").arg(QString::fromUtf8(description)));
        }
        else
        {
                ui->labelEncoderInfo->setVisible(false);
        }
 
+       //Update RC mode!
        updateRCMode(m_modeButtonGroup->checkedId());
 }
 
@@ -3320,99 +3453,50 @@ void MainWindow::updateEncoder(int id)
  */
 void MainWindow::updateRCMode(int id)
 {
-       m_settings->compressionRCMode(id);
+       /*qWarning("updateRCMode(%d)", id);*/
 
-       switch(m_settings->compressionEncoder())
+       //Store new RC mode
+       const int currentEncoder = m_encoderButtonGroup->checkedId();
+       EncoderRegistry::saveEncoderMode(m_settings, currentEncoder, id);
+
+       //Fetch encoder info
+       const AbstractEncoderInfo *info = EncoderRegistry::getEncoderInfo(currentEncoder);
+       const int valueCount = info->valueCount(id);
+
+       //Sanity check
+       if(!info->isModeSupported(id))
        {
-       case SettingsModel::MP3Encoder:
-               switch(m_settings->compressionRCMode())
-               {
-               case SettingsModel::VBRMode:
-                       ui->sliderBitrate->setMinimum(0);
-                       ui->sliderBitrate->setMaximum(9);
-                       break;
-               default:
-                       ui->sliderBitrate->setMinimum(0);
-                       ui->sliderBitrate->setMaximum(13);
-                       break;
-               }
-               break;
-       case SettingsModel::VorbisEncoder:
-               switch(m_settings->compressionRCMode())
-               {
-               case SettingsModel::VBRMode:
-                       ui->sliderBitrate->setMinimum(-2);
-                       ui->sliderBitrate->setMaximum(10);
-                       break;
-               default:
-                       ui->sliderBitrate->setMinimum(4);
-                       ui->sliderBitrate->setMaximum(63);
-                       break;
-               }
-               break;
-       case SettingsModel::AC3Encoder:
-               switch(m_settings->compressionRCMode())
-               {
-               case SettingsModel::VBRMode:
-                       ui->sliderBitrate->setMinimum(0);
-                       ui->sliderBitrate->setMaximum(16);
-                       break;
-               default:
-                       ui->sliderBitrate->setMinimum(0);
-                       ui->sliderBitrate->setMaximum(18);
-                       break;
-               }
-               break;
-       case SettingsModel::AACEncoder:
-               switch(m_settings->compressionRCMode())
-               {
-               case SettingsModel::VBRMode:
-                       if(m_qaacEncoderAvailable)
-                       {
-                               ui->sliderBitrate->setMinimum(0);
-                               ui->sliderBitrate->setMaximum(32);
-                       }
-                       else if(m_fhgEncoderAvailable)
-                       {
-                               ui->sliderBitrate->setMinimum(1);
-                               ui->sliderBitrate->setMaximum(6);
-                       }
-                       else
-                       {
-                               ui->sliderBitrate->setMinimum(0);
-                               ui->sliderBitrate->setMaximum(20);
-                       }
-                       break;
-               default:
-                       ui->sliderBitrate->setMinimum(4);
-                       ui->sliderBitrate->setMaximum(63);
-                       break;
-               }
-               break;
-       case SettingsModel::FLACEncoder:
-               ui->sliderBitrate->setMinimum(0);
-               ui->sliderBitrate->setMaximum(8);
-               break;
-       case SettingsModel::OpusEncoder:
-               ui->sliderBitrate->setMinimum(1);
-               ui->sliderBitrate->setMaximum(32);
-               break;
-       case SettingsModel::DCAEncoder:
-               ui->sliderBitrate->setMinimum(1);
-               ui->sliderBitrate->setMaximum(128);
-               break;
-       case SettingsModel::PCMEncoder:
-               ui->sliderBitrate->setMinimum(0);
-               ui->sliderBitrate->setMaximum(2);
-               ui->sliderBitrate->setValue(1);
-               break;
-       default:
-               ui->sliderBitrate->setMinimum(0);
-               ui->sliderBitrate->setMaximum(0);
-               break;
+               qWarning("Attempting to use an unsupported RC mode (%d) with current encoder (%d)!", id, currentEncoder);
+               ui->labelBitrate->setText("(ERROR)");
+               return;
+       }
+
+       //Update slider min/max values
+       if(valueCount > 0)
+       {
+               WITH_BLOCKED_SIGNALS(ui->sliderBitrate, setEnabled, true);
+               WITH_BLOCKED_SIGNALS(ui->sliderBitrate, setMinimum, 0);
+               WITH_BLOCKED_SIGNALS(ui->sliderBitrate, setMaximum, valueCount-1);
+       }
+       else
+       {
+               WITH_BLOCKED_SIGNALS(ui->sliderBitrate, setEnabled, false);
+               WITH_BLOCKED_SIGNALS(ui->sliderBitrate, setMinimum, 0);
+               WITH_BLOCKED_SIGNALS(ui->sliderBitrate, setMaximum, 2);
        }
 
-       updateBitrate(ui->sliderBitrate->value());
+       //Now update bitrate/quality value!
+       if(valueCount > 0)
+       {
+               const int currentValue = EncoderRegistry::loadEncoderValue(m_settings, currentEncoder, id);
+               ui->sliderBitrate->setValue(qBound(0, currentValue, valueCount-1));
+               updateBitrate(qBound(0, currentValue, valueCount-1));
+       }
+       else
+       {
+               ui->sliderBitrate->setValue(1);
+               updateBitrate(0);
+       }
 }
 
 /*
@@ -3420,92 +3504,54 @@ void MainWindow::updateRCMode(int id)
  */
 void MainWindow::updateBitrate(int value)
 {
-       m_settings->compressionBitrate(value);
-       
-       switch(m_settings->compressionRCMode())
+       /*qWarning("updateBitrate(%d)", value);*/
+
+       //Load current encoder and RC mode
+       const int currentEncoder = m_encoderButtonGroup->checkedId();
+       const int currentRCMode = m_modeButtonGroup->checkedId();
+
+       //Fetch encoder info
+       const AbstractEncoderInfo *info = EncoderRegistry::getEncoderInfo(currentEncoder);
+       const int valueCount = info->valueCount(currentRCMode);
+
+       //Sanity check
+       if(!info->isModeSupported(currentRCMode))
        {
-       case SettingsModel::VBRMode:
-               switch(m_settings->compressionEncoder())
-               {
-               case SettingsModel::MP3Encoder:
-                       ui->labelBitrate->setText(tr("Quality Level %1").arg(9 - value));
-                       break;
-               case SettingsModel::VorbisEncoder:
-                       ui->labelBitrate->setText(tr("Quality Level %1").arg(value));
-                       break;
-               case SettingsModel::AACEncoder:
-                       if(m_qaacEncoderAvailable)
-                       {
-                               ui->labelBitrate->setText(tr("Quality Level %1").arg(QString::number(qBound(0, value * 4 , 127))));
-                       }
-                       else if(m_fhgEncoderAvailable)
-                       {
-                               ui->labelBitrate->setText(tr("Quality Level %1").arg(QString::number(value)));
-                       }
-                       else
-                       {
-                               ui->labelBitrate->setText(tr("Quality Level %1").arg(QString().sprintf("%.2f", static_cast<double>(value) / 20.0)));
-                       }
-                       break;
-               case SettingsModel::FLACEncoder:
-                       ui->labelBitrate->setText(tr("Compression %1").arg(value));
-                       break;
-               case SettingsModel::OpusEncoder:
-                       ui->labelBitrate->setText(QString("&asymp; %1 kbps").arg(qMin(500, value * 8)));
-                       break;
-               case SettingsModel::AC3Encoder:
-                       ui->labelBitrate->setText(tr("Quality Level %1").arg(qMin(1024, qMax(0, value * 64))));
-                       break;
-               case SettingsModel::PCMEncoder:
-                       ui->labelBitrate->setText(tr("Uncompressed"));
-                       break;
-               default:
-                       ui->labelBitrate->setText(QString::number(value));
-                       break;
-               }
+               qWarning("Attempting to use an unsupported RC mode (%d) with current encoder (%d)!", currentRCMode, currentEncoder);
+               ui->labelBitrate->setText("(ERROR)");
+               return;
+       }
+
+       //Store new bitrate value
+       if(valueCount > 0)
+       {
+               EncoderRegistry::saveEncoderValue(m_settings, currentEncoder, currentRCMode, qBound(0, value, valueCount-1));
+       }
+
+       //Update bitrate value
+       const int displayValue = (valueCount > 0) ? info->valueAt(currentRCMode, qBound(0, value, valueCount-1)) : INT_MAX;
+       switch(info->valueType(currentRCMode))
+       {
+       case AbstractEncoderInfo::TYPE_BITRATE:
+               ui->labelBitrate->setText(QString("%1 kbps").arg(QString::number(displayValue)));
                break;
-       case SettingsModel::ABRMode:
-               switch(m_settings->compressionEncoder())
-               {
-               case SettingsModel::MP3Encoder:
-                       ui->labelBitrate->setText(QString("&asymp; %1 kbps").arg(SettingsModel::mp3Bitrates[value]));
-                       break;
-               case SettingsModel::FLACEncoder:
-                       ui->labelBitrate->setText(tr("Compression %1").arg(value));
-                       break;
-               case SettingsModel::AC3Encoder:
-                       ui->labelBitrate->setText(QString("&asymp; %1 kbps").arg(SettingsModel::ac3Bitrates[value]));
-                       break;
-               case SettingsModel::PCMEncoder:
-                       ui->labelBitrate->setText(tr("Uncompressed"));
-                       break;
-               default:
-                       ui->labelBitrate->setText(QString("&asymp; %1 kbps").arg(qMin(500, value * 8)));
-                       break;
-               }
+       case AbstractEncoderInfo::TYPE_APPROX_BITRATE:
+               ui->labelBitrate->setText(QString("&asymp; %1 kbps").arg(QString::number(displayValue)));
+               break;
+       case AbstractEncoderInfo::TYPE_QUALITY_LEVEL_INT:
+               ui->labelBitrate->setText(tr("Quality Level %1").arg(QString::number(displayValue)));
+               break;
+       case AbstractEncoderInfo::TYPE_QUALITY_LEVEL_FLT:
+               ui->labelBitrate->setText(tr("Quality Level %1").arg(QString().sprintf("%.2f", double(displayValue)/100.0)));
+               break;
+       case AbstractEncoderInfo::TYPE_COMPRESSION_LEVEL:
+               ui->labelBitrate->setText(tr("Compression %1").arg(QString::number(displayValue)));
+               break;
+       case AbstractEncoderInfo::TYPE_UNCOMPRESSED:
+               ui->labelBitrate->setText(tr("Uncompressed"));
                break;
        default:
-               switch(m_settings->compressionEncoder())
-               {
-               case SettingsModel::MP3Encoder:
-                       ui->labelBitrate->setText(QString("%1 kbps").arg(SettingsModel::mp3Bitrates[value]));
-                       break;
-               case SettingsModel::FLACEncoder:
-                       ui->labelBitrate->setText(tr("Compression %1").arg(value));
-                       break;
-               case SettingsModel::AC3Encoder:
-                       ui->labelBitrate->setText(QString("%1 kbps").arg(SettingsModel::ac3Bitrates[value]));
-                       break;
-               case SettingsModel::DCAEncoder:
-                       ui->labelBitrate->setText(QString("%1 kbps").arg(value * 32));
-                       break;
-               case SettingsModel::PCMEncoder:
-                       ui->labelBitrate->setText(tr("Uncompressed"));
-                       break;
-               default:
-                       ui->labelBitrate->setText(QString("%1 kbps").arg(qMin(500, value * 8)));
-                       break;
-               }
+               THROW("Unknown display value type encountered!");
                break;
        }
 }
@@ -3521,6 +3567,14 @@ void MainWindow::compressionTabEventOccurred(QWidget *sender, QEvent *event)
        {
                QDesktopServices::openUrl(helpUrl);
        }
+       else if((sender == ui->labelResetEncoders) && (event->type() == QEvent::MouseButtonPress))
+       {
+               PLAY_SOUND_OPTIONAL("blast", true);
+               EncoderRegistry::resetAllEncoders(m_settings);
+               m_settings->compressionEncoder(SettingsModel::MP3Encoder);
+               ui->radioButtonEncoderMP3->setChecked(true);
+               QTimer::singleShot(0, this, SLOT(updateEncoder()));
+       }
 }
 
 // =========================================================
@@ -3700,7 +3754,7 @@ void MainWindow::normalizationMaxVolumeChanged(double value)
  */
 void MainWindow::normalizationModeChanged(int mode)
 {
-       m_settings->normalizationFilterEqualizationMode(mode);
+       m_settings->normalizationFilterEQMode(mode);
 }
 
 /*
@@ -3756,12 +3810,12 @@ void MainWindow::customParamsChanged(void)
        ui->labelCustomParamsText->setVisible(customParamsUsed);
        ui->labelCustomParamsSpacer->setVisible(customParamsUsed);
 
-       m_settings->customParametersLAME(ui->lineEditCustomParamLAME->text());
-       m_settings->customParametersOggEnc(ui->lineEditCustomParamOggEnc->text());
-       m_settings->customParametersAacEnc(ui->lineEditCustomParamNeroAAC->text());
-       m_settings->customParametersFLAC(ui->lineEditCustomParamFLAC->text());
-       m_settings->customParametersAften(ui->lineEditCustomParamAften->text());
-       m_settings->customParametersOpus(ui->lineEditCustomParamOpus->text());
+       EncoderRegistry::saveEncoderCustomParams(m_settings, SettingsModel::MP3Encoder,    ui->lineEditCustomParamLAME->text());
+       EncoderRegistry::saveEncoderCustomParams(m_settings, SettingsModel::VorbisEncoder, ui->lineEditCustomParamOggEnc->text());
+       EncoderRegistry::saveEncoderCustomParams(m_settings, SettingsModel::AACEncoder,    ui->lineEditCustomParamNeroAAC->text());
+       EncoderRegistry::saveEncoderCustomParams(m_settings, SettingsModel::FLACEncoder,   ui->lineEditCustomParamFLAC->text());
+       EncoderRegistry::saveEncoderCustomParams(m_settings, SettingsModel::AC3Encoder,    ui->lineEditCustomParamAften->text());
+       EncoderRegistry::saveEncoderCustomParams(m_settings, SettingsModel::OpusEncoder,   ui->lineEditCustomParamOpus->text());
 }
 
 /*
@@ -3785,7 +3839,7 @@ void MainWindow::renameOutputPatternChanged(void)
 /*
  * Rename output files patterm changed
  */
-void MainWindow::renameOutputPatternChanged(const QString &text)
+void MainWindow::renameOutputPatternChanged(const QString &text, bool silent)
 {
        QString pattern(text.simplified());
        
@@ -3797,24 +3851,26 @@ void MainWindow::renameOutputPatternChanged(const QString &text)
        pattern.replace("<Year>", "2001", Qt::CaseInsensitive);
        pattern.replace("<Comment>", "Encoded by LameXP", Qt::CaseInsensitive);
 
-       if(pattern.compare(lamexp_clean_filename(pattern)))
+       const QString patternClean = lamexp_clean_filename(pattern);
+
+       if(pattern.compare(patternClean))
        {
                if(ui->lineEditRenamePattern->palette().color(QPalette::Text) != Qt::red)
                {
-                       MessageBeep(MB_ICONERROR);
+                       if(!silent) lamexp_beep(lamexp_beep_error);
                        SET_TEXT_COLOR(ui->lineEditRenamePattern, Qt::red);
                }
        }
        else
        {
-               if(ui->lineEditRenamePattern->palette().color(QPalette::Text) != Qt::black)
+               if(ui->lineEditRenamePattern->palette() != QPalette())
                {
-                       MessageBeep(MB_ICONINFORMATION);
-                       SET_TEXT_COLOR(ui->lineEditRenamePattern, Qt::black);
+                       if(!silent) lamexp_beep(lamexp_beep_info);
+                       ui->lineEditRenamePattern->setPalette(QPalette());
                }
        }
 
-       ui->labelRanameExample->setText(lamexp_clean_filename(pattern));
+       ui->labelRanameExample->setText(patternClean);
 }
 
 /*
@@ -3891,7 +3947,7 @@ void MainWindow::browseCustomTempFolderButtonClicked(void)
 
        if(!newTempFolder.isEmpty())
        {
-               QFile writeTest(QString("%1/~%2.tmp").arg(newTempFolder, lamexp_rand_str()));
+               QFile writeTest(QString("%1/~%2.tmp").arg(newTempFolder, MUtils::rand_str()));
                if(writeTest.open(QIODevice::ReadWrite))
                {
                        writeTest.remove();
@@ -3943,15 +3999,18 @@ void MainWindow::customParamsHelpRequested(QWidget *obj, QEvent *event)
        else if(obj == ui->helpCustomParamOggEnc)  showCustomParamsHelpScreen("oggenc2.exe", "--help");
        else if(obj == ui->helpCustomParamNeroAAC)
        {
-               if(m_qaacEncoderAvailable)         showCustomParamsHelpScreen("qaac.exe", "--help");
-               else if(m_fhgEncoderAvailable)     showCustomParamsHelpScreen("fhgaacenc.exe", "");
-               else if(m_neroEncoderAvailable)    showCustomParamsHelpScreen("neroAacEnc.exe", "-help");
-               else MessageBeep(MB_ICONERROR);
+               switch(EncoderRegistry::getAacEncoder())
+               {
+                       case SettingsModel::AAC_ENCODER_QAAC: showCustomParamsHelpScreen("qaac.exe", "--help"); break;
+                       case SettingsModel::AAC_ENCODER_FHG : showCustomParamsHelpScreen("fhgaacenc.exe", ""); break;
+                       case SettingsModel::AAC_ENCODER_NERO: showCustomParamsHelpScreen("neroAacEnc.exe", "-help"); break;
+                       default: lamexp_beep(lamexp_beep_error); break;
+               }
        }
        else if(obj == ui->helpCustomParamFLAC)    showCustomParamsHelpScreen("flac.exe", "--help");
        else if(obj == ui->helpCustomParamAften)   showCustomParamsHelpScreen("aften.exe", "-h");
        else if(obj == ui->helpCustomParamOpus)    showCustomParamsHelpScreen("opusenc.exe", "--help");
-       else MessageBeep(MB_ICONERROR);
+       else lamexp_beep(lamexp_beep_error);
 }
 
 /*
@@ -3962,35 +4021,36 @@ void MainWindow::showCustomParamsHelpScreen(const QString &toolName, const QStri
        const QString binary = lamexp_lookup_tool(toolName);
        if(binary.isEmpty())
        {
-               MessageBeep(MB_ICONERROR);
+               lamexp_beep(lamexp_beep_error);
                qWarning("customParamsHelpRequested: Binary could not be found!");
                return;
        }
 
-       QProcess *process = new QProcess();
-       process->setProcessChannelMode(QProcess::MergedChannels);
-       process->setReadChannel(QProcess::StandardOutput);
-       process->start(binary, command.isEmpty() ? QStringList() : QStringList() << command);
+       QProcess process;
+       MUtils::init_process(process, QFileInfo(binary).absolutePath());
+
+       process.start(binary, command.isEmpty() ? QStringList() : QStringList() << command);
+
        qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
 
-       if(process->waitForStarted(15000))
+       if(process.waitForStarted(15000))
        {
                qApp->processEvents();
-               process->waitForFinished(15000);
+               process.waitForFinished(15000);
        }
        
-       if(process->state() != QProcess::NotRunning)
+       if(process.state() != QProcess::NotRunning)
        {
-               process->kill();
-               process->waitForFinished(-1);
+               process.kill();
+               process.waitForFinished(-1);
        }
 
        qApp->restoreOverrideCursor();
        QStringList output; bool spaceFlag = true;
 
-       while(process->canReadLine())
+       while(process.canReadLine())
        {
-               QString temp = QString::fromUtf8(process->readLine());
+               QString temp = QString::fromUtf8(process.readLine());
                TRIM_STRING_RIGHT(temp);
                if(temp.isEmpty())
                {
@@ -4002,17 +4062,15 @@ void MainWindow::showCustomParamsHelpScreen(const QString &toolName, const QStri
                }
        }
 
-       LAMEXP_DELETE(process);
-
        if(output.count() < 1)
        {
                qWarning("Empty output, cannot show help screen!");
-               MessageBeep(MB_ICONERROR);
+               lamexp_beep(lamexp_beep_error);
        }
 
        LogViewDialog *dialog = new LogViewDialog(this);
        TEMP_HIDE_DROPBOX( dialog->exec(output); );
-       LAMEXP_DELETE(dialog);
+       MUTILS_DELETE(dialog);
 }
 
 void MainWindow::overwriteModeChanged(int id)
@@ -4035,6 +4093,8 @@ void MainWindow::overwriteModeChanged(int id)
  */
 void MainWindow::resetAdvancedOptionsButtonClicked(void)
 {
+       PLAY_SOUND_OPTIONAL("blast", true);
+
        ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQualityDefault());
        ui->spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRateDefault());
        ui->spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRateDefault());
@@ -4048,8 +4108,9 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
        ui->comboBoxAACProfile->setCurrentIndex(m_settings->aacEncProfileDefault());
        ui->comboBoxAftenCodingMode->setCurrentIndex(m_settings->aftenAudioCodingModeDefault());
        ui->comboBoxAftenDRCMode->setCurrentIndex(m_settings->aftenDynamicRangeCompressionDefault());
-       ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEqualizationModeDefault());
+       ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEQModeDefault());
        ui->comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesizeDefault());
+
        SET_CHECKBOX_STATE(ui->checkBoxBitrateManagement, m_settings->bitrateManagementEnabledDefault());
        SET_CHECKBOX_STATE(ui->checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2PassDefault());
        SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilter, m_settings->normalizationFilterEnabledDefault());
@@ -4059,16 +4120,19 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
        SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabledDefault());
        SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmixDefault());
        SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResampleDefault());
-       ui->lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault());
-       ui->lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault());
+       
+       ui->lineEditCustomParamLAME   ->setText(m_settings->customParametersLAMEDefault());
+       ui->lineEditCustomParamOggEnc ->setText(m_settings->customParametersOggEncDefault());
        ui->lineEditCustomParamNeroAAC->setText(m_settings->customParametersAacEncDefault());
-       ui->lineEditCustomParamFLAC->setText(m_settings->customParametersFLACDefault());
-       ui->lineEditCustomParamOpus->setText(m_settings->customParametersFLACDefault());
-       ui->lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
-       ui->lineEditRenamePattern->setText(m_settings->renameOutputFilesPatternDefault());
+       ui->lineEditCustomParamFLAC   ->setText(m_settings->customParametersFLACDefault());
+       ui->lineEditCustomParamOpus   ->setText(m_settings->customParametersOpusEncDefault());
+       ui->lineEditCustomTempFolder  ->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
+       ui->lineEditRenamePattern     ->setText(m_settings->renameOutputFilesPatternDefault());
+
        if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_KeepBoth) ui->radioButtonOverwriteModeKeepBoth->click();
        if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_SkipFile) ui->radioButtonOverwriteModeSkipFile->click();
        if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_Replaces) ui->radioButtonOverwriteModeReplaces->click();
+
        customParamsChanged();
        ui->scrollArea->verticalScrollBar()->setValue(0);
 }
@@ -4082,7 +4146,7 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
  */
 void MainWindow::notifyOtherInstance(void)
 {
-       if(!m_banner->isVisible())
+       if(!(BANNER_VISIBLE))
        {
                QMessageBox msgBox(QMessageBox::Warning, tr("Already Running"), tr("LameXP is already running, please use the running instance!"), QMessageBox::NoButton, this, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint);
                msgBox.exec();
@@ -4096,13 +4160,13 @@ void MainWindow::addFileDelayed(const QString &filePath, bool tryASAP)
 {
        if(tryASAP && !m_delayedFileTimer->isActive())
        {
-               qDebug("Received file: %s", filePath.toUtf8().constData());
+               qDebug("Received file: %s", MUTILS_UTF8(filePath));
                m_delayedFileList->append(filePath);
                QTimer::singleShot(0, this, SLOT(handleDelayedFiles()));
        }
        
        m_delayedFileTimer->stop();
-       qDebug("Received file: %s", filePath.toUtf8().constData());
+       qDebug("Received file: %s", MUTILS_UTF8(filePath));
        m_delayedFileList->append(filePath);
        m_delayedFileTimer->start(5000);
 }
@@ -4112,7 +4176,7 @@ void MainWindow::addFileDelayed(const QString &filePath, bool tryASAP)
  */
 void MainWindow::addFilesDelayed(const QStringList &filePaths, bool tryASAP)
 {
-       if(tryASAP && !m_delayedFileTimer->isActive())
+       if(tryASAP && (!m_delayedFileTimer->isActive()))
        {
                qDebug("Received %d file(s).", filePaths.count());
                m_delayedFileList->append(filePaths);
@@ -4132,7 +4196,7 @@ void MainWindow::addFilesDelayed(const QStringList &filePaths, bool tryASAP)
  */
 void MainWindow::addFolderDelayed(const QString &folderPath, bool recursive)
 {
-       if(!m_banner->isVisible())
+       if(!(BANNER_VISIBLE))
        {
                addFolder(folderPath, recursive, true);
        }