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

KSWAVE_OUTPUT_CAPABILITIES

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

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

フィールド

フィールドサイズx64x86説明
MaximumChannelsPerConnectionDWORD4+0+01接続あたりの最大チャンネル数を示す。
MinimumBitsPerSampleDWORD4+4+41サンプルあたりの最小ビット数を示す。
MaximumBitsPerSampleDWORD4+8+81サンプルあたりの最大ビット数を示す。
MinimumSampleFrequencyDWORD4+12+12最小サンプリング周波数をHzで示す。
MaximumSampleFrequencyDWORD4+16+16最大サンプリング周波数をHzで示す。
TotalConnectionsDWORD4+20+20サポートする出力接続の総数を示す。
StaticConnectionsDWORD4+24+24静的(ハードウェア固定)接続の数を示す。
StreamingConnectionsDWORD4+28+28ストリーミング接続の数を示す。
ActiveConnectionsDWORD4+32+32現在アクティブな接続の数を示す。
ActiveStaticConnectionsDWORD4+36+36アクティブな静的接続の数を示す。
ActiveStreamingConnectionsDWORD4+40+40アクティブなストリーミング接続の数を示す。
Total3DConnectionsDWORD4+44+44サポートする3D接続の総数を示す。
Static3DConnectionsDWORD4+48+48静的な3D接続の数を示す。
Streaming3DConnectionsDWORD4+52+52ストリーミングの3D接続の数を示す。
Active3DConnectionsDWORD4+56+56現在アクティブな3D接続の数を示す。
ActiveStatic3DConnectionsDWORD4+60+60アクティブな静的3D接続の数を示す。
ActiveStreaming3DConnectionsDWORD4+64+64アクティブなストリーミング3D接続の数を示す。
TotalSampleMemoryDWORD4+68+68サンプル用メモリの総容量をバイトで示す。
FreeSampleMemoryDWORD4+72+72空きサンプルメモリの容量をバイトで示す。
LargestFreeContiguousSampleMemoryDWORD4+76+76連続して確保可能な最大の空きメモリをバイトで示す。

各言語での定義

#include <windows.h>

