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

BDA_CAS_REQUESTTUNERDATA

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

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

フィールド

フィールドサイズx64x86説明
ucRequestPriorityBYTE1+0+0CASがチューナーを要求する優先度を示す値。値が高いほど優先される。
ucRequestReasonBYTE1+1+1チューナー要求の理由を示すコード。CASの動作目的を表す。
ucRequestConsequencesBYTE1+2+2要求が拒否された場合に生じる結果を示すコード。視聴中断等の影響を表す。
ulEstimatedTimeDWORD4+4+4要求したチューナーを占有する推定時間。単位はミリ秒。

各言語での定義

#include <windows.h>

// BDA_CAS_REQUESTTUNERDATA  (x64 8 / x86 8 バイト)
typedef struct BDA_CAS_REQUESTTUNERDATA {
    BYTE ucRequestPriority;
    BYTE ucRequestReason;
    BYTE ucRequestConsequences;
    DWORD ulEstimatedTime;
} BDA_CAS_REQUESTTUNERDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BDA_CAS_REQUESTTUNERDATA
{
    public byte ucRequestPriority;
    public byte ucRequestReason;
    public byte ucRequestConsequences;
    public uint ulEstimatedTime;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BDA_CAS_REQUESTTUNERDATA
    Public ucRequestPriority As Byte
    Public ucRequestReason As Byte
    Public ucRequestConsequences As Byte
    Public ulEstimatedTime As UInteger
End Structure
import ctypes
from ctypes import wintypes

class BDA_CAS_REQUESTTUNERDATA(ctypes.Structure):
    _fields_ = [
        ("ucRequestPriority", ctypes.c_ubyte),
        ("ucRequestReason", ctypes.c_ubyte),
        ("ucRequestConsequences", ctypes.c_ubyte),
        ("ulEstimatedTime", wintypes.DWORD),
    ]
#[repr(C)]
pub struct BDA_CAS_REQUESTTUNERDATA {
    pub ucRequestPriority: u8,
    pub ucRequestReason: u8,
    pub ucRequestConsequences: u8,
    pub ulEstimatedTime: u32,
}
import "golang.org/x/sys/windows"

type BDA_CAS_REQUESTTUNERDATA struct {
	ucRequestPriority byte
	ucRequestReason byte
	ucRequestConsequences byte
	ulEstimatedTime uint32
}
type
  BDA_CAS_REQUESTTUNERDATA = record
    ucRequestPriority: Byte;
    ucRequestReason: Byte;
    ucRequestConsequences: Byte;
    ulEstimatedTime: DWORD;
  end;
const BDA_CAS_REQUESTTUNERDATA = extern struct {
    ucRequestPriority: u8,
    ucRequestReason: u8,
    ucRequestConsequences: u8,
    ulEstimatedTime: u32,
};
type
  BDA_CAS_REQUESTTUNERDATA {.bycopy.} = object
    ucRequestPriority: uint8
    ucRequestReason: uint8
    ucRequestConsequences: uint8
    ulEstimatedTime: uint32
struct BDA_CAS_REQUESTTUNERDATA
{
    ubyte ucRequestPriority;
    ubyte ucRequestReason;
    ubyte ucRequestConsequences;
    uint ulEstimatedTime;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; BDA_CAS_REQUESTTUNERDATA サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; ucRequestPriority : BYTE (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; ucRequestReason : BYTE (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; ucRequestConsequences : BYTE (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; ulEstimatedTime : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global BDA_CAS_REQUESTTUNERDATA
    #field byte ucRequestPriority
    #field byte ucRequestReason
    #field byte ucRequestConsequences
    #field int ulEstimatedTime
#endstruct

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