ホーム › Media.Audio.DirectMusic › DMUS_CLOCKINFO8
DMUS_CLOCKINFO8
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| ctType | DMUS_CLOCKTYPE | 4 | +4 | +4 | クロックの種類を示す列挙値(DMUS_CLOCKTYPE)。 |
| guidClock | GUID | 16 | +8 | +8 | クロックを一意に識別するGUID。 |
| wszDescription | WCHAR | 256 | +24 | +24 | クロックの説明文字列(Unicode、固定長配列)。 |
| dwFlags | DWORD | 4 | +280 | +280 | クロックの属性を示すビットフラグ。DX8で追加。 |
各言語での定義
#include <windows.h>
// DMUS_CLOCKINFO8 (x64 284 / x86 284 バイト)
typedef struct DMUS_CLOCKINFO8 {
DWORD dwSize;
DMUS_CLOCKTYPE ctType;
GUID guidClock;
WCHAR wszDescription[128];
DWORD dwFlags;
} DMUS_CLOCKINFO8;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DMUS_CLOCKINFO8
{
public uint dwSize;
public int ctType;
public Guid guidClock;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string wszDescription;
public uint dwFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DMUS_CLOCKINFO8
Public dwSize As UInteger
Public ctType As Integer
Public guidClock As Guid
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public wszDescription As String
Public dwFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DMUS_CLOCKINFO8(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("ctType", ctypes.c_int),
("guidClock", GUID),
("wszDescription", ctypes.c_wchar * 128),
("dwFlags", wintypes.DWORD),
]#[repr(C)]
pub struct DMUS_CLOCKINFO8 {
pub dwSize: u32,
pub ctType: i32,
pub guidClock: GUID,
pub wszDescription: [u16; 128],
pub dwFlags: u32,
}import "golang.org/x/sys/windows"
type DMUS_CLOCKINFO8 struct {
dwSize uint32
ctType int32
guidClock windows.GUID
wszDescription [128]uint16
dwFlags uint32
}type
DMUS_CLOCKINFO8 = record
dwSize: DWORD;
ctType: Integer;
guidClock: TGUID;
wszDescription: array[0..127] of WideChar;
dwFlags: DWORD;
end;const DMUS_CLOCKINFO8 = extern struct {
dwSize: u32,
ctType: i32,
guidClock: GUID,
wszDescription: [128]u16,
dwFlags: u32,
};type
DMUS_CLOCKINFO8 {.bycopy.} = object
dwSize: uint32
ctType: int32
guidClock: GUID
wszDescription: array[128, uint16]
dwFlags: uint32struct DMUS_CLOCKINFO8
{
uint dwSize;
int ctType;
GUID guidClock;
wchar[128] wszDescription;
uint dwFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DMUS_CLOCKINFO8 サイズ: 284 バイト(x64)
dim st, 71 ; 4byte整数×71(構造体サイズ 284 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ctType : DMUS_CLOCKTYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; guidClock : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; wszDescription : WCHAR (+24, 256byte) varptr(st)+24 を基点に操作(256byte:入れ子/配列)
; dwFlags : DWORD (+280, 4byte) st.70 = 値 / 値 = st.70 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global DMUS_CLOCKINFO8
#field int dwSize
#field int ctType
#field GUID guidClock
#field wchar wszDescription 128
#field int dwFlags
#endstruct
stdim st, DMUS_CLOCKINFO8 ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize