From 01b15d6f70966453601d716375bcfe167b016e6f Mon Sep 17 00:00:00 2001 From: lordmulder Date: Mon, 21 Mar 2011 02:16:18 +0100 Subject: [PATCH] Display cover artwork in the "Meta Info" dialog. --- LameXP.vcproj | 8 +- doc/Changelog.html | 1 + etc/Translation/Blank.ts | 4 + etc/Translation/LameXP_DE.ts | 4 + etc/Translation/LameXP_ES.ts | 4 + etc/Translation/LameXP_FR.ts | 4 + etc/Translation/LameXP_IT.ts | 4 + etc/Translation/LameXP_RU.ts | 4 + etc/Translation/LameXP_UK.ts | 4 + gui/MetaInfo.ui | 192 ++++++++++++++++++++++++++++++++++ res/Icons.qrc | 1 + res/localization/LameXP_DE.qm | Bin 55439 -> 55483 bytes src/Config.h | 2 +- src/Dialog_MetaInfo.cpp | 26 +++++ src/Global.cpp | 2 +- 15 files changed, 254 insertions(+), 6 deletions(-) diff --git a/LameXP.vcproj b/LameXP.vcproj index 766fea23..f39274aa 100644 --- a/LameXP.vcproj +++ b/LameXP.vcproj @@ -192,7 +192,7 @@ @@ -1801,7 +1801,7 @@ @@ -1811,7 +1811,7 @@ diff --git a/doc/Changelog.html b/doc/Changelog.html index 873f00c8..7a14d839 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -11,6 +11,7 @@
  • Added an option to manually specify the number of parallel instances
  • Added an option to select a user-defined TEMP directory
  • Added an option to shutdown the computer as soon as all files are completed +
  • Added support for embedding cover artwork (currently with LAME only)
  • Updated Qt runtime libraries to v4.7.2
  • Updated LAME encoder to v3.99.0.14 (2011-02-28), compiled with ICL 12.0.2
  • Updated Vorbis encoder to v2.87 using aoTuV Beta-6.02 (2011-02-28), compiled with ICL 11.1 and MSVC 9.0 diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 5839efc2..04272060 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -1232,6 +1232,10 @@ Meta Information + + Artwork + + Edit diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 61e25d7a..5e09838d 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -1241,6 +1241,10 @@ Close Schießen + + Artwork + + MetaInfoDialog diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index 3be11785..75348768 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -1240,6 +1240,10 @@ Close Cerrar + + Artwork + + MetaInfoDialog diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index d649ace8..a505d8ce 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -1249,6 +1249,10 @@ Sélection automatique (par défaut) Close Fermer + + Artwork + + MetaInfoDialog diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 6bf5a4ba..995db8d9 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -1241,6 +1241,10 @@ Close Chiudi + + Artwork + + MetaInfoDialog diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts index e15fcec9..eeba5434 100644 --- a/etc/Translation/LameXP_RU.ts +++ b/etc/Translation/LameXP_RU.ts @@ -1243,6 +1243,10 @@ Close Закрыть + + Artwork + + MetaInfoDialog diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index a9ff6d4a..e39beac8 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -1240,6 +1240,10 @@ Close Вийти + + Artwork + + MetaInfoDialog diff --git a/gui/MetaInfo.ui b/gui/MetaInfo.ui index f9df2e30..3b4db62c 100644 --- a/gui/MetaInfo.ui +++ b/gui/MetaInfo.ui @@ -189,8 +189,146 @@ + + + + QFrame::Box + + + QFrame::Sunken + + + 1 + + + + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QFrame::Panel + + + QFrame::Sunken + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + (ARTWORK) + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + 90 + 0 + + + + Artwork + + + + :/icons/photo.png:/icons/photo.png + + + + 16 + 16 + + + + true + + + false + + + @@ -344,6 +482,12 @@ + + + + + + @@ -378,5 +522,53 @@ + + buttonArtwork + clicked(bool) + tableView + setHidden(bool) + + + 55 + 396 + + + 310 + 217 + + + + + buttonArtwork + clicked(bool) + editButton + setDisabled(bool) + + + 55 + 396 + + + 468 + 396 + + + + + buttonArtwork + clicked(bool) + frameArtwork + setVisible(bool) + + + 55 + 396 + + + 310 + 360 + + + diff --git a/res/Icons.qrc b/res/Icons.qrc index 7d80f8b7..2a5b16b1 100644 --- a/res/Icons.qrc +++ b/res/Icons.qrc @@ -62,6 +62,7 @@ icons/page_white_add.png icons/page_white_cd.png icons/paste_plain.png + icons/photo.png icons/play.png icons/report.png icons/resultset_next.png diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index 035eee6b5d0efd72486d7805a625d81dc2b30482..148fb3e3b6024a7c2b3dc85f1bcc9a340f0531e0 100644 GIT binary patch delta 1259 zcmX9;drVVz6#i~|?``jGO9#_bbhT8(ie^-tTG0WL#bIHHkAe6Cn}H}#12{9LAfWLH zj2x;kVdFi47DYvL@{m^?!;!_nVzMnvonwz+CRtoa#fQD}oHFO&IG!xq#=YiO9#0?Jua;kv1kxF35pNyO#FbsPSz6Io8$3D|@mOhDn zMIAu>$4I)q8mO4ShsF$G-)$W8UJJDUL`j^@-^B?kcAEP+=T+eVx+QL2w*^?M%LULFLzf05t3 zVFS=N!^fUD4s3aE4)6Q(X^XZ3iTQli(K6ucM4D0>>{Wb)y$cAsK8MaRzR`6CXcYLS z1GPZw_k3$SBi*`_cd0ztG6dc|z{o84jqiFg4aBVB`+XRhm+chA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heTp`tz_l`QO3^k+ zN9TA*F<_>uU1=vq#T&8<4~bim7Hw3P8z=>HS>>6jUf}jBrKdUooO)eZ`-lZ@eo96a zxiLmz&kgETe@oa`R17ScCloIz0`xnCGRq90`H}F6pQ1m5xRp9eScTHeRCU@Y6AkxOUBgt4mTJ{qo<{eVk!-=j*ojB53IX-b3F_14 zAftjQ`jqeWb z|EoFnN6}Hd1&FvR7LL)3r0#!wE*=_~0OSU-bWt>|MlYW5QTtp28C4myYsALf>p;ps zqVEMAyw)b7QJYfh#J?(L0(pOGl*2UlfeFp5xzB+*muAV}e!5PxG>K&TtKR9F3Q%-mDu%rn#0ZV5|bMi}p zT2`8Sr;;{OAjQ3;$rJ`@tF91m|1NEN`yu^84oJ>R)W#zz*G+ZpaY=c#uK>n+X^-PB or8AY>6SuwACXID$0K^{Y*Y{2WcKse;F!N@TCW+jvshhX*U)hg>FaQ7m diff --git a/src/Config.h b/src/Config.h index 907086f7..778c85eb 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 385 +#define VER_LAMEXP_BUILD 387 #define VER_LAMEXP_SUFFIX Beta-10 /* diff --git a/src/Dialog_MetaInfo.cpp b/src/Dialog_MetaInfo.cpp index 057ff7e1..2f835c14 100644 --- a/src/Dialog_MetaInfo.cpp +++ b/src/Dialog_MetaInfo.cpp @@ -33,6 +33,9 @@ MetaInfoDialog::MetaInfoDialog(QWidget *parent) { //Init the dialog, from the .ui file setupUi(this); + + //Hide artwork + frameArtwork->hide(); //Fix size setMinimumSize(this->size()); @@ -61,9 +64,32 @@ int MetaInfoDialog::exec(AudioFileModel &audioFile, bool allowUp, bool allowDown { MetaInfoModel *model = new MetaInfoModel(&audioFile); tableView->setModel(model); + tableView->show(); + frameArtwork->hide(); setWindowTitle(QString("Meta Information: %1").arg(QFileInfo(audioFile.filePath()).fileName())); + editButton->setEnabled(true); upButton->setEnabled(allowUp); downButton->setEnabled(allowDown); + buttonArtwork->setChecked(false); + buttonArtwork->setEnabled(false); + + if(!audioFile.fileCover().isEmpty()) + { + QImage artwork; + if(artwork.load(audioFile.fileCover())) + { + if((artwork.width() > 320) || (artwork.height() > 240)) + { + artwork = artwork.scaled(320, 240, Qt::KeepAspectRatio, Qt::SmoothTransformation); + } + labelArtwork->setPixmap(QPixmap::fromImage(artwork)); + buttonArtwork->setEnabled(true); + } + else + { + qWarning("Error: Failed to load cover art!"); + } + } int iResult = QDialog::exec(); diff --git a/src/Global.cpp b/src/Global.cpp index efc0da93..75ade01f 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -181,7 +181,7 @@ g_lamexp_ipc_ptr = }; //Image formats -static const char *g_lamexp_imageformats[] = {"png", "gif", "ico", "svg", NULL}; +static const char *g_lamexp_imageformats[] = {"png", "jpg", "gif", "ico", "svg", NULL}; //Global locks static QMutex g_lamexp_message_mutex;