ホーム › Media.KernelStreaming › KSPROPERTY_POSITIONS
KSPROPERTY_POSITIONS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Current | LONGLONG | 8 | +0 | +0 | 現在のシーク位置を示す。LONGLONGで再生位置を表す。 |
| Stop | LONGLONG | 8 | +8 | +8 | 停止位置を示す。LONGLONGで再生終了位置を表す。 |
| CurrentFlags | KS_SEEKING_FLAGS | 4 | +16 | +16 | 現在位置に対するシークフラグ(KS_SEEKING_FLAGS)。相対/絶対等を示す。 |
| StopFlags | KS_SEEKING_FLAGS | 4 | +20 | +20 | 停止位置に対するシークフラグ(KS_SEEKING_FLAGS)。指定方法を示す。 |
各言語での定義
#include <windows.h>
// KSPROPERTY_POSITIONS (x64 24 / x86 24 バイト)
typedef struct KSPROPERTY_POSITIONS {
LONGLONG Current;
LONGLONG Stop;
KS_SEEKING_FLAGS CurrentFlags;
KS_SEEKING_FLAGS StopFlags;
} KSPROPERTY_POSITIONS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSPROPERTY_POSITIONS
{
public long Current;
public long Stop;
public int CurrentFlags;
public int StopFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSPROPERTY_POSITIONS
Public Current As Long
Public Stop As Long
Public CurrentFlags As Integer
Public StopFlags As Integer
End Structureimport ctypes
from ctypes import wintypes
class KSPROPERTY_POSITIONS(ctypes.Structure):
_fields_ = [
("Current", ctypes.c_longlong),
("Stop", ctypes.c_longlong),
("CurrentFlags", ctypes.c_int),
("StopFlags", ctypes.c_int),
]#[repr(C)]
pub struct KSPROPERTY_POSITIONS {
pub Current: i64,
pub Stop: i64,
pub CurrentFlags: i32,
pub StopFlags: i32,
}import "golang.org/x/sys/windows"
type KSPROPERTY_POSITIONS struct {
Current int64
Stop int64
CurrentFlags int32
StopFlags int32
}type
KSPROPERTY_POSITIONS = record
Current: Int64;
Stop: Int64;
CurrentFlags: Integer;
StopFlags: Integer;
end;const KSPROPERTY_POSITIONS = extern struct {
Current: i64,
Stop: i64,
CurrentFlags: i32,
StopFlags: i32,
};type
KSPROPERTY_POSITIONS {.bycopy.} = object
Current: int64
Stop: int64
CurrentFlags: int32
StopFlags: int32struct KSPROPERTY_POSITIONS
{
long Current;
long Stop;
int CurrentFlags;
int StopFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSPROPERTY_POSITIONS サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Current : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Stop : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; CurrentFlags : KS_SEEKING_FLAGS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; StopFlags : KS_SEEKING_FLAGS (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSPROPERTY_POSITIONS
#field int64 Current
#field int64 Stop
#field int CurrentFlags
#field int StopFlags
#endstruct
stdim st, KSPROPERTY_POSITIONS ; NSTRUCT 変数を確保
st->Current = 100
mes "Current=" + st->Current