sessions dynamically removed
This commit is contained in:
parent
0dd016bb16
commit
5211b70669
9 changed files with 114 additions and 73 deletions
|
|
@ -71,57 +71,26 @@ HRESULT SessionStateCallback::OnGroupingParamChanged(LPCGUID NewGroupingParam, L
|
|||
}
|
||||
|
||||
HRESULT SessionStateCallback::OnStateChanged(AudioSessionState NewState) {
|
||||
/* enum _AudioSessionState {
|
||||
* AudioSessionStateInactive,
|
||||
* AudioSessionStateActive,
|
||||
* AudioSessionStateExpired
|
||||
* } AudioSessionState; */
|
||||
/*
|
||||
* char *pszState = "?????";
|
||||
*
|
||||
* switch (NewState)
|
||||
* {
|
||||
* case AudioSessionStateActive:
|
||||
* pszState = "active";
|
||||
* break;
|
||||
* case AudioSessionStateInactive:
|
||||
* pszState = "inactive";
|
||||
* break;
|
||||
* }
|
||||
* printf("New session state = %s\n", pszState);
|
||||
*/
|
||||
SessionState newState;// = sh->getState();
|
||||
switch (NewState) {
|
||||
case AudioSessionStateActive:
|
||||
newState = SessionState::ACTIVE;
|
||||
break;
|
||||
case AudioSessionStateInactive:
|
||||
newState = SessionState::INACTIVE;
|
||||
break;
|
||||
case AudioSessionStateExpired:
|
||||
newState = SessionState::EXPIRED;
|
||||
break;
|
||||
}
|
||||
|
||||
sh->reviseSessionShowing(newState);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT SessionStateCallback::OnSessionDisconnected(AudioSessionDisconnectReason DisconnectReason) {
|
||||
/*
|
||||
* char *pszReason = "?????";
|
||||
*
|
||||
* switch (DisconnectReason)
|
||||
* {
|
||||
* case DisconnectReasonDeviceRemoval:
|
||||
* pszReason = "device removed";
|
||||
* break;
|
||||
* case DisconnectReasonServerShutdown:
|
||||
* pszReason = "server shut down";
|
||||
* break;
|
||||
* case DisconnectReasonFormatChanged:
|
||||
* pszReason = "format changed";
|
||||
* break;
|
||||
* case DisconnectReasonSessionLogoff:
|
||||
* pszReason = "user logged off";
|
||||
* break;
|
||||
* case DisconnectReasonSessionDisconnected:
|
||||
* pszReason = "session disconnected";
|
||||
* break;
|
||||
* case DisconnectReasonExclusiveModeOverride:
|
||||
* pszReason = "exclusive-mode override";
|
||||
* break;
|
||||
* }
|
||||
* printf("Audio session disconnected (reason: %s)\n",
|
||||
* pszReason);
|
||||
*/
|
||||
|
||||
sh->setState(SessionState::DISCONNECTED);
|
||||
sh->reviseSessionShowing(SessionState::DISCONNECTED);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue