diff --git a/doc/Changelog.html b/doc/Changelog.html
index 9a56e984..58f3b7c2 100644
--- a/doc/Changelog.html
+++ b/doc/Changelog.html
@@ -19,9 +19,10 @@ a:visited { color: #0000EE; }
Changes between v4.08 and v4.09 [unreleased]:
- Upgraded build environment to Microsoft Visual Studio 2013 RTM
-
- Improved internal encoder API, so each encoder can define its own configuration options
- Complete overhaul of the file analyzer, resulting in up to 2.5x faster file import speed
- Reworked the application initialization code, resulting in notably faster startup speed
+
- Improved file analyzer to retain the original ordering of files imported from a playlist
+
- Improved internal encoder API, so each encoder can define its own configuration options
- Updated mpg123 decoder to v1.16.0 (2013-10-06), compiled with GCC 4.8.1
- Updated GnuPG to v1.4.15 (2013-10-05), compiled with GCC 4.8.1
- Various bugfixes and code improvements
diff --git a/src/Config.h b/src/Config.h
index 086317e2..35cee53e 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -34,8 +34,8 @@
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 9
#define VER_LAMEXP_TYPE Alpha
-#define VER_LAMEXP_PATCH 3
-#define VER_LAMEXP_BUILD 1418
+#define VER_LAMEXP_PATCH 4
+#define VER_LAMEXP_BUILD 1420
#define VER_LAMEXP_CONFG 1348
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/Dialog_WorkingBanner.cpp b/src/Dialog_WorkingBanner.cpp
index a278d66b..99f34152 100644
--- a/src/Dialog_WorkingBanner.cpp
+++ b/src/Dialog_WorkingBanner.cpp
@@ -35,7 +35,7 @@
/* It can happen that the QThread has just terminated and already emitted the 'terminated' signal, but did NOT change the 'isRunning' flag to FALSE yet. */
/* For this reason the macro will first check the 'isRunning' flag. If (and only if) the flag still returns TRUE, then we will wait() for at most 50 ms. */
/* If, after 50 ms, the wait() function returns with FALSE, then the thread probably is still running and we return TRUE. Otherwise we can return FALSE. */
-#define THREAD_RUNNING(THRD) (((THRD)->isRunning()) ? (!((THRD)->wait(50))) : false)
+#define THREAD_RUNNING(THRD) (((THRD)->isRunning()) ? (!((THRD)->wait(1))) : false)
////////////////////////////////////////////////////////////
// Constructor
@@ -73,6 +73,9 @@ WorkingBanner::WorkingBanner(QWidget *parent)
color.setColor(QPalette::WindowText, QColor::fromRgb(0x33, 0x33, 0x33));
m_progress->setPalette(color);
+ //Set Opacity
+ this->setWindowOpacity(0.85);
+
//Set wait cursor
setCursor(Qt::WaitCursor);
}
diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp
index 0ba3654d..1da05292 100644
--- a/src/Thread_FileAnalyzer.cpp
+++ b/src/Thread_FileAnalyzer.cpp
@@ -39,6 +39,16 @@
#include
#include
#include
+#include
+
+//Insert into QStringList *without* duplicates
+static inline void SAFE_APPEND_STRING(QStringList &list, const QString &str)
+{
+ if(!list.contains(str, Qt::CaseInsensitive))
+ {
+ list << str;
+ }
+}
////////////////////////////////////////////////////////////
// Constructor
@@ -161,12 +171,18 @@ void FileAnalyzer::run()
}
}
- //Handle playlist files
- lamexp_natural_string_sort(m_inputFiles, true);
- handlePlaylistFiles();
+ //Sort files
lamexp_natural_string_sort(m_inputFiles, true);
+ //Handle playlist files first!
+ handlePlaylistFiles();
+
const unsigned int nFiles = m_inputFiles.count();
+ if(nFiles < 1)
+ {
+ qWarning("File list is empty, nothing to do!");
+ return;
+ }
//Update progress
emit progressMaxChanged(nFiles);
@@ -245,22 +261,51 @@ bool FileAnalyzer::analyzeNextFile(void)
void FileAnalyzer::handlePlaylistFiles(void)
{
- QStringList importedFiles;
+ QQueue queue;
+ QStringList importedFromPlaylist;
+
+ //Import playlist files into "hierarchical" list
while(!m_inputFiles.isEmpty())
{
const QString currentFile = m_inputFiles.takeFirst();
- if(!PlaylistImporter::importPlaylist(importedFiles, currentFile))
+ QStringList importedFiles;
+ if(PlaylistImporter::importPlaylist(importedFiles, currentFile))
{
- importedFiles << currentFile;
+ queue.enqueue(importedFiles);
+ importedFromPlaylist << importedFiles;
+ }
+ else
+ {
+ queue.enqueue(currentFile);
}
}
- while(!importedFiles.isEmpty())
+ //Reduce temporary list
+ importedFromPlaylist.removeDuplicates();
+
+ //Now build the complete "flat" file list (files imported from playlist take precedence!)
+ while(!queue.isEmpty())
{
- const QString currentFile = importedFiles.takeFirst();
- if(!m_inputFiles.contains(currentFile, Qt::CaseInsensitive))
+ const QVariant current = queue.dequeue();
+ if(current.type() == QVariant::String)
{
- m_inputFiles << currentFile;
+ const QString temp = current.toString();
+ if(!importedFromPlaylist.contains(temp, Qt::CaseInsensitive))
+ {
+ SAFE_APPEND_STRING(m_inputFiles, temp);
+ }
+ }
+ else if(current.type() == QVariant::StringList)
+ {
+ const QStringList temp = current.toStringList();
+ for(QStringList::ConstIterator iter = temp.constBegin(); iter != temp.constEnd(); iter++)
+ {
+ SAFE_APPEND_STRING(m_inputFiles, (*iter));
+ }
+ }
+ else
+ {
+ qWarning("Encountered an unexpected variant type!");
}
}
}