OSDN Git Service

Added support for a few Playlist file name prefixes. Will be chosen based on the...
authorlordmulder <mulder2@gmx.de>
Tue, 6 Sep 2011 16:47:13 +0000 (18:47 +0200)
committerlordmulder <mulder2@gmx.de>
Tue, 6 Sep 2011 16:47:13 +0000 (18:47 +0200)
doc/Changelog.html
etc/Translation/Blank.ts
src/Config.h
src/Dialog_Processing.cpp
src/Global.cpp

index feb0442..e817c65 100644 (file)
@@ -27,6 +27,7 @@ a:visited { color: #0000EE; }
 <li>Updated language files (big thank-you to all contributors !!!)
 <li>Improved "downmix" filter by using explicit channel mappings for each number of input channels
 <li>Fixed Cue Sheet import for tracks with certain characters in the title
+<li>Fixed a problem with the "normalization" filter that sometimes caused the resulting file to be empty
 <li>Workaround for malicious "anti-virus" programs that prevent innocent applications from functioning
 <li>Enabled "Aero Glass" theme in installer and web-update program (Vista and Windows 7 only)
 <li>Restored Windows 2000 support with Visual Studio 2010 builds (this is experimental!)
index 9e943d1..d22afe8 100644 (file)
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Dialog_Processing.cpp" line="786"/>
+        <location filename="../../src/Dialog_Processing.cpp" line="798"/>
         <source>Playlist creation failed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Dialog_Processing.cpp" line="786"/>
+        <location filename="../../src/Dialog_Processing.cpp" line="798"/>
         <source>The playlist file could not be created:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Dialog_Processing.cpp" line="826"/>
+        <location filename="../../src/Dialog_Processing.cpp" line="838"/>
         <source>Warning: Computer will shutdown in %1 seconds...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Dialog_Processing.cpp" line="830"/>
-        <location filename="../../src/Dialog_Processing.cpp" line="831"/>
+        <location filename="../../src/Dialog_Processing.cpp" line="842"/>
+        <location filename="../../src/Dialog_Processing.cpp" line="843"/>
         <source>Cancel Shutdown</source>
         <translation type="unfinished"></translation>
     </message>
index 7eb8f1f..5114c62 100644 (file)
@@ -30,7 +30,7 @@
 #define VER_LAMEXP_MINOR_LO                                    3
 #define VER_LAMEXP_TYPE                                                Beta
 #define VER_LAMEXP_PATCH                                       1
-#define VER_LAMEXP_BUILD                                       683
+#define VER_LAMEXP_BUILD                                       684
 
 ///////////////////////////////////////////////////////////////////////////////
 // Tools versions
index 644bd80..fdb6e87 100644 (file)
@@ -723,8 +723,11 @@ void ProcessingDialog::writePlayList(void)
        }
        
        //Init local variables
-       const static char *invalidChars = "\\/:*?\"<>|";
        QStringList list;
+       QRegExp regExp1("\\[\\d\\d\\][^/\\\\]+$", Qt::CaseInsensitive);
+       QRegExp regExp2("\\(\\d\\d\\)[^/\\\\]+$", Qt::CaseInsensitive);
+       QRegExp regExp3("\\d\\d[^/\\\\]+$", Qt::CaseInsensitive);
+       bool usePrefix[3] = {true, true, true};
        bool useUtf8 = false;
        int counter = 1;
 
@@ -736,10 +739,7 @@ void ProcessingDialog::writePlayList(void)
        }
 
        //Clean playlist name
-       for(int i = 0; invalidChars[i]; i++)
-       {
-               playListName = playListName.replace(invalidChars[i], ' ').simplified();
-       }
+       playListName = lamexp_clean_filename(playListName);
 
        //Create list of audio files
        for(int i = 0; i < m_allJobs.count(); i++)
@@ -748,6 +748,18 @@ void ProcessingDialog::writePlayList(void)
                list << QDir::toNativeSeparators(QDir(m_settings->outputDir()).relativeFilePath(m_playList.value(m_allJobs.at(i), "N/A")));
        }
 
+       //Use prefix?
+       for(int i = 0; i < list.count(); i++)
+       {
+               if(regExp1.indexIn(list.at(i)) < 0) usePrefix[0] = false;
+               if(regExp2.indexIn(list.at(i)) < 0) usePrefix[1] = false;
+               if(regExp3.indexIn(list.at(i)) < 0) usePrefix[2] = false;
+       }
+       if(usePrefix[0] || usePrefix[1] || usePrefix[2])
+       {
+               playListName.prepend(usePrefix[0] ? "[00] " : (usePrefix[1] ? "(00) " : "00 "));
+       }
+
        //Do we need an UTF-8 playlist?
        for(int i = 0; i < list.count(); i++)
        {
index de198f8..2566dcc 100644 (file)
@@ -1553,6 +1553,7 @@ void lamexp_blink_window(QWidget *poWindow, unsigned int count, unsigned int del
 const QString lamexp_clean_filename(const QString &str)
 {
        QString newStr(str);
+       
        newStr.replace("\\", "-");
        newStr.replace(" / ", ", ");
        newStr.replace("/", ",");
@@ -1562,7 +1563,8 @@ const QString lamexp_clean_filename(const QString &str)
        newStr.replace("<", "[");
        newStr.replace(">", "]");
        newStr.replace("|", "!");
-       return newStr;
+       
+       return newStr.simplified();
 }
 
 /*