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

DEVCAPS

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

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

フィールド

フィールドサイズx64x86説明
CanRecordINT4+0+0デバイスが録画可能かを示す(非0で可能)。
CanRecordStrobeINT4+4+4録画ストローブ機能の対応可否を示す。
HasAudioINT4+8+8音声機能を持つかを示す。
HasVideoINT4+12+12映像機能を持つかを示す。
UsesFilesINT4+16+16ファイルベースで動作するかを示す。
CanSaveINT4+20+20保存操作に対応するかを示す。
DeviceTypeINT4+24+24デバイスの種別を示す値。
TCReadINT4+28+28タイムコードの読み取りに対応するかを示す。
TCWriteINT4+32+32タイムコードの書き込みに対応するかを示す。
CTLReadINT4+36+36コントロールトラックの読み取りに対応するかを示す。
IndexReadINT4+40+40インデックスの読み取りに対応するかを示す。
PrerollINT4+44+44プリロール対応の有無/値を示す。
PostrollINT4+48+48ポストロール対応の有無/値を示す。
SyncAccINT4+52+52同期精度を示す値。
NormRateINT4+56+56標準再生レートを示す値。
CanPreviewINT4+60+60プレビュー再生に対応するかを示す。
CanMonitorSrcINT4+64+64ソースモニタに対応するかを示す。
CanTestINT4+68+68テストモードに対応するかを示す。
VideoInINT4+72+72映像入力を持つかを示す。
AudioInINT4+76+76音声入力を持つかを示す。
CalibrateINT4+80+80キャリブレーション機能に対応するかを示す。
SeekTypeINT4+84+84対応するシーク方式を示す値。
SimulatedHardwareINT4+88+88シミュレートされたハードウェアかを示す。

各言語での定義

#include <windows.h>

