Changes between v4.00 and v4.01:<br><ul>
<li>Added an option to manually specify the number of parallel instances
+<li>Added an option to select a user-defined TEMP directory
<li>Updated LAME encoder to v3.99.0.12 (2011-02-13), compiled with ICL 12.0.2
<li>Updated Vorbis encoder to v2.87 using aoTuV Beta-6.01 (2011-02-22), compiled with ICL 11.1 and MSVC 9.0
<li>Updated language files (big "thank you" to all contributors !!!)
<translation type="unfinished"></translation>
</message>
<message>
+ <source> Temp Directory </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Reset Advanced Options </source>
<translation type="unfinished"></translation>
</message>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Not Found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Low Diskspace Warning</source>
<translation type="unfinished"></translation>
</message>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Do you really want to disable the update reminder?</source>
<translation type="unfinished"></translation>
</message>
<source>%1 Instance(s)</source>
<translation>%1 Instanz(en)</translation>
</message>
+ <message>
+ <source> Temp Directory </source>
+ <translation> Temp Verzeichnis </translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation>Durchsuchen...</translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation>Temporäre Dateien im standard TEMP Verzeichnis des Systems speichern (Empfohlen)</translation>
+ </message>
+ <message>
+ <source>Not Found</source>
+ <translation>Nicht Gefunden</translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation>Das derzeit ausgewählte TEMP Verzeichnis existiert nicht mehr:</translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation>Standard Wiederherstellen</translation>
+ </message>
+ <message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation>In das ausgewählte Verzeichnis kann nicht geschrieben werden. Bitte ein anderes Verzeichnis auswählen!</translation>
+ </message>
</context>
<context>
<name>MetaInfo</name>
<source>%1 Instance(s)</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source> Temp Directory </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MetaInfo</name>
<source>%1 Instance(s)</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source> Temp Directory </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MetaInfo</name>
<source>%1 Instance(s)</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source> Temp Directory </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MetaInfo</name>
<source>%1 Instance(s)</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source> Temp Directory </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MetaInfo</name>
<source>%1 Instance(s)</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source> Temp Directory </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Store temporary files in your system's default TEMP directory (Recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Your currently selected TEMP folder does not exist anymore:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restore Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot write to the selected directory. Please choose another directory!</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MetaInfo</name>
<x>0</x>
<y>0</y>
<width>604</width>
- <height>965</height>
+ <height>1091</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
</layout>
</widget>
</item>
+ <item row="8" column="0">
+ <widget class="QGroupBox" name="groupBox_13">
+ <property name="font">
+ <font>
+ <weight>50</weight>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="title">
+ <string> Temp Directory </string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_34">
+ <item row="0" column="1">
+ <layout class="QGridLayout" name="gridLayout_33">
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="lineEditCustomTempFolder">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QPushButton" name="buttonBrowseCustomTempFolder">
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../res/Icons.qrc">
+ <normaloff>:/icons/folder_explore.png</normaloff>:/icons/folder_explore.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="2">
+ <widget class="QCheckBox" name="checkBoxUseSystemTempFolder">
+ <property name="text">
+ <string>Store temporary files in your system's default TEMP directory (Recommended)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="2">
+ <spacer name="verticalSpacer_20">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="1" colspan="2">
+ <spacer name="verticalSpacer_21">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <spacer name="horizontalSpacer_37">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="3">
+ <spacer name="horizontalSpacer_38">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" colspan="2">
+ <spacer name="verticalSpacer_22">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>4</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
</layout>
</item>
<item row="6" column="0">
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
+ <include location="../res/Icons.qrc"/>
+ <include location="../res/Icons.qrc"/>
+ <include location="../res/Icons.qrc"/>
+ <include location="../res/Icons.qrc"/>
</resources>
<connections>
<connection>
</hint>
</hints>
</connection>
+ <connection>
+ <sender>checkBoxUseSystemTempFolder</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>lineEditCustomTempFolder</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>323</x>
+ <y>302</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>283</x>
+ <y>265</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>checkBoxUseSystemTempFolder</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>buttonBrowseCustomTempFolder</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>323</x>
+ <y>302</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>551</x>
+ <y>265</y>
+ </hint>
+ </hints>
+ </connection>
</connections>
</ui>
<file>icons/folder_add.png</file>
<file>icons/folder_go.png</file>
<file>icons/folder_image.png</file>
+ <file>icons/folder_explore.png</file>
<file>icons/folder_page.png</file>
<file>icons/font.png</file>
<file>icons/house.png</file>
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 1
-#define VER_LAMEXP_BUILD 336
+#define VER_LAMEXP_BUILD 338
#define VER_LAMEXP_SUFFIX Beta-3
/*
QProcess process;
QStringList args;
- process.setWorkingDirectory(lamexp_temp_folder());
+ process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
args << "-V3" << "-S" << "--temp" << ".";
args << QDir::toNativeSeparators(sourceFile);
while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2Pass()) checkBoxNeroAAC2PassMode->click();
while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabled()) checkBoxNormalizationFilter->click();
while(checkBoxAutoDetectInstances->isChecked() != (m_settings->maximumInstances() < 1)) checkBoxAutoDetectInstances->click();
+ while(checkBoxUseSystemTempFolder->isChecked() == m_settings->customTempPathEnabled()) checkBoxUseSystemTempFolder->click();
lineEditCustomParamLAME->setText(m_settings->customParametersLAME());
lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc());
lineEditCustomParamNeroAAC->setText(m_settings->customParametersNeroAAC());
lineEditCustomParamFLAC->setText(m_settings->customParametersFLAC());
+ lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPath()));
connect(sliderLameAlgoQuality, SIGNAL(valueChanged(int)), this, SLOT(updateLameAlgoQuality(int)));
connect(checkBoxBitrateManagement, SIGNAL(clicked(bool)), this, SLOT(bitrateManagementEnabledChanged(bool)));
connect(spinBoxBitrateManagementMin, SIGNAL(valueChanged(int)), this, SLOT(bitrateManagementMinChanged(int)));
connect(lineEditCustomParamFLAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(sliderMaxInstances, SIGNAL(valueChanged(int)), this, SLOT(updateMaximumInstances(int)));
connect(checkBoxAutoDetectInstances, SIGNAL(clicked(bool)), this, SLOT(autoDetectInstancesChanged(bool)));
+ connect(buttonBrowseCustomTempFolder, SIGNAL(clicked()), this, SLOT(browseCustomTempFolderButtonClicked()));
+ connect(lineEditCustomTempFolder, SIGNAL(textChanged(QString)), this, SLOT(customTempFolderChanged(QString)));
+ connect(checkBoxUseSystemTempFolder, SIGNAL(clicked(bool)), this, SLOT(useCustomTempFolderChanged(bool)));
connect(buttonResetAdvancedOptions, SIGNAL(clicked()), this, SLOT(resetAdvancedOptionsButtonClicked()));
updateLameAlgoQuality(sliderLameAlgoQuality->value());
updateMaximumInstances(sliderMaxInstances->value());
while(true)
{
- QString setupFile = QString("%1/%2.exe").arg(lamexp_temp_folder(), lamexp_rand_str());
+ QString setupFile = QString("%1/%2.exe").arg(lamexp_temp_folder2(), lamexp_rand_str());
QProcess process;
process.setWorkingDirectory(QFileInfo(setupFile).absolutePath());
return;
}
- __int64 currentFreeDiskspace = lamexp_free_diskspace(lamexp_temp_folder());
+ QString tempFolder = m_settings->customTempPathEnabled() ? m_settings->customTempPath() : lamexp_temp_folder2();
+ if(!QFileInfo(tempFolder).exists() || !QFileInfo(tempFolder).isDir())
+ {
+ if(QMessageBox::warning(this, tr("Not Found"), QString("<nobr>%1</nobr><br><nobr>%2</nobr>").arg(tr("Your currently selected TEMP folder does not exist anymore:"), QDir::toNativeSeparators(tempFolder)), tr("Restore Default"), tr("Cancel")) == 0)
+ {
+ while(checkBoxUseSystemTempFolder->isChecked() == m_settings->customTempPathEnabledDefault()) checkBoxUseSystemTempFolder->click();
+ }
+ return;
+ }
+ qint64 currentFreeDiskspace = lamexp_free_diskspace(tempFolder);
if(currentFreeDiskspace < (oneGigabyte * minimumFreeDiskspaceMultiplier))
{
- QStringList tempFolderParts = lamexp_temp_folder().split("/", QString::SkipEmptyParts, Qt::CaseInsensitive);
+ QStringList tempFolderParts = tempFolder.split("/", QString::SkipEmptyParts, Qt::CaseInsensitive);
tempFolderParts.takeLast();
if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), QString("<nobr>%1</nobr><br><nobr>%2</nobr><br><br>%3").arg(tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.").arg(QString::number(minimumFreeDiskspaceMultiplier)), tr("It is highly recommend to free up more diskspace before proceeding with the encode!"), tr("Your TEMP folder is located at:")).append("<br><nobr><i><a href=\"file:///%3\">%3</a></i></nobr><br>").arg(tempFolderParts.join("\\")), tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore")))
}
/*
+ * Browse for custom TEMP folder button clicked
+ */
+void MainWindow::browseCustomTempFolderButtonClicked(void)
+{
+ QString newTempFolder = QFileDialog::getExistingDirectory(this);
+
+ if(!newTempFolder.isEmpty())
+ {
+ QFile writeTest(QString("%1/~%2.tmp").arg(newTempFolder, lamexp_rand_str()));
+ if(writeTest.open(QIODevice::ReadWrite))
+ {
+ writeTest.remove();
+ lineEditCustomTempFolder->setText(QDir::toNativeSeparators(newTempFolder));
+ }
+ else
+ {
+ QMessageBox::warning(this, tr("Access Denied"), tr("Cannot write to the selected directory. Please choose another directory!"));
+ }
+ }
+}
+
+/*
+ * Custom TEMP folder changed
+ */
+void MainWindow::customTempFolderChanged(const QString &text)
+{
+ m_settings->customTempPath(QDir::fromNativeSeparators(text));
+}
+
+/*
+ * Use custom TEMP folder option changed
+ */
+void MainWindow::useCustomTempFolderChanged(bool checked)
+{
+ m_settings->customTempPathEnabled(!checked);
+}
+
+/*
* Reset all advanced options to their defaults
*/
void MainWindow::resetAdvancedOptionsButtonClicked(void)
while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2PassDefault()) checkBoxNeroAAC2PassMode->click();
while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabledDefault()) checkBoxNormalizationFilter->click();
while(checkBoxAutoDetectInstances->isChecked() != (m_settings->maximumInstancesDefault() < 1)) checkBoxAutoDetectInstances->click();
+ while(checkBoxUseSystemTempFolder->isChecked() == m_settings->customTempPathEnabledDefault()) checkBoxUseSystemTempFolder->click();
lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault());
lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault());
lineEditCustomParamNeroAAC->setText(m_settings->customParametersNeroAACDefault());
lineEditCustomParamFLAC->setText(m_settings->customParametersFLACDefault());
+ lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
customParamsChanged();
scrollArea->verticalScrollBar()->setValue(0);
}
void customParamsChanged(void);
void updateMaximumInstances(int value);
void autoDetectInstancesChanged(bool checked);
+ void browseCustomTempFolderButtonClicked(void);
+ void customTempFolderChanged(const QString &text);
+ void useCustomTempFolderChanged(bool checked);
void resetAdvancedOptionsButtonClicked(void);
void sourceModelChanged(void);
void metaTagsEnabledChanged(void);
ProcessThread *thread = new ProcessThread
(
currentFile,
- (m_settings->outputToSourceDir() ? QFileInfo(currentFile.filePath()).absolutePath(): m_settings->outputDir()),
+ (m_settings->outputToSourceDir() ? QFileInfo(currentFile.filePath()).absolutePath() : m_settings->outputDir()),
+ (m_settings->customTempPathEnabled() ? m_settings->customTempPath() : lamexp_temp_folder2()),
encoder,
m_settings->prependRelativeSourcePath()
);
if(connectionScore < MIN_CONNSCORE)
{
m_logFile->append(QStringList() << "" << "Testing host:" << known_hosts[i] << "");
- QString outFile = QString("%1/%2.htm").arg(lamexp_temp_folder(), lamexp_rand_str());
+ QString outFile = QString("%1/%2.htm").arg(lamexp_temp_folder2(), lamexp_rand_str());
if(getFile(known_hosts[i], outFile))
{
connectionScore++;
m_logFile->append(QStringList() << "" << "Trying mirror:" << url);
QString randPart = lamexp_rand_str();
- QString outFileVersionInfo = QString("%1/%2.ver").arg(lamexp_temp_folder(), randPart);
- QString outFileSignature = QString("%1/%2.sig").arg(lamexp_temp_folder(), randPart);
+ QString outFileVersionInfo = QString("%1/%2.ver").arg(lamexp_temp_folder2(), randPart);
+ QString outFileSignature = QString("%1/%2.sig").arg(lamexp_temp_folder2(), randPart);
m_logFile->append(QStringList() << "" << "Downloading update info:");
bool ok1 = getFile(QString("%1%2").arg(url, mirror_url_postfix[lamexp_version_demo() ? 1 : 0]), outFileVersionInfo);
memset(&fileOperation, 0, sizeof(SHFILEOPSTRUCTW));
fileOperation.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_FILESONLY;
+ emit messageLogged(QString("Copy file \"%1\" to \"%2\"").arg(sourceFile, outputFile));
+ fileOperation.wFunc = FO_COPY;
+
+ /*
if(lamexp_temp_folder().compare(QFileInfo(sourceFile).canonicalPath(), Qt::CaseInsensitive) == 0)
{
//If the source is in the TEMP folder take shortcut and move the file
emit messageLogged(QString("Copy file \"%1\" to \"%2\"").arg(sourceFile, outputFile));
fileOperation.wFunc = FO_COPY;
}
+ */
size_t srcLen = wcslen(reinterpret_cast<const wchar_t*>(sourceFile.utf16())) + 3;
wchar_t *srcBuffer = new wchar_t[srcLen];
QProcess process;
QStringList args;
- process.setWorkingDirectory(lamexp_temp_folder());
+ process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
args << "-V3";
args << "--guard" << "--temp" << ".";
QProcess process;
QStringList args;
- process.setWorkingDirectory(lamexp_temp_folder());
+ process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
args << "-V3";
args << "--temp" << ".";
QProcess process;
QStringList args;
- process.setWorkingDirectory(lamexp_temp_folder());
+ process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
args << "-V3";
args << "--guard" << "--temp" << ".";
#include <QDir>
#include <QProcess>
#include <QRegExp>
+#include <QFileInfo>
ToneAdjustFilter::ToneAdjustFilter(int bass, int treble)
:
QProcess process;
QStringList args;
- process.setWorkingDirectory(lamexp_temp_folder());
+ process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
args << "-V3";
args << "--guard" << "--temp" << ".";
/*
* Get LameXP temp folder
*/
-const QString &lamexp_temp_folder(void)
+const QString &lamexp_temp_folder2(void)
{
static const char *TEMP_STR = "Temp";
{
if(!QFile::remove(filename))
{
- DWORD attributes = GetFileAttributesW(reinterpret_cast<const wchar_t*>(filename.utf16()));
- SetFileAttributesW(reinterpret_cast<const wchar_t*>(filename.utf16()), (attributes & (~FILE_ATTRIBUTE_READONLY)));
+ DWORD attributes = GetFileAttributesW(QWCHAR(filename));
+ SetFileAttributesW(QWCHAR(filename), (attributes & (~FILE_ATTRIBUTE_READONLY)));
if(!QFile::remove(filename))
{
qWarning("Could not delete \"%s\"", filename.toLatin1().constData());
unsigned int lamexp_tool_version(const QString &toolName);
void lamexp_finalization(void);
QString lamexp_rand_str(void);
-const QString &lamexp_temp_folder(void);
+const QString &lamexp_temp_folder2(void);
void lamexp_ipc_read(unsigned int *command, char* message, size_t buffSize);
void lamexp_ipc_send(unsigned int command, const char* message);
lamexp_cpu_t lamexp_detect_cpu_features(void);
MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
+MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath");
+MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath");
//LUT
const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1};
MAKE_OPTION2(customParametersFLAC, QString());
MAKE_OPTION4(metaInfoPosition, UINT_MAX);
MAKE_OPTION4(maximumInstances, 0);
+MAKE_OPTION2(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation));
+MAKE_OPTION3(customTempPathEnabled, false);
MAKE_OPTION_DEC2(customParametersFLAC);
MAKE_OPTION_DEC4(metaInfoPosition);
MAKE_OPTION_DEC4(maximumInstances);
+ MAKE_OPTION_DEC2(customTempPath);
+ MAKE_OPTION_DEC3(customTempPathEnabled);
//Misc
void validate(void);
{
throw "The required checksum is missing, take care!";
}
- LockedFile *lockedFile = new LockedFile(QString(":/tools/%1").arg(toolName), QString(lamexp_temp_folder()).append(QString("/tool_%1").arg(toolName)), toolHash);
+ LockedFile *lockedFile = new LockedFile(QString(":/tools/%1").arg(toolName), QString(lamexp_temp_folder2()).append(QString("/tool_%1").arg(toolName)), toolHash);
lamexp_register_tool(toolName, lockedFile, toolVersion);
}
catch(char *errorMsg)
// Constructor
////////////////////////////////////////////////////////////
-ProcessThread::ProcessThread(const AudioFileModel &audioFile, const QString &outputDirectory, AbstractEncoder *encoder, const bool prependRelativeSourcePath)
+ProcessThread::ProcessThread(const AudioFileModel &audioFile, const QString &outputDirectory, const QString &tempDirectory, AbstractEncoder *encoder, const bool prependRelativeSourcePath)
:
m_audioFile(audioFile),
m_outputDirectory(outputDirectory),
+ m_tempDirectory(tempDirectory),
m_encoder(encoder),
m_jobId(QUuid::createUuid()),
m_prependRelativeSourcePath(prependRelativeSourcePath),
QString ProcessThread::generateTempFileName(void)
{
QMutexLocker lock(m_mutex_genFileName);
- QString tempFileName = QString("%1/%2.wav").arg(lamexp_temp_folder(), lamexp_rand_str());
+ QString tempFileName = QString("%1/%2.wav").arg(m_tempDirectory, lamexp_rand_str());
while(QFileInfo(tempFileName).exists())
{
- tempFileName = QString("%1/%2.wav").arg(lamexp_temp_folder(), lamexp_rand_str());
+ tempFileName = QString("%1/%2.wav").arg(m_tempDirectory, lamexp_rand_str());
}
QFile file(tempFileName);
Q_OBJECT
public:
- ProcessThread(const AudioFileModel &audioFile, const QString &outputDirectory, AbstractEncoder *encoder, const bool prependRelativeSourcePath);
+ ProcessThread(const AudioFileModel &audioFile, const QString &outputDirectory, const QString &tempDirectory, AbstractEncoder *encoder, const bool prependRelativeSourcePath);
~ProcessThread(void);
void run();
AudioFileModel m_audioFile;
AbstractEncoder *m_encoder;
const QString m_outputDirectory;
+ const QString m_tempDirectory;
volatile bool m_aborted;
ProcessStep m_currentStep;
QStringList m_tempFiles;