ホーム › Media.Audio.Apo › APO_CONNECTION_DESCRIPTOR
APO_CONNECTION_DESCRIPTOR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Type | APO_CONNECTION_BUFFER_TYPE | 4 | +0 | +0 | 接続バッファの種類を示す列挙値(APO_CONNECTION_BUFFER_TYPE)。 |
| pBuffer | UINT_PTR | 8/4 | +8 | +4 | オーディオデータバッファへのポインター。 |
| u32MaxFrameCount | DWORD | 4 | +16 | +8 | バッファが保持可能な最大フレーム数。 |
| pFormat | IAudioMediaType* | 8/4 | +24 | +12 | バッファのオーディオ形式を表すIAudioMediaTypeへのポインター。 |
| u32Signature | DWORD | 4 | +32 | +16 | 構造体の整合性を確認するシグネチャ値。 |
各言語での定義
#include <windows.h>
// APO_CONNECTION_DESCRIPTOR (x64 40 / x86 20 バイト)
typedef struct APO_CONNECTION_DESCRIPTOR {
APO_CONNECTION_BUFFER_TYPE Type;
UINT_PTR pBuffer;
DWORD u32MaxFrameCount;
IAudioMediaType* pFormat;
DWORD u32Signature;
} APO_CONNECTION_DESCRIPTOR;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct APO_CONNECTION_DESCRIPTOR
{
public int Type;
public UIntPtr pBuffer;
public uint u32MaxFrameCount;
public IntPtr pFormat;
public uint u32Signature;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure APO_CONNECTION_DESCRIPTOR
Public Type As Integer
Public pBuffer As UIntPtr
Public u32MaxFrameCount As UInteger
Public pFormat As IntPtr
Public u32Signature As UInteger
End Structureimport ctypes
from ctypes import wintypes
class APO_CONNECTION_DESCRIPTOR(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("pBuffer", ctypes.c_size_t),
("u32MaxFrameCount", wintypes.DWORD),
("pFormat", ctypes.c_void_p),
("u32Signature", wintypes.DWORD),
]#[repr(C)]
pub struct APO_CONNECTION_DESCRIPTOR {
pub Type: i32,
pub pBuffer: usize,
pub u32MaxFrameCount: u32,
pub pFormat: *mut core::ffi::c_void,
pub u32Signature: u32,
}import "golang.org/x/sys/windows"
type APO_CONNECTION_DESCRIPTOR struct {
Type int32
pBuffer uintptr
u32MaxFrameCount uint32
pFormat uintptr
u32Signature uint32
}type
APO_CONNECTION_DESCRIPTOR = record
Type: Integer;
pBuffer: NativeUInt;
u32MaxFrameCount: DWORD;
pFormat: Pointer;
u32Signature: DWORD;
end;const APO_CONNECTION_DESCRIPTOR = extern struct {
Type: i32,
pBuffer: usize,
u32MaxFrameCount: u32,
pFormat: ?*anyopaque,
u32Signature: u32,
};type
APO_CONNECTION_DESCRIPTOR {.bycopy.} = object
Type: int32
pBuffer: uint
u32MaxFrameCount: uint32
pFormat: pointer
u32Signature: uint32struct APO_CONNECTION_DESCRIPTOR
{
int Type;
size_t pBuffer;
uint u32MaxFrameCount;
void* pFormat;
uint u32Signature;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; APO_CONNECTION_DESCRIPTOR サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Type : APO_CONNECTION_BUFFER_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pBuffer : UINT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; u32MaxFrameCount : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pFormat : IAudioMediaType* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; u32Signature : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; APO_CONNECTION_DESCRIPTOR サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Type : APO_CONNECTION_BUFFER_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pBuffer : UINT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; u32MaxFrameCount : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pFormat : IAudioMediaType* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; u32Signature : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global APO_CONNECTION_DESCRIPTOR
#field int Type
#field intptr pBuffer
#field int u32MaxFrameCount
#field intptr pFormat
#field int u32Signature
#endstruct
stdim st, APO_CONNECTION_DESCRIPTOR ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type