#pragma once

#include "kpi_decoder.h"
#include "kpi_impl.h"
#include "kbncsf_config.h"

class XSFPlayer_NCSF;
class KbNcsfDecoder : public KbKpiUnknownImpl<IKpiDecoder>
{
private:
    KPI_MEDIAINFO   m_MediaInfo;
    kbncsf_Settings m_Settings;
    XSFPlayer_NCSF *m_ncsf;
    IKpiFile       *m_pFile;
    UINT64          m_qwCurSample;
    UINT64          m_qwEndSample;
    double          m_volume;
public:
    DWORD __fastcall Open(const KPI_MEDIAINFO *cpRequest,
                          IKpiFile *pFile,
                          IKpiFolder *pFolder);
    DWORD  WINAPI Select(DWORD dwNumber,
                         const KPI_MEDIAINFO **ppMediaInfo,
                         IKpiTagInfo *pTagInfo,
                         DWORD dwTagGetFlags);
    UINT64 WINAPI Seek(UINT64 qwPosSample, DWORD dwFlag);
    DWORD  WINAPI Render(BYTE *pBuffer, DWORD dwSizeSample);
    DWORD  WINAPI UpdateConfig(void *pvReserved){return 0;}
    static void __fastcall Init(IKpiConfig *pConfig);
    static void __fastcall Deinit(void);
    KbNcsfDecoder(IKpiConfig *pConfig);
    ~KbNcsfDecoder(void);
};
