Preview example file name for current rename pattern.

This commit is contained in:
LoRd_MuldeR 2011-08-05 15:41:19 +02:00
parent 613c9721a7
commit 229357f77c
17 changed files with 573 additions and 240 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1606,6 +1606,18 @@
<source>File name without extension</source> <source>File name without extension</source>
<translation>Dateiname ohne Erweiterung</translation> <translation>Dateiname ohne Erweiterung</translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation>Umbenennungsschema:</translation>
</message>
<message>
<source>Example File Name:</source>
<translation>Beispiel Dateiname:</translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation>Verbotene Zeichen in Dateinamen:</translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1894,6 +1906,26 @@
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation>In das Zielverzeichnis kann nicht geschrieben werden:</translation> <translation>In das Zielverzeichnis kann nicht geschrieben werden:</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation>Unbekannter Dateiname</translation>
</message>
<message>
<source>Unknown Title</source>
<translation>Unbekannter Titel</translation>
</message>
<message>
<source>Unknown Artist</source>
<translation>Unbekannter Künstler</translation>
</message>
<message>
<source>Unknown Album</source>
<translation>Unbekanntes Album</translation>
</message>
<message>
<source>Unknown Comment</source>
<translation>Unbekannter Kommentar</translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1605,6 +1605,18 @@
<source>File name without extension</source> <source>File name without extension</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Example File Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1893,6 +1905,26 @@
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation>NO se puede escribir en la carpeta de salida:</translation> <translation>NO se puede escribir en la carpeta de salida:</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Title</source>
<translation type="unfinished">Título desconocido</translation>
</message>
<message>
<source>Unknown Artist</source>
<translation type="unfinished">Artista desconocido</translation>
</message>
<message>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1615,6 +1615,18 @@ Ouvrir le dossier récursivement...</translation>
<source>File name without extension</source> <source>File name without extension</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Example File Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1903,6 +1915,26 @@ Ouvrir le dossier récursivement...</translation>
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation>Le répertoire de sortie cible n&apos;est pas accessible en écriture:</translation> <translation>Le répertoire de sortie cible n&apos;est pas accessible en écriture:</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Title</source>
<translation type="unfinished">Titre inconnu</translation>
</message>
<message>
<source>Unknown Artist</source>
<translation type="unfinished">Artiste inconnu</translation>
</message>
<message>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1606,6 +1606,18 @@
<source>File name without extension</source> <source>File name without extension</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Example File Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1894,6 +1906,26 @@
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation>La directory di destinazione è a SOLA lettura:</translation> <translation>La directory di destinazione è a SOLA lettura:</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1605,6 +1605,18 @@
<source>File name without extension</source> <source>File name without extension</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Example File Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1893,6 +1905,26 @@
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation type="unfinished"> :</translation> <translation type="unfinished"> :</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1611,6 +1611,18 @@
<source>File name without extension</source> <source>File name without extension</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Example File Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1900,6 +1912,26 @@
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation type="unfinished">Папка для выходных файлов недоступна для записи:</translation> <translation type="unfinished">Папка для выходных файлов недоступна для записи:</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Title</source>
<translation type="unfinished">Неизвестное Название</translation>
</message>
<message>
<source>Unknown Artist</source>
<translation type="unfinished">Неизвестный Артист</translation>
</message>
<message>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1606,6 +1606,18 @@
<source>File name without extension</source> <source>File name without extension</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Rename Pattern:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Example File Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Characters forbidden in file names:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MetaInfo</name> <name>MetaInfo</name>
@ -1894,6 +1906,26 @@
<source>The target output directory is NOT writable:</source> <source>The target output directory is NOT writable:</source>
<translation>До вихідної теки неможливо проводити запис:</translation> <translation>До вихідної теки неможливо проводити запис:</translation>
</message> </message>
<message>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Title</source>
<translation type="unfinished">Невідомий заголовок</translation>
</message>
<message>
<source>Unknown Artist</source>
<translation type="unfinished">Невідомий виконавець</translation>
</message>
<message>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>

View File

