Added an option to check for "Beta" (pre-release) updates in "Final" releases. Disabled by default, not available in "Beta" versions (Beta versions always check for Beta updates).

This commit is contained in:
LoRd_MuldeR 2011-05-03 14:28:06 +02:00
parent fe33e70247
commit 5ce0c7b82e
23 changed files with 417 additions and 133 deletions

View File

@ -24,7 +24,7 @@ a:visited { color: #0000EE; }
<li>Updated Qt runtime libraries to v4.7.3 <li>Updated Qt runtime libraries to v4.7.3
<li>Updated LAME encoder to v3.99.1.0 (2011-04-15), compiled with ICL 12.0.3 and MSVC 10.0 (<a href="http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/history.html?revision=1.127" target="_blank">details</a>) <li>Updated LAME encoder to v3.99.1.0 (2011-04-15), compiled with ICL 12.0.3 and MSVC 10.0 (<a href="http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/history.html?revision=1.127" target="_blank">details</a>)
<li>Updated mpg123 decoder to v1.13.3 (2011-04-21), compiled with GCC 4.6.0 <li>Updated mpg123 decoder to v1.13.3 (2011-04-21), compiled with GCC 4.6.0
<li>Updated MediaInfo to v0.7.44 (2011-04-19), compiled with ICL 12.0.3 and MSVC 10.0 <li>Updated MediaInfo to v0.7.45 Beta (2011-05-02), compiled with ICL 12.0.3 and MSVC 10.0
<li>Updated language files (big thank-you to all contributors !!!) <li>Updated language files (big thank-you to all contributors !!!)
<li>Fixed placement of the Dropbox when the Taskbar is located on the top or on the left side <li>Fixed placement of the Dropbox when the Taskbar is located on the top or on the left side
</ul><br> </ul><br>

View File

@ -788,6 +788,10 @@
<source>Open Folder Recursively...</source> <source>Open Folder Recursively...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Adding file(s), please wait...</source> <source>Adding file(s), please wait...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1228,6 +1232,30 @@
<source>The WMA Decoder notifications have been re-enabled.</source> <source>The WMA Decoder notifications have been re-enabled.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Shell Integration</source> <source>Shell Integration</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@ -1245,6 +1245,34 @@
<source>Add Folder</source> <source>Add Folder</source>
<translation>Verzeichnis hinzufügen</translation> <translation>Verzeichnis hinzufügen</translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation>Nach Beta-Updates suchen</translation>
</message>
<message>
<source>Beta Updates</source>
<translation>Beta Updates</translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation>Möchten Sie wirklich, dass LameXP nach Beta (Entwickler) Updates sucht?</translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation>LameXP wird fortan nach Beta (Entwickler) Updates suchen.</translation>
</message>
<message>
<source>Check Now</source>
<translation>Jetzt suchen</translation>
</message>
<message>
<source>Discard</source>
<translation>Schließen</translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation>LameXP wird fortan &lt;i&gt;nicht&lt;/i&gt; nach Beta (Entwickler) Updates suchen.</translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -1244,6 +1244,34 @@
<source>Add Folder</source> <source>Add Folder</source>
<translation>Añadir carpeta</translation> <translation>Añadir carpeta</translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -1254,6 +1254,34 @@ Ouvrir le dossier récursivement...</translation>
<source>Add Folder</source> <source>Add Folder</source>
<translation>Ajouter un dossier</translation> <translation>Ajouter un dossier</translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished">Abandonner</translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -1245,6 +1245,34 @@
<source>Add Folder</source> <source>Add Folder</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished">Annulla</translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -1244,6 +1244,34 @@
<source>The LameXP shell integration has been re-enabled.</source> <source>The LameXP shell integration has been re-enabled.</source>
<translation type="unfinished">LameXP .</translation> <translation type="unfinished">LameXP .</translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -1246,6 +1246,34 @@
<source>Help &amp;&amp; Support</source> <source>Help &amp;&amp; Support</source>
<translation type="unfinished">Помощиь и поддержка</translation> <translation type="unfinished">Помощиь и поддержка</translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished">Отменить</translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -1244,6 +1244,34 @@
<source>Cannot write to the selected directory. Please choose another directory!</source> <source>Cannot write to the selected directory. Please choose another directory!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Check for Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beta Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want LameXP to check for Beta (pre-release) updates?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LameXP will check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check Now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Discard</source>
<translation type="unfinished">Відмінити</translation>
</message>
<message>
<source>LameXP will &lt;i&gt;not&lt;/i&gt; check for Beta (pre-release) updates from now on.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>

View File

@ -2793,6 +2793,8 @@
<addaction name="actionDisableWmaDecoderNotifications"/> <addaction name="actionDisableWmaDecoderNotifications"/>
<addaction name="actionDisableNeroAacNotifications"/> <addaction name="actionDisableNeroAacNotifications"/>
<addaction name="actionDisableShellIntegration"/> <addaction name="actionDisableShellIntegration"/>
<addaction name="separator"/>
<addaction name="actionCheckForBetaUpdates"/>
</widget> </widget>
<addaction name="menuConfiguration"/> <addaction name="menuConfiguration"/>
<addaction name="actionInstallWMADecoder"/> <addaction name="actionInstallWMADecoder"/>
@ -3085,6 +3087,14 @@
<string>Open Folder Recursively...</string> <string>Open Folder Recursively...</string>
</property> </property>
</action> </action>
<action name="actionCheckForBetaUpdates">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Check for Beta Updates</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="../res/Icons.qrc"/> <include location="../res/Icons.qrc"/>
@ -3153,6 +3163,7 @@
<include location="../res/Icons.qrc"/> <include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/> <include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/> <include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -29,8 +29,8 @@
#define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_MINOR_LO 2
#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 8 #define VER_LAMEXP_PATCH 10
#define VER_LAMEXP_BUILD 474 #define VER_LAMEXP_BUILD 476
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Tools versions // Tools versions

View File

@ -319,6 +319,8 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
actionDisableWmaDecoderNotifications->setChecked(!m_settings->wmaDecoderNotificationsEnabled()); actionDisableWmaDecoderNotifications->setChecked(!m_settings->wmaDecoderNotificationsEnabled());
actionDisableShellIntegration->setChecked(!m_settings->shellIntegrationEnabled()); actionDisableShellIntegration->setChecked(!m_settings->shellIntegrationEnabled());
actionDisableShellIntegration->setDisabled(lamexp_portable_mode() && actionDisableShellIntegration->isChecked()); actionDisableShellIntegration->setDisabled(lamexp_portable_mode() && actionDisableShellIntegration->isChecked());
actionCheckForBetaUpdates->setChecked(m_settings->autoUpdateCheckBeta() || lamexp_version_demo());
actionCheckForBetaUpdates->setEnabled(!lamexp_version_demo());
connect(actionDisableUpdateReminder, SIGNAL(triggered(bool)), this, SLOT(disableUpdateReminderActionTriggered(bool))); connect(actionDisableUpdateReminder, SIGNAL(triggered(bool)), this, SLOT(disableUpdateReminderActionTriggered(bool)));
connect(actionDisableSounds, SIGNAL(triggered(bool)), this, SLOT(disableSoundsActionTriggered(bool))); connect(actionDisableSounds, SIGNAL(triggered(bool)), this, SLOT(disableSoundsActionTriggered(bool)));
connect(actionInstallWMADecoder, SIGNAL(triggered(bool)), this, SLOT(installWMADecoderActionTriggered(bool))); connect(actionInstallWMADecoder, SIGNAL(triggered(bool)), this, SLOT(installWMADecoderActionTriggered(bool)));
@ -326,6 +328,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(actionDisableWmaDecoderNotifications, SIGNAL(triggered(bool)), this, SLOT(disableWmaDecoderNotificationsActionTriggered(bool))); connect(actionDisableWmaDecoderNotifications, SIGNAL(triggered(bool)), this, SLOT(disableWmaDecoderNotificationsActionTriggered(bool)));
connect(actionDisableShellIntegration, SIGNAL(triggered(bool)), this, SLOT(disableShellIntegrationActionTriggered(bool))); connect(actionDisableShellIntegration, SIGNAL(triggered(bool)), this, SLOT(disableShellIntegrationActionTriggered(bool)));
connect(actionShowDropBoxWidget, SIGNAL(triggered(bool)), this, SLOT(showDropBoxWidgetActionTriggered(bool))); connect(actionShowDropBoxWidget, SIGNAL(triggered(bool)), this, SLOT(showDropBoxWidgetActionTriggered(bool)));
connect(actionCheckForBetaUpdates, SIGNAL(triggered(bool)), this, SLOT(checkForBetaUpdatesActionTriggered(bool)));
//Activate help menu actions //Activate help menu actions
actionVisitHomepage->setData(QString::fromLatin1(lamexp_website_url())); actionVisitHomepage->setData(QString::fromLatin1(lamexp_website_url()));
@ -2474,6 +2477,45 @@ void MainWindow::showDropBoxWidgetActionTriggered(bool checked)
FLASH_WINDOW(m_dropBox); FLASH_WINDOW(m_dropBox);
} }
/*
* Check for beta (pre-release) updates
*/
void MainWindow::checkForBetaUpdatesActionTriggered(bool checked)
{
bool checkUpdatesNow = false;
if(checked)
{
if(0 == QMessageBox::question(this, tr("Beta Updates"), tr("Do you really want LameXP to check for Beta (pre-release) updates?"), tr("Yes"), tr("No"), QString(), 1))
{
if(0 == QMessageBox::information(this, tr("Beta Updates"), tr("LameXP will check for Beta (pre-release) updates from now on."), tr("Check Now"), tr("Discard")))
{
checkUpdatesNow = true;
}
m_settings->autoUpdateCheckBeta(true);
}
else
{
m_settings->autoUpdateCheckBeta(false);
}
}
else
{
QMessageBox::information(this, tr("Beta Updates"), tr("LameXP will <i>not</i> check for Beta (pre-release) updates from now on."));
m_settings->autoUpdateCheckBeta(false);
}
actionCheckForBetaUpdates->setChecked(m_settings->autoUpdateCheckBeta());
if(checkUpdatesNow)
{
if(checkForUpdates())
{
QApplication::quit();
}
}
}
/* /*
* Disable shell integration action * Disable shell integration action
*/ */

View File

@ -117,6 +117,7 @@ private slots:
void disableNeroAacNotificationsActionTriggered(bool checked); void disableNeroAacNotificationsActionTriggered(bool checked);
void disableWmaDecoderNotificationsActionTriggered(bool checked); void disableWmaDecoderNotificationsActionTriggered(bool checked);
void showDropBoxWidgetActionTriggered(bool checked); void showDropBoxWidgetActionTriggered(bool checked);
void checkForBetaUpdatesActionTriggered(bool checked);
void disableShellIntegrationActionTriggered(bool); void disableShellIntegrationActionTriggered(bool);
protected: protected:

View File

@ -123,6 +123,7 @@ UpdateDialog::UpdateDialog(SettingsModel *settings, QWidget *parent)
m_updateInfo(NULL), m_updateInfo(NULL),
m_settings(settings), m_settings(settings),
m_logFile(new QStringList()), m_logFile(new QStringList()),
m_betaUpdates(settings ? (settings->autoUpdateCheckBeta() || lamexp_version_demo()) : lamexp_version_demo()),
m_success(false), m_success(false),
m_updateReadyToInstall(false) m_updateReadyToInstall(false)
{ {
@ -409,10 +410,10 @@ bool UpdateDialog::tryUpdateMirror(UpdateInfo *updateInfo, const QString &url)
QString outFileSignature = QString("%1/%2.sig").arg(lamexp_temp_folder2(), randPart); QString outFileSignature = QString("%1/%2.sig").arg(lamexp_temp_folder2(), randPart);
m_logFile->append(QStringList() << "" << "Downloading update info:"); m_logFile->append(QStringList() << "" << "Downloading update info:");
bool ok1 = getFile(QString("%1%2").arg(url, mirror_url_postfix[lamexp_version_demo() ? 1 : 0]), outFileVersionInfo); bool ok1 = getFile(QString("%1%2").arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileVersionInfo);
m_logFile->append(QStringList() << "" << "Downloading signature:"); m_logFile->append(QStringList() << "" << "Downloading signature:");
bool ok2 = getFile(QString("%1%2.sig").arg(url, mirror_url_postfix[lamexp_version_demo() ? 1 : 0]), outFileSignature); bool ok2 = getFile(QString("%1%2.sig").arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileSignature);
if(ok1 && ok2) if(ok1 && ok2)
{ {

View File

@ -53,6 +53,8 @@ protected:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
const bool m_betaUpdates;
private: private:
bool tryUpdateMirror(UpdateInfo *updateInfo, const QString &url); bool tryUpdateMirror(UpdateInfo *updateInfo, const QString &url);
bool getFile(const QString &url, const QString &outFile); bool getFile(const QString &url, const QString &outFile);

View File

@ -38,27 +38,27 @@
//Macros //Macros
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#define MAKE_OPTION1(OPT,DEF) \ #define LAMEXP_MAKE_OPTION_I(OPT,DEF) \
int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toInt(); } \ int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toInt(); } \
void SettingsModel::OPT(int value) { m_settings->setValue(g_settingsId_##OPT, value); } \ void SettingsModel::OPT(int value) { m_settings->setValue(g_settingsId_##OPT, value); } \
int SettingsModel::OPT##Default(void) { return DEF; } int SettingsModel::OPT##Default(void) { return DEF; }
#define MAKE_OPTION2(OPT,DEF) \ #define LAMEXP_MAKE_OPTION_S(OPT,DEF) \
QString SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toString().trimmed(); } \ QString SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toString().trimmed(); } \
void SettingsModel::OPT(const QString &value) { m_settings->setValue(g_settingsId_##OPT, value); } \ void SettingsModel::OPT(const QString &value) { m_settings->setValue(g_settingsId_##OPT, value); } \
QString SettingsModel::OPT##Default(void) { return DEF; } QString SettingsModel::OPT##Default(void) { return DEF; }
#define MAKE_OPTION3(OPT,DEF) \ #define LAMEXP_MAKE_OPTION_B(OPT,DEF) \
bool SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toBool(); } \ bool SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toBool(); } \
void SettingsModel::OPT(bool value) { m_settings->setValue(g_settingsId_##OPT, value); } \ void SettingsModel::OPT(bool value) { m_settings->setValue(g_settingsId_##OPT, value); } \
bool SettingsModel::OPT##Default(void) { return DEF; } bool SettingsModel::OPT##Default(void) { return DEF; }
#define MAKE_OPTION4(OPT,DEF) \ #define LAMEXP_MAKE_OPTION_U(OPT,DEF) \
unsigned int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toUInt(); } \ unsigned int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toUInt(); } \
void SettingsModel::OPT(unsigned int value) { m_settings->setValue(g_settingsId_##OPT, value); } \ void SettingsModel::OPT(unsigned int value) { m_settings->setValue(g_settingsId_##OPT, value); } \
unsigned int SettingsModel::OPT##Default(void) { return DEF; } unsigned int SettingsModel::OPT##Default(void) { return DEF; }
#define MAKE_ID(DEC,STR) static const char *g_settingsId_##DEC = STR #define LAMEXP_MAKE_ID(DEC,STR) static const char *g_settingsId_##DEC = STR
#define REMOVE_GROUP(OBJ,ID) OBJ->beginGroup(ID); OBJ->remove(""); OBJ->endGroup(); #define REMOVE_GROUP(OBJ,ID) OBJ->beginGroup(ID); OBJ->remove(""); OBJ->endGroup();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -66,45 +66,46 @@ unsigned int SettingsModel::OPT##Default(void) { return DEF; }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//Setting ID's //Setting ID's
MAKE_ID(versionNumber, "VersionNumber"); LAMEXP_MAKE_ID(versionNumber, "VersionNumber");
MAKE_ID(licenseAccepted, "LicenseAccepted"); LAMEXP_MAKE_ID(licenseAccepted, "LicenseAccepted");
MAKE_ID(interfaceStyle, "InterfaceStyle"); LAMEXP_MAKE_ID(interfaceStyle, "InterfaceStyle");
MAKE_ID(compressionEncoder, "Compression/Encoder"); LAMEXP_MAKE_ID(compressionEncoder, "Compression/Encoder");
MAKE_ID(compressionRCMode, "Compression/RCMode"); LAMEXP_MAKE_ID(compressionRCMode, "Compression/RCMode");
MAKE_ID(compressionBitrate, "Compression/Bitrate"); LAMEXP_MAKE_ID(compressionBitrate, "Compression/Bitrate");
MAKE_ID(outputDir, "OutputDirectory/SelectedPath"); LAMEXP_MAKE_ID(outputDir, "OutputDirectory/SelectedPath");
MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder"); LAMEXP_MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder");
MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath"); LAMEXP_MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath");
MAKE_ID(writeMetaTags, "Flags/WriteMetaTags"); LAMEXP_MAKE_ID(writeMetaTags, "Flags/WriteMetaTags");
MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist"); LAMEXP_MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist");
MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck"); LAMEXP_MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck");
MAKE_ID(autoUpdateEnabled, "AutoUpdate/Enabled"); LAMEXP_MAKE_ID(autoUpdateEnabled, "AutoUpdate/Enabled");
MAKE_ID(soundsEnabled, "Flags/EnableSounds"); LAMEXP_MAKE_ID(autoUpdateCheckBeta, "AutoUpdate/CheckForBetaVersions");
MAKE_ID(neroAacNotificationsEnabled, "Flags/EnableNeroAacNotifications"); LAMEXP_MAKE_ID(soundsEnabled, "Flags/EnableSounds");
MAKE_ID(wmaDecoderNotificationsEnabled, "Flags/EnableWmaDecoderNotifications"); LAMEXP_MAKE_ID(neroAacNotificationsEnabled, "Flags/EnableNeroAacNotifications");
MAKE_ID(dropBoxWidgetEnabled, "Flags/EnableDropBoxWidget"); LAMEXP_MAKE_ID(wmaDecoderNotificationsEnabled, "Flags/EnableWmaDecoderNotifications");
MAKE_ID(shellIntegrationEnabled, "Flags/EnableShellIntegration"); LAMEXP_MAKE_ID(dropBoxWidgetEnabled, "Flags/EnableDropBoxWidget");
MAKE_ID(currentLanguage, "Localization/Language"); LAMEXP_MAKE_ID(shellIntegrationEnabled, "Flags/EnableShellIntegration");
MAKE_ID(lameAlgoQuality, "AdvancedOptions/LAME/AlgorithmQuality"); LAMEXP_MAKE_ID(currentLanguage, "Localization/Language");
MAKE_ID(lameChannelMode, "AdvancedOptions/LAME/ChannelMode"); LAMEXP_MAKE_ID(lameAlgoQuality, "AdvancedOptions/LAME/AlgorithmQuality");
MAKE_ID(bitrateManagementEnabled, "AdvancedOptions/BitrateManagement/Enabled"); LAMEXP_MAKE_ID(lameChannelMode, "AdvancedOptions/LAME/ChannelMode");
MAKE_ID(bitrateManagementMinRate, "AdvancedOptions/BitrateManagement/MinRate"); LAMEXP_MAKE_ID(bitrateManagementEnabled, "AdvancedOptions/BitrateManagement/Enabled");
MAKE_ID(bitrateManagementMaxRate, "AdvancedOptions/BitrateManagement/MaxRate"); LAMEXP_MAKE_ID(bitrateManagementMinRate, "AdvancedOptions/BitrateManagement/MinRate");
MAKE_ID(samplingRate, "AdvancedOptions/Common/Resampling"); LAMEXP_MAKE_ID(bitrateManagementMaxRate, "AdvancedOptions/BitrateManagement/MaxRate");
MAKE_ID(neroAACEnable2Pass, "AdvancedOptions/NeroAAC/Enable2Pass"); LAMEXP_MAKE_ID(samplingRate, "AdvancedOptions/Common/Resampling");
MAKE_ID(neroAACProfile, "AdvancedOptions/NeroAAC/ForceProfile"); LAMEXP_MAKE_ID(neroAACEnable2Pass, "AdvancedOptions/NeroAAC/Enable2Pass");
MAKE_ID(normalizationFilterEnabled, "AdvancedOptions/VolumeNormalization/Enabled"); LAMEXP_MAKE_ID(neroAACProfile, "AdvancedOptions/NeroAAC/ForceProfile");
MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume"); LAMEXP_MAKE_ID(normalizationFilterEnabled, "AdvancedOptions/VolumeNormalization/Enabled");
MAKE_ID(toneAdjustBass, "AdvancedOptions/ToneAdjustment/Bass"); LAMEXP_MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume");
MAKE_ID(toneAdjustTreble, "AdvancedOptions/ToneAdjustment/Treble"); LAMEXP_MAKE_ID(toneAdjustBass, "AdvancedOptions/ToneAdjustment/Bass");
MAKE_ID(customParametersLAME, "AdvancedOptions/CustomParameters/LAME"); LAMEXP_MAKE_ID(toneAdjustTreble, "AdvancedOptions/ToneAdjustment/Treble");
MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc"); LAMEXP_MAKE_ID(customParametersLAME, "AdvancedOptions/CustomParameters/LAME");
MAKE_ID(customParametersNeroAAC, "AdvancedOptions/CustomParameters/NeroAAC"); LAMEXP_MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc");
MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC"); LAMEXP_MAKE_ID(customParametersNeroAAC, "AdvancedOptions/CustomParameters/NeroAAC");
MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition"); LAMEXP_MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances"); LAMEXP_MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath"); LAMEXP_MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath"); LAMEXP_MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath");
LAMEXP_MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath");
//LUT //LUT
const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1}; const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1};
@ -248,41 +249,42 @@ QString SettingsModel::defaultLanguage(void)
// Getter and Setter // Getter and Setter
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
MAKE_OPTION1(licenseAccepted, 0) LAMEXP_MAKE_OPTION_I(licenseAccepted, 0)
MAKE_OPTION1(interfaceStyle, 0) LAMEXP_MAKE_OPTION_I(interfaceStyle, 0)
MAKE_OPTION1(compressionEncoder, 0) LAMEXP_MAKE_OPTION_I(compressionEncoder, 0)
MAKE_OPTION1(compressionRCMode, 0) LAMEXP_MAKE_OPTION_I(compressionRCMode, 0)
MAKE_OPTION1(compressionBitrate, 7) LAMEXP_MAKE_OPTION_I(compressionBitrate, 7)
MAKE_OPTION2(outputDir, QString()) LAMEXP_MAKE_OPTION_S(outputDir, QString())
MAKE_OPTION3(outputToSourceDir, false) LAMEXP_MAKE_OPTION_B(outputToSourceDir, false)
MAKE_OPTION3(prependRelativeSourcePath, false) LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath, false)
MAKE_OPTION3(writeMetaTags, true) LAMEXP_MAKE_OPTION_B(writeMetaTags, true)
MAKE_OPTION3(createPlaylist, true) LAMEXP_MAKE_OPTION_B(createPlaylist, true)
MAKE_OPTION2(autoUpdateLastCheck, "Never") LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck, "Never")
MAKE_OPTION3(autoUpdateEnabled, true) LAMEXP_MAKE_OPTION_B(autoUpdateEnabled, true)
MAKE_OPTION3(soundsEnabled, true) LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta, false)
MAKE_OPTION3(neroAacNotificationsEnabled, true) LAMEXP_MAKE_OPTION_B(soundsEnabled, true)
MAKE_OPTION3(wmaDecoderNotificationsEnabled, true) LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled, true)
MAKE_OPTION3(dropBoxWidgetEnabled, true) LAMEXP_MAKE_OPTION_B(wmaDecoderNotificationsEnabled, true)
MAKE_OPTION3(shellIntegrationEnabled, !lamexp_portable_mode()) LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled, true)
MAKE_OPTION2(currentLanguage, defaultLanguage()) LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled, !lamexp_portable_mode())
MAKE_OPTION1(lameAlgoQuality, 3) LAMEXP_MAKE_OPTION_S(currentLanguage, defaultLanguage())
MAKE_OPTION1(lameChannelMode, 0); LAMEXP_MAKE_OPTION_I(lameAlgoQuality, 3)
MAKE_OPTION3(bitrateManagementEnabled, false) LAMEXP_MAKE_OPTION_I(lameChannelMode, 0);
MAKE_OPTION1(bitrateManagementMinRate, 32) LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled, false)
MAKE_OPTION1(bitrateManagementMaxRate, 500) LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate, 32)
MAKE_OPTION1(samplingRate, 0) LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate, 500)
MAKE_OPTION3(neroAACEnable2Pass, true) LAMEXP_MAKE_OPTION_I(samplingRate, 0)
MAKE_OPTION1(neroAACProfile, 0) LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass, true)
MAKE_OPTION3(normalizationFilterEnabled, false) LAMEXP_MAKE_OPTION_I(neroAACProfile, 0)
MAKE_OPTION1(normalizationFilterMaxVolume, -50) LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled, false)
MAKE_OPTION1(toneAdjustBass, 0) LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume, -50)
MAKE_OPTION1(toneAdjustTreble, 0) LAMEXP_MAKE_OPTION_I(toneAdjustBass, 0)
MAKE_OPTION2(customParametersLAME, QString()); LAMEXP_MAKE_OPTION_I(toneAdjustTreble, 0)
MAKE_OPTION2(customParametersOggEnc, QString()); LAMEXP_MAKE_OPTION_S(customParametersLAME, QString());
MAKE_OPTION2(customParametersNeroAAC, QString()); LAMEXP_MAKE_OPTION_S(customParametersOggEnc, QString());
MAKE_OPTION2(customParametersFLAC, QString()); LAMEXP_MAKE_OPTION_S(customParametersNeroAAC, QString());
MAKE_OPTION4(metaInfoPosition, UINT_MAX); LAMEXP_MAKE_OPTION_S(customParametersFLAC, QString());
MAKE_OPTION4(maximumInstances, 0); LAMEXP_MAKE_OPTION_U(metaInfoPosition, UINT_MAX);
MAKE_OPTION2(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation)); LAMEXP_MAKE_OPTION_U(maximumInstances, 0);
MAKE_OPTION3(customTempPathEnabled, false); LAMEXP_MAKE_OPTION_S(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation));
LAMEXP_MAKE_OPTION_B(customTempPathEnabled, false);

