ホーム › Media.Audio.XAudio2 › HrtfDirectivityCone
HrtfDirectivityCone
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| directivity | HrtfDirectivity | 8 | +0 | +0 | 基本となる指向性設定を示すHrtfDirectivity構造体。 |
| innerAngle | FLOAT | 4 | +8 | +8 | 減衰のない円錐内側の角度をラジアンで示す。 |
| outerAngle | FLOAT | 4 | +12 | +12 | 完全に減衰する円錐外側の角度をラジアンで示す。 |
各言語での定義
#include <windows.h>
// HrtfDirectivity (x64 8 / x86 8 バイト)
typedef struct HrtfDirectivity {
HrtfDirectivityType type;
FLOAT scaling;
} HrtfDirectivity;
// HrtfDirectivityCone (x64 16 / x86 16 バイト)
typedef struct HrtfDirectivityCone {
HrtfDirectivity directivity;
FLOAT innerAngle;
FLOAT outerAngle;
} HrtfDirectivityCone;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HrtfDirectivity
{
public int type;
public float scaling;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HrtfDirectivityCone
{
public HrtfDirectivity directivity;
public float innerAngle;
public float outerAngle;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HrtfDirectivity
Public type As Integer
Public scaling As Single
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HrtfDirectivityCone
Public directivity As HrtfDirectivity
Public innerAngle As Single
Public outerAngle As Single
End Structureimport ctypes
from ctypes import wintypes
class HrtfDirectivity(ctypes.Structure):
_fields_ = [
("type", ctypes.c_int),
("scaling", ctypes.c_float),
]
class HrtfDirectivityCone(ctypes.Structure):
_fields_ = [
("directivity", HrtfDirectivity),
("innerAngle", ctypes.c_float),
("outerAngle", ctypes.c_float),
]#[repr(C)]
pub struct HrtfDirectivity {
pub type: i32,
pub scaling: f32,
}
#[repr(C)]
pub struct HrtfDirectivityCone {
pub directivity: HrtfDirectivity,
pub innerAngle: f32,
pub outerAngle: f32,
}import "golang.org/x/sys/windows"
type HrtfDirectivity struct {
type int32
scaling float32
}
type HrtfDirectivityCone struct {
directivity HrtfDirectivity
innerAngle float32
outerAngle float32
}type
HrtfDirectivity = record
type: Integer;
scaling: Single;
end;
HrtfDirectivityCone = record
directivity: HrtfDirectivity;
innerAngle: Single;
outerAngle: Single;
end;const HrtfDirectivity = extern struct {
type: i32,
scaling: f32,
};
const HrtfDirectivityCone = extern struct {
directivity: HrtfDirectivity,
innerAngle: f32,
outerAngle: f32,
};type
HrtfDirectivity {.bycopy.} = object
type: int32
scaling: float32
HrtfDirectivityCone {.bycopy.} = object
directivity: HrtfDirectivity
innerAngle: float32
outerAngle: float32struct HrtfDirectivity
{
int type;
float scaling;
}
struct HrtfDirectivityCone
{
HrtfDirectivity directivity;
float innerAngle;
float outerAngle;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HrtfDirectivityCone サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; directivity : HrtfDirectivity (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; innerAngle : FLOAT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; outerAngle : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global HrtfDirectivity
#field int type
#field float scaling
#endstruct
#defstruct global HrtfDirectivityCone
#field HrtfDirectivity directivity
#field float innerAngle
#field float outerAngle
#endstruct
stdim st, HrtfDirectivityCone ; NSTRUCT 変数を確保
st->innerAngle = 100
mes "innerAngle=" + st->innerAngle