ホーム › Media.Audio.DirectMusic › DMUS_EVENTHEADER
DMUS_EVENTHEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbEvent | DWORD | 4 | +0 | +0 | イベントデータのバイトサイズ。 |
| dwChannelGroup | DWORD | 4 | +4 | +4 | イベントが属するチャンネルグループ番号(1始まり)。 |
| rtDelta | LONGLONG | 8 | +8 | +8 | 前イベントからの相対時刻差(REFERENCE_TIME、100ナノ秒単位、64bit)。 |
| dwFlags | DWORD | 4 | +16 | +16 | イベント種別を示すビットフラグ(DMUS_EVENT_STRUCTURED等)。 |
各言語での定義
#include <windows.h>
// DMUS_EVENTHEADER (x64 20 / x86 20 バイト)
#pragma pack(push, 4)
typedef struct DMUS_EVENTHEADER {
DWORD cbEvent;
DWORD dwChannelGroup;
LONGLONG rtDelta;
DWORD dwFlags;
} DMUS_EVENTHEADER;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct DMUS_EVENTHEADER
{
public uint cbEvent;
public uint dwChannelGroup;
public long rtDelta;
public uint dwFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure DMUS_EVENTHEADER
Public cbEvent As UInteger
Public dwChannelGroup As UInteger
Public rtDelta As Long
Public dwFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DMUS_EVENTHEADER(ctypes.Structure):
_pack_ = 4
_fields_ = [
("cbEvent", wintypes.DWORD),
("dwChannelGroup", wintypes.DWORD),
("rtDelta", ctypes.c_longlong),
("dwFlags", wintypes.DWORD),
]#[repr(C, packed(4))]
pub struct DMUS_EVENTHEADER {
pub cbEvent: u32,
pub dwChannelGroup: u32,
pub rtDelta: i64,
pub dwFlags: u32,
}import "golang.org/x/sys/windows"
type DMUS_EVENTHEADER struct {
cbEvent uint32
dwChannelGroup uint32
rtDelta int64
dwFlags uint32
}type
DMUS_EVENTHEADER = packed record
cbEvent: DWORD;
dwChannelGroup: DWORD;
rtDelta: Int64;
dwFlags: DWORD;
end;const DMUS_EVENTHEADER = extern struct {
cbEvent: u32,
dwChannelGroup: u32,
rtDelta: i64,
dwFlags: u32,
};type
DMUS_EVENTHEADER {.packed.} = object
cbEvent: uint32
dwChannelGroup: uint32
rtDelta: int64
dwFlags: uint32align(4)
struct DMUS_EVENTHEADER
{
uint cbEvent;
uint dwChannelGroup;
long rtDelta;
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_EVENTHEADER サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbEvent : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwChannelGroup : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; rtDelta : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DMUS_EVENTHEADER, pack=4
#field int cbEvent
#field int dwChannelGroup
#field int64 rtDelta
#field int dwFlags
#endstruct
stdim st, DMUS_EVENTHEADER ; NSTRUCT 変数を確保
st->cbEvent = 100
mes "cbEvent=" + st->cbEvent