Chromium Code Reviews| Index: chrome/common/extensions/api/audio.idl |
| diff --git a/chrome/common/extensions/api/audio.idl b/chrome/common/extensions/api/audio.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d9e188bcc4586cbc29035b75d4308c3bb855bb11 |
| --- /dev/null |
| +++ b/chrome/common/extensions/api/audio.idl |
| @@ -0,0 +1,67 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +namespace audio { |
| + |
| + dictionary OutputDeviceInfo { |
| + // The unique identifier of the audio output device. |
| + DOMString id; |
| + // The user-friendly name (e.g. "Bose Amplifier"). |
| + DOMString name; |
| + // True if this is the current active device. |
| + boolean isActive; |
| + // True if this is muted. |
| + boolean isMuted; |
| + // The output volume ranging from 0.0 to 1.0. |
| + double volume; |
| + }; |
| + |
| + dictionary InputDeviceInfo { |
| + // The unique identifier of the audio input device. |
| + DOMString id; |
| + // The user-friendly name (e.g. "USB Microphone"). |
| + DOMString name; |
| + // True if this is the current active device. |
| + boolean isActive; |
| + // True if this is muted. |
| + boolean isMuted; |
| + // The input gain ranging from 0.0 to 1.0. |
| + double gain; |
| + }; |
| + |
| + dictionary DeviceProperties { |
| + // True if this is muted. |
| + boolean isMuted; |
| + // If this is an output device then this field indicates the output volume. |
| + // If this is an input device then this field is ignored. |
| + double? volume; |
| + // If this is an input device then this field indicates the input gain. |
| + // If this is an output device then this field is ignored. |
| + double? gain; |
| + }; |
| + |
| + callback GetInfoCallback = void(OutputDeviceInfo[] outputInfo, |
| + InputDeviceInfo[] inputInfo); |
| + callback SetActiveDevicesCallback = void(); |
| + callback SetPropertiesCallback = void(); |
| + |
| + interface Functions { |
| + // Get the information of all audio output and input devices. |
| + static void getInfo(GetInfoCallback callback); |
| + |
| + // Select a subset of audio devices as active. |
| + static void setActiveDevices(DOMString[] ids, |
| + SetActiveDevicesCallback callback); |
| + |
| + // Sets the properties for the input or output device. |
| + static void setProperties(DOMString id, |
| + DeviceProperties properties, |
| + SetPropertiesCallback callback); |
| + }; |
| + |
| + interface Events { |
| + // Fired when anything changes to the audio device configuration. |
| + static void onDeviceChanged(); |
|
Matt Perry
2013/04/22 23:57:26
This should pass down the same data as the getInfo
hshi1
2013/04/23 00:07:34
This event is defined this way because it is not t
Matt Perry
2013/04/23 00:12:54
Maybe I don't understand how onDeviceChanged will
|
| + }; |
| +}; |