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

TRANSPORTAUDIOPARMS

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

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

フィールド

フィールドサイズx64x86説明
EnableOutputINT4+0+0音声出力を有効にするかを示す。
EnableRecordINT4+4+4音声録音を有効にするかを示す。
EnableSelsyncINT4+8+8セルシンク(同期録音)を有効にするかを示す。
InputINT4+12+12選択された音声入力を示す値。
MonitorSourceINT4+16+16音声モニタのソースを示す値。

各言語での定義

#include <windows.h>

// TRANSPORTAUDIOPARMS  (x64 20 / x86 20 バイト)
typedef struct TRANSPORTAUDIOPARMS {
    INT EnableOutput;
    INT EnableRecord;
    INT EnableSelsync;
    INT Input;
    INT MonitorSource;
} TRANSPORTAUDIOPARMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRANSPORTAUDIOPARMS
{
    public int EnableOutput;
    public int EnableRecord;
    public int EnableSelsync;
    public int Input;
    public int MonitorSource;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRANSPORTAUDIOPARMS
    Public EnableOutput As Integer
    Public EnableRecord As Integer
    Public EnableSelsync As Integer
    Public Input As Integer
    Public MonitorSource As Integer
End Structure
import ctypes
from ctypes import wintypes

class TRANSPORTAUDIOPARMS(ctypes.Structure):
    _fields_ = [
        ("EnableOutput", ctypes.c_int),
        ("EnableRecord", ctypes.c_int),
        ("EnableSelsync", ctypes.c_int),
        ("Input", ctypes.c_int),
        ("MonitorSource", ctypes.c_int),
    ]
#[repr(C)]
pub struct TRANSPORTAUDIOPARMS {
    pub EnableOutput: i32,
    pub EnableRecord: i32,
    pub EnableSelsync: i32,
    pub Input: i32,
    pub MonitorSource: i32,
}
import "golang.org/x/sys/windows"

type TRANSPORTAUDIOPARMS struct {
	EnableOutput int32
	EnableRecord int32
	EnableSelsync int32
	Input int32
	MonitorSource int32
}
type
  TRANSPORTAUDIOPARMS = record
    EnableOutput: Integer;
    EnableRecord: Integer;
    EnableSelsync: Integer;
    Input: Integer;
    MonitorSource: Integer;
  end;
const TRANSPORTAUDIOPARMS = extern struct {
    EnableOutput: i32,
    EnableRecord: i32,
    EnableSelsync: i32,
    Input: i32,
    MonitorSource: i32,
};
type
  TRANSPORTAUDIOPARMS {.bycopy.} = object
    EnableOutput: int32
    EnableRecord: int32
    EnableSelsync: int32
    Input: int32
    MonitorSource: int32
struct TRANSPORTAUDIOPARMS
{
    int EnableOutput;
    int EnableRecord;
    int EnableSelsync;
    int Input;
    int MonitorSource;
}

HSP用 定義

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

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

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