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