ホーム › Media.Audio.DirectMusic › IDirectMusic
IDirectMusic
COMメソッド 9
vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT EnumPort(DWORD dwIndex, DMUS_PORTCAPS* pPortCaps)
| dwIndex | DWORD | in | 列挙するポートの0起点インデックス。順に増やして全ポートを取得する。 |
| pPortCaps | DMUS_PORTCAPS* | inout | 指定インデックスのポート能力を受け取るDMUS_PORTCAPS構造体へのポインタ。dwSizeを事前設定する。 |
vtbl 4 HRESULT CreateMusicBuffer(DMUS_BUFFERDESC* pBufferDesc, IDirectMusicBuffer** ppBuffer, IUnknown* pUnkOuter)
| pBufferDesc | DMUS_BUFFERDESC* | inout | 作成するミュージックバッファの形式やサイズを指定するDMUS_BUFFERDESC構造体へのポインタ。 |
| ppBuffer | IDirectMusicBuffer** | out | 生成されたIDirectMusicBufferインターフェイスの受け取り先。要Release。 |
| pUnkOuter | IUnknown* | in | COMアグリゲーション用の外部IUnknown。通常はNULL。 |
vtbl 5 HRESULT CreatePort(GUID* rclsidPort, DMUS_PORTPARAMS8* pPortParams, IDirectMusicPort** ppPort, IUnknown* pUnkOuter)
| rclsidPort | GUID* | in | 作成するポートのクラスを示すCLSID(GUID)へのポインタ。 |
| pPortParams | DMUS_PORTPARAMS8* | inout | チャンネルグループ数や音色などポート初期化パラメータを指定するDMUS_PORTPARAMS8へのポインタ。 |
| ppPort | IDirectMusicPort** | out | 生成されたIDirectMusicPortインターフェイスの受け取り先。要Release。 |
| pUnkOuter | IUnknown* | in | COMアグリゲーション用の外部IUnknown。通常はNULL。 |
vtbl 6 HRESULT EnumMasterClock(DWORD dwIndex, DMUS_CLOCKINFO8* lpClockInfo)
| dwIndex | DWORD | in | 列挙するマスタークロックの0起点インデックス。 |
| lpClockInfo | DMUS_CLOCKINFO8* | inout | 指定インデックスのクロック情報を受け取るDMUS_CLOCKINFO8構造体へのポインタ。 |
vtbl 7 HRESULT GetMasterClock(GUID* pguidClock, IReferenceClock** ppReferenceClock)
| pguidClock | GUID* | inout | 現在のマスタークロックを識別するGUIDの受け取り先。不要ならNULL可。 |
| ppReferenceClock | IReferenceClock** | out | 現在のマスタークロックのIReferenceClockインターフェイスの受け取り先。要Release。 |
vtbl 8 HRESULT SetMasterClock(GUID* rguidClock)
| rguidClock | GUID* | in | マスタークロックに設定するクロックのGUIDへのポインタ。EnumMasterClockで得た値を渡す。 |
| fEnable | BOOL | in | DirectMusicを有効化(TRUE)するか無効化(FALSE)するかを指定するブール値。 |
vtbl 10 HRESULT GetDefaultPort(GUID* pguidPort)
| pguidPort | GUID* | inout | システム既定のポートを識別するGUIDの受け取り先。 |
vtbl 11 HRESULT SetDirectSound(IDirectSound* pDirectSound, HWND hWnd)
| pDirectSound | IDirectSound* | in | DirectMusicが出力に用いるIDirectSoundオブジェクト。NULLで既定のDirectSoundを使用する。 |
| hWnd | HWND | in | 協調レベル設定に用いるアプリケーションのウィンドウハンドル。NULL可。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_IDirectMusic "{6536115A-7B2D-11D2-BA18-0000F875AC12}" #usecom global IDirectMusic IID_IDirectMusic "{636B9F10-0C7D-11D1-95B2-0020AFDC7421}" #comfunc global IDirectMusic_EnumPort 3 int,var #comfunc global IDirectMusic_CreateMusicBuffer 4 var,sptr,sptr #comfunc global IDirectMusic_CreatePort 5 var,var,sptr,sptr #comfunc global IDirectMusic_EnumMasterClock 6 int,var #comfunc global IDirectMusic_GetMasterClock 7 var,sptr #comfunc global IDirectMusic_SetMasterClock 8 var #comfunc global IDirectMusic_Activate 9 int #comfunc global IDirectMusic_GetDefaultPort 10 var #comfunc global IDirectMusic_SetDirectSound 11 sptr,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※#usecom 末尾は CoCreateInstance 用のクラスID(コクラスCLSID, SDKから自動取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_IDirectMusic "{6536115A-7B2D-11D2-BA18-0000F875AC12}" #usecom global IDirectMusic IID_IDirectMusic "{636B9F10-0C7D-11D1-95B2-0020AFDC7421}" #comfunc global IDirectMusic_EnumPort 3 int,sptr #comfunc global IDirectMusic_CreateMusicBuffer 4 sptr,sptr,sptr #comfunc global IDirectMusic_CreatePort 5 sptr,sptr,sptr,sptr #comfunc global IDirectMusic_EnumMasterClock 6 int,sptr #comfunc global IDirectMusic_GetMasterClock 7 sptr,sptr #comfunc global IDirectMusic_SetMasterClock 8 sptr #comfunc global IDirectMusic_Activate 9 int #comfunc global IDirectMusic_GetDefaultPort 10 sptr #comfunc global IDirectMusic_SetDirectSound 11 sptr,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※#usecom 末尾は CoCreateInstance 用のクラスID(コクラスCLSID, SDKから自動取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。