#pragma once

#include "kpi_device.h"

class KbDSoundEnumerator
{
private:
    struct DSOUND_DEVICE
    {
        enum{
            MAX_DEVICE_LENGTH = 256,//デバイス名の最大長
        };
        wchar_t szDeviceName[MAX_DEVICE_LENGTH];//デバイス名
        GUID DriverGuid;                        //デバイスの GUID
    };
    DSOUND_DEVICE *m_pDevices;
    int  m_nCount;//デバイスの数
    static BOOL CALLBACK DSoundEnumCallback(GUID* pGUID, LPCWSTR strDesc, 
                                            LPCWSTR strDrvName, VOID* pContext);
    BOOL __fastcall DSoundEnumCallback(GUID* pGUID, LPCWSTR strDesc, LPCWSTR strDrvName);
public:
    BOOL __fastcall GetDriverGuidFromDeviceName(const wchar_t *cszDeviceName, const wchar_t *cszId, GUID *pGuid);
    void __fastcall EnumerateDevices(IKpiDeviceEnumerator *pDeviceEnumerator);
    void __fastcall GetDeviceName(int nIndex, 
                                  wchar_t *pszDeviceName, int nSizeDevice,
                                  wchar_t *pszId, int nSizeId);
    KbDSoundEnumerator(void);
    ~KbDSoundEnumerator(void);
};

