Win32 API 日本語リファレンス
ホームMedia.KernelStreaming › KSAUDIO_MIX_CAPS

KSAUDIO_MIX_CAPS

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

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

フィールド

フィールドサイズx64x86説明
MuteBOOL4+0+0ミュートをサポートするかを示すブール値である。
MinimumINT4+4+4設定可能な最小ミキシングレベルを100分の1dBで示す。
MaximumINT4+8+8設定可能な最大ミキシングレベルを100分の1dBで示す。
Anonymous_Anonymous_e__Union4+12+12追加の機能情報を保持する匿名共用体である。

共用体: _Anonymous_e__Union x64 4B / x86 4B

フィールドサイズx64x86
ResetINT4+0+0
ResolutionINT4+0+0

各言語での定義

#include <windows.h>

// KSAUDIO_MIX_CAPS  (x64 16 / x86 16 バイト)
typedef struct KSAUDIO_MIX_CAPS {
    BOOL Mute;
    INT Minimum;
    INT Maximum;
    _Anonymous_e__Union Anonymous;
} KSAUDIO_MIX_CAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSAUDIO_MIX_CAPS
{
    [MarshalAs(UnmanagedType.Bool)] public bool Mute;
    public int Minimum;
    public int Maximum;
    public _Anonymous_e__Union Anonymous;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSAUDIO_MIX_CAPS
    <MarshalAs(UnmanagedType.Bool)> Public Mute As Boolean
    Public Minimum As Integer
    Public Maximum As Integer
    Public Anonymous As _Anonymous_e__Union
End Structure
import ctypes
from ctypes import wintypes

class KSAUDIO_MIX_CAPS(ctypes.Structure):
    _fields_ = [
        ("Mute", wintypes.BOOL),
        ("Minimum", ctypes.c_int),
        ("Maximum", ctypes.c_int),
        ("Anonymous", _Anonymous_e__Union),
    ]
#[repr(C)]
pub struct KSAUDIO_MIX_CAPS {
    pub Mute: i32,
    pub Minimum: i32,
    pub Maximum: i32,
    pub Anonymous: _Anonymous_e__Union,
}
import "golang.org/x/sys/windows"

type KSAUDIO_MIX_CAPS struct {
	Mute int32
	Minimum int32
	Maximum int32
	Anonymous _Anonymous_e__Union
}
type
  KSAUDIO_MIX_CAPS = record
    Mute: BOOL;
    Minimum: Integer;
    Maximum: Integer;
    Anonymous: _Anonymous_e__Union;
  end;
const KSAUDIO_MIX_CAPS = extern struct {
    Mute: i32,
    Minimum: i32,
    Maximum: i32,
    Anonymous: _Anonymous_e__Union,
};
type
  KSAUDIO_MIX_CAPS {.bycopy.} = object
    Mute: int32
    Minimum: int32
    Maximum: int32
    Anonymous: _Anonymous_e__Union
struct KSAUDIO_MIX_CAPS
{
    int Mute;
    int Minimum;
    int Maximum;
    _Anonymous_e__Union Anonymous;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSAUDIO_MIX_CAPS サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Mute : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Minimum : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Maximum : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSAUDIO_MIX_CAPS
    #field bool Mute
    #field int Minimum
    #field int Maximum
    #field byte Anonymous 4
#endstruct

stdim st, KSAUDIO_MIX_CAPS        ; NSTRUCT 変数を確保
st->Mute = 100
mes "Mute=" + st->Mute
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。