2 * Core Audio audio policy definitions
4 * Copyright 2009 Maarten Lankhorst
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.
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.
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
22 cpp_quote
("#ifndef __audiopolicy_h__")
23 cpp_quote
("#define __audiopolicy_h__")
28 import
"audiosessiontypes.h";
29 import
"audioclient.idl";
31 interface IAudioSessionEvents
;
32 interface IAudioSessionControl
;
33 interface IAudioSessionControl2
;
34 interface IAudioSessionManager
;
35 interface IAudioVolumeDuckNotification
;
36 interface IAudioSessionNotification
;
37 interface IAudioSessionEnumerator
;
38 interface IAudioSessionManager2
;
40 typedef enum AudioSessionDisconnectReason
/*[local]*/
42 DisconnectReasonDeviceRemoval
= 0,
43 DisconnectReasonServerShutdown
,
44 DisconnectReasonFormatChanged
,
45 DisconnectReasonSessionLogoff
,
46 DisconnectReasonSessionDisconnected
,
47 DisconnectReasonExclusiveModeOverride
,
48 } AudioSessionDisconnectReason
;
52 uuid(24918acc
-64b3
-37c1
-8ca9
-74a66e9957a8
),
53 pointer_default(unique),
56 interface IAudioSessionEvents
: IUnknown
58 HRESULT OnDisplayNameChanged
(
59 [string,in] LPCWSTR NewDisplayName
,
60 [in] LPCGUID EventContext
62 HRESULT OnIconPathChanged
(
63 [string,in] LPCWSTR NewIconPath
,
64 [in] LPCGUID EventContext
66 HRESULT OnSimpleVolumeChanged
(
69 [in] LPCGUID EventContext
71 HRESULT OnChannelVolumeChanged
(
72 [in] DWORD ChannelCount
,
73 [size_is(ChannelCount
),in] float *NewChannelVolumeArray
,
74 [in] DWORD ChangedChannel
,
75 [in] LPCGUID EventContext
77 HRESULT OnGroupingParamChanged
(
78 [in] LPCGUID NewGroupingParam
,
79 [in] LPCGUID EventContext
81 HRESULT OnStateChanged
(
82 [in] AudioSessionState NewState
84 HRESULT OnSessionDisconnected
(
85 [in] AudioSessionDisconnectReason DisconnectReason
91 uuid(f4b1a599
-7266-4319-a8ca
-e70acb11e8cd
),
92 pointer_default(unique),
95 interface IAudioSessionControl
: IUnknown
98 [out] AudioSessionState
*pRetVal
100 HRESULT GetDisplayName
(
101 [string,out] LPWSTR
*pRetVal
103 HRESULT SetDisplayName
(
104 [string,in] LPCWSTR DisplayName
,
105 [unique,in] LPCGUID EventContext
108 [string,out] LPWSTR
*pRetVal
111 [string,in] LPCWSTR Value
,
112 [unique,in] LPCGUID EventContext
114 HRESULT GetGroupingParam
(
117 HRESULT SetGroupingParam
(
118 [in] LPCGUID Override
,
119 [unique,in] LPCGUID EventContext
121 HRESULT RegisterAudioSessionNotification
(
122 [in] IAudioSessionEvents
*NewNotifications
124 HRESULT UnregisterAudioSessionNotification
(
125 [in] IAudioSessionEvents
*NewNotifications
131 uuid(bfb7ff88
-7239-4fc9
-8fa2
-07c950be9c6d
),
132 pointer_default(unique),
135 interface IAudioSessionControl2
: IAudioSessionControl
137 HRESULT GetSessionIdentifier
(
138 [string,out] LPWSTR
*pRetVal
140 HRESULT GetSessionInstanceIdentifier
(
141 [string,out] LPWSTR
*pRetVal
143 HRESULT GetProcessId
(
146 HRESULT IsSystemSoundsSession
(void);
147 HRESULT SetDuckingPreferences
(
154 uuid(bfa971f1
-4d5e
-40bb
-935e-967039bfbee4
),
155 pointer_default(unique),
158 interface IAudioSessionManager
: IUnknown
160 HRESULT GetAudioSessionControl
(
161 [in] LPCGUID AudioSessionGuid
,
162 [in] DWORD StreamFlags
,
163 [out] IAudioSessionControl
**SessionControl
165 HRESULT GetSimpleAudioVolume
(
166 [in] LPCGUID AudioSessionGuid
,
167 [in] DWORD StreamFlags
,
168 [out] ISimpleAudioVolume
**AudioVolume
174 uuid(c3b284d4
-6d39
-4359-b3cf
-b56ddb3bb39c
),
175 pointer_default(unique),
178 interface IAudioVolumeDuckNotification
: IUnknown
180 HRESULT OnVolumeDuckNotification
(
181 [in] LPCWSTR sessionID
,
182 [in] UINT32 countCommunicationSessions
184 HRESULT OnVolumeUnduckNotification
(
185 [in] LPCWSTR sessionID
191 uuid(641dd20b
-4d41
-49cc
-aba3
-174b9477bb08
),
192 pointer_default(unique),
195 interface IAudioSessionNotification
: IUnknown
197 HRESULT OnSessionCreated
(
198 [in] IAudioSessionControl
*NewSession
204 uuid(e2f5bb11
-0570-40ca
-acdd
-3aa01277dee8
),
205 pointer_default(unique),
208 interface IAudioSessionEnumerator
: IUnknown
211 [out] INT *SessionCount
214 [in] INT SessionCount
,
215 [out] IAudioSessionControl
**Session
221 uuid(77aa99a0
-1bd6
-484f
-8bc7
-2c654c9a9b6f
),
222 pointer_default(unique),
225 interface IAudioSessionManager2
: IAudioSessionManager
227 HRESULT GetSessionEnumerator
(
228 [retval,out] IAudioSessionEnumerator
**SessionEnum
230 HRESULT RegisterSessionNotification
(
231 [in] IAudioSessionNotification
*SessionNotification
233 HRESULT UnregisterSessionNotification
(
234 [in] IAudioSessionNotification
*SessionNotification
236 HRESULT RegisterDuckNotification
(
237 [string,in] LPCWSTR sessionID
,
238 [in] IAudioVolumeDuckNotification
*duckNotification
240 HRESULT UnregisterDuckNotification
(
241 [in] IAudioVolumeDuckNotification
*duckNotification
245 cpp_quote
("#endif /*__audiopolicy_h__*/")