diff --git a/LameXP_VS2010.vcxproj b/LameXP_VS2010.vcxproj
index add5f55c..f81c47fa 100644
--- a/LameXP_VS2010.vcxproj
+++ b/LameXP_VS2010.vcxproj
@@ -835,6 +835,7 @@ del "$(TargetDir)imageformats\q???d4.dll"
"$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\QRC_%(Filename).cpp" -name "%(Filename)" "%(FullPath)"
$(SolutionDir)tmp\QRC_%(Filename).cpp;%(Outputs)
+ Designer
RCC "$(SolutionDir)tmp\QRC_%(Filename).cpp"
diff --git a/res/Images.qrc b/res/Images.qrc
index 51e72b58..d33eb6ef 100644
--- a/res/Images.qrc
+++ b/res/Images.qrc
@@ -2,6 +2,7 @@
images/Busy.gif
+ images/Cartoon.png
images/CD.png
images/Disque.png
images/DropBox.png
diff --git a/res/images/Cartoon.png b/res/images/Cartoon.png
new file mode 100644
index 00000000..5982d4c2
Binary files /dev/null and b/res/images/Cartoon.png differ
diff --git a/res/images/Disque.png b/res/images/Disque.png
index 5e247d56..cd82cc39 100644
Binary files a/res/images/Disque.png and b/res/images/Disque.png differ
diff --git a/src/Config.h b/src/Config.h
index 0685e0c0..0a8920d7 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 2
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 7
-#define VER_LAMEXP_BUILD 462
+#define VER_LAMEXP_BUILD 468
///////////////////////////////////////////////////////////////////////////////
// Tools versions
diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp
index 0af333ce..7c39a474 100644
--- a/src/Dialog_About.cpp
+++ b/src/Dialog_About.cpp
@@ -77,7 +77,9 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta
QMessageBox(parent),
m_settings(settings),
m_disque(NULL),
- m_disqueTimer(NULL)
+ m_disqueTimer(NULL),
+ m_rotateNext(false),
+ m_disqueDelay(_I64_MAX)
{
const QString versionStr = QString().sprintf
(
@@ -91,6 +93,11 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta
qVersion()
);
+ for(int i = 0; i < 4; i++)
+ {
+ m_cartoon[i] = NULL;
+ }
+
QString aboutText;
aboutText += QString("%1
").arg(tr("LameXP − Audio Encoder Front-end"));
@@ -189,12 +196,12 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta
m_disque->setPixmap(disque);
m_disque->setWindowOpacity(0.01);
m_disque->show();
+ m_disqueFlags[0] = (qrand() > (RAND_MAX/2));
+ m_disqueFlags[1] = (qrand() > (RAND_MAX/2));
m_disqueTimer = new QTimer;
connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
m_disqueTimer->setInterval(10);
m_disqueTimer->start();
- m_disqueFlags[0] = true;
- m_disqueFlags[1] = true;
}
m_firstShow = firstStart;
@@ -212,6 +219,10 @@ AboutDialog::~AboutDialog(void)
m_disqueTimer->stop();
LAMEXP_DELETE(m_disqueTimer);
}
+ for(int i = 0; i < 4; i++)
+ {
+ LAMEXP_DELETE(m_cartoon[i]);
+ }
}
@@ -475,31 +486,65 @@ void AboutDialog::showMoreAbout(void)
void AboutDialog::moveDisque(void)
{
- static const int delta = 2;
-
+ int delta = 2;
+ LARGE_INTEGER perfCount, perfFrequ;
+
+ if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount))
+ {
+ if(m_disqueDelay != _I64_MAX)
+ {
+ double delay = static_cast(perfCount.QuadPart) - static_cast(m_disqueDelay);
+ delta = max(1, min(128, static_cast(ceil(delay / static_cast(perfFrequ.QuadPart) / 0.00512))));
+ }
+ m_disqueDelay = perfCount.QuadPart;
+ }
+
if(m_disque)
{
QPoint pos = m_disque->pos();
pos.setX(m_disqueFlags[0] ? pos.x() + delta : pos.x() - delta);
pos.setY(m_disqueFlags[1] ? pos.y() + delta : pos.y() - delta);
- m_disque->move(pos);
if(pos.x() <= 0)
{
m_disqueFlags[0] = true;
+ pos.setX(0);
+ m_rotateNext = true;
}
else if(pos.x() >= m_screenGeometry.width() - m_disque->width())
{
m_disqueFlags[0] = false;
+ pos.setX(m_screenGeometry.width() - m_disque->width());
+ m_rotateNext = true;
}
-
if(pos.y() <= 0)
{
m_disqueFlags[1] = true;
+ pos.setY(0);
+ m_rotateNext = true;
}
else if(pos.y() >= m_screenGeometry.height()- m_disque->height())
{
m_disqueFlags[1] = false;
+ pos.setY(m_screenGeometry.height() - m_disque->height());
+ m_rotateNext = true;
+ }
+
+ m_disque->move(pos);
+
+ if(m_rotateNext)
+ {
+ QPixmap *cartoon = NULL;
+ if(m_disqueFlags[0] == true && m_disqueFlags[1] != true) cartoon = m_cartoon[0];
+ if(m_disqueFlags[0] == true && m_disqueFlags[1] == true) cartoon = m_cartoon[1];
+ if(m_disqueFlags[0] != true && m_disqueFlags[1] == true) cartoon = m_cartoon[2];
+ if(m_disqueFlags[0] != true && m_disqueFlags[1] != true) cartoon = m_cartoon[3];
+ if(cartoon)
+ {
+ m_disque->setPixmap(*cartoon);
+ m_disque->resize(cartoon->size());
+ }
+ m_rotateNext = false;
}
if(m_disque->windowOpacity() < 0.9)
@@ -533,7 +578,15 @@ bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
{
if((obj == m_disque) && (event->type() == QEvent::MouseButtonPress))
{
- m_disque->hide();
+ QPixmap cartoon(":/images/Cartoon.png");
+ for(int i = 0; i < 4; i++)
+ {
+ if(!m_cartoon[i])
+ {
+ m_cartoon[i] = new QPixmap(cartoon.transformed(QMatrix().rotate(static_cast(i*90) + 45.0), Qt::SmoothTransformation));
+ m_rotateNext = true;
+ }
+ }
QDesktopServices::openUrl(QUrl(disqueUrl));
}
diff --git a/src/Dialog_About.h b/src/Dialog_About.h
index f86e748b..eae2e2b9 100644
--- a/src/Dialog_About.h
+++ b/src/Dialog_About.h
@@ -55,6 +55,9 @@ private:
QTimer * m_disqueTimer;
bool m_disqueFlags[2];
QRect m_screenGeometry;
+ QPixmap *m_cartoon[4];
+ bool m_rotateNext;
+ __int64 m_disqueDelay;
QString makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo = QString());
bool playResoureSound(const QString &library, const unsigned long soundId, const bool async);
diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp
index a735fc62..0bd47701 100644
--- a/src/Thread_FileAnalyzer.cpp
+++ b/src/Thread_FileAnalyzer.cpp
@@ -114,6 +114,7 @@ const AudioFileModel FileAnalyzer::analyzeFile(const QString &filePath)
AudioFileModel audioFile(filePath);
m_currentSection = sectionOther;
m_currentCover = coverNone;
+ m_lineBreakBugWorkaround = false;
QFile readTest(filePath);
if(!readTest.open(QIODevice::ReadOnly))
@@ -169,6 +170,7 @@ const AudioFileModel FileAnalyzer::analyzeFile(const QString &filePath)
int index = line.indexOf(':');
if(index > 0)
{
+ m_lineBreakBugWorkaround = false;
QString key = line.left(index-1).trimmed();
QString val = line.mid(index+1).trimmed();
if(!key.isEmpty() && !val.isEmpty())
@@ -230,7 +232,11 @@ void FileAnalyzer::updateSection(const QString §ion)
}
else
{
- qWarning("Unknown section: %s", section.toUtf8().constData());
+ if(!m_lineBreakBugWorkaround)
+ {
+ m_currentSection = sectionOther;
+ qWarning("Unknown section: %s", section.toUtf8().constData());
+ }
}
}
@@ -299,6 +305,10 @@ void FileAnalyzer::updateInfo(AudioFileModel &audioFile, const QString &key, con
m_currentCover = coverGif;
}
}
+ else if(!key.compare("Complete Name", Qt::CaseInsensitive))
+ {
+ m_lineBreakBugWorkaround = true;
+ }
break;
case sectionAudio:
diff --git a/src/Thread_FileAnalyzer.h b/src/Thread_FileAnalyzer.h
index b5d61d65..2a3313f7 100644
--- a/src/Thread_FileAnalyzer.h
+++ b/src/Thread_FileAnalyzer.h
@@ -83,5 +83,6 @@ private:
unsigned int m_filesRejected;
unsigned int m_filesDenied;
unsigned int m_filesDummyCDDA;
+ bool m_lineBreakBugWorkaround;
bool m_bSuccess;
};