Win32 API 日本語リファレンス
ホームMedia.DirectShow.Tv › DualMonoInfo

DualMonoInfo

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

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

フィールド

フィールドサイズx64x86説明
LangID1WORD2+0+0デュアルモノラル第1チャンネルの言語識別子。
LangID2WORD2+2+2デュアルモノラル第2チャンネルの言語識別子。
lISOLangCode1INT4+4+4第1チャンネルのISO 639言語コード。INT型に格納される。
lISOLangCode2INT4+8+8第2チャンネルのISO 639言語コード。INT型に格納される。

各言語での定義

#include <windows.h>

// DualMonoInfo  (x64 12 / x86 12 バイト)
typedef struct DualMonoInfo {
    WORD LangID1;
    WORD LangID2;
    INT lISOLangCode1;
    INT lISOLangCode2;
} DualMonoInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DualMonoInfo
{
    public ushort LangID1;
    public ushort LangID2;
    public int lISOLangCode1;
    public int lISOLangCode2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DualMonoInfo
    Public LangID1 As UShort
    Public LangID2 As UShort
    Public lISOLangCode1 As Integer
    Public lISOLangCode2 As Integer
End Structure
import ctypes
from ctypes import wintypes

class DualMonoInfo(ctypes.Structure):
    _fields_ = [
        ("LangID1", ctypes.c_ushort),
        ("LangID2", ctypes.c_ushort),
        ("lISOLangCode1", ctypes.c_int),
        ("lISOLangCode2", ctypes.c_int),
    ]
#[repr(C)]
pub struct DualMonoInfo {
    pub LangID1: u16,
    pub LangID2: u16,
    pub lISOLangCode1: i32,
    pub lISOLangCode2: i32,
}
import "golang.org/x/sys/windows"

type DualMonoInfo struct {
	LangID1 uint16
	LangID2 uint16
	lISOLangCode1 int32
	lISOLangCode2 int32
}
type
  DualMonoInfo = record
    LangID1: Word;
    LangID2: Word;
    lISOLangCode1: Integer;
    lISOLangCode2: Integer;
  end;
const DualMonoInfo = extern struct {
    LangID1: u16,
    LangID2: u16,
    lISOLangCode1: i32,
    lISOLangCode2: i32,
};
type
  DualMonoInfo {.bycopy.} = object
    LangID1: uint16
    LangID2: uint16
    lISOLangCode1: int32
    lISOLangCode2: int32
struct DualMonoInfo
{
    ushort LangID1;
    ushort LangID2;
    int lISOLangCode1;
    int lISOLangCode2;
}

HSP用 定義

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

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

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