ホーム › Media.Audio › MIXERCAPS2W
MIXERCAPS2W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| wMid | WORD | 2 | +0 | +0 | ミキサーデバイス製造元(メーカー)ID。 |
| wPid | WORD | 2 | +2 | +2 | ミキサーデバイス製品ID。 |
| vDriverVersion | DWORD | 4 | +4 | +4 | ドライバのバージョン(上位8bitがメジャー、下位8bitがマイナー)。 |
| szPname | WCHAR | 64 | +8 | +8 | デバイス製品名(Unicode、固定長配列)。 |
| fdwSupport | DWORD | 4 | +72 | +72 | サポートする機能を示すビットフラグ。現状予約。 |
| cDestinations | DWORD | 4 | +76 | +76 | このミキサーが持つ出力先(デスティネーション)ライン数。 |
| ManufacturerGuid | GUID | 16 | +80 | +80 | 製造元を一意に識別するGUID。 |
| ProductGuid | GUID | 16 | +96 | +96 | 製品を一意に識別するGUID。 |
| NameGuid | GUID | 16 | +112 | +112 | 製品名文字列リソースを識別するGUID。 |
各言語での定義
#include <windows.h>
// MIXERCAPS2W (x64 128 / x86 128 バイト)
#pragma pack(push, 1)
typedef struct MIXERCAPS2W {
WORD wMid;
WORD wPid;
DWORD vDriverVersion;
WCHAR szPname[32];
DWORD fdwSupport;
DWORD cDestinations;
GUID ManufacturerGuid;
GUID ProductGuid;
GUID NameGuid;
} MIXERCAPS2W;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MIXERCAPS2W
{
public ushort wMid;
public ushort wPid;
public uint vDriverVersion;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string szPname;
public uint fdwSupport;
public uint cDestinations;
public Guid ManufacturerGuid;
public Guid ProductGuid;
public Guid NameGuid;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MIXERCAPS2W
Public wMid As UShort
Public wPid As UShort
Public vDriverVersion As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public szPname As String
Public fdwSupport As UInteger
Public cDestinations As UInteger
Public ManufacturerGuid As Guid
Public ProductGuid As Guid
Public NameGuid As Guid
End Structureimport ctypes
from ctypes import wintypes
class MIXERCAPS2W(ctypes.Structure):
_pack_ = 1
_fields_ = [
("wMid", ctypes.c_ushort),
("wPid", ctypes.c_ushort),
("vDriverVersion", wintypes.DWORD),
("szPname", ctypes.c_wchar * 32),
("fdwSupport", wintypes.DWORD),
("cDestinations", wintypes.DWORD),
("ManufacturerGuid", GUID),
("ProductGuid", GUID),
("NameGuid", GUID),
]#[repr(C, packed(1))]
pub struct MIXERCAPS2W {
pub wMid: u16,
pub wPid: u16,
pub vDriverVersion: u32,
pub szPname: [u16; 32],
pub fdwSupport: u32,
pub cDestinations: u32,
pub ManufacturerGuid: GUID,
pub ProductGuid: GUID,
pub NameGuid: GUID,
}import "golang.org/x/sys/windows"
type MIXERCAPS2W struct {
wMid uint16
wPid uint16
vDriverVersion uint32
szPname [32]uint16
fdwSupport uint32
cDestinations uint32
ManufacturerGuid windows.GUID
ProductGuid windows.GUID
NameGuid windows.GUID
}type
MIXERCAPS2W = packed record
wMid: Word;
wPid: Word;
vDriverVersion: DWORD;
szPname: array[0..31] of WideChar;
fdwSupport: DWORD;
cDestinations: DWORD;
ManufacturerGuid: TGUID;
ProductGuid: TGUID;
NameGuid: TGUID;
end;const MIXERCAPS2W = extern struct {
wMid: u16,
wPid: u16,
vDriverVersion: u32,
szPname: [32]u16,
fdwSupport: u32,
cDestinations: u32,
ManufacturerGuid: GUID,
ProductGuid: GUID,
NameGuid: GUID,
};type
MIXERCAPS2W {.packed.} = object
wMid: uint16
wPid: uint16
vDriverVersion: uint32
szPname: array[32, uint16]
fdwSupport: uint32
cDestinations: uint32
ManufacturerGuid: GUID
ProductGuid: GUID
NameGuid: GUIDalign(1)
struct MIXERCAPS2W
{
ushort wMid;
ushort wPid;
uint vDriverVersion;
wchar[32] szPname;
uint fdwSupport;
uint cDestinations;
GUID ManufacturerGuid;
GUID ProductGuid;
GUID NameGuid;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIXERCAPS2W サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; wMid : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; wPid : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; vDriverVersion : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szPname : WCHAR (+8, 64byte) varptr(st)+8 を基点に操作(64byte:入れ子/配列)
; fdwSupport : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; cDestinations : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ManufacturerGuid : GUID (+80, 16byte) varptr(st)+80 を基点に操作(16byte:入れ子/配列)
; ProductGuid : GUID (+96, 16byte) varptr(st)+96 を基点に操作(16byte:入れ子/配列)
; NameGuid : GUID (+112, 16byte) varptr(st)+112 を基点に操作(16byte:入れ子/配列)
; ※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 MIXERCAPS2W, pack=1
#field short wMid
#field short wPid
#field int vDriverVersion
#field wchar szPname 32
#field int fdwSupport
#field int cDestinations
#field GUID ManufacturerGuid
#field GUID ProductGuid
#field GUID NameGuid
#endstruct
stdim st, MIXERCAPS2W ; NSTRUCT 変数を確保
st->wMid = 100
mes "wMid=" + st->wMid