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

DVD_KaraokeAttributes

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

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

フィールド

フィールドサイズx64x86説明
bVersionBYTE1+0+0カラオケ仕様のバージョンを示す。
fMasterOfCeremoniesInGuideVocal1BOOL4+4+4ガイドボーカル1にMC(司会)が含まれるかを示す真偽値。
fDuetBOOL4+8+8デュエット形式かを示す真偽値。
ChannelAssignmentDVD_KARAOKE_ASSIGNMENT4+12+12チャンネルの割り当てを示すDVD_KARAOKE_ASSIGNMENT値。
wChannelContentsWORD16+16+16各チャンネルの内容を示すビットフラグを示す。

各言語での定義

#include <windows.h>

// DVD_KaraokeAttributes  (x64 32 / x86 32 バイト)
typedef struct DVD_KaraokeAttributes {
    BYTE bVersion;
    BOOL fMasterOfCeremoniesInGuideVocal1;
    BOOL fDuet;
    DVD_KARAOKE_ASSIGNMENT ChannelAssignment;
    WORD wChannelContents[8];
} DVD_KaraokeAttributes;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_KaraokeAttributes
{
    public byte bVersion;
    [MarshalAs(UnmanagedType.Bool)] public bool fMasterOfCeremoniesInGuideVocal1;
    [MarshalAs(UnmanagedType.Bool)] public bool fDuet;
    public int ChannelAssignment;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public ushort[] wChannelContents;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_KaraokeAttributes
    Public bVersion As Byte
    <MarshalAs(UnmanagedType.Bool)> Public fMasterOfCeremoniesInGuideVocal1 As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fDuet As Boolean
    Public ChannelAssignment As Integer
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public wChannelContents() As UShort
End Structure
import ctypes
from ctypes import wintypes

class DVD_KaraokeAttributes(ctypes.Structure):
    _fields_ = [
        ("bVersion", ctypes.c_ubyte),
        ("fMasterOfCeremoniesInGuideVocal1", wintypes.BOOL),
        ("fDuet", wintypes.BOOL),
        ("ChannelAssignment", ctypes.c_int),
        ("wChannelContents", ctypes.c_ushort * 8),
    ]
#[repr(C)]
pub struct DVD_KaraokeAttributes {
    pub bVersion: u8,
    pub fMasterOfCeremoniesInGuideVocal1: i32,
    pub fDuet: i32,
    pub ChannelAssignment: i32,
    pub wChannelContents: [u16; 8],
}
import "golang.org/x/sys/windows"

type DVD_KaraokeAttributes struct {
	bVersion byte
	fMasterOfCeremoniesInGuideVocal1 int32
	fDuet int32
	ChannelAssignment int32
	wChannelContents [8]uint16
}
type
  DVD_KaraokeAttributes = record
    bVersion: Byte;
    fMasterOfCeremoniesInGuideVocal1: BOOL;
    fDuet: BOOL;
    ChannelAssignment: Integer;
    wChannelContents: array[0..7] of Word;
  end;
const DVD_KaraokeAttributes = extern struct {
    bVersion: u8,
    fMasterOfCeremoniesInGuideVocal1: i32,
    fDuet: i32,
    ChannelAssignment: i32,
    wChannelContents: [8]u16,
};
type
  DVD_KaraokeAttributes {.bycopy.} = object
    bVersion: uint8
    fMasterOfCeremoniesInGuideVocal1: int32
    fDuet: int32
    ChannelAssignment: int32
    wChannelContents: array[8, uint16]
struct DVD_KaraokeAttributes
{
    ubyte bVersion;
    int fMasterOfCeremoniesInGuideVocal1;
    int fDuet;
    int ChannelAssignment;
    ushort[8] wChannelContents;
}

HSP用 定義

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

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

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