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

DVD_HMSF_TIMECODE

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

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

フィールド

フィールドサイズx64x86説明
bHoursBYTE1+0+0時を示す。
bMinutesBYTE1+1+1分を示す。0から59の範囲となる。
bSecondsBYTE1+2+2秒を示す。0から59の範囲となる。
bFramesBYTE1+3+3フレーム番号を示す。

各言語での定義

#include <windows.h>

// DVD_HMSF_TIMECODE  (x64 4 / x86 4 バイト)
typedef struct DVD_HMSF_TIMECODE {
    BYTE bHours;
    BYTE bMinutes;
    BYTE bSeconds;
    BYTE bFrames;
} DVD_HMSF_TIMECODE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_HMSF_TIMECODE
{
    public byte bHours;
    public byte bMinutes;
    public byte bSeconds;
    public byte bFrames;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_HMSF_TIMECODE
    Public bHours As Byte
    Public bMinutes As Byte
    Public bSeconds As Byte
    Public bFrames As Byte
End Structure
import ctypes
from ctypes import wintypes

class DVD_HMSF_TIMECODE(ctypes.Structure):
    _fields_ = [
        ("bHours", ctypes.c_ubyte),
        ("bMinutes", ctypes.c_ubyte),
        ("bSeconds", ctypes.c_ubyte),
        ("bFrames", ctypes.c_ubyte),
    ]
#[repr(C)]
pub struct DVD_HMSF_TIMECODE {
    pub bHours: u8,
    pub bMinutes: u8,
    pub bSeconds: u8,
    pub bFrames: u8,
}
import "golang.org/x/sys/windows"

type DVD_HMSF_TIMECODE struct {
	bHours byte
	bMinutes byte
	bSeconds byte
	bFrames byte
}
type
  DVD_HMSF_TIMECODE = record
    bHours: Byte;
    bMinutes: Byte;
    bSeconds: Byte;
    bFrames: Byte;
  end;
const DVD_HMSF_TIMECODE = extern struct {
    bHours: u8,
    bMinutes: u8,
    bSeconds: u8,
    bFrames: u8,
};
type
  DVD_HMSF_TIMECODE {.bycopy.} = object
    bHours: uint8
    bMinutes: uint8
    bSeconds: uint8
    bFrames: uint8
struct DVD_HMSF_TIMECODE
{
    ubyte bHours;
    ubyte bMinutes;
    ubyte bSeconds;
    ubyte bFrames;
}

HSP用 定義

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

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

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