ホーム › Media.DirectShow › MP_ENVELOPE_SEGMENT
MP_ENVELOPE_SEGMENT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| rtStart | LONGLONG | 8 | +0 | +0 | エンベロープ区間の開始時刻。単位は100ナノ秒。 |
| rtEnd | LONGLONG | 8 | +8 | +8 | エンベロープ区間の終了時刻。単位は100ナノ秒。 |
| valStart | FLOAT | 4 | +16 | +16 | 区間開始時のパラメータ値。 |
| valEnd | FLOAT | 4 | +20 | +20 | 区間終了時のパラメータ値。 |
| iCurve | MP_CURVE_TYPE | 4 | +24 | +24 | 区間内の補間カーブ種別(MP_CURVE_TYPE)。 |
| flags | DWORD | 4 | +28 | +28 | エンベロープ区間のフラグ。属性を示すビット集合。 |
各言語での定義
#include <windows.h>
// MP_ENVELOPE_SEGMENT (x64 32 / x86 32 バイト)
typedef struct MP_ENVELOPE_SEGMENT {
LONGLONG rtStart;
LONGLONG rtEnd;
FLOAT valStart;
FLOAT valEnd;
MP_CURVE_TYPE iCurve;
DWORD flags;
} MP_ENVELOPE_SEGMENT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MP_ENVELOPE_SEGMENT
{
public long rtStart;
public long rtEnd;
public float valStart;
public float valEnd;
public int iCurve;
public uint flags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MP_ENVELOPE_SEGMENT
Public rtStart As Long
Public rtEnd As Long
Public valStart As Single
Public valEnd As Single
Public iCurve As Integer
Public flags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MP_ENVELOPE_SEGMENT(ctypes.Structure):
_fields_ = [
("rtStart", ctypes.c_longlong),
("rtEnd", ctypes.c_longlong),
("valStart", ctypes.c_float),
("valEnd", ctypes.c_float),
("iCurve", ctypes.c_int),
("flags", wintypes.DWORD),
]#[repr(C)]
pub struct MP_ENVELOPE_SEGMENT {
pub rtStart: i64,
pub rtEnd: i64,
pub valStart: f32,
pub valEnd: f32,
pub iCurve: i32,
pub flags: u32,
}import "golang.org/x/sys/windows"
type MP_ENVELOPE_SEGMENT struct {
rtStart int64
rtEnd int64
valStart float32
valEnd float32
iCurve int32
flags uint32
}type
MP_ENVELOPE_SEGMENT = record
rtStart: Int64;
rtEnd: Int64;
valStart: Single;
valEnd: Single;
iCurve: Integer;
flags: DWORD;
end;const MP_ENVELOPE_SEGMENT = extern struct {
rtStart: i64,
rtEnd: i64,
valStart: f32,
valEnd: f32,
iCurve: i32,
flags: u32,
};type
MP_ENVELOPE_SEGMENT {.bycopy.} = object
rtStart: int64
rtEnd: int64
valStart: float32
valEnd: float32
iCurve: int32
flags: uint32struct MP_ENVELOPE_SEGMENT
{
long rtStart;
long rtEnd;
float valStart;
float valEnd;
int iCurve;
uint flags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MP_ENVELOPE_SEGMENT サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; rtStart : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; rtEnd : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; valStart : FLOAT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; valEnd : FLOAT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; iCurve : MP_CURVE_TYPE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; flags : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MP_ENVELOPE_SEGMENT
#field int64 rtStart
#field int64 rtEnd
#field float valStart
#field float valEnd
#field int iCurve
#field int flags
#endstruct
stdim st, MP_ENVELOPE_SEGMENT ; NSTRUCT 変数を確保
st->rtStart = 100
mes "rtStart=" + st->rtStart