@ -1068,7 +1068,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>604</width> <width>604</width>
<height>1365</height> <height>1393</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_22"> <layout class="QGridLayout" name="gridLayout_22">
@ -2827,7 +2827,7 @@
<layout class="QGridLayout" name="gridLayout_38"> <layout class="QGridLayout" name="gridLayout_38">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_37"> <layout class="QGridLayout" name="gridLayout_37">
<item row="1" column="0" rowspan="3"> <item row="1" column="0" rowspan="5">
<spacer name="horizontalSpacer_43"> <spacer name="horizontalSpacer_43">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -2843,7 +2843,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="3" rowspan="3"> <item row="1" column="4" rowspan="5">
<spacer name="horizontalSpacer_44"> <spacer name="horizontalSpacer_44">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -2859,7 +2859,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="1" colspan="2"> <item row="1" column="2" colspan="2">
<widget class="QLineEdit" name="lineEditRenamePattern"> <widget class="QLineEdit" name="lineEditRenamePattern">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2877,7 +2877,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" colspan="2"> <item row="0" column="1" colspan="3">
<spacer name="verticalSpacer_26"> <spacer name="verticalSpacer_26">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -2893,7 +2893,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="4" column="1" colspan="2"> <item row="6" column="1" colspan="3">
<spacer name="verticalSpacer_27"> <spacer name="verticalSpacer_27">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -2909,20 +2909,14 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="1"> <item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxRenameOutput"> <widget class="QCheckBox" name="checkBoxRenameOutput">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Rename Output Files</string> <string>Rename Output Files</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="2"> <item row="4" column="1" colspan="3">
<spacer name="verticalSpacer_28"> <spacer name="verticalSpacer_28">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -2938,8 +2932,14 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="2"> <item row="5" column="3">
<widget class="QLabel" name="labelShowRenameMacros"> <widget class="QLabel" name="labelShowRenameMacros">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>&lt;a href=&quot;reset&quot;&gt;Reset&lt;/a&gt; &amp;nbsp; &lt;a href=&quot;#&quot;&gt;Show List of Macros&lt;/a&gt;</string> <string>&lt;a href=&quot;reset&quot;&gt;Reset&lt;/a&gt; &amp;nbsp; &lt;a href=&quot;#&quot;&gt;Show List of Macros&lt;/a&gt;</string>
</property> </property>
@ -2948,6 +2948,64 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="3">
<spacer name="verticalSpacer_29">
<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>1</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Rename Pattern:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Example File Name:</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QLabel" name="labelRanameExample">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -3646,6 +3704,11 @@
<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"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 3 #define VER_LAMEXP_MINOR_LO 3
#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 7 #define VER_LAMEXP_PATCH 7
#define VER_LAMEXP_BUILD 618 #define VER_LAMEXP_BUILD 621
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Tools versions // Tools versions

View File

