Win32 API 日本語リファレンス
ホームMedia.Audio.DirectMusic › DMUS_WAVEARTDL

DMUS_WAVEARTDL

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

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

フィールド

フィールドサイズx64x86説明
ulDownloadIdIdxDWORD4+0+0ダウンロードID識別子の配列インデックス。
ulBusDWORD4+4+4波形を出力するオーディオバス(チャンネル)番号。
ulBuffersDWORD4+8+8使用するDirectSoundバッファ数。
ulMasterDLIdDWORD4+12+12マスターダウンロードID。関連ダウンロードをまとめる識別子。
usOptionsWORD2+16+16ダウンロードオプションを示すビットフラグ(WORD)。

各言語での定義

#include <windows.h>

// DMUS_WAVEARTDL  (x64 20 / x86 20 バイト)
typedef struct DMUS_WAVEARTDL {
    DWORD ulDownloadIdIdx;
    DWORD ulBus;
    DWORD ulBuffers;
    DWORD ulMasterDLId;
    WORD usOptions;
} DMUS_WAVEARTDL;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DMUS_WAVEARTDL
{
    public uint ulDownloadIdIdx;
    public uint ulBus;
    public uint ulBuffers;
    public uint ulMasterDLId;
    public ushort usOptions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DMUS_WAVEARTDL
    Public ulDownloadIdIdx As UInteger
    Public ulBus As UInteger
    Public ulBuffers As UInteger
    Public ulMasterDLId As UInteger
    Public usOptions As UShort
End Structure
import ctypes
from ctypes import wintypes

class DMUS_WAVEARTDL(ctypes.Structure):
    _fields_ = [
        ("ulDownloadIdIdx", wintypes.DWORD),
        ("ulBus", wintypes.DWORD),
        ("ulBuffers", wintypes.DWORD),
        ("ulMasterDLId", wintypes.DWORD),
        ("usOptions", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct DMUS_WAVEARTDL {
    pub ulDownloadIdIdx: u32,
    pub ulBus: u32,
    pub ulBuffers: u32,
    pub ulMasterDLId: u32,
    pub usOptions: u16,
}
import "golang.org/x/sys/windows"

type DMUS_WAVEARTDL struct {
	ulDownloadIdIdx uint32
	ulBus uint32
	ulBuffers uint32
	ulMasterDLId uint32
	usOptions uint16
}
type
  DMUS_WAVEARTDL = record
    ulDownloadIdIdx: DWORD;
    ulBus: DWORD;
    ulBuffers: DWORD;
    ulMasterDLId: DWORD;
    usOptions: Word;
  end;
const DMUS_WAVEARTDL = extern struct {
    ulDownloadIdIdx: u32,
    ulBus: u32,
    ulBuffers: u32,
    ulMasterDLId: u32,
    usOptions: u16,
};
type
  DMUS_WAVEARTDL {.bycopy.} = object
    ulDownloadIdIdx: uint32
    ulBus: uint32
    ulBuffers: uint32
    ulMasterDLId: uint32
    usOptions: uint16
struct DMUS_WAVEARTDL
{
    uint ulDownloadIdIdx;
    uint ulBus;
    uint ulBuffers;
    uint ulMasterDLId;
    ushort usOptions;
}

HSP用 定義

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

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

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