diff --git a/LameXP.rc b/LameXP.rc index 15ac354c..f72d9e6f 100644 --- a/LameXP.rc +++ b/LameXP.rc @@ -47,15 +47,6 @@ END #endif // APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON "res\\MainIcon.ico" - ///////////////////////////////////////////////////////////////////////////// // // WAVE @@ -69,8 +60,8 @@ IDR_WAVE_ABOUT WAVE "res\\sounds\\uuaarrgh.wav" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,0,0,0 - PRODUCTVERSION 4,0,0,0 + FILEVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD + PRODUCTVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x3L @@ -88,13 +79,13 @@ BEGIN VALUE "Comments", "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY" VALUE "CompanyName", "Free Software Foundation" VALUE "FileDescription", "LameXP - Audio Encoder Front-End" - VALUE "FileVersion", "4.0.0.0" + VALUE "FileVersion", VER_LAMEXP_STR VALUE "InternalName", "LameXP Qt" VALUE "LegalCopyright", "Copyright (C) 2004-2010 LoRd_MuldeR " VALUE "LegalTrademarks", "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License " VALUE "OriginalFilename", "LameXP.exe" VALUE "ProductName", "LameXP - Audio Encoder Front-End" - VALUE "ProductVersion", "v4.00 Pre-Alpha" + VALUE "ProductVersion", VER_LAMEXP_STR END END BLOCK "VarFileInfo" @@ -103,6 +94,15 @@ BEGIN END END + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "res\\MainIcon.ico" #endif // German (Germany) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/LameXP.vcproj b/LameXP.vcproj index 0461e2c2..2fab5ce8 100644 --- a/LameXP.vcproj +++ b/LameXP.vcproj @@ -18,8 +18,8 @@ @@ -69,7 +69,7 @@ LinkIncremental="1" AdditionalLibraryDirectories=""$(QTDIR)\lib";"$(QTDIR)\plugins\imageformats"" GenerateDebugInformation="true" - SubSystem="1" + SubSystem="2" TargetMachine="1" /> @@ -156,7 +156,7 @@ GenerateDebugInformation="false" AssemblyDebug="0" MapExports="false" - SubSystem="1" + SubSystem="2" LinkTimeCodeGeneration="1" TargetMachine="1" /> diff --git a/etc/Deployment/release.bat b/etc/Deployment/release.bat index 8e87875b..20224e34 100644 --- a/etc/Deployment/release.bat +++ b/etc/Deployment/release.bat @@ -2,7 +2,7 @@ call _paths.bat REM ------------------------------------------ set "TEMP_DIR=%TEMP%\~LameXP.%DATE%.tmp" -set "OUT_PATH=..\..\out\Release" +set "OUT_PATH=..\..\bin\Release" set "OUT_FILE=%OUT_PATH%\..\LameXP.%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%.Release.zip" REM ------------------------------------------ del "%OUT_FILE%" @@ -29,8 +29,10 @@ mkdir "%TEMP_DIR%" mkdir "%TEMP_DIR%\imageformats" REM ------------------------------------------ copy "%OUT_PATH%\*.exe" "%TEMP_DIR%" -copy "%QTDIR%\bin\qtcore4.dll" "%TEMP_DIR%" -copy "%QTDIR%\bin\qtgui4.dll" "%TEMP_DIR%" +copy "%QTDIR%\bin\QtCore4.dll" "%TEMP_DIR%" +copy "%QTDIR%\bin\QtGui4.dll" "%TEMP_DIR%" +copy "%QTDIR%\bin\QtXml4.dll" "%TEMP_DIR%" +copy "%QTDIR%\bin\QtSvg4.dll" "%TEMP_DIR%" copy "%QTDIR%\plugins\imageformats\q???4.dll" "%TEMP_DIR%\imageformats" REM ------------------------------------------ for %%f in ("%TEMP_DIR%\*.exe") do ( diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index d82adffd..e7fb1609 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -13,10 +13,6 @@ LameXP - Audio Encoder Front-end - - - :/MainIcon.ico:/MainIcon.ico - @@ -848,11 +844,14 @@ Visit Official Homepage + + Visit Official Web-Site + - :/icons/transmit.png:/icons/transmit.png + :/icons/transmit_blue.png:/icons/transmit_blue.png Check for Updates @@ -898,6 +897,7 @@ + diff --git a/res/Icons.qrc b/res/Icons.qrc index 8a816e30..e42b0045 100644 --- a/res/Icons.qrc +++ b/res/Icons.qrc @@ -2,6 +2,7 @@ MainIcon.ico + MainIcon.png icons/add.png icons/application_view_list.png icons/arrow_down.png @@ -42,7 +43,7 @@ icons/star.png icons/table_edit.png icons/timeline_marker.png - icons/transmit.png + icons/transmit_blue.png icons/user.png icons/world.png diff --git a/res/Images.qrc b/res/Images.qrc index 74015c9d..4a8c71cd 100644 --- a/res/Images.qrc +++ b/res/Images.qrc @@ -9,5 +9,6 @@ images/Splash.png images/Thumb.png images/Construction.gif - + images/Qt.svg + diff --git a/res/MainIcon.ico b/res/MainIcon.ico index 712f2bde..dcace83d 100644 Binary files a/res/MainIcon.ico and b/res/MainIcon.ico differ diff --git a/res/MainIcon.png b/res/MainIcon.png new file mode 100644 index 00000000..2ac0805d Binary files /dev/null and b/res/MainIcon.png differ diff --git a/res/images/Qt.png b/res/images/Qt.png new file mode 100644 index 00000000..edfb94f6 Binary files /dev/null and b/res/images/Qt.png differ diff --git a/res/images/Qt.svg b/res/images/Qt.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/res/images/Qt.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 1dd1d296..76ce0995 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -42,6 +42,8 @@ //Win32 includes #include +#define LINK(URL) QString("%2").arg(URL).arg(URL) + //////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////// @@ -156,11 +158,13 @@ void MainWindow::aboutButtonClicked(void) { QString aboutText; - aboutText += "LameXP - Audio Encoder Front-end
"; - aboutText += "Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
"; - aboutText += QString().sprintf("Version %d.%02d %s, Build %d [%s]

", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData()); - aboutText += "Please visit http://mulder.dummwiedeutsch.de/ for news and updates!


"; - aboutText += "This program is free software; you can redistribute it and/or
"; + aboutText += "

LameXP - Audio Encoder Front-end

"; + aboutText += QString("Copyright (C) 2004-%1 LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.
").arg(max(lamexp_version_date().year(),QDate::currentDate().year())); + aboutText += QString().sprintf("Version %d.%02d %s, Build %d [%s]

", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData()); + aboutText += "Please visit the official web-site at "; + aboutText += LINK("http://mulder.dummwiedeutsch.de/") += " for news and updates!
"; + aboutText += "

"; + aboutText += "This program is free software; you can redistribute it and/or
"; aboutText += "modify it under the terms of the GNU General Public License
"; aboutText += "as published by the Free Software Foundation; either version 2
"; aboutText += "of the License, or (at your option) any later version.

"; @@ -170,26 +174,64 @@ void MainWindow::aboutButtonClicked(void) aboutText += "GNU General Public License for more details.

"; aboutText += "You should have received a copy of the GNU General Public License
"; aboutText += "along with this program; if not, write to the Free Software
"; - aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


"; - aboutText += "This software uses the 'slick' icon set by http://www.famfamfam.com/.
"; + aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

"; + aboutText += "

