ホーム › Media.Audio › CreateRenderAudioStateMonitorForCategory
CreateRenderAudioStateMonitorForCategory
関数指定カテゴリのレンダリングオーディオ状態監視を生成する。
シグネチャ
// Windows.Media.MediaControl.dll
#include <windows.h>
HRESULT CreateRenderAudioStateMonitorForCategory(
AUDIO_STREAM_CATEGORY category,
IAudioStateMonitor** audioStateMonitor
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| category | AUDIO_STREAM_CATEGORY | in |
| audioStateMonitor | IAudioStateMonitor** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// Windows.Media.MediaControl.dll
#include <windows.h>
HRESULT CreateRenderAudioStateMonitorForCategory(
AUDIO_STREAM_CATEGORY category,
IAudioStateMonitor** audioStateMonitor
);[DllImport("Windows.Media.MediaControl.dll", ExactSpelling = true)]
static extern int CreateRenderAudioStateMonitorForCategory(
int category, // AUDIO_STREAM_CATEGORY
IntPtr audioStateMonitor // IAudioStateMonitor** out
);<DllImport("Windows.Media.MediaControl.dll", ExactSpelling:=True)>
Public Shared Function CreateRenderAudioStateMonitorForCategory(
category As Integer, ' AUDIO_STREAM_CATEGORY
audioStateMonitor As IntPtr ' IAudioStateMonitor** out
) As Integer
End Function' category : AUDIO_STREAM_CATEGORY
' audioStateMonitor : IAudioStateMonitor** out
Declare PtrSafe Function CreateRenderAudioStateMonitorForCategory Lib "windows.media.mediacontrol" ( _
ByVal category As Long, _
ByVal audioStateMonitor As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CreateRenderAudioStateMonitorForCategory = ctypes.windll.LoadLibrary("Windows.Media.MediaControl.dll").CreateRenderAudioStateMonitorForCategory
CreateRenderAudioStateMonitorForCategory.restype = ctypes.c_int
CreateRenderAudioStateMonitorForCategory.argtypes = [
ctypes.c_int, # category : AUDIO_STREAM_CATEGORY
ctypes.c_void_p, # audioStateMonitor : IAudioStateMonitor** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('Windows.Media.MediaControl.dll')
CreateRenderAudioStateMonitorForCategory = Fiddle::Function.new(
lib['CreateRenderAudioStateMonitorForCategory'],
[
Fiddle::TYPE_INT, # category : AUDIO_STREAM_CATEGORY
Fiddle::TYPE_VOIDP, # audioStateMonitor : IAudioStateMonitor** out
],
Fiddle::TYPE_INT)#[link(name = "windows.media.mediacontrol")]
extern "system" {
fn CreateRenderAudioStateMonitorForCategory(
category: i32, // AUDIO_STREAM_CATEGORY
audioStateMonitor: *mut *mut core::ffi::c_void // IAudioStateMonitor** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("Windows.Media.MediaControl.dll")]
public static extern int CreateRenderAudioStateMonitorForCategory(int category, IntPtr audioStateMonitor);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Windows.Media.MediaControl_CreateRenderAudioStateMonitorForCategory' -Namespace Win32 -PassThru
# $api::CreateRenderAudioStateMonitorForCategory(category, audioStateMonitor)#uselib "Windows.Media.MediaControl.dll"
#func global CreateRenderAudioStateMonitorForCategory "CreateRenderAudioStateMonitorForCategory" sptr, sptr
; CreateRenderAudioStateMonitorForCategory category, audioStateMonitor ; 戻り値は stat
; category : AUDIO_STREAM_CATEGORY -> "sptr"
; audioStateMonitor : IAudioStateMonitor** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "Windows.Media.MediaControl.dll"
#cfunc global CreateRenderAudioStateMonitorForCategory "CreateRenderAudioStateMonitorForCategory" int, sptr
; res = CreateRenderAudioStateMonitorForCategory(category, audioStateMonitor)
; category : AUDIO_STREAM_CATEGORY -> "int"
; audioStateMonitor : IAudioStateMonitor** out -> "sptr"; HRESULT CreateRenderAudioStateMonitorForCategory(AUDIO_STREAM_CATEGORY category, IAudioStateMonitor** audioStateMonitor)
#uselib "Windows.Media.MediaControl.dll"
#cfunc global CreateRenderAudioStateMonitorForCategory "CreateRenderAudioStateMonitorForCategory" int, intptr
; res = CreateRenderAudioStateMonitorForCategory(category, audioStateMonitor)
; category : AUDIO_STREAM_CATEGORY -> "int"
; audioStateMonitor : IAudioStateMonitor** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
windows_media_mediacontrol = windows.NewLazySystemDLL("Windows.Media.MediaControl.dll")
procCreateRenderAudioStateMonitorForCategory = windows_media_mediacontrol.NewProc("CreateRenderAudioStateMonitorForCategory")
)
// category (AUDIO_STREAM_CATEGORY), audioStateMonitor (IAudioStateMonitor** out)
r1, _, err := procCreateRenderAudioStateMonitorForCategory.Call(
uintptr(category),
uintptr(audioStateMonitor),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CreateRenderAudioStateMonitorForCategory(
category: Integer; // AUDIO_STREAM_CATEGORY
audioStateMonitor: Pointer // IAudioStateMonitor** out
): Integer; stdcall;
external 'Windows.Media.MediaControl.dll' name 'CreateRenderAudioStateMonitorForCategory';result := DllCall("Windows.Media.MediaControl\CreateRenderAudioStateMonitorForCategory"
, "Int", category ; AUDIO_STREAM_CATEGORY
, "Ptr", audioStateMonitor ; IAudioStateMonitor** out
, "Int") ; return: HRESULT●CreateRenderAudioStateMonitorForCategory(category, audioStateMonitor) = DLL("Windows.Media.MediaControl.dll", "int CreateRenderAudioStateMonitorForCategory(int, void*)")
# 呼び出し: CreateRenderAudioStateMonitorForCategory(category, audioStateMonitor)
# category : AUDIO_STREAM_CATEGORY -> "int"
# audioStateMonitor : IAudioStateMonitor** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。