Win32 API 日本語リファレンス
ホームUI.Input.GameInput › GameInputForceFeedbackEnvelope

GameInputForceFeedbackEnvelope

構造体
サイズx64: 48 バイト / x86: 48 バイト

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

フィールド

フィールドサイズx64x86説明
attackDurationULONGLONG8+0+0アタック(立ち上がり)時間をマイクロ秒で指定する。
sustainDurationULONGLONG8+8+8サステイン(持続)時間をマイクロ秒で指定する。
releaseDurationULONGLONG8+16+16リリース(減衰)時間をマイクロ秒で指定する。
attackGainFLOAT4+24+24アタック開始時のゲインを0〜1で指定する。
sustainGainFLOAT4+28+28サステイン中のゲインを0〜1で指定する。
releaseGainFLOAT4+32+32リリース終了時のゲインを0〜1で指定する。
playCountDWORD4+36+36エフェクトの再生回数である。
repeatDelayULONGLONG8+40+40繰り返し間の遅延をマイクロ秒で指定する。

各言語での定義

#include <windows.h>

// GameInputForceFeedbackEnvelope  (x64 48 / x86 48 バイト)
typedef struct GameInputForceFeedbackEnvelope {
    ULONGLONG attackDuration;
    ULONGLONG sustainDuration;
    ULONGLONG releaseDuration;
    FLOAT attackGain;
    FLOAT sustainGain;
    FLOAT releaseGain;
    DWORD playCount;
    ULONGLONG repeatDelay;
} GameInputForceFeedbackEnvelope;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputForceFeedbackEnvelope
{
    public ulong attackDuration;
    public ulong sustainDuration;
    public ulong releaseDuration;
    public float attackGain;
    public float sustainGain;
    public float releaseGain;
    public uint playCount;
    public ulong repeatDelay;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputForceFeedbackEnvelope
    Public attackDuration As ULong
    Public sustainDuration As ULong
    Public releaseDuration As ULong
    Public attackGain As Single
    Public sustainGain As Single
    Public releaseGain As Single
    Public playCount As UInteger
    Public repeatDelay As ULong
End Structure
import ctypes
from ctypes import wintypes

class GameInputForceFeedbackEnvelope(ctypes.Structure):
    _fields_ = [
        ("attackDuration", ctypes.c_ulonglong),
        ("sustainDuration", ctypes.c_ulonglong),
        ("releaseDuration", ctypes.c_ulonglong),
        ("attackGain", ctypes.c_float),
        ("sustainGain", ctypes.c_float),
        ("releaseGain", ctypes.c_float),
        ("playCount", wintypes.DWORD),
        ("repeatDelay", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct GameInputForceFeedbackEnvelope {
    pub attackDuration: u64,
    pub sustainDuration: u64,
    pub releaseDuration: u64,
    pub attackGain: f32,
    pub sustainGain: f32,
    pub releaseGain: f32,
    pub playCount: u32,
    pub repeatDelay: u64,
}
import "golang.org/x/sys/windows"

type GameInputForceFeedbackEnvelope struct {
	attackDuration uint64
	sustainDuration uint64
	releaseDuration uint64
	attackGain float32
	sustainGain float32
	releaseGain float32
	playCount uint32
	repeatDelay uint64
}
type
  GameInputForceFeedbackEnvelope = record
    attackDuration: UInt64;
    sustainDuration: UInt64;
    releaseDuration: UInt64;
    attackGain: Single;
    sustainGain: Single;
    releaseGain: Single;
    playCount: DWORD;
    repeatDelay: UInt64;
  end;
const GameInputForceFeedbackEnvelope = extern struct {
    attackDuration: u64,
    sustainDuration: u64,
    releaseDuration: u64,
    attackGain: f32,
    sustainGain: f32,
    releaseGain: f32,
    playCount: u32,
    repeatDelay: u64,
};
type
  GameInputForceFeedbackEnvelope {.bycopy.} = object
    attackDuration: uint64
    sustainDuration: uint64
    releaseDuration: uint64
    attackGain: float32
    sustainGain: float32
    releaseGain: float32
    playCount: uint32
    repeatDelay: uint64
struct GameInputForceFeedbackEnvelope
{
    ulong attackDuration;
    ulong sustainDuration;
    ulong releaseDuration;
    float attackGain;
    float sustainGain;
    float releaseGain;
    uint playCount;
    ulong repeatDelay;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputForceFeedbackEnvelope サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; attackDuration : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; sustainDuration : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; releaseDuration : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; attackGain : FLOAT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; sustainGain : FLOAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; releaseGain : FLOAT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; playCount : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; repeatDelay : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputForceFeedbackEnvelope
    #field int64 attackDuration
    #field int64 sustainDuration
    #field int64 releaseDuration
    #field float attackGain
    #field float sustainGain
    #field float releaseGain
    #field int playCount
    #field int64 repeatDelay
#endstruct

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