ホーム › Media.KernelStreaming › KSJACK_DESCRIPTION
KSJACK_DESCRIPTION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ChannelMapping | DWORD | 4 | +0 | +0 | ジャックのチャンネル配置(スピーカ構成)を示すマスク。 |
| Color | DWORD | 4 | +4 | +4 | ジャックの色をRGB値で示す。 |
| ConnectionType | EPcxConnectionType | 4 | +8 | +8 | 物理コネクタ種別を示すEPcxConnectionType列挙値。 |
| GeoLocation | EPcxGeoLocation | 4 | +12 | +12 | 筐体上の物理的な位置を示すEPcxGeoLocation列挙値。 |
| GenLocation | EPcxGenLocation | 4 | +16 | +16 | 一般的な位置区分(本体/ドック等)を示すEPcxGenLocation列挙値。 |
| PortConnection | EPxcPortConnection | 4 | +20 | +20 | ポート接続の種別を示すEPxcPortConnection列挙値。 |
| IsConnected | BOOL | 4 | +24 | +24 | ジャックに機器が接続されているかを示すBOOL値。 |
各言語での定義
#include <windows.h>
// KSJACK_DESCRIPTION (x64 28 / x86 28 バイト)
typedef struct KSJACK_DESCRIPTION {
DWORD ChannelMapping;
DWORD Color;
EPcxConnectionType ConnectionType;
EPcxGeoLocation GeoLocation;
EPcxGenLocation GenLocation;
EPxcPortConnection PortConnection;
BOOL IsConnected;
} KSJACK_DESCRIPTION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSJACK_DESCRIPTION
{
public uint ChannelMapping;
public uint Color;
public int ConnectionType;
public int GeoLocation;
public int GenLocation;
public int PortConnection;
[MarshalAs(UnmanagedType.Bool)] public bool IsConnected;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSJACK_DESCRIPTION
Public ChannelMapping As UInteger
Public Color As UInteger
Public ConnectionType As Integer
Public GeoLocation As Integer
Public GenLocation As Integer
Public PortConnection As Integer
<MarshalAs(UnmanagedType.Bool)> Public IsConnected As Boolean
End Structureimport ctypes
from ctypes import wintypes
class KSJACK_DESCRIPTION(ctypes.Structure):
_fields_ = [
("ChannelMapping", wintypes.DWORD),
("Color", wintypes.DWORD),
("ConnectionType", ctypes.c_int),
("GeoLocation", ctypes.c_int),
("GenLocation", ctypes.c_int),
("PortConnection", ctypes.c_int),
("IsConnected", wintypes.BOOL),
]#[repr(C)]
pub struct KSJACK_DESCRIPTION {
pub ChannelMapping: u32,
pub Color: u32,
pub ConnectionType: i32,
pub GeoLocation: i32,
pub GenLocation: i32,
pub PortConnection: i32,
pub IsConnected: i32,
}import "golang.org/x/sys/windows"
type KSJACK_DESCRIPTION struct {
ChannelMapping uint32
Color uint32
ConnectionType int32
GeoLocation int32
GenLocation int32
PortConnection int32
IsConnected int32
}type
KSJACK_DESCRIPTION = record
ChannelMapping: DWORD;
Color: DWORD;
ConnectionType: Integer;
GeoLocation: Integer;
GenLocation: Integer;
PortConnection: Integer;
IsConnected: BOOL;
end;const KSJACK_DESCRIPTION = extern struct {
ChannelMapping: u32,
Color: u32,
ConnectionType: i32,
GeoLocation: i32,
GenLocation: i32,
PortConnection: i32,
IsConnected: i32,
};type
KSJACK_DESCRIPTION {.bycopy.} = object
ChannelMapping: uint32
Color: uint32
ConnectionType: int32
GeoLocation: int32
GenLocation: int32
PortConnection: int32
IsConnected: int32struct KSJACK_DESCRIPTION
{
uint ChannelMapping;
uint Color;
int ConnectionType;
int GeoLocation;
int GenLocation;
int PortConnection;
int IsConnected;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSJACK_DESCRIPTION サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; ChannelMapping : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Color : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ConnectionType : EPcxConnectionType (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; GeoLocation : EPcxGeoLocation (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; GenLocation : EPcxGenLocation (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; PortConnection : EPxcPortConnection (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; IsConnected : BOOL (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSJACK_DESCRIPTION
#field int ChannelMapping
#field int Color
#field int ConnectionType
#field int GeoLocation
#field int GenLocation
#field int PortConnection
#field bool IsConnected
#endstruct
stdim st, KSJACK_DESCRIPTION ; NSTRUCT 変数を確保
st->ChannelMapping = 100
mes "ChannelMapping=" + st->ChannelMapping