// KSWAVE_OUTPUT_CAPABILITIES  (x64 80 / x86 80 バイト)
typedef struct KSWAVE_OUTPUT_CAPABILITIES {
    DWORD MaximumChannelsPerConnection;
    DWORD MinimumBitsPerSample;
    DWORD MaximumBitsPerSample;
    DWORD MinimumSampleFrequency;
    DWORD MaximumSampleFrequency;
    DWORD TotalConnections;
    DWORD StaticConnections;
    DWORD StreamingConnections;
    DWORD ActiveConnections;
    DWORD ActiveStaticConnections;
    DWORD ActiveStreamingConnections;
    DWORD Total3DConnections;
    DWORD Static3DConnections;
    DWORD Streaming3DConnections;
    DWORD Active3DConnections;
    DWORD ActiveStatic3DConnections;
    DWORD ActiveStreaming3DConnections;
    DWORD TotalSampleMemory;
    DWORD FreeSampleMemory;
    DWORD LargestFreeContiguousSampleMemory;
} KSWAVE_OUTPUT_CAPABILITIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSWAVE_OUTPUT_CAPABILITIES
{
    public uint MaximumChannelsPerConnection;
    public uint MinimumBitsPerSample;
    public uint MaximumBitsPerSample;
    public uint MinimumSampleFrequency;
    public uint MaximumSampleFrequency;
    public uint TotalConnections;
    public uint StaticConnections;
    public uint StreamingConnections;
    public uint ActiveConnections;
    public uint ActiveStaticConnections;
    public uint ActiveStreamingConnections;
    public uint Total3DConnections;
    public uint Static3DConnections;
    public uint Streaming3DConnections;
    public uint Active3DConnections;
    public uint ActiveStatic3DConnections;
    public uint ActiveStreaming3DConnections;
    public uint TotalSampleMemory;
    public uint FreeSampleMemory;
    public uint LargestFreeContiguousSampleMemory;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSWAVE_OUTPUT_CAPABILITIES
    Public MaximumChannelsPerConnection As UInteger
    Public MinimumBitsPerSample As UInteger
    Public MaximumBitsPerSample As UInteger
    Public MinimumSampleFrequency As UInteger
    Public MaximumSampleFrequency As UInteger
    Public TotalConnections As UInteger
    Public StaticConnections As UInteger
    Public StreamingConnections As UInteger
    Public ActiveConnections As UInteger
    Public ActiveStaticConnections As UInteger
    Public ActiveStreamingConnections As UInteger
    Public Total3DConnections As UInteger
    Public Static3DConnections As UInteger
    Public Streaming3DConnections As UInteger
    Public Active3DConnections As UInteger
    Public ActiveStatic3DConnections As UInteger
    Public ActiveStreaming3DConnections As UInteger
    Public TotalSampleMemory As UInteger
    Public FreeSampleMemory As UInteger
    Public LargestFreeContiguousSampleMemory As UInteger
End Structure
import ctypes
from ctypes import wintypes

class KSWAVE_OUTPUT_CAPABILITIES(ctypes.Structure):
    _fields_ = [
        ("MaximumChannelsPerConnection", wintypes.DWORD),
        ("MinimumBitsPerSample", wintypes.DWORD),
        ("MaximumBitsPerSample", wintypes.DWORD),
        ("MinimumSampleFrequency", wintypes.DWORD),
        ("MaximumSampleFrequency", wintypes.DWORD),
        ("TotalConnections", wintypes.DWORD),
        ("StaticConnections", wintypes.DWORD),
        ("StreamingConnections", wintypes.DWORD),
        ("ActiveConnections", wintypes.DWORD),
        ("ActiveStaticConnections", wintypes.DWORD),
        ("ActiveStreamingConnections", wintypes.DWORD),
        ("Total3DConnections", wintypes.DWORD),
        ("Static3DConnections", wintypes.DWORD),
        ("Streaming3DConnections", wintypes.DWORD),
        ("Active3DConnections", wintypes.DWORD),
        ("ActiveStatic3DConnections", wintypes.DWORD),
        ("ActiveStreaming3DConnections", wintypes.DWORD),
        ("TotalSampleMemory", wintypes.DWORD),
        ("FreeSampleMemory", wintypes.DWORD),
        ("LargestFreeContiguousSampleMemory", wintypes.DWORD),
    ]
#[repr(C)]
pub struct KSWAVE_OUTPUT_CAPABILITIES {
    pub MaximumChannelsPerConnection: u32,
    pub MinimumBitsPerSample: u32,
    pub MaximumBitsPerSample: u32,
    pub MinimumSampleFrequency: u32,
    pub MaximumSampleFrequency: u32,
    pub TotalConnections: u32,
    pub StaticConnections: u32,
    pub StreamingConnections: u32,
    pub ActiveConnections: u32,
    pub ActiveStaticConnections: u32,
    pub ActiveStreamingConnections: u32,
    pub Total3DConnections: u32,
    pub Static3DConnections: u32,
    pub Streaming3DConnections: u32,
    pub Active3DConnections: u32,
    pub ActiveStatic3DConnections: u32,
    pub ActiveStreaming3DConnections: u32,
    pub TotalSampleMemory: u32,
    pub FreeSampleMemory: u32,
    pub LargestFreeContiguousSampleMemory: u32,
}
import "golang.org/x/sys/windows"

type KSWAVE_OUTPUT_CAPABILITIES struct {
	MaximumChannelsPerConnection uint32
	MinimumBitsPerSample uint32
	MaximumBitsPerSample uint32
	MinimumSampleFrequency uint32
	MaximumSampleFrequency uint32
	TotalConnections uint32
	StaticConnections uint32
	StreamingConnections uint32
	ActiveConnections uint32
	ActiveStaticConnections uint32
	ActiveStreamingConnections uint32
	Total3DConnections uint32
	Static3DConnections uint32
	Streaming3DConnections uint32
	Active3DConnections uint32
	ActiveStatic3DConnections uint32
	ActiveStreaming3DConnections uint32
	TotalSampleMemory uint32
	FreeSampleMemory uint32
	LargestFreeContiguousSampleMemory uint32
}
type
  KSWAVE_OUTPUT_CAPABILITIES = record
    MaximumChannelsPerConnection: DWORD;
    MinimumBitsPerSample: DWORD;
    MaximumBitsPerSample: DWORD;
    MinimumSampleFrequency: DWORD;
    MaximumSampleFrequency: DWORD;
    TotalConnections: DWORD;
    StaticConnections: DWORD;
    StreamingConnections: DWORD;
    ActiveConnections: DWORD;
    ActiveStaticConnections: DWORD;
    ActiveStreamingConnections: DWORD;
    Total3DConnections: DWORD;
    Static3DConnections: DWORD;
    Streaming3DConnections: DWORD;
    Active3DConnections: DWORD;
    ActiveStatic3DConnections: DWORD;
    ActiveStreaming3DConnections: DWORD;
    TotalSampleMemory: DWORD;
    FreeSampleMemory: DWORD;
    LargestFreeContiguousSampleMemory: DWORD;
  end;
const KSWAVE_OUTPUT_CAPABILITIES = extern struct {
    MaximumChannelsPerConnection: u32,
    MinimumBitsPerSample: u32,
    MaximumBitsPerSample: u32,
    MinimumSampleFrequency: u32,
    MaximumSampleFrequency: u32,
    TotalConnections: u32,
    StaticConnections: u32,
    StreamingConnections: u32,
    ActiveConnections: u32,
    ActiveStaticConnections: u32,
    ActiveStreamingConnections: u32,
    Total3DConnections: u32,
    Static3DConnections: u32,
    Streaming3DConnections: u32,
    Active3DConnections: u32,
    ActiveStatic3DConnections: u32,
    ActiveStreaming3DConnections: u32,
    TotalSampleMemory: u32,
    FreeSampleMemory: u32,
    LargestFreeContiguousSampleMemory: u32,
};
type
  KSWAVE_OUTPUT_CAPABILITIES {.bycopy.} = object
    MaximumChannelsPerConnection: uint32
    MinimumBitsPerSample: uint32
    MaximumBitsPerSample: uint32
    MinimumSampleFrequency: uint32
    MaximumSampleFrequency: uint32
    TotalConnections: uint32
    StaticConnections: uint32
    StreamingConnections: uint32
    ActiveConnections: uint32
    ActiveStaticConnections: uint32
    ActiveStreamingConnections: uint32
    Total3DConnections: uint32
    Static3DConnections: uint32
    Streaming3DConnections: uint32
    Active3DConnections: uint32
    ActiveStatic3DConnections: uint32
    ActiveStreaming3DConnections: uint32
    TotalSampleMemory: uint32
    FreeSampleMemory: uint32
    LargestFreeContiguousSampleMemory: uint32
struct KSWAVE_OUTPUT_CAPABILITIES
{
    uint MaximumChannelsPerConnection;
    uint MinimumBitsPerSample;
    uint MaximumBitsPerSample;
    uint MinimumSampleFrequency;
    uint MaximumSampleFrequency;
    uint TotalConnections;
    uint StaticConnections;
    uint StreamingConnections;
    uint ActiveConnections;
    uint ActiveStaticConnections;
    uint ActiveStreamingConnections;
    uint Total3DConnections;
    uint Static3DConnections;
    uint Streaming3DConnections;
    uint Active3DConnections;
    uint ActiveStatic3DConnections;
    uint ActiveStreaming3DConnections;
    uint TotalSampleMemory;
    uint FreeSampleMemory;
    uint LargestFreeContiguousSampleMemory;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSWAVE_OUTPUT_CAPABILITIES サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; MaximumChannelsPerConnection : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MinimumBitsPerSample : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MaximumBitsPerSample : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; MinimumSampleFrequency : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; MaximumSampleFrequency : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; TotalConnections : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; StaticConnections : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; StreamingConnections : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ActiveConnections : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ActiveStaticConnections : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ActiveStreamingConnections : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; Total3DConnections : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; Static3DConnections : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; Streaming3DConnections : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; Active3DConnections : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ActiveStatic3DConnections : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ActiveStreaming3DConnections : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; TotalSampleMemory : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; FreeSampleMemory : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; LargestFreeContiguousSampleMemory : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSWAVE_OUTPUT_CAPABILITIES
    #field int MaximumChannelsPerConnection
    #field int MinimumBitsPerSample
    #field int MaximumBitsPerSample
    #field int MinimumSampleFrequency
    #field int MaximumSampleFrequency
    #field int TotalConnections
    #field int StaticConnections
    #field int StreamingConnections
    #field int ActiveConnections
    #field int ActiveStaticConnections
    #field int ActiveStreamingConnections
    #field int Total3DConnections
    #field int Static3DConnections
    #field int Streaming3DConnections
    #field int Active3DConnections
    #field int ActiveStatic3DConnections
    #field int ActiveStreaming3DConnections
    #field int TotalSampleMemory
    #field int FreeSampleMemory
    #field int LargestFreeContiguousSampleMemory
#endstruct

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