1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
7 use shared
::basetsd
::UINT32
;
8 use shared
::guiddef
::{GUID, LPCGUID}
;
9 use shared
::minwindef
::{BOOL, DWORD, UINT}
;
10 use um
::unknwnbase
::{IUnknown, IUnknownVtbl}
;
11 use um
::winnt
::HRESULT
;
12 STRUCT
!{struct AUDIO_VOLUME_NOTIFICATION_DATA
{
13 guidEventContext
: GUID
,
15 fMasterVolume
: c_float
,
17 afChannelVolumes
: [c_float
; 1],
19 pub type PAUDIO_VOLUME_NOTIFICATION_DATA
= *mut AUDIO_VOLUME_NOTIFICATION_DATA
;
20 pub const ENDPOINT_HARDWARE_SUPPORT_VOLUME
: DWORD
= 0x00000001;
21 pub const ENDPOINT_HARDWARE_SUPPORT_MUTE
: DWORD
= 0x00000002;
22 pub const ENDPOINT_HARDWARE_SUPPORT_METER
: DWORD
= 0x00000004;
23 RIDL
!{#[uuid(0x657804fa, 0xd6ad, 0x4496, 0x8a, 0x60, 0x35, 0x27, 0x52, 0xaf, 0x4f, 0x89)]
24 interface
IAudioEndpointVolumeCallback(IAudioEndpointVolumeCallbackVtbl
): IUnknown(IUnknownVtbl
) {
26 pNotify
: PAUDIO_VOLUME_NOTIFICATION_DATA
,
29 RIDL
!{#[uuid(0x5cdf2c82, 0x841e, 0x4546, 0x97, 0x22, 0x0c, 0xf7, 0x40, 0x78, 0x22, 0x9a)]
30 interface
IAudioEndpointVolume(IAudioEndpointVolumeVtbl
): IUnknown(IUnknownVtbl
) {
31 fn RegisterControlChangeNotify(
32 pNotify
: *mut IAudioEndpointVolumeCallback
,
34 fn UnregisterControlChangeNotify(
35 pNotify
: *mut IAudioEndpointVolumeCallback
,
38 pnChannelCount
: *mut UINT
,
40 fn SetMasterVolumeLevel(
42 pguidEventContext
: LPCGUID
,
44 fn SetMasterVolumeLevelScalar(
46 pguidEventContext
: LPCGUID
,
48 fn GetMasterVolumeLevel(
49 pfLevelDB
: *mut c_float
,
51 fn GetMasterVolumeLevelScalar(
52 pfLevel
: *mut c_float
,
54 fn SetChannelVolumeLevel(
57 pguidEventContext
: LPCGUID
,
59 fn SetChannelVolumeLevelScalar(
62 pguidEventContext
: LPCGUID
,
64 fn GetChannelVolumeLevel(
66 pfLevelDB
: *mut c_float
,
68 fn GetChannelVolumeLevelScalar(
70 pfLevel
: *mut c_float
,
74 pguidEventContext
: LPCGUID
,
81 pnStepCount
: *mut UINT
,
84 pguidEventContext
: LPCGUID
,
87 pguidEventContext
: LPCGUID
,
89 fn QueryHardwareSupport(
90 pdwHardwareSupportMask
: *mut DWORD
,
93 pflVolumeMindB
: *mut c_float
,
94 pflVolumeMaxdB
: *mut c_float
,
95 pflVolumeIncrementdB
: *mut c_float
,
98 RIDL
!{#[uuid(0x66e11784, 0xf695, 0x4f28, 0xa5, 0x05, 0xa7, 0x08, 0x00, 0x81, 0xa7, 0x8f)]
99 interface
IAudioEndpointVolumeEx(IAudioEndpointVolumeExVtbl
):
100 IAudioEndpointVolume(IAudioEndpointVolumeVtbl
) {
101 fn GetVolumeRangeChannel(
103 pflVolumeMindB
: *mut c_float
,
104 pflVolumeMaxdB
: *mut c_float
,
105 pflVolumeIncrementdB
: *mut c_float
,
108 RIDL
!{#[uuid(0xc02216f6, 0x8c67, 0x4b5b, 0x9d, 0x00, 0xd0, 0x08, 0xe7, 0x3e, 0x00, 0x64)]
109 interface
IAudioMeterInformation(IAudioMeterInformationVtbl
): IUnknown(IUnknownVtbl
) {
111 pfPeak
: *mut c_float
,
113 fn GetMeteringChannelCount(
114 pnChannelCount
: *mut UINT
,
116 fn GetChannelsPeakValues(
117 u32ChannelCount
: UINT32
,
118 afPeakValues
: *mut c_float
,
120 fn QueryHardwareSupport(
121 pdwHardwareSupportMask
: *mut DWORD
,