IAudioSessionControl::GetLastInactivation method
The GetLastInactivation method retrieves the time at which the session last became inactive.
Syntax
HRESULT GetLastInactivation(
[out] DATE *pRetVal
);
Parameters
- pRetVal [out]
Pointer to a caller-allocated DATE variable into which the method writes the date and time, in Universal Coordinated Time (UTC) format, of the last inactivation. For more information about DATE and UTC, see the Windows SDK documentation.
Return value
If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.
Return code | Description |
---|---|
E_POINTER | Parameter pRetVal is NULL. |
AUDCLNT_E_DEVICE_INVALIDATED | The audio endpoint device has been unplugged, or the audio hardware or associated hardware resources have been reconfigured, disabled, removed, or otherwise made unavailable for use. |
AUDCLNT_E_SERVICE_NOT_RUNNING | The Windows audio service is not running. |
Remarks
An audio session is active if it contains one or more active audio streams. An active stream is in the running state. An inactive stream is in the stopped state. A session becomes active when its first stream becomes active. A session becomes inactive when its last active stream becomes inactive. The session state changes to expired when the client destroys the last stream in the session by releasing all references to the stream object.
The client assigns a stream to a session when it calls the IAudioClient::Initialize method to create the stream.
The client can determine the time at which the session last became active by calling the IAudioSessionControl::GetLastActivation method. The client can determine whether the session is currently active or inactive by calling the IAudioSessionControl::GetState method.
Requirements
Minimum supported client |
Windows Vista [desktop apps | Windows Store apps] |
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
Header |
Audiopolicy.h |
See also
IAudioSessionControl Interface
IAudioSessionControl::GetLastActivation
IAudioSessionControl::GetState
Send comments about this topic to Microsoft
Build date: 10/12/2013