#pragma once

#include "kpi_player.h"
#include "kpi_impl.h"
extern "C" {
#include "PsxPub.h"

#ifdef CSTR_EXPORT
#define CSTR_EXTERN
#else
#define CSTR_EXTERN     extern
#endif

CSTR_EXTERN HINSTANCE           hinstancePSXPUB;        // PSXPUB.DLLインスタンス
CSTR_EXTERN PFNPlbAnaluzeFile       _PlbAnalyzeFile;
CSTR_EXTERN PFNPlbOpenPlayer        _PlbOpenPlayer;
CSTR_EXTERN PFNPlbClosePlayer       _PlbClosePlayer;
CSTR_EXTERN PFNPlbPlayPlayer        _PlbPlayPlayer;
CSTR_EXTERN PFNPlbStopPlayer        _PlbStopPlayer;
CSTR_EXTERN PFNPlbPausePlayer       _PlbPausePlayer;
CSTR_EXTERN PFNPlbResumPlayer       _PlbResumPlayer;
CSTR_EXTERN PFNPlbSeekPlayer        _PlbSeekPlayer;
CSTR_EXTERN PFNPlbGetPlayRect       _PlbGetPlayRect;
CSTR_EXTERN PFNPlbSetPlayRect       _PlbSetPlayRect;
CSTR_EXTERN PFNPlbGetPlayerStatus   _PlbGetPlayerStatus;
CSTR_EXTERN PFNPlbGetPlayPosition   _PlbGetPlayPosition;
CSTR_EXTERN PFNPlbLockFrameDIB      _PlbLockFrameDIB;
CSTR_EXTERN PFNPlbUnlockFrameDIB    _PlbUnlockFrameDIB;
CSTR_EXTERN PFNPlbSetVolume         _PlbSetVolume;
CSTR_EXTERN PFNPlbSetTempo          _PlbSetTempo;
};

class KbCstrModule : public KbKpiUnknownImpl<IKpiPlayerModule>
{
private:
    KPI_PLAYER_MODULEINFO m_ModuleInfo;
public:
    void  WINAPI GetModuleInfo(const KPI_PLAYER_MODULEINFO **ppModuleInfo);
    DWORD WINAPI Open(const KPI_MEDIAINFO *cpRequest, 
                      IKpiFile *pFile, 
                      IKpiFolder *pFolder, 
                      IKpiPlayer **ppPlayer);
    BOOL  WINAPI EnumConfig(IKpiConfigEnumerator *pEnumerator){return false;}
    DWORD WINAPI ApplyConfig(const wchar_t *cszSection,//セクション名
                             const wchar_t *cszKey,    //キー名
                             INT64  nValue, //変更後の値(BOOL/INT の場合)
                             double dValue, //変更後の値(FLOAT の場合)
                             const wchar_t *cszValue){return KPI_CFGRET_OK;}//変更後の値(文字列)
    KbCstrModule(void);
    ~KbCstrModule(void);
};

