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

AUDIO_MICROPHONE_BOOST_NOTIFICATION

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

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

フィールド

フィールドサイズx64x86説明
endpointIMMDevice*8/4+0+0対象オーディオエンドポイントを表すIMMDeviceへのポインター。
eventContextGUID16+8+4通知元を識別するイベントコンテキストGUID。
microphoneBoostEnabledBOOL4+24+20マイクブーストが有効かを示すBOOL。
levelInDbFLOAT4+28+24現在のブーストレベルをデシベルで示す。
levelMinInDbFLOAT4+32+28ブーストレベルの最小値をデシベルで示す。
levelMaxInDbFLOAT4+36+32ブーストレベルの最大値をデシベルで示す。
levelStepInDbFLOAT4+40+36ブーストレベル1ステップの増分をデシベルで示す。
muteSupportedBOOL4+44+40ミュート操作に対応しているかを示すBOOL。
muteBOOL4+48+44現在ミュート状態かを示すBOOL。

各言語での定義

#include <windows.h>

// AUDIO_MICROPHONE_BOOST_NOTIFICATION  (x64 56 / x86 48 バイト)
typedef struct AUDIO_MICROPHONE_BOOST_NOTIFICATION {
    IMMDevice* endpoint;
    GUID eventContext;
    BOOL microphoneBoostEnabled;
    FLOAT levelInDb;
    FLOAT levelMinInDb;
    FLOAT levelMaxInDb;
    FLOAT levelStepInDb;
    BOOL muteSupported;
    BOOL mute;
} AUDIO_MICROPHONE_BOOST_NOTIFICATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AUDIO_MICROPHONE_BOOST_NOTIFICATION
{
    public IntPtr endpoint;
    public Guid eventContext;
    [MarshalAs(UnmanagedType.Bool)] public bool microphoneBoostEnabled;
    public float levelInDb;
    public float levelMinInDb;
    public float levelMaxInDb;
    public float levelStepInDb;
    [MarshalAs(UnmanagedType.Bool)] public bool muteSupported;
    [MarshalAs(UnmanagedType.Bool)] public bool mute;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AUDIO_MICROPHONE_BOOST_NOTIFICATION
    Public endpoint As IntPtr
    Public eventContext As Guid
    <MarshalAs(UnmanagedType.Bool)> Public microphoneBoostEnabled As Boolean
    Public levelInDb As Single
    Public levelMinInDb As Single
    Public levelMaxInDb As Single
    Public levelStepInDb As Single
    <MarshalAs(UnmanagedType.Bool)> Public muteSupported As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public mute As Boolean
End Structure
import ctypes
from ctypes import wintypes

class AUDIO_MICROPHONE_BOOST_NOTIFICATION(ctypes.Structure):
    _fields_ = [
        ("endpoint", ctypes.c_void_p),
        ("eventContext", GUID),
        ("microphoneBoostEnabled", wintypes.BOOL),
        ("levelInDb", ctypes.c_float),
        ("levelMinInDb", ctypes.c_float),
        ("levelMaxInDb", ctypes.c_float),
        ("levelStepInDb", ctypes.c_float),
        ("muteSupported", wintypes.BOOL),
        ("mute", wintypes.BOOL),
    ]
#[repr(C)]
pub struct AUDIO_MICROPHONE_BOOST_NOTIFICATION {
    pub endpoint: *mut core::ffi::c_void,
    pub eventContext: GUID,
    pub microphoneBoostEnabled: i32,
    pub levelInDb: f32,
    pub levelMinInDb: f32,
    pub levelMaxInDb: f32,
    pub levelStepInDb: f32,
    pub muteSupported: i32,
    pub mute: i32,
}
import "golang.org/x/sys/windows"

type AUDIO_MICROPHONE_BOOST_NOTIFICATION struct {
	endpoint uintptr
	eventContext windows.GUID
	microphoneBoostEnabled int32
	levelInDb float32
	levelMinInDb float32
	levelMaxInDb float32
	levelStepInDb float32
	muteSupported int32
	mute int32
}
type
  AUDIO_MICROPHONE_BOOST_NOTIFICATION = record
    endpoint: Pointer;
    eventContext: TGUID;
    microphoneBoostEnabled: BOOL;
    levelInDb: Single;
    levelMinInDb: Single;
    levelMaxInDb: Single;
    levelStepInDb: Single;
    muteSupported: BOOL;
    mute: BOOL;
  end;
const AUDIO_MICROPHONE_BOOST_NOTIFICATION = extern struct {
    endpoint: ?*anyopaque,
    eventContext: GUID,
    microphoneBoostEnabled: i32,
    levelInDb: f32,
    levelMinInDb: f32,
    levelMaxInDb: f32,
    levelStepInDb: f32,
    muteSupported: i32,
    mute: i32,
};
type
  AUDIO_MICROPHONE_BOOST_NOTIFICATION {.bycopy.} = object
    endpoint: pointer
    eventContext: GUID
    microphoneBoostEnabled: int32
    levelInDb: float32
    levelMinInDb: float32
    levelMaxInDb: float32
    levelStepInDb: float32
    muteSupported: int32
    mute: int32
struct AUDIO_MICROPHONE_BOOST_NOTIFICATION
{
    void* endpoint;
    GUID eventContext;
    int microphoneBoostEnabled;
    float levelInDb;
    float levelMinInDb;
    float levelMaxInDb;
    float levelStepInDb;
    int muteSupported;
    int mute;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; AUDIO_MICROPHONE_BOOST_NOTIFICATION サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; endpoint : IMMDevice* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; eventContext : GUID (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; microphoneBoostEnabled : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; levelInDb : FLOAT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; levelMinInDb : FLOAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; levelMaxInDb : FLOAT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; levelStepInDb : FLOAT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; muteSupported : BOOL (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; mute : BOOL (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AUDIO_MICROPHONE_BOOST_NOTIFICATION サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; endpoint : IMMDevice* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; eventContext : GUID (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; microphoneBoostEnabled : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; levelInDb : FLOAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; levelMinInDb : FLOAT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; levelMaxInDb : FLOAT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; levelStepInDb : FLOAT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; muteSupported : BOOL (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; mute : BOOL (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ※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 AUDIO_MICROPHONE_BOOST_NOTIFICATION
    #field intptr endpoint
    #field GUID eventContext
    #field bool microphoneBoostEnabled
    #field float levelInDb
    #field float levelMinInDb
    #field float levelMaxInDb
    #field float levelStepInDb
    #field bool muteSupported
    #field bool mute
#endstruct

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