diff --git a/src/Config.h b/src/Config.h index 8a12bc44..4735ea3a 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 532 +#define VER_LAMEXP_BUILD 533 /////////////////////////////////////////////////////////////////////////////// // Tools versions diff --git a/src/Model_CueSheet.cpp b/src/Model_CueSheet.cpp index 0e28659b..91b8f51c 100644 --- a/src/Model_CueSheet.cpp +++ b/src/Model_CueSheet.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -796,22 +797,16 @@ double CueSheetModel::parseTimeIndex(const QString &index) QString CueSheetModel::indexToString(const double index) const { - if(!_finite(index) || (index < 0.0)) + if(!_finite(index) || (index < 0.0) || (index > 86400.0)) { return QString("??:??.???"); } - - unsigned int temp = static_cast(floor(0.5 + (index * 1000.0))); - - unsigned int msec = temp % 1000; - unsigned int secs = temp / 1000; - unsigned int mins = secs / 60; - secs = secs % 60; + QTime time = QTime().addMSecs(static_cast(floor(0.5 + (index * 1000.0)))); - if(mins < 100) + if(time.minute() < 100) { - return QString().sprintf("%02u:%02u.%03u", mins, secs, msec); + return time.toString("mm:ss.zzz"); } else { diff --git a/src/Thread_CueSplitter.cpp b/src/Thread_CueSplitter.cpp index 34737d59..b004749c 100644 --- a/src/Thread_CueSplitter.cpp +++ b/src/Thread_CueSplitter.cpp @@ -56,13 +56,13 @@ CueSplitter::CueSplitter(const QString &outputDir, const QString &baseName, CueS m_decompressedFiles.clear(); m_tempFiles.clear(); - qDebug("\n[CueSplitter::CueSplitter]"); + qDebug("\n[CueSplitter]"); int nInputFiles = inputFilesInfo.count(); for(int i = 0; i < nInputFiles; i++) { m_inputFilesInfo.insert(inputFilesInfo[i].filePath(), inputFilesInfo[i]); - qDebug("%02d <%s>", i, inputFilesInfo[i].filePath().toUtf8().constData()); + qDebug("File %02d: <%s>", i, inputFilesInfo[i].filePath().toUtf8().constData()); } qDebug("All input files added."); @@ -380,33 +380,13 @@ void CueSplitter::splitFile(const QString &output, const int trackNo, const QStr QString CueSplitter::indexToString(const double index) const { - if(!_finite(index) || (index < 0.0)) + if(!_finite(index) || (index < 0.0) || (index > 86400.0)) { return QString(); } - - unsigned int temp = static_cast(floor(0.5 + (index * 1000.0))); - - unsigned int msec = temp % 1000; - unsigned int secs = temp / 1000; - unsigned int mins = secs / 60; - unsigned int hour = mins / 60; - secs = secs % 60; - mins = mins % 60; - - if(hour > 0) - { - return QString().sprintf("%u:%02u:%02u.%03u", hour, mins, secs, msec); - } - else if(mins > 0) - { - return QString().sprintf("%u:%02u.%03u", mins, secs, msec); - } - else - { - return QString().sprintf("%u.%03u", secs, msec); - } + QTime time = QTime().addMSecs(static_cast(floor(0.5 + (index * 1000.0)))); + return time.toString(time.hour() ? "H:mm:ss.zzz" : "m:ss.zzz"); } ////////////////////////////////////////////////////////////