mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 889730 - Switch states of Headphone are not only On/Off but Headset/Headphone. r=baku
This commit is contained in:
parent
ac61c92192
commit
39359ecf3a
@ -41,13 +41,7 @@ AudioChannelManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
void
|
||||
AudioChannelManager::Notify(const SwitchEvent& aEvent)
|
||||
{
|
||||
if (aEvent.status() == SWITCH_STATE_ON ||
|
||||
aEvent.status() == SWITCH_STATE_HEADSET ||
|
||||
aEvent.status() == SWITCH_STATE_HEADPHONE) {
|
||||
mState = SWITCH_STATE_ON;
|
||||
} else {
|
||||
mState = SWITCH_STATE_OFF;
|
||||
}
|
||||
mState = aEvent.status();
|
||||
|
||||
DispatchTrustedEvent(NS_LITERAL_STRING("headphoneschange"));
|
||||
}
|
||||
|
@ -43,7 +43,8 @@ public:
|
||||
|
||||
bool Headphones() const
|
||||
{
|
||||
return mState == hal::SWITCH_STATE_ON;
|
||||
MOZ_ASSERT(mState != SWITCH_STATE_UNKNOWN);
|
||||
return mState != hal::SWITCH_STATE_OFF;
|
||||
}
|
||||
|
||||
IMPL_EVENT_HANDLER(headphoneschange)
|
||||
|
Loading…
Reference in New Issue
Block a user