diff --git a/src/Config.h b/src/Config.h index 2fde98cc..c590950b 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 5 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 1937 +#define VER_LAMEXP_BUILD 1939 #define VER_LAMEXP_CONFG 1934 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp index cce27475..700a2f52 100644 --- a/src/Dialog_About.cpp +++ b/src/Dialog_About.cpp @@ -184,8 +184,6 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta //Show about dialog for the first time? if(!firstStart) { - MUtils::seed_rand(); - ui->acceptButton->hide(); ui->declineButton->hide(); ui->aboutQtButton->show(); @@ -204,10 +202,10 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta geometryUpdated(); m_discOpacity = 0.01; - m_disquePos.setX(static_cast(MUtils::next_rand32() % static_cast(m_disqueBound.right() - disque.width() - m_disqueBound.left())) + m_disqueBound.left()); - m_disquePos.setY(static_cast(MUtils::next_rand32() % static_cast(m_disqueBound.bottom() - disque.height() - m_disqueBound.top())) + m_disqueBound.top()); - m_disqueFlags[0] = (MUtils::next_rand32() > (UINT_MAX/2)); - m_disqueFlags[1] = (MUtils::next_rand32() > (UINT_MAX/2)); + m_disquePos.setX(static_cast(MUtils::next_rand_u32() % static_cast(m_disqueBound.right() - disque.width() - m_disqueBound.left())) + m_disqueBound.left()); + m_disquePos.setY(static_cast(MUtils::next_rand_u32() % static_cast(m_disqueBound.bottom() - disque.height() - m_disqueBound.top())) + m_disqueBound.top()); + m_disqueFlags[0] = (MUtils::next_rand_u32() > (UINT_MAX/2)); + m_disqueFlags[1] = (MUtils::next_rand_u32() > (UINT_MAX/2)); m_disque->move(m_disquePos); m_disque->setWindowOpacity(m_discOpacity); m_disque->show(); diff --git a/src/Dialog_CueImport.cpp b/src/Dialog_CueImport.cpp index ec21661f..6c6c2dd5 100644 --- a/src/Dialog_CueImport.cpp +++ b/src/Dialog_CueImport.cpp @@ -297,7 +297,7 @@ void CueImportDialog::importButtonClicked(void) return; } - QFile writeTest(QString("%1/~%2.txt").arg(m_outputDir, MUtils::rand_str())); + QFile writeTest(QString("%1/~%2.txt").arg(m_outputDir, MUtils::next_rand_str())); if(!(writeTest.open(QIODevice::ReadWrite) && (writeTest.write(writeTestBuffer) == strlen(writeTestBuffer)))) { QMessageBox::warning(this, tr("LameXP"), QString("%2").arg(tr("Error: The selected output directory is not writable!"))); diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 2a5804d9..e237a59d 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -1767,7 +1767,7 @@ void MainWindow::encodeButtonClicked(void) if(!m_settings->outputToSourceDir()) { - QFile writeTest(QString("%1/~%2.txt").arg(m_settings->outputDir(), MUtils::rand_str())); + QFile writeTest(QString("%1/~%2.txt").arg(m_settings->outputDir(), MUtils::next_rand_str())); if(!(writeTest.open(QIODevice::ReadWrite) && (writeTest.write(writeTestBuffer) == strlen(writeTestBuffer)))) { QMessageBox::warning(this, tr("LameXP"), QString("%1
%2

