1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/system/gonk/nsIAudioManager.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +[scriptable, builtinclass, uuid(60da41b4-cdc2-11e2-8a91-10bf48d64bd4)] 1.11 +interface nsIAudioManager : nsISupports 1.12 +{ 1.13 + /** 1.14 + * Microphone muted? 1.15 + */ 1.16 + attribute boolean microphoneMuted; 1.17 + 1.18 + /** 1.19 + * Are we playing audio from the FM radio? 1.20 + */ 1.21 + attribute boolean fmRadioAudioEnabled; 1.22 + 1.23 + /** 1.24 + * Set the phone's audio mode. 1.25 + */ 1.26 + const long PHONE_STATE_INVALID = -2; 1.27 + const long PHONE_STATE_CURRENT = -1; 1.28 + const long PHONE_STATE_NORMAL = 0; 1.29 + const long PHONE_STATE_RINGTONE = 1; 1.30 + const long PHONE_STATE_IN_CALL = 2; 1.31 + const long PHONE_STATE_IN_COMMUNICATION = 3; 1.32 + 1.33 + attribute long phoneState; 1.34 + 1.35 + /** 1.36 + * Configure a particular device ("force") to be used for one of the uses 1.37 + * (communication, media playback, etc.) 1.38 + */ 1.39 + const long FORCE_NONE = 0; // the default 1.40 + const long FORCE_SPEAKER = 1; 1.41 + const long FORCE_HEADPHONES = 2; 1.42 + const long FORCE_BT_SCO = 3; 1.43 + const long FORCE_BT_A2DP = 4; 1.44 + const long FORCE_WIRED_ACCESSORY = 5; 1.45 + const long FORCE_BT_CAR_DOCK = 6; 1.46 + const long FORCE_BT_DESK_DOCK = 7; 1.47 + 1.48 + const long USE_COMMUNICATION = 0; 1.49 + const long USE_MEDIA = 1; 1.50 + const long USE_RECORD = 2; 1.51 + const long USE_DOCK = 3; 1.52 + 1.53 + void setForceForUse(in long usage, in long force); 1.54 + long getForceForUse(in long usage); 1.55 + 1.56 + /* The range of volume index is from 0 to N. Ex: 0 ~ 15 */ 1.57 + void setAudioChannelVolume(in long channel, in long index); 1.58 + long getAudioChannelVolume(in long channel); 1.59 + long getMaxAudioChannelVolume(in long channel); 1.60 +};