mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 708446 - Part 3: Implement mute and speaker. r=mrbkap a=khuey
This commit is contained in:
parent
221092b136
commit
984dca283f
@ -356,6 +356,20 @@ Telephony.prototype = {
|
||||
return call;
|
||||
},
|
||||
|
||||
get muted() {
|
||||
return this.telephone.microphoneMuted;
|
||||
},
|
||||
set muted(value) {
|
||||
this.telephone.microphoneMuted = value;
|
||||
},
|
||||
|
||||
get speakerOn() {
|
||||
return this.telephone.speakerEnabled;
|
||||
},
|
||||
set speakerOn(value) {
|
||||
this.telephone.speakerEnabled = value;
|
||||
},
|
||||
|
||||
// Additional stuff that's useful.
|
||||
|
||||
signalStrength: null,
|
||||
|
@ -40,13 +40,16 @@
|
||||
interface nsIDOMEventListener;
|
||||
interface mozIDOMTelephonyCall;
|
||||
|
||||
[scriptable, uuid(24371c72-1631-477d-b26e-f14db369bc22)]
|
||||
[scriptable, uuid(55b23b6e-ef31-4a30-bddb-15ce9274dad8)]
|
||||
interface mozIDOMTelephony : nsIDOMEventTarget {
|
||||
|
||||
readonly attribute jsval liveCalls;
|
||||
mozIDOMTelephonyCall dial(in DOMString number);
|
||||
attribute nsIDOMEventListener onincoming;
|
||||
|
||||
attribute boolean muted;
|
||||
attribute boolean speakerOn;
|
||||
|
||||
//XXX philikon's additions
|
||||
attribute nsIDOMEventListener onoperatorchange;
|
||||
attribute nsIDOMEventListener onradiostatechange;
|
||||
|
@ -48,7 +48,7 @@ interface nsITelephoneCallback : nsISupports {
|
||||
void onsignalstrengthchange(in jsval event);
|
||||
};
|
||||
|
||||
[scriptable, uuid(3d3deb80-fa5e-4e05-9153-91ee614f67d5)]
|
||||
[scriptable, uuid(f6baa721-665e-403e-8a98-acaa0d8bf267)]
|
||||
interface nsITelephone : nsISupports {
|
||||
|
||||
readonly attribute jsval currentState;
|
||||
@ -57,6 +57,8 @@ interface nsITelephone : nsISupports {
|
||||
void hangUp(in long callIndex);
|
||||
void answerCall();
|
||||
void rejectCall();
|
||||
attribute bool microphoneMuted;
|
||||
attribute bool speakerEnabled;
|
||||
|
||||
void registerCallback(in nsITelephoneCallback callback);
|
||||
void unregisterCallback(in nsITelephoneCallback callback);
|
||||
|
@ -242,6 +242,33 @@ nsTelephonyWorker.prototype = {
|
||||
this.worker.postMessage({type: "rejectCall"});
|
||||
},
|
||||
|
||||
get microphoneMuted() {
|
||||
return gAudioManager.microphoneMuted;
|
||||
},
|
||||
set microphoneMuted(value) {
|
||||
if (value == this.microphoneMuted) {
|
||||
return;
|
||||
}
|
||||
gAudioManager.phoneState = value ?
|
||||
Ci.nsIAudioManager.PHONE_STATE_IN_COMMUNICATION :
|
||||
Ci.nsIAudioManager.PHONE_STATE_IN_CALL; //XXX why is this needed?
|
||||
gAudioManager.microphoneMuted = value;
|
||||
},
|
||||
|
||||
get speakerEnabled() {
|
||||
return (gAudioManager.getForceForUse(Ci.nsIAudioManager.USE_COMMUNICATION)
|
||||
== Ci.nsIAudioManager.FORCE_SPEAKER);
|
||||
},
|
||||
set speakerEnabled(value) {
|
||||
if (value == this.speakerEnabled) {
|
||||
return;
|
||||
}
|
||||
gAudioManager.phoneState = Ci.nsIAudioManager.PHONE_STATE_IN_CALL; // XXX why is this needed?
|
||||
let force = value ? Ci.nsIAudioManager.FORCE_SPEAKER :
|
||||
Ci.nsIAudioManager.FORCE_NONE;
|
||||
gAudioManager.setForceUse(Ci.nsIAudioManager.USE_COMMUNICATION, force);
|
||||
},
|
||||
|
||||
_callbacks: null,
|
||||
|
||||
registerCallback: function registerCallback(callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user