From dba6d2fb3ec9961b8090c3ca2c92bcc850e0e0b7 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 25 Mar 2011 16:17:19 +0100 Subject: [PATCH] Added support for embedding cover artwork to FLAC encoder. --- src/Config.h | 2 +- src/Encoder_FLAC.cpp | 3 ++- src/Global.cpp | 17 ++++++++++------- src/Global.h | 7 +++++-- src/WinSevenTaskbar.h | 3 ++- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/Config.h b/src/Config.h index 8a7a771b..8a472083 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 1 -#define VER_LAMEXP_BUILD 405 +#define VER_LAMEXP_BUILD 406 #define VER_LAMEXP_SUFFIX Beta-14 /* diff --git a/src/Encoder_FLAC.cpp b/src/Encoder_FLAC.cpp index c214df01..ae3133b3 100644 --- a/src/Encoder_FLAC.cpp +++ b/src/Encoder_FLAC.cpp @@ -58,7 +58,8 @@ bool FLACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaIn if(!metaInfo.fileComment().isEmpty()) args << "-T" << QString("comment=%1").arg(metaInfo.fileComment()); if(metaInfo.fileYear()) args << "-T" << QString("date=%1").arg(QString::number(metaInfo.fileYear())); if(metaInfo.filePosition()) args << "-T" << QString("track=%1").arg(QString::number(metaInfo.filePosition())); - + if(!metaInfo.fileCover().isEmpty()) args << QString("--picture=%1").arg(metaInfo.fileCover()); + //args << "--tv" << QString().sprintf("Encoder=LameXP v%d.%02d.%04d [%s]", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build(), lamexp_version_release()); if(!m_configCustomParams.isEmpty()) args << m_configCustomParams.split(" ", QString::SkipEmptyParts); diff --git a/src/Global.cpp b/src/Global.cpp index 8078d01a..78779c14 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -367,15 +367,18 @@ void lamexp_init_console(int argc, char* argv[]) { bool enableConsole = lamexp_version_demo(); - for(int i = 0; i < argc; i++) + if(!LAMEXP_DEBUG) { - if(!_stricmp(argv[i], "--console")) + for(int i = 0; i < argc; i++) { - enableConsole = true; - } - else if(!_stricmp(argv[i], "--no-console")) - { - enableConsole = false; + if(!_stricmp(argv[i], "--console")) + { + enableConsole = true; + } + else if(!_stricmp(argv[i], "--no-console")) + { + enableConsole = false; + } } } diff --git a/src/Global.h b/src/Global.h index 3f0a5e3e..20188f66 100644 --- a/src/Global.h +++ b/src/Global.h @@ -124,6 +124,9 @@ SIZE_T lamexp_dbg_private_bytes(void); #define WCHAR2QSTR(STR) QString::fromUtf16(reinterpret_cast(STR)) #define LAMEXP_DYNCAST(OUT,CLASS,SRC) try { OUT = dynamic_cast(SRC); } catch(std::bad_cast) { OUT = NULL; } #define LAMEXP_BOOL(X) (X ? "1" : "0") +#define LAMEXP_MAKE_STRING_EX(X) #X +#define LAMEXP_MAKE_STRING(X) LAMEXP_MAKE_STRING_EX(X) +#define LAMEXP_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" LAMEXP_MAKE_STRING(__LINE__) ") : warning: " TXT)) //Output Qt debug message (Unicode-safe versions) #define qDebug64(FORMAT, ...) qDebug("@BASE64@%s", QString(FORMAT).arg(__VA_ARGS__).toUtf8().toBase64().constData()); @@ -132,13 +135,13 @@ SIZE_T lamexp_dbg_private_bytes(void); //Check for debug build #if defined(_DEBUG) || defined(QT_DEBUG) || !defined(NDEBUG) || !defined(QT_NO_DEBUG) -#define LAMEXP_DEBUG 1 +#define LAMEXP_DEBUG (1) #define LAMEXP_CHECK_DEBUG_BUILD \ qWarning("---------------------------------------------------------"); \ qWarning("DEBUG BUILD: DO NOT RELEASE THIS BINARY TO THE PUBLIC !!!"); \ qWarning("---------------------------------------------------------\n"); #else -#define LAMEXP_DEBUG 0 +#define LAMEXP_DEBUG (0) #define LAMEXP_CHECK_DEBUG_BUILD #endif diff --git a/src/WinSevenTaskbar.h b/src/WinSevenTaskbar.h index 8566313a..8d5c8575 100644 --- a/src/WinSevenTaskbar.h +++ b/src/WinSevenTaskbar.h @@ -21,6 +21,7 @@ #pragma once +#include "Global.h" #include class QWidget; @@ -56,7 +57,7 @@ private: #else //__ITaskbarList3_INTERFACE_DEFINED__ -#pragma message("WARNING: ITaskbarList3 not defined. Compiling *without* support for Win7 taskbar!") +LAMEXP_COMPILER_WARNING("ITaskbarList3 not defined. Compiling *without* support for Win7 taskbar!") class WinSevenTaskbar {