#ifndef kbqtmovH
#define kbqtmovH

#ifdef _WIN64 //64bit では何もしない

namespace KbQtPlayer
{
    inline BOOL QuickTimeIsInstalled(void){return false;}
    inline void InitQt(void){}
    inline void DeinitQt(void){}
};

#else

#include "kpi_player.h"
#include "kpi_impl.h"
#include "QTML.h"
#include "Movies.h"
#include "Scrap.h"

class KbQtPlayer : public KbKpiUnknownImpl<IKpiPlayer>
{
private:
    KPI_MEDIAINFO   m_MediaInfo;
    BOOL            m_bTopMost;
    IKpiFile       *m_pFile;
    HWND            m_hWnd;
    Movie           m_theMovie;
    MovieController m_theMC;
    int             m_nStatus;
    int             m_nTempo;
    int             m_nVolume;
    int             m_nSliderHeight;//シークバーの高さ
private:
    static wchar_t  s_szClassName[128];
    static BOOL     s_bInitialized;
    static BOOL     s_bQtIsInstalled;
    static LRESULT CALLBACK QtMovWindowProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
public:
    BOOL __fastcall Open(IKpiFile *pFile, IKpiFolder *pFolder);
    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);
    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;}//設定が変更されたら呼ばれる
    static void InitQt(void);
    static void DeinitQt(void);
    KbQtPlayer(void);
    ~KbQtPlayer(void);
};

#endif //_WIN64

#endif
