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