Skip to content

Commit

Permalink
Aiff files: get bits per sample + cover, fixes #509
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Aug 3, 2024
1 parent 55928fb commit 1c98775
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libs/metadata/impl/TagLibTagReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <unordered_map>

#include <taglib/aifffile.h>
#include <taglib/apeproperties.h>
#include <taglib/apetag.h>
#include <taglib/asffile.h>
Expand Down Expand Up @@ -300,6 +301,16 @@ namespace lms::metadata
if (!opusFile->tag()->pictureList().isEmpty())
_hasEmbeddedCover = true;
}
else if (TagLib::RIFF::AIFF::File * aiffFile{ dynamic_cast<TagLib::RIFF::AIFF::File*>(_file.file()) })
{
if (aiffFile->hasID3v2Tag())
{
const auto& frameListMap{ aiffFile->tag()->frameListMap() };

if (!frameListMap["APIC"].isEmpty())
_hasEmbeddedCover = true;
}
}

if (debug && core::Service<core::logging::ILogger>::get()->isSeverityActive(core::logging::Severity::DEBUG))
{
Expand Down Expand Up @@ -334,6 +345,8 @@ namespace lms::metadata
_audioProperties.bitsPerSample = mp4Properties->bitsPerSample();
else if (const auto* wavePackProperties{ dynamic_cast<const TagLib::WavPack::Properties*>(properties) })
_audioProperties.bitsPerSample = wavePackProperties->bitsPerSample();
else if (const auto* aiffProperties{ dynamic_cast<const TagLib::RIFF::AIFF::Properties*>(properties) })
_audioProperties.bitsPerSample = aiffProperties->bitsPerSample();
#if TAGLIB_MAJOR_VERSION >= 2
else if (const auto* dsfProperties{ dynamic_cast<const TagLib::DSF::Properties*>(properties) })
_audioProperties.bitsPerSample = dsfProperties->bitsPerSample();
Expand Down

0 comments on commit 1c98775

Please sign in to comment.