ホーム › Media.Audio.DirectSound › DSEFFECTDESC
DSEFFECTDESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| dwFlags | DWORD | 4 | +4 | +4 | エフェクト配置を示すビットフラグ(DSFX_LOCHARDWARE/SOFTWARE等)。 |
| guidDSFXClass | GUID | 16 | +8 | +8 | 適用するエフェクトのクラスを識別するGUID(GUID_DSFX_*)。 |
| dwReserved1 | UINT_PTR | 8/4 | +24 | +24 | 予約済み。0に設定する。 |
| dwReserved2 | UINT_PTR | 8/4 | +32 | +28 | 予約済み。0に設定する。 |
各言語での定義
#include <windows.h>
// DSEFFECTDESC (x64 40 / x86 32 バイト)
typedef struct DSEFFECTDESC {
DWORD dwSize;
DWORD dwFlags;
GUID guidDSFXClass;
UINT_PTR dwReserved1;
UINT_PTR dwReserved2;
} DSEFFECTDESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSEFFECTDESC
{
public uint dwSize;
public uint dwFlags;
public Guid guidDSFXClass;
public UIntPtr dwReserved1;
public UIntPtr dwReserved2;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSEFFECTDESC
Public dwSize As UInteger
Public dwFlags As UInteger
Public guidDSFXClass As Guid
Public dwReserved1 As UIntPtr
Public dwReserved2 As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class DSEFFECTDESC(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("guidDSFXClass", GUID),
("dwReserved1", ctypes.c_size_t),
("dwReserved2", ctypes.c_size_t),
]#[repr(C)]
pub struct DSEFFECTDESC {
pub dwSize: u32,
pub dwFlags: u32,
pub guidDSFXClass: GUID,
pub dwReserved1: usize,
pub dwReserved2: usize,
}import "golang.org/x/sys/windows"
type DSEFFECTDESC struct {
dwSize uint32
dwFlags uint32
guidDSFXClass windows.GUID
dwReserved1 uintptr
dwReserved2 uintptr
}type
DSEFFECTDESC = record
dwSize: DWORD;
dwFlags: DWORD;
guidDSFXClass: TGUID;
dwReserved1: NativeUInt;
dwReserved2: NativeUInt;
end;const DSEFFECTDESC = extern struct {
dwSize: u32,
dwFlags: u32,
guidDSFXClass: GUID,
dwReserved1: usize,
dwReserved2: usize,
};type
DSEFFECTDESC {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
guidDSFXClass: GUID
dwReserved1: uint
dwReserved2: uintstruct DSEFFECTDESC
{
uint dwSize;
uint dwFlags;
GUID guidDSFXClass;
size_t dwReserved1;
size_t dwReserved2;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DSEFFECTDESC サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; guidDSFXClass : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; dwReserved1 : UINT_PTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwReserved2 : UINT_PTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSEFFECTDESC サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; guidDSFXClass : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; dwReserved1 : UINT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwReserved2 : UINT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※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 DSEFFECTDESC
#field int dwSize
#field int dwFlags
#field GUID guidDSFXClass
#field intptr dwReserved1
#field intptr dwReserved2
#endstruct
stdim st, DSEFFECTDESC ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize