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

DVD_AudioAttributes

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

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

フィールド

フィールドサイズx64x86説明
AppModeDVD_AUDIO_APPMODE4+0+0オーディオのアプリケーションモードを示すDVD_AUDIO_APPMODE値。
AppModeDataBYTE1+4+4アプリケーションモード固有のデータを格納するバイト。
AudioFormatDVD_AUDIO_FORMAT4+8+8オーディオの符号化形式を示すDVD_AUDIO_FORMAT値。
LanguageDWORD4+12+12オーディオの言語をLCID(ロケール識別子)で示す。
LanguageExtensionDVD_AUDIO_LANG_EXT4+16+16言語の用途拡張を示すDVD_AUDIO_LANG_EXT値。
fHasMultichannelInfoBOOL4+20+20マルチチャンネル情報を持つかを示す真偽値。
dwFrequencyDWORD4+24+24サンプリング周波数をHzで示す。
bQuantizationBYTE1+28+28量子化ビット数を示す。
bNumberOfChannelsBYTE1+29+29オーディオチャンネル数を示す。
dwReservedDWORD8+32+32将来用に予約された領域。

各言語での定義

#include <windows.h>

// DVD_AudioAttributes  (x64 40 / x86 40 バイト)
typedef struct DVD_AudioAttributes {
    DVD_AUDIO_APPMODE AppMode;
    BYTE AppModeData;
    DVD_AUDIO_FORMAT AudioFormat;
    DWORD Language;
    DVD_AUDIO_LANG_EXT LanguageExtension;
    BOOL fHasMultichannelInfo;
    DWORD dwFrequency;
    BYTE bQuantization;
    BYTE bNumberOfChannels;
    DWORD dwReserved[2];
} DVD_AudioAttributes;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_AudioAttributes
{
    public int AppMode;
    public byte AppModeData;
    public int AudioFormat;
    public uint Language;
    public int LanguageExtension;
    [MarshalAs(UnmanagedType.Bool)] public bool fHasMultichannelInfo;
    public uint dwFrequency;
    public byte bQuantization;
    public byte bNumberOfChannels;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public uint[] dwReserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_AudioAttributes
    Public AppMode As Integer
    Public AppModeData As Byte
    Public AudioFormat As Integer
    Public Language As UInteger
    Public LanguageExtension As Integer
    <MarshalAs(UnmanagedType.Bool)> Public fHasMultichannelInfo As Boolean
    Public dwFrequency As UInteger
    Public bQuantization As Byte
    Public bNumberOfChannels As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public dwReserved() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DVD_AudioAttributes(ctypes.Structure):
    _fields_ = [
        ("AppMode", ctypes.c_int),
        ("AppModeData", ctypes.c_ubyte),
        ("AudioFormat", ctypes.c_int),
        ("Language", wintypes.DWORD),
        ("LanguageExtension", ctypes.c_int),
        ("fHasMultichannelInfo", wintypes.BOOL),
        ("dwFrequency", wintypes.DWORD),
        ("bQuantization", ctypes.c_ubyte),
        ("bNumberOfChannels", ctypes.c_ubyte),
        ("dwReserved", wintypes.DWORD * 2),
    ]
#[repr(C)]
pub struct DVD_AudioAttributes {
    pub AppMode: i32,
    pub AppModeData: u8,
    pub AudioFormat: i32,
    pub Language: u32,
    pub LanguageExtension: i32,
    pub fHasMultichannelInfo: i32,
    pub dwFrequency: u32,
    pub bQuantization: u8,
    pub bNumberOfChannels: u8,
    pub dwReserved: [u32; 2],
}
import "golang.org/x/sys/windows"

type DVD_AudioAttributes struct {
	AppMode int32
	AppModeData byte
	AudioFormat int32
	Language uint32
	LanguageExtension int32
	fHasMultichannelInfo int32
	dwFrequency uint32
	bQuantization byte
	bNumberOfChannels byte
	dwReserved [2]uint32
}
type
  DVD_AudioAttributes = record
    AppMode: Integer;
    AppModeData: Byte;
    AudioFormat: Integer;
    Language: DWORD;
    LanguageExtension: Integer;
    fHasMultichannelInfo: BOOL;
    dwFrequency: DWORD;
    bQuantization: Byte;
    bNumberOfChannels: Byte;
    dwReserved: array[0..1] of DWORD;
  end;
const DVD_AudioAttributes = extern struct {
    AppMode: i32,
    AppModeData: u8,
    AudioFormat: i32,
    Language: u32,
    LanguageExtension: i32,
    fHasMultichannelInfo: i32,
    dwFrequency: u32,
    bQuantization: u8,
    bNumberOfChannels: u8,
    dwReserved: [2]u32,
};
type
  DVD_AudioAttributes {.bycopy.} = object
    AppMode: int32
    AppModeData: uint8
    AudioFormat: int32
    Language: uint32
    LanguageExtension: int32
    fHasMultichannelInfo: int32
    dwFrequency: uint32
    bQuantization: uint8
    bNumberOfChannels: uint8
    dwReserved: array[2, uint32]
struct DVD_AudioAttributes
{
    int AppMode;
    ubyte AppModeData;
    int AudioFormat;
    uint Language;
    int LanguageExtension;
    int fHasMultichannelInfo;
    uint dwFrequency;
    ubyte bQuantization;
    ubyte bNumberOfChannels;
    uint[2] dwReserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DVD_AudioAttributes サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; AppMode : DVD_AUDIO_APPMODE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; AppModeData : BYTE (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; AudioFormat : DVD_AUDIO_FORMAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Language : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; LanguageExtension : DVD_AUDIO_LANG_EXT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; fHasMultichannelInfo : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwFrequency : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; bQuantization : BYTE (+28, 1byte)  poke st,28,値  /  値 = peek(st,28)
; bNumberOfChannels : BYTE (+29, 1byte)  poke st,29,値  /  値 = peek(st,29)
; dwReserved : DWORD (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DVD_AudioAttributes
    #field int AppMode
    #field byte AppModeData
    #field int AudioFormat
    #field int Language
    #field int LanguageExtension
    #field bool fHasMultichannelInfo
    #field int dwFrequency
    #field byte bQuantization
    #field byte bNumberOfChannels
    #field int dwReserved 2
#endstruct

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