<a name="4.09"></a>Changes between v4.08 and v4.09 [<font color="darkred">unreleased</font>]:<br><ul>
<li>Upgraded build environment to Microsoft Visual Studio 2013 RTM
-<li>Improved internal encoder API, so each encoder can define its own configuration options
<li>Complete overhaul of the file analyzer, resulting in up to 2.5x faster file import speed
<li>Reworked the application initialization code, resulting in notably faster startup speed
+<li>Improved file analyzer to retain the original ordering of files imported from a playlist
+<li>Improved internal encoder API, so each encoder can define its own configuration options
<li>Updated mpg123 decoder to v1.16.0 (2013-10-06), compiled with GCC 4.8.1
<li>Updated GnuPG to v1.4.15 (2013-10-05), compiled with GCC 4.8.1
<li>Various bugfixes and code improvements
#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
///////////////////////////////////////////////////////////////////////////////
/* 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
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);
}
#include <QTime>
#include <QElapsedTimer>
#include <QTimer>
+#include <QQueue>
+
+//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
}
}
- //Handle playlist files
+ //Sort files
lamexp_natural_string_sort(m_inputFiles, true);
+
+ //Handle playlist files first!
handlePlaylistFiles();
- lamexp_natural_string_sort(m_inputFiles, true);
const unsigned int nFiles = m_inputFiles.count();
+ if(nFiles < 1)
+ {
+ qWarning("File list is empty, nothing to do!");
+ return;
+ }
//Update progress
emit progressMaxChanged(nFiles);
void FileAnalyzer::handlePlaylistFiles(void)
{
- QStringList importedFiles;
+ QQueue<QVariant> 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)
+ {
+ 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
{
- m_inputFiles << currentFile;
+ qWarning("Encountered an unexpected variant type!");
}
}
}