2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-12-12 10:22:26 -08:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2013-07-17 19:21:24 -07:00
|
|
|
[scriptable, builtinclass, uuid(60da41b4-cdc2-11e2-8a91-10bf48d64bd4)]
|
2011-12-12 10:22:26 -08:00
|
|
|
interface nsIAudioManager : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Microphone muted?
|
|
|
|
*/
|
|
|
|
attribute boolean microphoneMuted;
|
|
|
|
|
2012-09-19 10:51:35 -07:00
|
|
|
/**
|
|
|
|
* Are we playing audio from the FM radio?
|
|
|
|
*/
|
|
|
|
attribute boolean fmRadioAudioEnabled;
|
|
|
|
|
2011-12-12 10:22:26 -08:00
|
|
|
/**
|
|
|
|
* Set the phone's audio mode.
|
|
|
|
*/
|
|
|
|
const long PHONE_STATE_INVALID = -2;
|
|
|
|
const long PHONE_STATE_CURRENT = -1;
|
|
|
|
const long PHONE_STATE_NORMAL = 0;
|
|
|
|
const long PHONE_STATE_RINGTONE = 1;
|
|
|
|
const long PHONE_STATE_IN_CALL = 2;
|
|
|
|
const long PHONE_STATE_IN_COMMUNICATION = 3;
|
|
|
|
|
|
|
|
attribute long phoneState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure a particular device ("force") to be used for one of the uses
|
|
|
|
* (communication, media playback, etc.)
|
|
|
|
*/
|
|
|
|
const long FORCE_NONE = 0; // the default
|
|
|
|
const long FORCE_SPEAKER = 1;
|
|
|
|
const long FORCE_HEADPHONES = 2;
|
|
|
|
const long FORCE_BT_SCO = 3;
|
|
|
|
const long FORCE_BT_A2DP = 4;
|
|
|
|
const long FORCE_WIRED_ACCESSORY = 5;
|
|
|
|
const long FORCE_BT_CAR_DOCK = 6;
|
|
|
|
const long FORCE_BT_DESK_DOCK = 7;
|
|
|
|
|
|
|
|
const long USE_COMMUNICATION = 0;
|
|
|
|
const long USE_MEDIA = 1;
|
|
|
|
const long USE_RECORD = 2;
|
|
|
|
const long USE_DOCK = 3;
|
|
|
|
|
|
|
|
void setForceForUse(in long usage, in long force);
|
|
|
|
long getForceForUse(in long usage);
|
2012-11-02 02:36:46 -07:00
|
|
|
|
2013-07-17 22:22:36 -07:00
|
|
|
/* The range of volume index is from 0 to N. Ex: 0 ~ 15 */
|
|
|
|
void setAudioChannelVolume(in long channel, in long index);
|
|
|
|
long getAudioChannelVolume(in long channel);
|
|
|
|
long getMaxAudioChannelVolume(in long channel);
|
2011-12-12 10:22:26 -08:00
|
|
|
};
|