@ -731,6 +731,7 @@ void MainWindow::changeEvent(QEvent *e)
updateEncoder(m_settings->compressionEncoder()); updateEncoder(m_settings->compressionEncoder());
updateLameAlgoQuality(sliderLameAlgoQuality->value()); updateLameAlgoQuality(sliderLameAlgoQuality->value());
updateMaximumInstances(sliderMaxInstances->value()); updateMaximumInstances(sliderMaxInstances->value());
renameOutputPatternChanged(lineEditRenamePattern->text());
//Re-install shell integration //Re-install shell integration
if(m_settings->shellIntegrationEnabled()) if(m_settings->shellIntegrationEnabled())
@ -2741,15 +2742,15 @@ void MainWindow::renameOutputPatternChanged(void)
*/ */
void MainWindow::renameOutputPatternChanged(const QString &text) void MainWindow::renameOutputPatternChanged(const QString &text)
{ {
QString pattern(text); QString pattern(text.simplified());
pattern.remove("<BaseName>", Qt::CaseInsensitive); pattern.replace("<BaseName>", "The_White_Stripes_-_Fell_In_Love_With_A_Girl", Qt::CaseInsensitive);
pattern.remove("<TrackNo>", Qt::CaseInsensitive); pattern.replace("<TrackNo>", "04", Qt::CaseInsensitive);
pattern.remove("<Title>", Qt::CaseInsensitive); pattern.replace("<Title>", "Fell In Love With A Girl", Qt::CaseInsensitive);
pattern.remove("<Artist>", Qt::CaseInsensitive); pattern.replace("<Artist>", "The White Stripes", Qt::CaseInsensitive);
pattern.remove("<Album>", Qt::CaseInsensitive); pattern.replace("<Album>", "White Blood Cells", Qt::CaseInsensitive);
pattern.remove("<Year>", Qt::CaseInsensitive); pattern.replace("<Year>", "2001", Qt::CaseInsensitive);
pattern.remove("<Comment>", Qt::CaseInsensitive); pattern.replace("<Comment>", "Encoded by LameXP", Qt::CaseInsensitive);
if(pattern.compare(lamexp_clean_filename(pattern))) if(pattern.compare(lamexp_clean_filename(pattern)))
{ {
@ -2767,6 +2768,8 @@ void MainWindow::renameOutputPatternChanged(const QString &text)
SET_TEXT_COLOR(lineEditRenamePattern, Qt::black); SET_TEXT_COLOR(lineEditRenamePattern, Qt::black);
} }
} }
labelRanameExample->setText(lamexp_clean_filename(pattern));
} }
/* /*
@ -2790,7 +2793,9 @@ void MainWindow::showRenameMacros(const QString &text)
message += QString(format).arg("Album", tr("Album name")); message += QString(format).arg("Album", tr("Album name"));
message += QString(format).arg("Year", tr("Year with (at least) four digits")); message += QString(format).arg("Year", tr("Year with (at least) four digits"));
message += QString(format).arg("Comment", tr("Comment")); message += QString(format).arg("Comment", tr("Comment"));
message += "</table><br>"; message += "</table><br><br>";
message += QString("%1<br>").arg(tr("Characters forbidden in file names:"));
message += "<b><tt>\\ / : * ? &lt; &gt; |<br>";
QMessageBox::information(this, tr("Rename Macros"), message, tr("Discard")); QMessageBox::information(this, tr("Rename Macros"), message, tr("Discard"));
} }

View File

@ -44,6 +44,7 @@
#include <stdlib.h> #include <stdlib.h>
#define DIFF(X,Y) ((X > Y) ? (X-Y) : (Y-X)) #define DIFF(X,Y) ((X > Y) ? (X-Y) : (Y-X))
#define STRDEF(STR,DEF) ((!STR.isEmpty()) ? STR : DEF)
QMutex *ProcessThread::m_mutex_genFileName = NULL; QMutex *ProcessThread::m_mutex_genFileName = NULL;
@ -306,13 +307,13 @@ QString ProcessThread::generateOutFileName(void)
} }
QString fileName = m_renamePattern; QString fileName = m_renamePattern;
fileName.replace("<BaseName>", baseName, Qt::CaseInsensitive); fileName.replace("<BaseName>", STRDEF(baseName, tr("Unknown File Name")), Qt::CaseInsensitive);
fileName.replace("<TrackNo>", QString().sprintf("%02d", m_audioFile.filePosition()), Qt::CaseInsensitive); fileName.replace("<TrackNo>", QString().sprintf("%02d", m_audioFile.filePosition()), Qt::CaseInsensitive);
fileName.replace("<Title>", m_audioFile.fileName() , Qt::CaseInsensitive); fileName.replace("<Title>", STRDEF(m_audioFile.fileName(), tr("Unknown Title")) , Qt::CaseInsensitive);
fileName.replace("<Artist>", m_audioFile.fileArtist(), Qt::CaseInsensitive); fileName.replace("<Artist>", STRDEF(m_audioFile.fileArtist(), tr("Unknown Artist")), Qt::CaseInsensitive);
fileName.replace("<Album>", m_audioFile.fileAlbum(), Qt::CaseInsensitive); fileName.replace("<Album>", STRDEF(m_audioFile.fileAlbum(), tr("Unknown Album")), Qt::CaseInsensitive);
fileName.replace("<Year>", QString().sprintf("%04d", m_audioFile.fileYear()), Qt::CaseInsensitive); fileName.replace("<Year>", QString().sprintf("%04d", m_audioFile.fileYear()), Qt::CaseInsensitive);
fileName.replace("<Comment>", m_audioFile.fileComment(), Qt::CaseInsensitive); fileName.replace("<Comment>", STRDEF(m_audioFile.fileComment(), tr("Unknown Comment")), Qt::CaseInsensitive);
fileName = lamexp_clean_filename(fileName).simplified(); fileName = lamexp_clean_filename(fileName).simplified();
QString outFileName = QString("%1/%2.%3").arg(targetDir.canonicalPath(), fileName, m_encoder->extension()); QString outFileName = QString("%1/%2.%3").arg(targetDir.canonicalPath(), fileName, m_encoder->extension());