| 1 |
/* |
| 2 |
* Copyright (C) 2009 Maarten Lankhorst |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 |
*/ |
| 18 |
|
| 19 |
import "unknwn.idl"; |
| 20 |
import "devicetopology.idl"; |
| 21 |
|
| 22 |
typedef struct AUDIO_VOLUME_NOTIFICATION_DATA |
| 23 |
{ |
| 24 |
GUID guidEventContext; |
| 25 |
BOOL bMuted; |
| 26 |
FLOAT fMasterVolume; |
| 27 |
UINT nChannels; |
| 28 |
FLOAT afChannelVolumes[1]; |
| 29 |
} AUDIO_VOLUME_NOTIFICATION_DATA; |
| 30 |
|
| 31 |
cpp_quote("typedef struct AUDIO_VOLUME_NOTIFICATION_DATA *PAUDIO_VOLUME_NOTIFICATION_DATA;") |
| 32 |
|
| 33 |
cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_VOLUME 0x1") |
| 34 |
cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_MUTE 0x2") |
| 35 |
cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_METER 0x4") |
| 36 |
|
| 37 |
interface IAudioEndpointVolumeCallback; |
| 38 |
interface IAudioEndpointVolume; |
| 39 |
interface IAudioEndpointVolumeEx; |
| 40 |
interface IAudioMeterInformation; |
| 41 |
|
| 42 |
[ |
| 43 |
pointer_default(unique), |
| 44 |
nonextensible, |
| 45 |
uuid(657804fa-d6ad-4496-8a60-352752af4f89), |
| 46 |
local, |
| 47 |
object |
| 48 |
] |
| 49 |
interface IAudioEndpointVolumeCallback : IUnknown |
| 50 |
{ |
| 51 |
HRESULT OnNotify( |
| 52 |
AUDIO_VOLUME_NOTIFICATION_DATA *pNotify |
| 53 |
); |
| 54 |
} |
| 55 |
|
| 56 |
[ |
| 57 |
pointer_default(unique), |
| 58 |
nonextensible, |
| 59 |
uuid(5cdf2c82-841e-4546-9722-0cf74078229a), |
| 60 |
local, |
| 61 |
object |
| 62 |
] |
| 63 |
interface IAudioEndpointVolume : IUnknown |
| 64 |
{ |
| 65 |
HRESULT RegisterControlChangeNotify( |
| 66 |
[in] IAudioEndpointVolumeCallback *pNotify |
| 67 |
); |
| 68 |
HRESULT UnregisterControlChangeNotify( |
| 69 |
[in] IAudioEndpointVolumeCallback *pNotify |
| 70 |
); |
| 71 |
HRESULT GetChannelCount( |
| 72 |
[out] UINT *pnChannelCount |
| 73 |
); |
| 74 |
HRESULT SetMasterVolumeLevel( |
| 75 |
[in] FLOAT fLevelDB, |
| 76 |
[unique,in] LPCGUID pguidEventContext |
| 77 |
); |
| 78 |
HRESULT SetMasterVolumeLevelScalar( |
| 79 |
[in] FLOAT fLevel, |
| 80 |
[unique,in] LPCGUID pguidEventContext |
| 81 |
); |
| 82 |
HRESULT GetMasterVolumeLevel( |
| 83 |
[out] FLOAT *fLevelDB |
| 84 |
); |
| 85 |
HRESULT GetMasterVolumeLevelScalar( |
| 86 |
[out] FLOAT *fLevel |
| 87 |
); |
| 88 |
HRESULT SetChannelVolumeLevel( |
| 89 |
[in] UINT nChannel, |
| 90 |
[in] FLOAT fLevelDB, |
| 91 |
[unique,in] LPCGUID pguidEventContext |
| 92 |
); |
| 93 |
HRESULT SetChannelVolumeLevelScalar( |
| 94 |
[in] UINT nChannel, |
| 95 |
[in] FLOAT fLevel, |
| 96 |
[unique,in] LPCGUID pguidEventContext |
| 97 |
); |
| 98 |
HRESULT GetChannelVolumeLevel( |
| 99 |
[in] UINT nChannel, |
| 100 |
[out] FLOAT *fLevelDB |
| 101 |
); |
| 102 |
HRESULT GetChannelVolumeLevelScalar( |
| 103 |
[in] UINT nChannel, |
| 104 |
[out] FLOAT *fLevel |
| 105 |
); |
| 106 |
HRESULT SetMute( |
| 107 |
[in] BOOL bMute, |
| 108 |
[unique,in] LPCGUID pguidEventContext |
| 109 |
); |
| 110 |
HRESULT GetMute( |
| 111 |
[out] BOOL *bMute |
| 112 |
); |
| 113 |
HRESULT GetVolumeStepInfo( |
| 114 |
[out] UINT *pnStep, |
| 115 |
[out] UINT *pnStepCount |
| 116 |
); |
| 117 |
HRESULT VolumeStepUp( |
| 118 |
[unique,in] LPCGUID pguidEventContext |
| 119 |
); |
| 120 |
HRESULT VolumeStepDown( |
| 121 |
[unique,in] LPCGUID pguidEventContext |
| 122 |
); |
| 123 |
HRESULT QueryHardwareSupport( |
| 124 |
[out] DWORD *pdwHardwareSupportMask |
| 125 |
); |
| 126 |
HRESULT GetVolumeRange( |
| 127 |
[out] FLOAT *pflVolumeMindB, |
| 128 |
[out] FLOAT *pflVolumeMaxdB, |
| 129 |
[out] FLOAT *pflVolumeIncrementdB |
| 130 |
); |
| 131 |
} |
| 132 |
|
| 133 |
[ |
| 134 |
pointer_default(unique), |
| 135 |
nonextensible, |
| 136 |
uuid(66e11784-f695-4f28-a505-a7080081a78f), |
| 137 |
local, |
| 138 |
object |
| 139 |
] |
| 140 |
interface IAudioEndpointVolumeEx : IAudioEndpointVolume |
| 141 |
{ |
| 142 |
HRESULT GetVolumeRangeChannel( |
| 143 |
[in] UINT iChannel, |
| 144 |
[out] FLOAT *pflVolumeMindB, |
| 145 |
[out] FLOAT *pflVolumeMaxdB, |
| 146 |
[out] FLOAT *pflVolumeIncrementdB |
| 147 |
); |
| 148 |
} |