"; + aboutText += "This software uses the 'slick' icon set by Mark James – http://www.famfamfam.com/.
"; aboutText += "Released under the Creative Commons Attribution 2.5 License.
"; - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); - QApplication::restoreOverrideCursor(); + QMessageBox *aboutBox = new QMessageBox(this); + aboutBox->setText(aboutText); + aboutBox->setIconPixmap(dynamic_cast(QApplication::instance())->windowIcon().pixmap(QSize(64,64))); + aboutBox->setWindowTitle("About LameXP"); + + QPushButton *firstButton = aboutBox->addButton("More About...", QMessageBox::AcceptRole); + firstButton->setIcon(QIcon(":/icons/information.png")); + firstButton->setMinimumWidth(120); + + QPushButton *secondButton = aboutBox->addButton("About Qt...", QMessageBox::AcceptRole); + secondButton->setIcon(QIcon(":/images/Qt.svg")); + secondButton->setMinimumWidth(120); + + QPushButton *thirdButton = aboutBox->addButton("Discard", QMessageBox::AcceptRole); + thirdButton->setIcon(QIcon(":/icons/cross.png")); + thirdButton->setMinimumWidth(90); + + PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); while(1) { - switch(QMessageBox::information(this, "About LameXP", aboutText, " More about... ", " About Qt... ", " Discard ")) + switch(aboutBox->exec()) { case 0: { + const QString li("
  • "); QString moreAboutText; - moreAboutText += "The following third-party software is used in LameXP:

    "; - moreAboutText += "LAME - OpenSource mp3 Encoder
    Released under the terms of the GNU Leser General Public License.
    http://lame.sourceforge.net/

    "; - moreAboutText += "OggEnc - Ogg Vorbis Encoder
    Completely open and patent-free audio encoding technology.
    http://www.vorbis.com/

    "; - moreAboutText += "Nero AAC reference MPEG-4 Encoder
    Freeware state-of-the-art HE-AAC encoder with 2-Pass support.
    http://www.nero.com/eng/technologies-aac-codec.html
    "; - QMessageBox::information(this, "About third-party tools", moreAboutText, "Discard"); + moreAboutText += "

    The following third-party software is used in LameXP:

    "; + moreAboutText += "
      "; + moreAboutText += li + "LAME - OpenSource mp3 Encoder
      "; + moreAboutText += "Released under the terms of the GNU Leser General Public License.
      "; + moreAboutText += LINK("http://lame.sourceforge.net/"); + moreAboutText += "
      "; + moreAboutText += li + "OggEnc - Ogg Vorbis Encoder"; + moreAboutText += "
      Completely open and patent-free audio encoding technology.
      "; + moreAboutText += LINK("http://www.vorbis.com/"); + moreAboutText += "
      "; + moreAboutText += li + "Nero AAC reference MPEG-4 Encoder
      "; + moreAboutText += "Freeware state-of-the-art HE-AAC encoder with 2-Pass support.
      "; + moreAboutText += LINK("http://www.nero.com/eng/technologies-aac-codec.html/"); + moreAboutText += "
      "; + moreAboutText += li + "MediaInfo - Media File Analysis Tool
      "; + moreAboutText += "Released under the terms of the GNU Leser General Public License.
      "; + moreAboutText += LINK("http://mediainfo.sourceforge.net/"); + moreAboutText += "
    "; + + QMessageBox *moreAboutBox = new QMessageBox(this); + moreAboutBox->setText(moreAboutText); + moreAboutBox->setIconPixmap(dynamic_cast(QApplication::instance())->windowIcon().pixmap(QSize(64,64))); + moreAboutBox->setWindowTitle("About Third-party Software"); + moreAboutBox->exec(); + + LAMEXP_DELETE(moreAboutBox); break; } case 1: @@ -199,6 +241,8 @@ void MainWindow::aboutButtonClicked(void) return; } } + + LAMEXP_DELETE(aboutBox); } /* diff --git a/src/Global.cpp b/src/Global.cpp index 0d285f12..a5dd8667 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -36,8 +36,14 @@ #include //LameXP includes +#include "Resource.h" #include "LockedFile.h" +//CRT includes +#include +#include +#include + //Debug only includes #ifdef _DEBUG #include @@ -48,10 +54,10 @@ /////////////////////////////////////////////////////////////////////////////// //Build version -static const unsigned int g_lamexp_version_major = 4; -static const unsigned int g_lamexp_version_minor = 0; -static const unsigned int g_lamexp_version_build = 4; -static const char *g_lamexp_version_release = "Pre-Alpha"; +static const unsigned int g_lamexp_version_major = VER_LAMEXP_MAJOR; +static const unsigned int g_lamexp_version_minor = VER_LAMEXP_MINOR; +static const unsigned int g_lamexp_version_build = VER_LAMEXP_BUILD; +static const char *g_lamexp_version_release = VER_LAMEXP_SUFFIX_STR; //Build date static QDate g_lamexp_version_date; @@ -79,7 +85,11 @@ unsigned int lamexp_version_major(void) { return g_lamexp_version_major; } unsigned int lamexp_version_minor(void) { return g_lamexp_version_minor; } unsigned int lamexp_version_build(void) { return g_lamexp_version_build; } const char *lamexp_version_release(void) { return g_lamexp_version_release; } -bool lamexp_version_demo(void) { return !(strstr(g_lamexp_version_release, "Final") || strstr(g_lamexp_version_release, "Hotfix")); } + +bool lamexp_version_demo(void) +{ + return !(strstr(g_lamexp_version_release, "Final") || strstr(g_lamexp_version_release, "Hotfix")); +} /* * Get build date date @@ -127,6 +137,41 @@ const QDate &lamexp_version_date(void) return g_lamexp_version_date; } +/* + * Initialize the console + */ +void lamexp_init_console(int argc, char* argv[]) +{ + for(int i = 0; i < argc; i++) + { + if(lamexp_version_demo() || !_stricmp(argv[i], "--console")) + { + if(AllocConsole()) + { + //See: http://support.microsoft.com/default.aspx?scid=kb;en-us;105305 + int hCrtStdOut = _open_osfhandle((long) GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT); + int hCrtStdErr = _open_osfhandle((long) GetStdHandle(STD_ERROR_HANDLE), _O_TEXT); + FILE *hfStdOut = _fdopen(hCrtStdOut, "w"); + FILE *hfStderr = _fdopen(hCrtStdErr, "w"); + *stdout = *hfStdOut; + *stderr = *hfStderr; + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); + } + + HMENU hMenu = GetSystemMenu(GetConsoleWindow(), 0); + EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); + RemoveMenu(hMenu, SC_CLOSE, MF_BYCOMMAND); + + SetConsoleCtrlHandler(NULL, TRUE); + SetConsoleTitle(L"LameXP - Audio Encoder Front-End | Debug Console"); + SetConsoleOutputCP(CP_UTF8); + + break; + } + } +} + /* * Initialize Qt framework */ @@ -173,14 +218,15 @@ bool lamexp_init_qt(int argc, char* argv[]) application->setApplicationVersion(QString().sprintf("%d.%02d.%04d", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build())); application->setOrganizationName("LoRd_MuldeR"); application->setOrganizationDomain("mulder.dummwiedeutsch.de"); - application->setWindowIcon(QIcon(":/MainIcon.ico")); + application->setWindowIcon(QIcon(":/MainIcon.png")); //Load plugins from application directory QCoreApplication::setLibraryPaths(QStringList() << QApplication::applicationDirPath()); - + qDebug("Library Path:\n%s\n", QApplication::libraryPaths().first().toUtf8().constData()); + //Check for supported image formats QList supportedFormats = QImageReader::supportedImageFormats(); - if(!(supportedFormats.contains("png") && supportedFormats.contains("gif") && supportedFormats.contains("ico"))) + if(!(supportedFormats.contains("png") && supportedFormats.contains("gif") && supportedFormats.contains("ico") && supportedFormats.contains("svg"))) { qFatal("Qt initialization error: At least one image format plugin is missing!"); return false; @@ -219,7 +265,7 @@ bool lamexp_check_instances(void) { QString errorMessage = sharedMemory->errorString(); LAMEXP_DELETE(sharedMemory); - qFatal("Failed to create shared memory: %s", errorMessage.toLatin1().constData()); + qFatal("Failed to create shared memory: %s", errorMessage.toUtf8().constData()); return false; } } diff --git a/src/Global.h b/src/Global.h index 4e28e1c2..6c2e1957 100644 --- a/src/Global.h +++ b/src/Global.h @@ -45,6 +45,7 @@ const char *lamexp_version_release(void); bool lamexp_version_demo(void); //Public functions +void lamexp_init_console(int argc, char* argv[]); bool lamexp_init_qt(int argc, char* argv[]); bool lamexp_check_instances(void); void lamexp_register_tool(const QString &toolName, LockedFile *file); diff --git a/src/LockedFile.cpp b/src/LockedFile.cpp index c6bc44dc..ce1c1650 100644 --- a/src/LockedFile.cpp +++ b/src/LockedFile.cpp @@ -45,7 +45,7 @@ LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, cons { QFile::remove(QFileInfo(outFile).absoluteFilePath()); char error_msg[256]; - strcpy_s(error_msg, 256, QString("File '%1' could not be written!").arg(QFileInfo(outFile).fileName()).toLatin1().constData()); + strcpy_s(error_msg, 256, QString("File '%1' could not be written!").arg(QFileInfo(outFile).fileName()).toUtf8().constData()); throw error_msg; } outFile.close(); @@ -53,7 +53,7 @@ LockedFile::LockedFile(const QString &resourcePath, const QString &outPath, cons else { char error_msg[256]; - strcpy_s(error_msg, 256, QString("File '%1' could not be created!").arg(QFileInfo(outFile).fileName()).toLatin1().constData()); + strcpy_s(error_msg, 256, QString("File '%1' could not be created!").arg(QFileInfo(outFile).fileName()).toUtf8().constData()); throw error_msg; } diff --git a/src/Main.cpp b/src/Main.cpp index c7b64f94..39b8231a 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -36,11 +36,13 @@ int lamexp_main(int argc, char* argv[]) { + //Init console + lamexp_init_console(argc, argv); + //Print version info - SetConsoleTitle(L"LameXP - Audio Encoder Front-End | DO NOT CLOSE CONSOLE !!!"); - qDebug("\nLameXP - Audio Encoder Front-End"); + qDebug("LameXP - Audio Encoder Front-End"); qDebug("Version %d.%02d %s, Build %d [%s], MSVC compiler v%02d.%02d", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(), _MSC_VER / 100, _MSC_VER % 100); - qDebug("Copyright (C) 2004-2010 LoRd_MuldeR \n"); + qDebug("Copyright (C) 2004-%04d LoRd_MuldeR \n", max(lamexp_version_date().year(),QDate::currentDate().year())); //print license info qDebug("This program is free software: you can redistribute it and/or modify"); @@ -60,7 +62,8 @@ int lamexp_main(int argc, char* argv[]) qWarning(QString("Note: This demo (pre-release) version of LameXP will expire at %1.\n").arg(expireDate.toString(Qt::ISODate)).toLatin1().constData()); if(QDate::currentDate() >= expireDate) { - QMessageBox::warning(NULL, "LameXP - Expired", QString("This demo (pre-release) version of LameXP has expired at %1.").arg(expireDate.toString()), "Exit Program"); + qWarning("Expired !!!"); + QMessageBox::warning(NULL, "LameXP - Expired", QString("This demo (pre-release) version of LameXP has expired at %1.\nLameXP is free software and release versions won't expire.").arg(expireDate.toString()), "Exit Program"); return 0; } } diff --git a/src/Resource.h b/src/Resource.h index b8e5f2cc..15525b79 100644 --- a/src/Resource.h +++ b/src/Resource.h @@ -1,17 +1,61 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by g:\DeLpHi\LameXP_Qt\LameXP\LameXP.rc +/////////////////////////////////////////////////////////////////////////////// +// LameXP - Audio Encoder Front-End +// Copyright (C) 2004-2010 LoRd_MuldeR // -#define IDI_ICON1 101 +// 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 +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// http://www.gnu.org/licenses/gpl-2.0.txt +/////////////////////////////////////////////////////////////////////////////// + +/* + * LameXP Version Info + */ +#define VER_LAMEXP_MAJOR 4 +#define VER_LAMEXP_MINOR_HI 0 +#define VER_LAMEXP_MINOR_LO 0 +#define VER_LAMEXP_BUILD 7 +#define VER_LAMEXP_SUFFIX TechPreview + +/* + * Resource ID's + */ +#define IDI_ICON1 106 #define IDR_WAVE_ABOUT 666 -// Next default values for new objects -// +/* + * Next default values for new objects + */ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_RESOURCE_VALUE 107 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif + +/* + * Helper macros (having fun with the C pre-processor) + */ +#define VER_LAMEXP_STR_HLP1(X) #X +#define VER_LAMEXP_STR_HLP2(V,W,X,Y,Z) VER_LAMEXP_STR_HLP1(v##V.W##X Z [Build Y]) +#define VER_LAMEXP_STR_HLP3(V,W,X,Y,Z) VER_LAMEXP_STR_HLP2(V,W,X,Y,Z) +#define VER_LAMEXP_STR VER_LAMEXP_STR_HLP3(VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD,VER_LAMEXP_SUFFIX) +#define VER_LAMEXP_SUFFIX_STR_HLP1(X) #X +#define VER_LAMEXP_SUFFIX_STR_HLP2(X) VER_LAMEXP_SUFFIX_STR_HLP1(X) +#define VER_LAMEXP_SUFFIX_STR VER_LAMEXP_SUFFIX_STR_HLP2(VER_LAMEXP_SUFFIX) +#define VER_LAMEXP_MINOR_HLP1(X,Y) X##Y +#define VER_LAMEXP_MINOR_HLP2(X,Y) VER_LAMEXP_MINOR_HLP1(X,Y) +#define VER_LAMEXP_MINOR VER_LAMEXP_MINOR_HLP2(VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO) diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp index bb66175b..30b768f5 100644 --- a/src/Thread_FileAnalyzer.cpp +++ b/src/Thread_FileAnalyzer.cpp @@ -61,9 +61,14 @@ void FileAnalyzer::run() while(!m_inputFiles.isEmpty()) { QString currentFile = QDir::fromNativeSeparators(m_inputFiles.takeFirst()); - qDebug("Adding: %s", currentFile.toLatin1().constData()); + qDebug("Analyzing: %s", currentFile.toUtf8().constData()); emit fileSelected(QFileInfo(currentFile).fileName()); AudioFileModel file = analyzeFile(currentFile); + if(file.formatContainerType().isEmpty() || file.formatAudioType().isEmpty()) + { + qDebug("Skipped: %s", file.filePath().toUtf8().constData()); + continue; + } emit fileAnalyzed(file); } @@ -83,7 +88,8 @@ const AudioFileModel FileAnalyzer::analyzeFile(const QString &filePath) QProcess process; process.setProcessChannelMode(QProcess::MergedChannels); process.setReadChannel(QProcess::StandardOutput); - process.start(m_mediaInfoBin, QStringList() << filePath); + process.start(m_mediaInfoBin, QStringList() << QDir::toNativeSeparators(filePath)); + process.waitForStarted(); while(process.state() != QProcess::NotRunning) { @@ -154,7 +160,7 @@ void FileAnalyzer::updateSection(const QString §ion) } else { - qWarning("Unknown section: %s", section.toLatin1().constData()); + qWarning("Unknown section: %s", section.toUtf8().constData()); } }