Index: extensions/common/api/audio.idl |
diff --git a/extensions/common/api/audio.idl b/extensions/common/api/audio.idl |
index 0f088276c5da0c3eac0f310a4b46c9fb94d8f364..40a7943f184374f88e03a71161133851e2cb6d0f 100644 |
--- a/extensions/common/api/audio.idl |
+++ b/extensions/common/api/audio.idl |
@@ -44,16 +44,41 @@ namespace audio { |
double? gain; |
}; |
+ dictionary AudioDeviceInfo { |
+ // The unique identifier of the audio device. |
+ DOMString id; |
+ // True if the device is an input device; False if it is an output device. |
+ boolean isInput; |
+ // Display name of the device, (e.g. "Bose Amplifier"). |
+ DOMString displayName; |
+ // Device name of the device. |
+ DOMString deviceName; |
+ // True if the device is active. |
+ boolean isActive; |
+ // True if the device is muted. |
+ boolean isMuted; |
+ // Volume if this is an output device, Gain if this is an input device. |
+ double volumeGain; |
+ }; |
+ |
callback GetInfoCallback = void(OutputDeviceInfo[] outputInfo, |
InputDeviceInfo[] inputInfo); |
callback SetActiveDevicesCallback = void(); |
callback SetPropertiesCallback = void(); |
+ callback GetDeviceInfoCallback = void(AudioDeviceInfo[] deviceInfo); |
interface Functions { |
- // Get the information of all audio output and input devices. |
+ // Gets the information of all audio output and input devices. |
static void getInfo(GetInfoCallback callback); |
- // Select a subset of audio devices as active. |
+ // Sets the active nodes to the nodes specified by |ids|. |
+ // It can pass in the "complete" active node id list of either input |
+ // nodes, or output nodes, or both. If only input node ids are passed in, |
+ // it will only change the input nodes' active status, output nodes will NOT |
+ // be changed; similarly for the case if only output nodes are passed. |
+ // If the nodes specified in |new_active_ids| are already active, they will |
+ // remain active. Otherwise, the old active nodes will be de-activated before |
+ // we activate the new nodes with the same type(input/output). |
static void setActiveDevices(DOMString[] ids, |
SetActiveDevicesCallback callback); |
@@ -61,10 +86,18 @@ namespace audio { |
static void setProperties(DOMString id, |
DeviceProperties properties, |
SetPropertiesCallback callback); |
+ |
+ // Gets the information of all audio devices. |
+ static void getDeviceInfo(GetDeviceInfoCallback callback); |
}; |
interface Events { |
// Fired when anything changes to the audio device configuration. |
static void onDeviceChanged(); |
+ |
+ // Fired when output volume changes for a particular node. |
+ // |id|: id of the output node. |
+ // |volume|: new volume of the output node. |
+ static void OnOutputNodeVolumeChanged(DOMString id, double volume); |
}; |
}; |