View File

@ -26,22 +26,22 @@ class QString;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define MAKE_OPTION_DEC1(OPT) \ #define LAMEXP_MAKE_OPTION_I(OPT) \
int OPT(void); \ int OPT(void); \
void OPT(int value); \ void OPT(int value); \
int OPT##Default(void); int OPT##Default(void);
#define MAKE_OPTION_DEC2(OPT) \ #define LAMEXP_MAKE_OPTION_S(OPT) \
QString OPT(void); \ QString OPT(void); \
void OPT(const QString &value); \ void OPT(const QString &value); \
QString OPT##Default(void); QString OPT##Default(void);
#define MAKE_OPTION_DEC3(OPT) \ #define LAMEXP_MAKE_OPTION_B(OPT) \
bool OPT(void); \ bool OPT(void); \
void OPT(bool value); \ void OPT(bool value); \
bool OPT##Default(void); bool OPT##Default(void);
#define MAKE_OPTION_DEC4(OPT) \ #define LAMEXP_MAKE_OPTION_U(OPT) \
unsigned int OPT(void); \ unsigned int OPT(void); \
void OPT(unsigned int value); \ void OPT(unsigned int value); \
unsigned int OPT##Default(void); unsigned int OPT##Default(void);
@ -75,44 +75,45 @@ public:
static const int samplingRates[8]; static const int samplingRates[8];
//Getters & setters //Getters & setters
MAKE_OPTION_DEC1(licenseAccepted); LAMEXP_MAKE_OPTION_I(licenseAccepted);
MAKE_OPTION_DEC1(interfaceStyle); LAMEXP_MAKE_OPTION_I(interfaceStyle);
MAKE_OPTION_DEC1(compressionEncoder); LAMEXP_MAKE_OPTION_I(compressionEncoder);
MAKE_OPTION_DEC1(compressionRCMode); LAMEXP_MAKE_OPTION_I(compressionRCMode);
MAKE_OPTION_DEC1(compressionBitrate); LAMEXP_MAKE_OPTION_I(compressionBitrate);
MAKE_OPTION_DEC2(outputDir); LAMEXP_MAKE_OPTION_S(outputDir);
MAKE_OPTION_DEC3(outputToSourceDir); LAMEXP_MAKE_OPTION_B(outputToSourceDir);
MAKE_OPTION_DEC3(prependRelativeSourcePath); LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath);
MAKE_OPTION_DEC3(writeMetaTags); LAMEXP_MAKE_OPTION_B(writeMetaTags);
MAKE_OPTION_DEC3(createPlaylist); LAMEXP_MAKE_OPTION_B(createPlaylist);
MAKE_OPTION_DEC2(autoUpdateLastCheck); LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck);
MAKE_OPTION_DEC3(autoUpdateEnabled); LAMEXP_MAKE_OPTION_B(autoUpdateEnabled);
MAKE_OPTION_DEC3(soundsEnabled); LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta);
MAKE_OPTION_DEC3(neroAacNotificationsEnabled); LAMEXP_MAKE_OPTION_B(soundsEnabled);
MAKE_OPTION_DEC3(wmaDecoderNotificationsEnabled); LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled);
MAKE_OPTION_DEC3(dropBoxWidgetEnabled); LAMEXP_MAKE_OPTION_B(wmaDecoderNotificationsEnabled);
MAKE_OPTION_DEC3(shellIntegrationEnabled); LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled);
MAKE_OPTION_DEC2(currentLanguage); LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled);
MAKE_OPTION_DEC1(lameAlgoQuality); LAMEXP_MAKE_OPTION_S(currentLanguage);
MAKE_OPTION_DEC1(lameChannelMode); LAMEXP_MAKE_OPTION_I(lameAlgoQuality);
MAKE_OPTION_DEC3(bitrateManagementEnabled); LAMEXP_MAKE_OPTION_I(lameChannelMode);
MAKE_OPTION_DEC1(bitrateManagementMinRate); LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled);
MAKE_OPTION_DEC1(bitrateManagementMaxRate); LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate);
MAKE_OPTION_DEC1(samplingRate); LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate);
MAKE_OPTION_DEC3(neroAACEnable2Pass); LAMEXP_MAKE_OPTION_I(samplingRate);
MAKE_OPTION_DEC1(neroAACProfile); LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass);
MAKE_OPTION_DEC3(normalizationFilterEnabled); LAMEXP_MAKE_OPTION_I(neroAACProfile);
MAKE_OPTION_DEC1(normalizationFilterMaxVolume); LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled);
MAKE_OPTION_DEC1(toneAdjustBass); LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume);
MAKE_OPTION_DEC1(toneAdjustTreble); LAMEXP_MAKE_OPTION_I(toneAdjustBass);
MAKE_OPTION_DEC2(customParametersLAME); LAMEXP_MAKE_OPTION_I(toneAdjustTreble);
MAKE_OPTION_DEC2(customParametersOggEnc); LAMEXP_MAKE_OPTION_S(customParametersLAME);
MAKE_OPTION_DEC2(customParametersNeroAAC); LAMEXP_MAKE_OPTION_S(customParametersOggEnc);
MAKE_OPTION_DEC2(customParametersFLAC); LAMEXP_MAKE_OPTION_S(customParametersNeroAAC);
MAKE_OPTION_DEC4(metaInfoPosition); LAMEXP_MAKE_OPTION_S(customParametersFLAC);
MAKE_OPTION_DEC4(maximumInstances); LAMEXP_MAKE_OPTION_U(metaInfoPosition);
MAKE_OPTION_DEC2(customTempPath); LAMEXP_MAKE_OPTION_U(maximumInstances);
MAKE_OPTION_DEC3(customTempPathEnabled); LAMEXP_MAKE_OPTION_S(customTempPath);
LAMEXP_MAKE_OPTION_B(customTempPathEnabled);
//Misc //Misc
void validate(void); void validate(void);
@ -125,7 +126,7 @@ private:
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#undef MAKE_OPTION_DEC1 #undef LAMEXP_MAKE_OPTION_I
#undef MAKE_OPTION_DEC2 #undef LAMEXP_MAKE_OPTION_S
#undef MAKE_OPTION_DEC3 #undef LAMEXP_MAKE_OPTION_B
#undef MAKE_OPTION_DEC4 #undef LAMEXP_MAKE_OPTION_U