다음을 통해 공유


IAudioSessionControl::GetLastInactivation

Previous Next

IAudioSessionControl::GetLastInactivation

The GetLastInactivation method retrieves the time at which the session last became inactive.

HRESULT GetLastInactivation(
  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

Client: Windows Vista

Header: Include Audiopolicy.h.

See Also

Previous Next