Skip to content

Commit cf86f20

Browse files
authored
Add DSD information to WavPack properties (#1303)
1 parent 74d93db commit cf86f20

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

taglib/wavpack/wavpackproperties.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class WavPack::Properties::PropertiesPrivate
5151
int version { 0 };
5252
int bitsPerSample { 0 };
5353
bool lossless { false };
54+
bool dsd { false };
5455
unsigned int sampleFrames { 0 };
5556
};
5657

@@ -102,6 +103,11 @@ bool WavPack::Properties::isLossless() const
102103
return d->lossless;
103104
}
104105

106+
bool WavPack::Properties::isDsd() const
107+
{
108+
return d->dsd;
109+
}
110+
105111
unsigned int WavPack::Properties::sampleFrames() const
106112
{
107113
return d->sampleFrames;
@@ -291,6 +297,7 @@ void WavPack::Properties::read(File *file, offset_t streamLength)
291297
d->bitsPerSample = static_cast<int>(((flags & BYTES_STORED) + 1) * 8 - ((flags & SHIFT_MASK) >> SHIFT_LSB));
292298
d->sampleRate = static_cast<int>(smplRate);
293299
d->lossless = !(flags & HYBRID_FLAG);
300+
d->dsd = (flags & DSD_FLAG) != 0;
294301
d->sampleFrames = smplFrames;
295302
}
296303

taglib/wavpack/wavpackproperties.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ namespace TagLib {
9696
*/
9797
bool isLossless() const;
9898

99+
/*!
100+
* Returns whether or not the file is DSD (not PCM)
101+
*/
102+
bool isDsd() const;
103+
99104
/*!
100105
* Returns the total number of audio samples in file.
101106
*/

0 commit comments

Comments
 (0)