Win32 API 日本語リファレンス
ホームMedia.Audio.XAudio2 › FXEQ_PARAMETERS

FXEQ_PARAMETERS

構造体
サイズx64: 48 バイト / x86: 48 バイトパッキング1

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
FrequencyCenter0FLOAT4+0+0バンド0の中心周波数をHzで示す。
Gain0FLOAT4+4+4バンド0のゲイン倍率を示す。1.0で無変化となる。
Bandwidth0FLOAT4+8+8バンド0の帯域幅をオクターブ単位で示す。
FrequencyCenter1FLOAT4+12+12バンド1の中心周波数をHzで示す。
Gain1FLOAT4+16+16バンド1のゲイン倍率を示す。1.0で無変化となる。
Bandwidth1FLOAT4+20+20バンド1の帯域幅をオクターブ単位で示す。
FrequencyCenter2FLOAT4+24+24バンド2の中心周波数をHzで示す。
Gain2FLOAT4+28+28バンド2のゲイン倍率を示す。1.0で無変化となる。
Bandwidth2FLOAT4+32+32バンド2の帯域幅をオクターブ単位で示す。
FrequencyCenter3FLOAT4+36+36バンド3の中心周波数をHzで示す。
Gain3FLOAT4+40+40バンド3のゲイン倍率を示す。1.0で無変化となる。
Bandwidth3FLOAT4+44+44バンド3の帯域幅をオクターブ単位で示す。

各言語での定義

#include <windows.h>

// FXEQ_PARAMETERS  (x64 48 / x86 48 バイト)
#pragma pack(push, 1)
typedef struct FXEQ_PARAMETERS {
    FLOAT FrequencyCenter0;
    FLOAT Gain0;
    FLOAT Bandwidth0;
    FLOAT FrequencyCenter1;
    FLOAT Gain1;
    FLOAT Bandwidth1;
    FLOAT FrequencyCenter2;
    FLOAT Gain2;
    FLOAT Bandwidth2;
    FLOAT FrequencyCenter3;
    FLOAT Gain3;
    FLOAT Bandwidth3;
} FXEQ_PARAMETERS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct FXEQ_PARAMETERS
{
    public float FrequencyCenter0;
    public float Gain0;
    public float Bandwidth0;
    public float FrequencyCenter1;
    public float Gain1;
    public float Bandwidth1;
    public float FrequencyCenter2;
    public float Gain2;
    public float Bandwidth2;
    public float FrequencyCenter3;
    public float Gain3;
    public float Bandwidth3;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure FXEQ_PARAMETERS
    Public FrequencyCenter0 As Single
    Public Gain0 As Single
    Public Bandwidth0 As Single
    Public FrequencyCenter1 As Single
    Public Gain1 As Single
    Public Bandwidth1 As Single
    Public FrequencyCenter2 As Single
    Public Gain2 As Single
    Public Bandwidth2 As Single
    Public FrequencyCenter3 As Single
    Public Gain3 As Single
    Public Bandwidth3 As Single
End Structure
import ctypes
from ctypes import wintypes

class FXEQ_PARAMETERS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("FrequencyCenter0", ctypes.c_float),
        ("Gain0", ctypes.c_float),
        ("Bandwidth0", ctypes.c_float),
        ("FrequencyCenter1", ctypes.c_float),
        ("Gain1", ctypes.c_float),
        ("Bandwidth1", ctypes.c_float),
        ("FrequencyCenter2", ctypes.c_float),
        ("Gain2", ctypes.c_float),
        ("Bandwidth2", ctypes.c_float),
        ("FrequencyCenter3", ctypes.c_float),
        ("Gain3", ctypes.c_float),
        ("Bandwidth3", ctypes.c_float),
    ]
#[repr(C, packed(1))]
pub struct FXEQ_PARAMETERS {
    pub FrequencyCenter0: f32,
    pub Gain0: f32,
    pub Bandwidth0: f32,
    pub FrequencyCenter1: f32,
    pub Gain1: f32,
    pub Bandwidth1: f32,
    pub FrequencyCenter2: f32,
    pub Gain2: f32,
    pub Bandwidth2: f32,
    pub FrequencyCenter3: f32,
    pub Gain3: f32,
    pub Bandwidth3: f32,
}
import "golang.org/x/sys/windows"

type FXEQ_PARAMETERS struct {
	FrequencyCenter0 float32
	Gain0 float32
	Bandwidth0 float32
	FrequencyCenter1 float32
	Gain1 float32
	Bandwidth1 float32
	FrequencyCenter2 float32
	Gain2 float32
	Bandwidth2 float32
	FrequencyCenter3 float32
	Gain3 float32
	Bandwidth3 float32
}
type
  FXEQ_PARAMETERS = packed record
    FrequencyCenter0: Single;
    Gain0: Single;
    Bandwidth0: Single;
    FrequencyCenter1: Single;
    Gain1: Single;
    Bandwidth1: Single;
    FrequencyCenter2: Single;
    Gain2: Single;
    Bandwidth2: Single;
    FrequencyCenter3: Single;
    Gain3: Single;
    Bandwidth3: Single;
  end;
const FXEQ_PARAMETERS = extern struct {
    FrequencyCenter0: f32,
    Gain0: f32,
    Bandwidth0: f32,
    FrequencyCenter1: f32,
    Gain1: f32,
    Bandwidth1: f32,
    FrequencyCenter2: f32,
    Gain2: f32,
    Bandwidth2: f32,
    FrequencyCenter3: f32,
    Gain3: f32,
    Bandwidth3: f32,
};
type
  FXEQ_PARAMETERS {.packed.} = object
    FrequencyCenter0: float32
    Gain0: float32
    Bandwidth0: float32
    FrequencyCenter1: float32
    Gain1: float32
    Bandwidth1: float32
    FrequencyCenter2: float32
    Gain2: float32
    Bandwidth2: float32
    FrequencyCenter3: float32
    Gain3: float32
    Bandwidth3: float32
align(1)
struct FXEQ_PARAMETERS
{
    float FrequencyCenter0;
    float Gain0;
    float Bandwidth0;
    float FrequencyCenter1;
    float Gain1;
    float Bandwidth1;
    float FrequencyCenter2;
    float Gain2;
    float Bandwidth2;
    float FrequencyCenter3;
    float Gain3;
    float Bandwidth3;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FXEQ_PARAMETERS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; FrequencyCenter0 : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Gain0 : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Bandwidth0 : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; FrequencyCenter1 : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Gain1 : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Bandwidth1 : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; FrequencyCenter2 : FLOAT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Gain2 : FLOAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Bandwidth2 : FLOAT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; FrequencyCenter3 : FLOAT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; Gain3 : FLOAT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; Bandwidth3 : FLOAT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FXEQ_PARAMETERS, pack=1
    #field float FrequencyCenter0
    #field float Gain0
    #field float Bandwidth0
    #field float FrequencyCenter1
    #field float Gain1
    #field float Bandwidth1
    #field float FrequencyCenter2
    #field float Gain2
    #field float Bandwidth2
    #field float FrequencyCenter3
    #field float Gain3
    #field float Bandwidth3
#endstruct

stdim st, FXEQ_PARAMETERS        ; NSTRUCT 変数を確保
st->FrequencyCenter0 = 100
mes "FrequencyCenter0=" + st->FrequencyCenter0