// DEVCAPS  (x64 92 / x86 92 バイト)
typedef struct DEVCAPS {
    INT CanRecord;
    INT CanRecordStrobe;
    INT HasAudio;
    INT HasVideo;
    INT UsesFiles;
    INT CanSave;
    INT DeviceType;
    INT TCRead;
    INT TCWrite;
    INT CTLRead;
    INT IndexRead;
    INT Preroll;
    INT Postroll;
    INT SyncAcc;
    INT NormRate;
    INT CanPreview;
    INT CanMonitorSrc;
    INT CanTest;
    INT VideoIn;
    INT AudioIn;
    INT Calibrate;
    INT SeekType;
    INT SimulatedHardware;
} DEVCAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEVCAPS
{
    public int CanRecord;
    public int CanRecordStrobe;
    public int HasAudio;
    public int HasVideo;
    public int UsesFiles;
    public int CanSave;
    public int DeviceType;
    public int TCRead;
    public int TCWrite;
    public int CTLRead;
    public int IndexRead;
    public int Preroll;
    public int Postroll;
    public int SyncAcc;
    public int NormRate;
    public int CanPreview;
    public int CanMonitorSrc;
    public int CanTest;
    public int VideoIn;
    public int AudioIn;
    public int Calibrate;
    public int SeekType;
    public int SimulatedHardware;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEVCAPS
    Public CanRecord As Integer
    Public CanRecordStrobe As Integer
    Public HasAudio As Integer
    Public HasVideo As Integer
    Public UsesFiles As Integer
    Public CanSave As Integer
    Public DeviceType As Integer
    Public TCRead As Integer
    Public TCWrite As Integer
    Public CTLRead As Integer
    Public IndexRead As Integer
    Public Preroll As Integer
    Public Postroll As Integer
    Public SyncAcc As Integer
    Public NormRate As Integer
    Public CanPreview As Integer
    Public CanMonitorSrc As Integer
    Public CanTest As Integer
    Public VideoIn As Integer
    Public AudioIn As Integer
    Public Calibrate As Integer
    Public SeekType As Integer
    Public SimulatedHardware As Integer
End Structure
import ctypes
from ctypes import wintypes

class DEVCAPS(ctypes.Structure):
    _fields_ = [
        ("CanRecord", ctypes.c_int),
        ("CanRecordStrobe", ctypes.c_int),
        ("HasAudio", ctypes.c_int),
        ("HasVideo", ctypes.c_int),
        ("UsesFiles", ctypes.c_int),
        ("CanSave", ctypes.c_int),
        ("DeviceType", ctypes.c_int),
        ("TCRead", ctypes.c_int),
        ("TCWrite", ctypes.c_int),
        ("CTLRead", ctypes.c_int),
        ("IndexRead", ctypes.c_int),
        ("Preroll", ctypes.c_int),
        ("Postroll", ctypes.c_int),
        ("SyncAcc", ctypes.c_int),
        ("NormRate", ctypes.c_int),
        ("CanPreview", ctypes.c_int),
        ("CanMonitorSrc", ctypes.c_int),
        ("CanTest", ctypes.c_int),
        ("VideoIn", ctypes.c_int),
        ("AudioIn", ctypes.c_int),
        ("Calibrate", ctypes.c_int),
        ("SeekType", ctypes.c_int),
        ("SimulatedHardware", ctypes.c_int),
    ]
#[repr(C)]
pub struct DEVCAPS {
    pub CanRecord: i32,
    pub CanRecordStrobe: i32,
    pub HasAudio: i32,
    pub HasVideo: i32,
    pub UsesFiles: i32,
    pub CanSave: i32,
    pub DeviceType: i32,
    pub TCRead: i32,
    pub TCWrite: i32,
    pub CTLRead: i32,
    pub IndexRead: i32,
    pub Preroll: i32,
    pub Postroll: i32,
    pub SyncAcc: i32,
    pub NormRate: i32,
    pub CanPreview: i32,
    pub CanMonitorSrc: i32,
    pub CanTest: i32,
    pub VideoIn: i32,
    pub AudioIn: i32,
    pub Calibrate: i32,
    pub SeekType: i32,
    pub SimulatedHardware: i32,
}
import "golang.org/x/sys/windows"

type DEVCAPS struct {
	CanRecord int32
	CanRecordStrobe int32
	HasAudio int32
	HasVideo int32
	UsesFiles int32
	CanSave int32
	DeviceType int32
	TCRead int32
	TCWrite int32
	CTLRead int32
	IndexRead int32
	Preroll int32
	Postroll int32
	SyncAcc int32
	NormRate int32
	CanPreview int32
	CanMonitorSrc int32
	CanTest int32
	VideoIn int32
	AudioIn int32
	Calibrate int32
	SeekType int32
	SimulatedHardware int32
}
type
  DEVCAPS = record
    CanRecord: Integer;
    CanRecordStrobe: Integer;
    HasAudio: Integer;
    HasVideo: Integer;
    UsesFiles: Integer;
    CanSave: Integer;
    DeviceType: Integer;
    TCRead: Integer;
    TCWrite: Integer;
    CTLRead: Integer;
    IndexRead: Integer;
    Preroll: Integer;
    Postroll: Integer;
    SyncAcc: Integer;
    NormRate: Integer;
    CanPreview: Integer;
    CanMonitorSrc: Integer;
    CanTest: Integer;
    VideoIn: Integer;
    AudioIn: Integer;
    Calibrate: Integer;
    SeekType: Integer;
    SimulatedHardware: Integer;
  end;
const DEVCAPS = extern struct {
    CanRecord: i32,
    CanRecordStrobe: i32,
    HasAudio: i32,
    HasVideo: i32,
    UsesFiles: i32,
    CanSave: i32,
    DeviceType: i32,
    TCRead: i32,
    TCWrite: i32,
    CTLRead: i32,
    IndexRead: i32,
    Preroll: i32,
    Postroll: i32,
    SyncAcc: i32,
    NormRate: i32,
    CanPreview: i32,
    CanMonitorSrc: i32,
    CanTest: i32,
    VideoIn: i32,
    AudioIn: i32,
    Calibrate: i32,
    SeekType: i32,
    SimulatedHardware: i32,
};
type
  DEVCAPS {.bycopy.} = object
    CanRecord: int32
    CanRecordStrobe: int32
    HasAudio: int32
    HasVideo: int32
    UsesFiles: int32
    CanSave: int32
    DeviceType: int32
    TCRead: int32
    TCWrite: int32
    CTLRead: int32
    IndexRead: int32
    Preroll: int32
    Postroll: int32
    SyncAcc: int32
    NormRate: int32
    CanPreview: int32
    CanMonitorSrc: int32
    CanTest: int32
    VideoIn: int32
    AudioIn: int32
    Calibrate: int32
    SeekType: int32
    SimulatedHardware: int32
struct DEVCAPS
{
    int CanRecord;
    int CanRecordStrobe;
    int HasAudio;
    int HasVideo;
    int UsesFiles;
    int CanSave;
    int DeviceType;
    int TCRead;
    int TCWrite;
    int CTLRead;
    int IndexRead;
    int Preroll;
    int Postroll;
    int SyncAcc;
    int NormRate;
    int CanPreview;
    int CanMonitorSrc;
    int CanTest;
    int VideoIn;
    int AudioIn;
    int Calibrate;
    int SeekType;
    int SimulatedHardware;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEVCAPS サイズ: 92 バイト(x64)
dim st, 23    ; 4byte整数×23(構造体サイズ 92 / 4 切り上げ)
; CanRecord : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; CanRecordStrobe : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; HasAudio : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; HasVideo : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; UsesFiles : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; CanSave : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; DeviceType : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; TCRead : INT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; TCWrite : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; CTLRead : INT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; IndexRead : INT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; Preroll : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; Postroll : INT (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; SyncAcc : INT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; NormRate : INT (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; CanPreview : INT (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; CanMonitorSrc : INT (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; CanTest : INT (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; VideoIn : INT (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; AudioIn : INT (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; Calibrate : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; SeekType : INT (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; SimulatedHardware : INT (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEVCAPS
    #field int CanRecord
    #field int CanRecordStrobe
    #field int HasAudio
    #field int HasVideo
    #field int UsesFiles
    #field int CanSave
    #field int DeviceType
    #field int TCRead
    #field int TCWrite
    #field int CTLRead
    #field int IndexRead
    #field int Preroll
    #field int Postroll
    #field int SyncAcc
    #field int NormRate
    #field int CanPreview
    #field int CanMonitorSrc
    #field int CanTest
    #field int VideoIn
    #field int AudioIn
    #field int Calibrate
    #field int SeekType
    #field int SimulatedHardware
#endstruct

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