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

TRANSPORTSTATUS

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

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

フィールド

フィールドサイズx64x86説明
ModeINT4+0+0トランスポートの現在の動作モードを示す。
LastErrorINT4+4+4直近のエラーコードを示す。
RecordInhibitINT4+8+8録画禁止状態かを示す。
ServoLockINT4+12+12サーボがロックされているかを示す。
MediaPresentINT4+16+16メディアが挿入されているかを示す。
MediaLengthINT4+20+20メディアの長さを示す。
MediaSizeINT4+24+24メディアのサイズを示す。
MediaTrackCountINT4+28+28メディアのトラック数を示す。
MediaTrackLengthINT4+32+321トラックの長さを示す。
MediaTrackSideINT4+36+36現在のトラック面(A/B等)を示す。
MediaTypeINT4+40+40メディアの種別を示す値。
LinkModeINT4+44+44デバイス間のリンクモードを示す。
NotifyOnINT4+48+48通知対象となるイベント条件を示す。

各言語での定義

#include <windows.h>

// TRANSPORTSTATUS  (x64 52 / x86 52 バイト)
typedef struct TRANSPORTSTATUS {
    INT Mode;
    INT LastError;
    INT RecordInhibit;
    INT ServoLock;
    INT MediaPresent;
    INT MediaLength;
    INT MediaSize;
    INT MediaTrackCount;
    INT MediaTrackLength;
    INT MediaTrackSide;
    INT MediaType;
    INT LinkMode;
    INT NotifyOn;
} TRANSPORTSTATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRANSPORTSTATUS
{
    public int Mode;
    public int LastError;
    public int RecordInhibit;
    public int ServoLock;
    public int MediaPresent;
    public int MediaLength;
    public int MediaSize;
    public int MediaTrackCount;
    public int MediaTrackLength;
    public int MediaTrackSide;
    public int MediaType;
    public int LinkMode;
    public int NotifyOn;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRANSPORTSTATUS
    Public Mode As Integer
    Public LastError As Integer
    Public RecordInhibit As Integer
    Public ServoLock As Integer
    Public MediaPresent As Integer
    Public MediaLength As Integer
    Public MediaSize As Integer
    Public MediaTrackCount As Integer
    Public MediaTrackLength As Integer
    Public MediaTrackSide As Integer
    Public MediaType As Integer
    Public LinkMode As Integer
    Public NotifyOn As Integer
End Structure
import ctypes
from ctypes import wintypes

class TRANSPORTSTATUS(ctypes.Structure):
    _fields_ = [
        ("Mode", ctypes.c_int),
        ("LastError", ctypes.c_int),
        ("RecordInhibit", ctypes.c_int),
        ("ServoLock", ctypes.c_int),
        ("MediaPresent", ctypes.c_int),
        ("MediaLength", ctypes.c_int),
        ("MediaSize", ctypes.c_int),
        ("MediaTrackCount", ctypes.c_int),
        ("MediaTrackLength", ctypes.c_int),
        ("MediaTrackSide", ctypes.c_int),
        ("MediaType", ctypes.c_int),
        ("LinkMode", ctypes.c_int),
        ("NotifyOn", ctypes.c_int),
    ]
#[repr(C)]
pub struct TRANSPORTSTATUS {
    pub Mode: i32,
    pub LastError: i32,
    pub RecordInhibit: i32,
    pub ServoLock: i32,
    pub MediaPresent: i32,
    pub MediaLength: i32,
    pub MediaSize: i32,
    pub MediaTrackCount: i32,
    pub MediaTrackLength: i32,
    pub MediaTrackSide: i32,
    pub MediaType: i32,
    pub LinkMode: i32,
    pub NotifyOn: i32,
}
import "golang.org/x/sys/windows"

type TRANSPORTSTATUS struct {
	Mode int32
	LastError int32
	RecordInhibit int32
	ServoLock int32
	MediaPresent int32
	MediaLength int32
	MediaSize int32
	MediaTrackCount int32
	MediaTrackLength int32
	MediaTrackSide int32
	MediaType int32
	LinkMode int32
	NotifyOn int32
}
type
  TRANSPORTSTATUS = record
    Mode: Integer;
    LastError: Integer;
    RecordInhibit: Integer;
    ServoLock: Integer;
    MediaPresent: Integer;
    MediaLength: Integer;
    MediaSize: Integer;
    MediaTrackCount: Integer;
    MediaTrackLength: Integer;
    MediaTrackSide: Integer;
    MediaType: Integer;
    LinkMode: Integer;
    NotifyOn: Integer;
  end;
const TRANSPORTSTATUS = extern struct {
    Mode: i32,
    LastError: i32,
    RecordInhibit: i32,
    ServoLock: i32,
    MediaPresent: i32,
    MediaLength: i32,
    MediaSize: i32,
    MediaTrackCount: i32,
    MediaTrackLength: i32,
    MediaTrackSide: i32,
    MediaType: i32,
    LinkMode: i32,
    NotifyOn: i32,
};
type
  TRANSPORTSTATUS {.bycopy.} = object
    Mode: int32
    LastError: int32
    RecordInhibit: int32
    ServoLock: int32
    MediaPresent: int32
    MediaLength: int32
    MediaSize: int32
    MediaTrackCount: int32
    MediaTrackLength: int32
    MediaTrackSide: int32
    MediaType: int32
    LinkMode: int32
    NotifyOn: int32
struct TRANSPORTSTATUS
{
    int Mode;
    int LastError;
    int RecordInhibit;
    int ServoLock;
    int MediaPresent;
    int MediaLength;
    int MediaSize;
    int MediaTrackCount;
    int MediaTrackLength;
    int MediaTrackSide;
    int MediaType;
    int LinkMode;
    int NotifyOn;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TRANSPORTSTATUS サイズ: 52 バイト(x64)
dim st, 13    ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; Mode : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; LastError : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; RecordInhibit : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ServoLock : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; MediaPresent : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; MediaLength : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; MediaSize : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; MediaTrackCount : INT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; MediaTrackLength : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; MediaTrackSide : INT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; MediaType : INT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; LinkMode : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; NotifyOn : INT (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TRANSPORTSTATUS
    #field int Mode
    #field int LastError
    #field int RecordInhibit
    #field int ServoLock
    #field int MediaPresent
    #field int MediaLength
    #field int MediaSize
    #field int MediaTrackCount
    #field int MediaTrackLength
    #field int MediaTrackSide
    #field int MediaType
    #field int LinkMode
    #field int NotifyOn
#endstruct

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