#pragma once

extern "C" {
#include "alac/codec/ALACDecoder.h"
#include "alac/codec/ALACBitUtilities.h"
#include "mp4ff/mp4ff.h"
}
#include "kbmp4_decoder.h"

class KbAlacDecoder : public KbMp4Decoder
{
private:
    BitBuffer        m_BitBuffer;
    ALACDecoder     *m_pAlacDecoder;

    void  __fastcall Close(void);
public:
    DWORD __fastcall Open(const KPI_MEDIAINFO *cpRequest, 
                          IKpiFile   *pFile,
                          IKpiFolder *pFolder);
    void  __fastcall GetTagInfo(IKpiTagInfo *pTagInfo,
                                DWORD dwTagGetFlags);

    DWORD  WINAPI Render(BYTE *pBuffer, DWORD dwSizeSample);
    DWORD  WINAPI UpdateConfig(void *pvReserved){return 0;}
    KbAlacDecoder(void);
    ~KbAlacDecoder(void);
};

