diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-02-10 11:27:33 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-02-10 11:27:33 +0000 |
| commit | e94084ab46412950b49f82805a43c378dd365ac9 (patch) | |
| tree | 4bd83b02686a9521c945a485007b2adfb62fa00f /src/plugins/General | |
| parent | 32160275fb287bd1f346a8f3ceabed2732c184fe (diff) | |
| download | qmmp-e94084ab46412950b49f82805a43c378dd365ac9.tar.gz qmmp-e94084ab46412950b49f82805a43c378dd365ac9.tar.bz2 qmmp-e94084ab46412950b49f82805a43c378dd365ac9.zip | |
fixed support of taglib versions less than 1.10
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6127 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General')
| -rw-r--r-- | src/plugins/General/rgscan/rgscandialog.cpp | 16 | ||||
| -rw-r--r-- | src/plugins/General/rgscan/rgscandialog.h | 5 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/General/rgscan/rgscandialog.cpp b/src/plugins/General/rgscan/rgscandialog.cpp index bfd8b3cec..fcb88ad76 100644 --- a/src/plugins/General/rgscan/rgscandialog.cpp +++ b/src/plugins/General/rgscan/rgscandialog.cpp @@ -35,7 +35,10 @@ #include <taglib/wavpackfile.h> #include <taglib/id3v2tag.h> #include <taglib/textidentificationframe.h> +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 10)) #include <taglib/mp4file.h> +#endif +#include <taglib/taglib.h> #include "rgscanner.h" #include "gain_analysis.h" #include "rgscandialog.h" @@ -76,8 +79,12 @@ RGScanDialog::RGScanDialog(QList <PlayListTrack *> tracks, QWidget *parent) : Q ext == "flac" || //native flac ext == "oga" || //ogg flac ext == "ogg" || //ogg vorbis - ext == "wv" || //wavpack - ext == "m4a") //aac (mp4 container) + ext == "wv" //wavpack +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 10)) + || ext == "m4a") //aac (mp4 container) +#else + ) +#endif { paths.append(track->url()); QString name = formatter.format(track); @@ -369,8 +376,10 @@ void RGScanDialog::writeVorbisComment(TagLib::Ogg::XiphComment *tag, ReplayGainI } } +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 10)) void RGScanDialog::writeMP4Tag(TagLib::MP4::Tag *tag, ReplayGainInfoItem *item) { + if(m_ui.trackCheckBox->isChecked()) { tag->setItem("----:com.apple.iTunes:replaygain_track_gain", @@ -386,6 +395,7 @@ void RGScanDialog::writeMP4Tag(TagLib::MP4::Tag *tag, ReplayGainInfoItem *item) gainToStringList(item->info[Qmmp::REPLAYGAIN_ALBUM_PEAK])); } } +#endif void RGScanDialog::on_writeButton_clicked() { @@ -429,11 +439,13 @@ void RGScanDialog::on_writeButton_clicked() writeAPETag(file.APETag(true), item); file.save(); } +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 10)) else if(ext == "m4a") //MPEG-4 Part 14 { TagLib::MP4::File file(qPrintable(item->url)); writeMP4Tag(file.tag(), item); file.save(); } +#endif } } diff --git a/src/plugins/General/rgscan/rgscandialog.h b/src/plugins/General/rgscan/rgscandialog.h index 6b2d23afa..1500796c2 100644 --- a/src/plugins/General/rgscan/rgscandialog.h +++ b/src/plugins/General/rgscan/rgscandialog.h @@ -24,6 +24,7 @@ #include <QDialog> #include <QStringList> #include <qmmp/qmmp.h> +#include <taglib/taglib.h> #include <taglib/tstring.h> #include "ui_rgscandialog.h" @@ -47,10 +48,12 @@ namespace TagLib { class XiphComment; } +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 10)) namespace MP4 { class Tag; } +#endif } /** @@ -80,7 +83,9 @@ private: void writeAPETag(TagLib::APE::Tag *tag, ReplayGainInfoItem *item); void writeID3v2Tag(TagLib::ID3v2::Tag *tag, ReplayGainInfoItem *item); void writeVorbisComment(TagLib::Ogg::XiphComment *tag, ReplayGainInfoItem *item); +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 10)) void writeMP4Tag(TagLib::MP4::Tag *tag, ReplayGainInfoItem *item); +#endif Ui::RGScanDialog m_ui; QList<RGScanner *> m_scanners; QList<ReplayGainInfoItem*> m_replayGainItemList; |
