///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
QAACEncoder::QAACEncoder(void)
:
- m_binary_enc(lamexp_lookup_tool("qaac.exe"))
+ m_binary_enc(lamexp_lookup_tool("qaac.exe")),
+ m_binary_dll(lamexp_lookup_tool("libsoxrate.dll"))
{
- if(m_binary_enc.isEmpty())
+ if(m_binary_enc.isEmpty() || m_binary_dll.isEmpty())
{
throw "Error initializing QAAC. Tool 'qaac.exe' is not registred!";
}
process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
- env.insert("PATH", QString("%1;%2").arg(QDir::toNativeSeparators(QDir(QCoreApplication::applicationDirPath()).canonicalPath()), QDir::toNativeSeparators(lamexp_temp_folder2())));
- env.insert("TEMP", QDir::toNativeSeparators(lamexp_temp_folder2()));
- env.insert("TMP", QDir::toNativeSeparators(lamexp_temp_folder2()));
+ env.insert("PATH", QDir::toNativeSeparators(QString("%1;%1/QTfiles;%2").arg(QDir(QCoreApplication::applicationDirPath()).canonicalPath(), lamexp_temp_folder2())));
process.setProcessEnvironment(env);
if(m_configRCMode != SettingsModel::VBRMode)
args << "--abr" << QString::number(qBound(32, m_configBitrate * 8, 500));
break;
case SettingsModel::VBRMode:
- args << "--tvbr" << QString::number(qBound(0, qRound((static_cast<double>(m_configBitrate * 5) / 100.0) * 127.0), 127));
+ args << "--tvbr" << QString::number(qBound(0, m_configBitrate * 4, 127));
break;
default:
throw "Bad rate-control mode!";
if(!m_configCustomParams.isEmpty()) args << m_configCustomParams.split(" ", QString::SkipEmptyParts);
- if(!metaInfo.fileName().isEmpty()) args << "--title" << metaInfo.fileName();
- if(!metaInfo.fileArtist().isEmpty()) args << "--artist" << metaInfo.fileArtist();
- if(!metaInfo.fileAlbum().isEmpty()) args << "--album" << metaInfo.fileAlbum();
- if(!metaInfo.fileGenre().isEmpty()) args << "--genre" << metaInfo.fileGenre();
- if(!metaInfo.fileComment().isEmpty()) args << "--comment" << metaInfo.fileComment();
+ if(!metaInfo.fileName().isEmpty()) args << "--title" << cleanTag(metaInfo.fileName());
+ if(!metaInfo.fileArtist().isEmpty()) args << "--artist" << cleanTag(metaInfo.fileArtist());
+ if(!metaInfo.fileAlbum().isEmpty()) args << "--album" << cleanTag(metaInfo.fileAlbum());
+ if(!metaInfo.fileGenre().isEmpty()) args << "--genre" << cleanTag(metaInfo.fileGenre());
+ if(!metaInfo.fileComment().isEmpty()) args << "--comment" << cleanTag( metaInfo.fileComment());
if(metaInfo.fileYear()) args << "--date" << QString::number(metaInfo.fileYear());
if(metaInfo.filePosition()) args << "--track" << QString::number(metaInfo.filePosition());
if(!metaInfo.fileCover().isEmpty()) args << "--artwork" << metaInfo.fileCover();
emit statusUpdated(100);
emit messageLogged(QString().sprintf("\nExited with code: 0x%04X", process.exitCode()));
- if(bTimeout || bAborted || process.exitStatus() != QProcess::NormalExit)
+ if(bTimeout || bAborted || process.exitCode() != EXIT_SUCCESS)
{
return false;
}