%3").arg(tr("Cannot write to the selected output directory."), m_settings->outputDir(), tr("Please choose a different directory!"))); @@ -3924,7 +3924,7 @@ void MainWindow::normalizationFilterSizeFinished(void) const int value = ui->spinBoxNormalizationFilterSize->value(); if((value % 2) != 1) { - bool rnd = MUtils::parity(MUtils::next_rand32()); + bool rnd = MUtils::parity(MUtils::next_rand_u32()); ui->spinBoxNormalizationFilterSize->setValue(rnd ? value+1 : value-1); } } @@ -4263,7 +4263,7 @@ void MainWindow::browseCustomTempFolderButtonClicked(void) if(!newTempFolder.isEmpty()) { - QFile writeTest(QString("%1/~%2.tmp").arg(newTempFolder, MUtils::rand_str())); + QFile writeTest(QString("%1/~%2.tmp").arg(newTempFolder, MUtils::next_rand_str())); if(writeTest.open(QIODevice::ReadWrite)) { writeTest.remove(); diff --git a/src/Thread_CueSplitter.cpp b/src/Thread_CueSplitter.cpp index 56fc2f88..41d715ea 100644 --- a/src/Thread_CueSplitter.cpp +++ b/src/Thread_CueSplitter.cpp @@ -127,7 +127,7 @@ void CueSplitter::run() emit fileSelected(m_activeFile); emit progressValChanged(i+1); - QString tempFile = QString("%1/~%2.wav").arg(m_outputDir, MUtils::rand_str()); + QString tempFile = QString("%1/~%2.wav").arg(m_outputDir, MUtils::next_rand_str()); connect(decoder, SIGNAL(statusUpdated(int)), this, SLOT(handleUpdate(int)), Qt::DirectConnection); if(decoder->decode(inputFileList.at(i), tempFile, &m_abortFlag)) diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp index bedee3d2..d6f070f6 100644 --- a/src/Thread_FileAnalyzer.cpp +++ b/src/Thread_FileAnalyzer.cpp @@ -320,7 +320,7 @@ bool FileAnalyzer::createTemplate(void) return true; } - QString templatePath = QString("%1/%2.txt").arg(MUtils::temp_folder(), MUtils::rand_str()); + QString templatePath = QString("%1/%2.txt").arg(MUtils::temp_folder(), MUtils::next_rand_str()); QFile templateFile(templatePath); if(!templateFile.open(QIODevice::WriteOnly)) diff --git a/src/Thread_FileAnalyzer_Task.cpp b/src/Thread_FileAnalyzer_Task.cpp index ef6f4429..a49c8d36 100644 --- a/src/Thread_FileAnalyzer_Task.cpp +++ b/src/Thread_FileAnalyzer_Task.cpp @@ -496,7 +496,7 @@ void AnalyzeTask::retrieveCover(AudioFileModel &audioFile, const quint32 coverTy static const QString ext = QString::fromLatin1(MIME_TYPES[qBound(0U, coverType, MIME_TYPES_MAX)].ext[0]); if(!(QImage::fromData(coverData, ext.toUpper().toLatin1().constData()).isNull())) { - QFile coverFile(QString("%1/%2.%3").arg(MUtils::temp_folder(), MUtils::rand_str(), ext)); + QFile coverFile(QString("%1/%2.%3").arg(MUtils::temp_folder(), MUtils::next_rand_str(), ext)); if(coverFile.open(QIODevice::WriteOnly)) { coverFile.write(coverData); diff --git a/src/Thread_Process.cpp b/src/Thread_Process.cpp index f0322e3d..081d09af 100644 --- a/src/Thread_Process.cpp +++ b/src/Thread_Process.cpp @@ -445,7 +445,7 @@ int ProcessThread::generateOutFileName(QString &outFileName) } //Make sure that the output dir is writable - QFile writeTest(QString("%1/.%2").arg(targetDir.canonicalPath(), MUtils::rand_str())); + QFile writeTest(QString("%1/.%2").arg(targetDir.canonicalPath(), MUtils::next_rand_str())); if(!writeTest.open(QIODevice::ReadWrite)) { handleMessage(QString("%1\n%2").arg(tr("The target output directory is NOT writable:"), QDir::toNativeSeparators(targetDir.absolutePath()))); @@ -547,7 +547,7 @@ QString ProcessThread::generateTempFileName(void) const QString tempFileName = MUtils::make_temp_file(m_tempDirectory, "wav", true); if(tempFileName.isEmpty()) { - return QString("%1/~whoops%2.wav").arg(m_tempDirectory, QString::number(MUtils::next_rand32())); + return QString("%1/~whoops%2.wav").arg(m_tempDirectory, QString::number(MUtils::next_rand_u32())); } m_tempFiles << tempFileName;