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

MIXERLINEW

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

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

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のバイトサイズ。呼び出し前に設定する。
dwDestinationDWORD4+4+4出力先(デスティネーション)ラインのインデックス。
dwSourceDWORD4+8+8入力元(ソース)ラインのインデックス。デスティネーション自身は-1相当。
dwLineIDDWORD4+12+12ラインを一意に識別するID。
fdwLineDWORD4+16+16ラインの状態を示すビットフラグ(MIXERLINE_LINEF_*)。
dwUserUINT_PTR8/4+20+20アプリ定義のユーザーデータ。
dwComponentTypeMIXERLINE_COMPONENTTYPE4+28+24ラインのコンポーネント種別(マイク/スピーカー等、MIXERLINE_COMPONENTTYPE)。
cChannelsDWORD4+32+28ラインのチャンネル数。
cConnectionsDWORD4+36+32このラインに接続されたソースラインの数。
cControlsDWORD4+40+36このラインに関連付けられたコントロールの数。
szShortNameWCHAR32+44+40ラインの短い名前(Unicode、固定長配列)。
szNameWCHAR128+76+72ラインの完全名(Unicode、固定長配列)。
Target_Target_e__Struct80+204+200このラインに対応するターゲットメディアデバイス情報(入れ子構造体)。

構造体: _Target_e__Struct x64 80B / x86 80B

フィールドサイズx64x86
dwTypeDWORD4+0+0
dwDeviceIDDWORD4+4+4
wMidWORD2+8+8
wPidWORD2+10+10
vDriverVersionDWORD4+12+12
szPnameWCHAR64+16+16

各言語での定義

#include <windows.h>

