Some fixes to adapt for latest MUtils changes.

This commit is contained in:
LoRd_MuldeR 2016-12-19 21:17:41 +01:00
parent ca43ef6982
commit 1ff5e1ca07
8 changed files with 14 additions and 16 deletions

View File

@ -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
///////////////////////////////////////////////////////////////////////////////

View File

@ -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<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound.right() - disque.width() - m_disqueBound.left())) + m_disqueBound.left());
m_disquePos.setY(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(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<int>(MUtils::next_rand_u32() % static_cast<unsigned int>(m_disqueBound.right() - disque.width() - m_disqueBound.left())) + m_disqueBound.left());
m_disquePos.setY(static_cast<int>(MUtils::next_rand_u32() % static_cast<unsigned int>(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();

View File

@ -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("<nobr>%2</nobr>").arg(tr("Error: The selected output directory is not writable!")));

View File

@ -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<br><nobr>%2</nobr><br><br>%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();

View File

@ -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))

View File

@ -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))

View File

@ -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);

View File

@ -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;