Skip to content

Commit

Permalink
Include wavpack/wavpack.h for WavpackContext
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Dec 29, 2019
1 parent 8943126 commit ee626b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion src/sources/soundsourcewv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,25 @@ static WavpackStreamReader s_streamReader = {
SoundSourceWV::CanSeekCallback,
SoundSourceWV::WriteBytesCallback};



} // anonymous namespace


// This wrapper class hides the changing WavpackContext definition in
// wavpack/wavpack.h from the public interface.
class WpContext {
public:
WpContext(WavpackContext* wpc = nullptr)
: m_context(wpc) {
}
operator WavpackContext*() const { return m_context; }
private:
WavpackContext* m_context;
}

SoundSourceWV::SoundSourceWV(const QUrl& url)
: SoundSource(url, "wv"),
m_wpc(nullptr),
m_sampleScaleFactor(CSAMPLE_ZERO),
m_pWVFile(nullptr),
m_pWVCFile(nullptr),
Expand Down
6 changes: 3 additions & 3 deletions src/sources/soundsourcewv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

class QFile;

typedef void WavpackContext;

namespace mixxx {

class WpContext;

class SoundSourceWV : public SoundSource {
public:
static int32_t ReadBytesCallback(void* id, void* data, int bcount);
Expand All @@ -35,7 +35,7 @@ class SoundSourceWV : public SoundSource {
OpenMode mode,
const OpenParams& params) override;

WavpackContext* m_wpc;
WpContext* m_wpc;
CSAMPLE m_sampleScaleFactor;
QFile* m_pWVFile;
QFile* m_pWVCFile;
Expand Down

0 comments on commit ee626b1

Please sign in to comment.