// MIXERLINEW  (x64 284 / x86 280 バイト)
#pragma pack(push, 1)
typedef struct MIXERLINEW {
    DWORD cbStruct;
    DWORD dwDestination;
    DWORD dwSource;
    DWORD dwLineID;
    DWORD fdwLine;
    UINT_PTR dwUser;
    MIXERLINE_COMPONENTTYPE dwComponentType;
    DWORD cChannels;
    DWORD cConnections;
    DWORD cControls;
    WCHAR szShortName[16];
    WCHAR szName[64];
    _Target_e__Struct Target;
} MIXERLINEW;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MIXERLINEW
{
    public uint cbStruct;
    public uint dwDestination;
    public uint dwSource;
    public uint dwLineID;
    public uint fdwLine;
    public UIntPtr dwUser;
    public uint dwComponentType;
    public uint cChannels;
    public uint cConnections;
    public uint cControls;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string szShortName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string szName;
    public _Target_e__Struct Target;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MIXERLINEW
    Public cbStruct As UInteger
    Public dwDestination As UInteger
    Public dwSource As UInteger
    Public dwLineID As UInteger
    Public fdwLine As UInteger
    Public dwUser As UIntPtr
    Public dwComponentType As UInteger
    Public cChannels As UInteger
    Public cConnections As UInteger
    Public cControls As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public szShortName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szName As String
    Public Target As _Target_e__Struct
End Structure
import ctypes
from ctypes import wintypes

class MIXERLINEW(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("dwDestination", wintypes.DWORD),
        ("dwSource", wintypes.DWORD),
        ("dwLineID", wintypes.DWORD),
        ("fdwLine", wintypes.DWORD),
        ("dwUser", ctypes.c_size_t),
        ("dwComponentType", wintypes.DWORD),
        ("cChannels", wintypes.DWORD),
        ("cConnections", wintypes.DWORD),
        ("cControls", wintypes.DWORD),
        ("szShortName", ctypes.c_wchar * 16),
        ("szName", ctypes.c_wchar * 64),
        ("Target", _Target_e__Struct),
    ]
#[repr(C, packed(1))]
pub struct MIXERLINEW {
    pub cbStruct: u32,
    pub dwDestination: u32,
    pub dwSource: u32,
    pub dwLineID: u32,
    pub fdwLine: u32,
    pub dwUser: usize,
    pub dwComponentType: u32,
    pub cChannels: u32,
    pub cConnections: u32,
    pub cControls: u32,
    pub szShortName: [u16; 16],
    pub szName: [u16; 64],
    pub Target: _Target_e__Struct,
}
import "golang.org/x/sys/windows"

type MIXERLINEW struct {
	cbStruct uint32
	dwDestination uint32
	dwSource uint32
	dwLineID uint32
	fdwLine uint32
	dwUser uintptr
	dwComponentType uint32
	cChannels uint32
	cConnections uint32
	cControls uint32
	szShortName [16]uint16
	szName [64]uint16
	Target _Target_e__Struct
}
type
  MIXERLINEW = packed record
    cbStruct: DWORD;
    dwDestination: DWORD;
    dwSource: DWORD;
    dwLineID: DWORD;
    fdwLine: DWORD;
    dwUser: NativeUInt;
    dwComponentType: DWORD;
    cChannels: DWORD;
    cConnections: DWORD;
    cControls: DWORD;
    szShortName: array[0..15] of WideChar;
    szName: array[0..63] of WideChar;
    Target: _Target_e__Struct;
  end;
const MIXERLINEW = extern struct {
    cbStruct: u32,
    dwDestination: u32,
    dwSource: u32,
    dwLineID: u32,
    fdwLine: u32,
    dwUser: usize,
    dwComponentType: u32,
    cChannels: u32,
    cConnections: u32,
    cControls: u32,
    szShortName: [16]u16,
    szName: [64]u16,
    Target: _Target_e__Struct,
};
type
  MIXERLINEW {.packed.} = object
    cbStruct: uint32
    dwDestination: uint32
    dwSource: uint32
    dwLineID: uint32
    fdwLine: uint32
    dwUser: uint
    dwComponentType: uint32
    cChannels: uint32
    cConnections: uint32
    cControls: uint32
    szShortName: array[16, uint16]
    szName: array[64, uint16]
    Target: _Target_e__Struct
align(1)
struct MIXERLINEW
{
    uint cbStruct;
    uint dwDestination;
    uint dwSource;
    uint dwLineID;
    uint fdwLine;
    size_t dwUser;
    uint dwComponentType;
    uint cChannels;
    uint cConnections;
    uint cControls;
    wchar[16] szShortName;
    wchar[64] szName;
    _Target_e__Struct Target;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MIXERLINEW サイズ: 280 バイト(x86)
dim st, 70    ; 4byte整数×70(構造体サイズ 280 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwDestination : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwSource : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwLineID : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; fdwLine : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwUser : UINT_PTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwComponentType : MIXERLINE_COMPONENTTYPE (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cChannels : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; cConnections : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; cControls : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; szShortName : WCHAR (+40, 32byte)  varptr(st)+40 を基点に操作(32byte:入れ子/配列)
; szName : WCHAR (+72, 128byte)  varptr(st)+72 を基点に操作(128byte:入れ子/配列)
; Target : _Target_e__Struct (+200, 80byte)  varptr(st)+200 を基点に操作(80byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIXERLINEW サイズ: 284 バイト(x64)
dim st, 71    ; 4byte整数×71(構造体サイズ 284 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwDestination : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwSource : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwLineID : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; fdwLine : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwUser : UINT_PTR (+20, 8byte)  qpoke st,20,値 / qpeek(st,20)  ※IronHSPのみ。3.7/3.8は lpoke st,20,下位 : lpoke st,24,上位
; dwComponentType : MIXERLINE_COMPONENTTYPE (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; cChannels : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; cConnections : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; cControls : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; szShortName : WCHAR (+44, 32byte)  varptr(st)+44 を基点に操作(32byte:入れ子/配列)
; szName : WCHAR (+76, 128byte)  varptr(st)+76 を基点に操作(128byte:入れ子/配列)
; Target : _Target_e__Struct (+204, 80byte)  varptr(st)+204 を基点に操作(80byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIXERLINEW, pack=1
    #field int cbStruct
    #field int dwDestination
    #field int dwSource
    #field int dwLineID
    #field int fdwLine
    #field intptr dwUser
    #field int dwComponentType
    #field int cChannels
    #field int cConnections
    #field int cControls
    #field wchar szShortName 16
    #field wchar szName 64
    #field _Target_e__Struct Target
#endstruct

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