1/* 2 * Core Audio audio policy definitions 3 * 4 * Copyright 2009 Maarten Lankhorst 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 * 20 */ 21 22import "oaidl.idl"; 23import "ocidl.idl"; 24import "propidl.idl"; 25import "audiosessiontypes.h"; 26import "audioclient.idl"; 27 28interface IAudioSessionEvents; 29interface IAudioSessionControl; 30interface IAudioSessionControl2; 31interface IAudioSessionManager; 32interface IAudioVolumeDuckNotification; 33interface IAudioSessionNotification; 34interface IAudioSessionEnumerator; 35interface IAudioSessionManager2; 36 37typedef enum AudioSessionDisconnectReason /*[local]*/ 38{ 39 DisconnectReasonDeviceRemoval = 0, 40 DisconnectReasonServerShutdown, 41 DisconnectReasonFormatChanged, 42 DisconnectReasonSessionLogoff, 43 DisconnectReasonSessionDisconnected, 44 DisconnectReasonExclusiveModeOverride, 45} AudioSessionDisconnectReason; 46 47[ 48 local, 49 uuid(24918acc-64b3-37c1-8ca9-74a66e9957a8), 50 pointer_default(unique), 51 object 52] 53interface IAudioSessionEvents : IUnknown 54{ 55 HRESULT OnDisplayNameChanged( 56 [string,in] LPCWSTR NewDisplayName, 57 [in] LPCGUID EventContext 58 ); 59 HRESULT OnIconPathChanged( 60 [string,in] LPCWSTR NewIconPath, 61 [in] LPCGUID EventContext 62 ); 63 HRESULT OnSimpleVolumeChanged( 64 [in] float NewVolume, 65 [in] BOOL NewMute, 66 [in] LPCGUID EventContext 67 ); 68 HRESULT OnChannelVolumeChanged( 69 [in] DWORD ChannelCount, 70 [size_is(ChannelCount),in] float *NewChannelVolumeArray, 71 [in] DWORD ChangedChannel, 72 [in] LPCGUID EventContext 73 ); 74 HRESULT OnGroupingParamChanged( 75 [in] LPCGUID NewGroupingParam, 76 [in] LPCGUID EventContext 77 ); 78 HRESULT OnStateChanged( 79 [in] AudioSessionState NewState 80 ); 81 HRESULT OnSessionDisconnected( 82 [in] AudioSessionDisconnectReason DisconnectReason 83 ); 84} 85 86[ 87 local, 88 uuid(f4b1a599-7266-4319-a8ca-e70acb11e8cd), 89 pointer_default(unique), 90 object 91] 92interface IAudioSessionControl : IUnknown 93{ 94 HRESULT GetState( 95 [out] AudioSessionState *pRetVal 96 ); 97 HRESULT GetDisplayName( 98 [string,out] LPWSTR *pRetVal 99 ); 100 HRESULT SetDisplayName( 101 [string,in] LPCWSTR DisplayName, 102 [unique,in] LPCGUID EventContext 103 ); 104 HRESULT GetIconPath( 105 [string,out] LPWSTR *pRetVal 106 ); 107 HRESULT SetIconPath( 108 [string,in] LPCWSTR Value, 109 [unique,in] LPCGUID EventContext 110 ); 111 HRESULT GetGroupingParam( 112 [out] GUID *pRetVal 113 ); 114 HRESULT SetGroupingParam( 115 [in] LPCGUID Override, 116 [unique,in] LPCGUID EventContext 117 ); 118 HRESULT RegisterAudioSessionNotification( 119 [in] IAudioSessionEvents *NewNotifications 120 ); 121 HRESULT UnregisterAudioSessionNotification( 122 [in] IAudioSessionEvents *NewNotifications 123 ); 124} 125 126[ 127 local, 128 uuid(bfb7ff88-7239-4fc9-8fa2-07c950be9c6d), 129 pointer_default(unique), 130 object 131] 132interface IAudioSessionControl2 : IAudioSessionControl 133{ 134 HRESULT GetSessionIdentifier( 135 [string,out] LPWSTR *pRetVal 136 ); 137 HRESULT GetSessionInstanceIdentifier( 138 [string,out] LPWSTR *pRetVal 139 ); 140 HRESULT GetProcessId( 141 [out] DWORD *pRetVal 142 ); 143 HRESULT IsSystemSoundsSession(void); 144 HRESULT SetDuckingPreferences( 145 [in] BOOL optOut 146 ); 147}; 148 149[ 150 local, 151 uuid(bfa971f1-4d5e-40bb-935e-967039bfbee4), 152 pointer_default(unique), 153 object 154] 155interface IAudioSessionManager : IUnknown 156{ 157 HRESULT GetAudioSessionControl( 158 [in] LPCGUID AudioSessionGuid, 159 [in] DWORD StreamFlags, 160 [out] IAudioSessionControl **SessionControl 161 ); 162 HRESULT GetSimpleAudioVolume( 163 [in] LPCGUID AudioSessionGuid, 164 [in] DWORD StreamFlags, 165 [out] ISimpleAudioVolume **AudioVolume 166 ); 167}; 168 169[ 170 local, 171 uuid(c3b284d4-6d39-4359-b3cf-b56ddb3bb39c), 172 pointer_default(unique), 173 object 174] 175interface IAudioVolumeDuckNotification : IUnknown 176{ 177 HRESULT OnVolumeDuckNotification( 178 [in] LPCWSTR sessionID, 179 [in] UINT32 countCommunicationSessions 180 ); 181 HRESULT OnVolumeUnduckNotification( 182 [in] LPCWSTR sessionID 183 ); 184}; 185 186[ 187 local, 188 uuid(641dd20b-4d41-49cc-aba3-174b9477bb08), 189 pointer_default(unique), 190 object 191] 192interface IAudioSessionNotification : IUnknown 193{ 194 HRESULT OnSessionCreated( 195 [in] IAudioSessionControl *NewSession 196 ); 197}; 198 199[ 200 local, 201 uuid(e2f5bb11-0570-40ca-acdd-3aa01277dee8), 202 pointer_default(unique), 203 object 204] 205interface IAudioSessionEnumerator : IUnknown 206{ 207 HRESULT GetCount( 208 [out] INT *SessionCount 209 ); 210 HRESULT GetSession( 211 [in] INT SessionCount, 212 [out] IAudioSessionControl **Session 213 ); 214}; 215 216[ 217 local, 218 uuid(77aa99a0-1bd6-484f-8bc7-2c654c9a9b6f), 219 pointer_default(unique), 220 object 221] 222interface IAudioSessionManager2 : IAudioSessionManager 223{ 224 HRESULT GetSessionEnumerator( 225 [retval,out] IAudioSessionEnumerator **SessionEnum 226 ); 227 HRESULT RegisterSessionNotification( 228 [in] IAudioSessionNotification *SessionNotification 229 ); 230 HRESULT UnregisterSessionNotification( 231 [in] IAudioSessionNotification *SessionNotification 232 ); 233 HRESULT RegisterDuckNotification( 234 [string,in] LPCWSTR sessionID, 235 [in] IAudioVolumeDuckNotification *duckNotification 236 ); 237 HRESULT UnregisterDuckNotification( 238 [in] IAudioVolumeDuckNotification *duckNotification 239 ); 240}; 241