ホーム › Media.Audio.DirectMusic › DMUS_SYNTHSTATS8
DMUS_SYNTHSTATS8
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| dwValidStats | DWORD | 4 | +4 | +4 | 有効な統計メンバを示すビットフラグ(DMUS_SYNTHSTATS_*)。 |
| dwVoices | DWORD | 4 | +8 | +8 | 現在発音中のボイス数。 |
| dwTotalCPU | DWORD | 4 | +12 | +12 | シンセが使用しているCPU負荷の総量(パーセント×100)。 |
| dwCPUPerVoice | DWORD | 4 | +16 | +16 | 1ボイスあたりのCPU負荷(パーセント×100)。 |
| dwLostNotes | DWORD | 4 | +20 | +20 | 発音できず破棄されたノート数。 |
| dwFreeMemory | DWORD | 4 | +24 | +24 | 利用可能なメモリのバイト量。 |
| lPeakVolume | INT | 4 | +28 | +28 | ピーク音量レベル(符号付き、デシベル相当)。 |
| dwSynthMemUse | DWORD | 4 | +32 | +32 | シンセが使用中のメモリのバイト量。DX8で追加。 |
各言語での定義
#include <windows.h>
// DMUS_SYNTHSTATS8 (x64 36 / x86 36 バイト)
typedef struct DMUS_SYNTHSTATS8 {
DWORD dwSize;
DWORD dwValidStats;
DWORD dwVoices;
DWORD dwTotalCPU;
DWORD dwCPUPerVoice;
DWORD dwLostNotes;
DWORD dwFreeMemory;
INT lPeakVolume;
DWORD dwSynthMemUse;
} DMUS_SYNTHSTATS8;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DMUS_SYNTHSTATS8
{
public uint dwSize;
public uint dwValidStats;
public uint dwVoices;
public uint dwTotalCPU;
public uint dwCPUPerVoice;
public uint dwLostNotes;
public uint dwFreeMemory;
public int lPeakVolume;
public uint dwSynthMemUse;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DMUS_SYNTHSTATS8
Public dwSize As UInteger
Public dwValidStats As UInteger
Public dwVoices As UInteger
Public dwTotalCPU As UInteger
Public dwCPUPerVoice As UInteger
Public dwLostNotes As UInteger
Public dwFreeMemory As UInteger
Public lPeakVolume As Integer
Public dwSynthMemUse As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DMUS_SYNTHSTATS8(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwValidStats", wintypes.DWORD),
("dwVoices", wintypes.DWORD),
("dwTotalCPU", wintypes.DWORD),
("dwCPUPerVoice", wintypes.DWORD),
("dwLostNotes", wintypes.DWORD),
("dwFreeMemory", wintypes.DWORD),
("lPeakVolume", ctypes.c_int),
("dwSynthMemUse", wintypes.DWORD),
]#[repr(C)]
pub struct DMUS_SYNTHSTATS8 {
pub dwSize: u32,
pub dwValidStats: u32,
pub dwVoices: u32,
pub dwTotalCPU: u32,
pub dwCPUPerVoice: u32,
pub dwLostNotes: u32,
pub dwFreeMemory: u32,
pub lPeakVolume: i32,
pub dwSynthMemUse: u32,
}import "golang.org/x/sys/windows"
type DMUS_SYNTHSTATS8 struct {
dwSize uint32
dwValidStats uint32
dwVoices uint32
dwTotalCPU uint32
dwCPUPerVoice uint32
dwLostNotes uint32
dwFreeMemory uint32
lPeakVolume int32
dwSynthMemUse uint32
}type
DMUS_SYNTHSTATS8 = record
dwSize: DWORD;
dwValidStats: DWORD;
dwVoices: DWORD;
dwTotalCPU: DWORD;
dwCPUPerVoice: DWORD;
dwLostNotes: DWORD;
dwFreeMemory: DWORD;
lPeakVolume: Integer;
dwSynthMemUse: DWORD;
end;const DMUS_SYNTHSTATS8 = extern struct {
dwSize: u32,
dwValidStats: u32,
dwVoices: u32,
dwTotalCPU: u32,
dwCPUPerVoice: u32,
dwLostNotes: u32,
dwFreeMemory: u32,
lPeakVolume: i32,
dwSynthMemUse: u32,
};type
DMUS_SYNTHSTATS8 {.bycopy.} = object
dwSize: uint32
dwValidStats: uint32
dwVoices: uint32
dwTotalCPU: uint32
dwCPUPerVoice: uint32
dwLostNotes: uint32
dwFreeMemory: uint32
lPeakVolume: int32
dwSynthMemUse: uint32struct DMUS_SYNTHSTATS8
{
uint dwSize;
uint dwValidStats;
uint dwVoices;
uint dwTotalCPU;
uint dwCPUPerVoice;
uint dwLostNotes;
uint dwFreeMemory;
int lPeakVolume;
uint dwSynthMemUse;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DMUS_SYNTHSTATS8 サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwValidStats : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwVoices : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwTotalCPU : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwCPUPerVoice : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwLostNotes : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwFreeMemory : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lPeakVolume : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwSynthMemUse : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DMUS_SYNTHSTATS8
#field int dwSize
#field int dwValidStats
#field int dwVoices
#field int dwTotalCPU
#field int dwCPUPerVoice
#field int dwLostNotes
#field int dwFreeMemory
#field int lPeakVolume
#field int dwSynthMemUse
#endstruct
stdim st, DMUS_SYNTHSTATS8 ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize