#pragma once

#include "kpi_player.h"
#include "kpi_impl.h"
#include "GuruGuruSMF4_Cpp.h"

//マルチプルインスタンスが機能しているかのテスト
//(本体が複数を同時に開いてくれない為)
#ifdef _DEBUG
//#define TEST_MULTIPLE
#endif

///////////////////////////////////////////////////////////////////////////////
class KbGuru2SMFPlayer: public KbKpiUnknownImpl<IKpiPlayer>
{
private:
    KPI_MEDIAINFO               m_MediaInfo;
    GuruGuruSmf::Ggs4         * m_pGGS;
    GuruGuruSmf::SmfInformation m_smfInfo;
#ifdef TEST_MULTIPLE
    GuruGuruSmf::Ggs4* m_pGGS2;
#endif

    BOOL    m_bRepeat;
    DWORD   m_dwStatus;
    BOOL    m_bDevOpen;//デバイスを開いたら TRUE
public:
    KbGuru2SMFPlayer(IKpiConfig * pConfig);
    virtual ~KbGuru2SMFPlayer(void);

public:
    DWORD WINAPI Select(DWORD dwNumber, const KPI_MEDIAINFO ** ppInfo, IKpiTagInfo * pTagInfo, DWORD dwTagGetFlags);
    BOOL  WINAPI Play(DWORD dwStartpos, BOOL bVisible);
    BOOL  WINAPI Pause(void);
    BOOL  WINAPI Restart(void);
    void  WINAPI Stop(void);
    DWORD WINAPI GetPosition(void);
    DWORD WINAPI GetStatus(void);
    void  WINAPI SetTempo(int Tempo);
    void  WINAPI SetVolume(int Volume);
    void  WINAPI SetVisible(BOOL bVisible) { };
    void  WINAPI GetWindowPosition(int * pLeft,  int * pTop, int * pVideoWidth, int * pVideoHeight) {
        *pLeft = *pTop = *pVideoWidth = *pVideoHeight = 0;
    };
    void  WINAPI SetWindowPosition(int nLeft, int nTop, int nVideoWidth, int nVideoHeight) { };
    void  WINAPI SetTopMost(BOOL bTopMost) { };
    void  WINAPI SetRepeat(BOOL bRepeat);
    DWORD WINAPI UpdateConfig(void * pvReserved) { return 0; }   //設定が変更されたら呼ばれる

public:
    DWORD Open(IKpiFile * pFile, IKpiFolder * pFolder);

};
///////////////////////////////////////////////////////////////////////////////
