1 // Copyright © 2018 winapi-rs developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
4 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
5 // All files in the project carrying such notice may not be copied, modified, or distributed
6 // except according to those terms.
8 use shared
::basetsd
::UINT32
;
9 use shared
::guiddef
::{GUID, LPCGUID}
;
10 use shared
::minwindef
::{BOOL, DWORD, UINT}
;
11 use um
::unknwnbase
::{IUnknown, IUnknownVtbl}
;
12 use um
::winnt
::HRESULT
;
13 STRUCT
!{struct AUDIO_VOLUME_NOTIFICATION_DATA
{
14 guidEventContext
: GUID
,
16 fMasterVolume
: c_float
,
18 afChannelVolumes
: [c_float
; 1],
20 pub type PAUDIO_VOLUME_NOTIFICATION_DATA
= *mut AUDIO_VOLUME_NOTIFICATION_DATA
;
21 pub const ENDPOINT_HARDWARE_SUPPORT_VOLUME
: DWORD
= 0x00000001;
22 pub const ENDPOINT_HARDWARE_SUPPORT_MUTE
: DWORD
= 0x00000002;
23 pub const ENDPOINT_HARDWARE_SUPPORT_METER
: DWORD
= 0x00000004;
24 RIDL
!{#[uuid(0x657804fa, 0xd6ad, 0x4496, 0x8a, 0x60, 0x35, 0x27, 0x52, 0xaf, 0x4f, 0x89)]
25 interface
IAudioEndpointVolumeCallback(IAudioEndpointVolumeCallbackVtbl
): IUnknown(IUnknownVtbl
) {
27 pNotify
: PAUDIO_VOLUME_NOTIFICATION_DATA
,
30 RIDL
!{#[uuid(0x5cdf2c82, 0x841e, 0x4546, 0x97, 0x22, 0x0c, 0xf7, 0x40, 0x78, 0x22, 0x9a)]
31 interface
IAudioEndpointVolume(IAudioEndpointVolumeVtbl
): IUnknown(IUnknownVtbl
) {
32 fn RegisterControlChangeNotify(
33 pNotify
: *mut IAudioEndpointVolumeCallback
,
35 fn UnregisterControlChangeNotify(
36 pNotify
: *mut IAudioEndpointVolumeCallback
,
39 pnChannelCount
: *mut UINT
,
41 fn SetMasterVolumeLevel(
43 pguidEventContext
: LPCGUID
,
45 fn SetMasterVolumeLevelScalar(
47 pguidEventContext
: LPCGUID
,
49 fn GetMasterVolumeLevel(
50 pfLevelDB
: *mut c_float
,
52 fn GetMasterVolumeLevelScalar(
53 pfLevel
: *mut c_float
,
55 fn SetChannelVolumeLevel(
58 pguidEventContext
: LPCGUID
,
60 fn SetChannelVolumeLevelScalar(
63 pguidEventContext
: LPCGUID
,
65 fn GetChannelVolumeLevel(
67 pfLevelDB
: *mut c_float
,
69 fn GetChannelVolumeLevelScalar(
71 pfLevel
: *mut c_float
,
75 pguidEventContext
: LPCGUID
,
82 pnStepCount
: *mut UINT
,
85 pguidEventContext
: LPCGUID
,
88 pguidEventContext
: LPCGUID
,
90 fn QueryHardwareSupport(
91 pdwHardwareSupportMask
: *mut DWORD
,
94 pflVolumeMindB
: *mut c_float
,
95 pflVolumeMaxdB
: *mut c_float
,
96 pflVolumeIncrementdB
: *mut c_float
,
99 RIDL
!{#[uuid(0x66e11784, 0xf695, 0x4f28, 0xa5, 0x05, 0xa7, 0x08, 0x00, 0x81, 0xa7, 0x8f)]
100 interface
IAudioEndpointVolumeEx(IAudioEndpointVolumeExVtbl
):
101 IAudioEndpointVolume(IAudioEndpointVolumeVtbl
) {
102 fn GetVolumeRangeChannel(
104 pflVolumeMindB
: *mut c_float
,
105 pflVolumeMaxdB
: *mut c_float
,
106 pflVolumeIncrementdB
: *mut c_float
,
109 RIDL
!{#[uuid(0xc02216f6, 0x8c67, 0x4b5b, 0x9d, 0x00, 0xd0, 0x08, 0xe7, 0x3e, 0x00, 0x64)]
110 interface
IAudioMeterInformation(IAudioMeterInformationVtbl
): IUnknown(IUnknownVtbl
) {
112 pfPeak
: *mut c_float
,
114 fn GetMeteringChannelCount(
115 pnChannelCount
: *mut UINT
,
117 fn GetChannelsPeakValues(
118 u32ChannelCount
: UINT32
,
119 afPeakValues
: *mut c_float
,
121 fn QueryHardwareSupport(
122 pdwHardwareSupportMask
: *mut DWORD
,