ホーム › Media.Audio › MIXERLINEA
MIXERLINEA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| dwDestination | DWORD | 4 | +4 | +4 | 出力先(デスティネーション)ラインのインデックス。 |
| dwSource | DWORD | 4 | +8 | +8 | 入力元(ソース)ラインのインデックス。デスティネーション自身は-1相当。 |
| dwLineID | DWORD | 4 | +12 | +12 | ラインを一意に識別するID。 |
| fdwLine | DWORD | 4 | +16 | +16 | ラインの状態を示すビットフラグ(MIXERLINE_LINEF_*)。 |
| dwUser | UINT_PTR | 8/4 | +20 | +20 | アプリ定義のユーザーデータ。 |
| dwComponentType | MIXERLINE_COMPONENTTYPE | 4 | +28 | +24 | ラインのコンポーネント種別(マイク/スピーカー等、MIXERLINE_COMPONENTTYPE)。 |
| cChannels | DWORD | 4 | +32 | +28 | ラインのチャンネル数。 |
| cConnections | DWORD | 4 | +36 | +32 | このラインに接続されたソースラインの数。 |
| cControls | DWORD | 4 | +40 | +36 | このラインに関連付けられたコントロールの数。 |
| szShortName | CHAR | 16 | +44 | +40 | ラインの短い名前(ANSI、固定長配列)。 |
| szName | CHAR | 64 | +60 | +56 | ラインの完全名(ANSI、固定長配列)。 |
| Target | _Target_e__Struct | 48 | +124 | +120 | このラインに対応するターゲットメディアデバイス情報(入れ子構造体)。 |
構造体: _Target_e__Struct x64 48B / x86 48B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| dwType | DWORD | 4 | +0 | +0 |
| dwDeviceID | DWORD | 4 | +4 | +4 |
| wMid | WORD | 2 | +8 | +8 |
| wPid | WORD | 2 | +10 | +10 |
| vDriverVersion | DWORD | 4 | +12 | +12 |
| szPname | CHAR | 32 | +16 | +16 |
各言語での定義
#include <windows.h>
// MIXERLINEA (x64 172 / x86 168 バイト)
#pragma pack(push, 1)
typedef struct MIXERLINEA {
DWORD cbStruct;
DWORD dwDestination;
DWORD dwSource;
DWORD dwLineID;
DWORD fdwLine;
UINT_PTR dwUser;
MIXERLINE_COMPONENTTYPE dwComponentType;
DWORD cChannels;
DWORD cConnections;
DWORD cControls;
CHAR szShortName[16];
CHAR szName[64];
_Target_e__Struct Target;
} MIXERLINEA;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MIXERLINEA
{
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.ByValArray, SizeConst = 16)] public sbyte[] szShortName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szName;
public _Target_e__Struct Target;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MIXERLINEA
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.ByValArray, SizeConst:=16)> Public szShortName() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public szName() As SByte
Public Target As _Target_e__Struct
End Structureimport ctypes
from ctypes import wintypes
class MIXERLINEA(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_byte * 16),
("szName", ctypes.c_byte * 64),
("Target", _Target_e__Struct),
]#[repr(C, packed(1))]
pub struct MIXERLINEA {
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: [i8; 16],
pub szName: [i8; 64],
pub Target: _Target_e__Struct,
}import "golang.org/x/sys/windows"
type MIXERLINEA struct {
cbStruct uint32
dwDestination uint32
dwSource uint32
dwLineID uint32
fdwLine uint32
dwUser uintptr
dwComponentType uint32
cChannels uint32
cConnections uint32
cControls uint32
szShortName [16]int8
szName [64]int8
Target _Target_e__Struct
}type
MIXERLINEA = 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 Shortint;
szName: array[0..63] of Shortint;
Target: _Target_e__Struct;
end;const MIXERLINEA = extern struct {
cbStruct: u32,
dwDestination: u32,
dwSource: u32,
dwLineID: u32,
fdwLine: u32,
dwUser: usize,
dwComponentType: u32,
cChannels: u32,
cConnections: u32,
cControls: u32,
szShortName: [16]i8,
szName: [64]i8,
Target: _Target_e__Struct,
};type
MIXERLINEA {.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, int8]
szName: array[64, int8]
Target: _Target_e__Structalign(1)
struct MIXERLINEA
{
uint cbStruct;
uint dwDestination;
uint dwSource;
uint dwLineID;
uint fdwLine;
size_t dwUser;
uint dwComponentType;
uint cChannels;
uint cConnections;
uint cControls;
byte[16] szShortName;
byte[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 レイアウト)
; MIXERLINEA サイズ: 168 バイト(x86)
dim st, 42 ; 4byte整数×42(構造体サイズ 168 / 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 : CHAR (+40, 16byte) varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; szName : CHAR (+56, 64byte) varptr(st)+56 を基点に操作(64byte:入れ子/配列)
; Target : _Target_e__Struct (+120, 48byte) varptr(st)+120 を基点に操作(48byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIXERLINEA サイズ: 172 バイト(x64)
dim st, 43 ; 4byte整数×43(構造体サイズ 172 / 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 : CHAR (+44, 16byte) varptr(st)+44 を基点に操作(16byte:入れ子/配列)
; szName : CHAR (+60, 64byte) varptr(st)+60 を基点に操作(64byte:入れ子/配列)
; Target : _Target_e__Struct (+124, 48byte) varptr(st)+124 を基点に操作(48byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIXERLINEA, 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 byte szShortName 16
#field byte szName 64
#field _Target_e__Struct Target
#endstruct
stdim st, MIXERLINEA ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct