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

MP_PARAMINFO

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

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

フィールド

フィールドサイズx64x86説明
mpTypeMP_TYPE4+0+0パラメータのデータ型を示す列挙値(MP_TYPE)。
mopCapsDWORD4+4+4パラメータが対応する操作(エンベロープ等)を示すフラグ。
mpdMinValueFLOAT4+8+8パラメータの最小値。
mpdMaxValueFLOAT4+12+12パラメータの最大値。
mpdNeutralValueFLOAT4+16+16パラメータの中立(既定)値。
szUnitTextWCHAR64+20+20値の単位を示すワイド文字列。
szLabelWCHAR64+84+84パラメータの表示名を示すワイド文字列。

各言語での定義

#include <windows.h>

// MP_PARAMINFO  (x64 148 / x86 148 バイト)
typedef struct MP_PARAMINFO {
    MP_TYPE mpType;
    DWORD mopCaps;
    FLOAT mpdMinValue;
    FLOAT mpdMaxValue;
    FLOAT mpdNeutralValue;
    WCHAR szUnitText[32];
    WCHAR szLabel[32];
} MP_PARAMINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MP_PARAMINFO
{
    public int mpType;
    public uint mopCaps;
    public float mpdMinValue;
    public float mpdMaxValue;
    public float mpdNeutralValue;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string szUnitText;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string szLabel;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MP_PARAMINFO
    Public mpType As Integer
    Public mopCaps As UInteger
    Public mpdMinValue As Single
    Public mpdMaxValue As Single
    Public mpdNeutralValue As Single
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public szUnitText As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public szLabel As String
End Structure
import ctypes
from ctypes import wintypes

class MP_PARAMINFO(ctypes.Structure):
    _fields_ = [
        ("mpType", ctypes.c_int),
        ("mopCaps", wintypes.DWORD),
        ("mpdMinValue", ctypes.c_float),
        ("mpdMaxValue", ctypes.c_float),
        ("mpdNeutralValue", ctypes.c_float),
        ("szUnitText", ctypes.c_wchar * 32),
        ("szLabel", ctypes.c_wchar * 32),
    ]
#[repr(C)]
pub struct MP_PARAMINFO {
    pub mpType: i32,
    pub mopCaps: u32,
    pub mpdMinValue: f32,
    pub mpdMaxValue: f32,
    pub mpdNeutralValue: f32,
    pub szUnitText: [u16; 32],
    pub szLabel: [u16; 32],
}
import "golang.org/x/sys/windows"

type MP_PARAMINFO struct {
	mpType int32
	mopCaps uint32
	mpdMinValue float32
	mpdMaxValue float32
	mpdNeutralValue float32
	szUnitText [32]uint16
	szLabel [32]uint16
}
type
  MP_PARAMINFO = record
    mpType: Integer;
    mopCaps: DWORD;
    mpdMinValue: Single;
    mpdMaxValue: Single;
    mpdNeutralValue: Single;
    szUnitText: array[0..31] of WideChar;
    szLabel: array[0..31] of WideChar;
  end;
const MP_PARAMINFO = extern struct {
    mpType: i32,
    mopCaps: u32,
    mpdMinValue: f32,
    mpdMaxValue: f32,
    mpdNeutralValue: f32,
    szUnitText: [32]u16,
    szLabel: [32]u16,
};
type
  MP_PARAMINFO {.bycopy.} = object
    mpType: int32
    mopCaps: uint32
    mpdMinValue: float32
    mpdMaxValue: float32
    mpdNeutralValue: float32
    szUnitText: array[32, uint16]
    szLabel: array[32, uint16]
struct MP_PARAMINFO
{
    int mpType;
    uint mopCaps;
    float mpdMinValue;
    float mpdMaxValue;
    float mpdNeutralValue;
    wchar[32] szUnitText;
    wchar[32] szLabel;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MP_PARAMINFO サイズ: 148 バイト(x64)
dim st, 37    ; 4byte整数×37(構造体サイズ 148 / 4 切り上げ)
; mpType : MP_TYPE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; mopCaps : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; mpdMinValue : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; mpdMaxValue : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; mpdNeutralValue : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; szUnitText : WCHAR (+20, 64byte)  varptr(st)+20 を基点に操作(64byte:入れ子/配列)
; szLabel : WCHAR (+84, 64byte)  varptr(st)+84 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MP_PARAMINFO
    #field int mpType
    #field int mopCaps
    #field float mpdMinValue
    #field float mpdMaxValue
    #field float mpdNeutralValue
    #field wchar szUnitText 32
    #field wchar szLabel 32
#endstruct

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