Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 namespace audio { | |
| 6 | |
| 7 dictionary OutputDeviceInfo { | |
| 8 // The unique identifier of the audio output device. | |
| 9 DOMString id; | |
| 10 // The user-friendly name (e.g. "Bose Amplifier"). | |
| 11 DOMString name; | |
| 12 // True if this is the current active device. | |
| 13 boolean isActive; | |
| 14 // True if this is muted. | |
| 15 boolean isMuted; | |
| 16 // The output volume ranging from 0.0 to 1.0. | |
| 17 double volume; | |
| 18 }; | |
| 19 | |
| 20 dictionary InputDeviceInfo { | |
| 21 // The unique identifier of the audio input device. | |
| 22 DOMString id; | |
| 23 // The user-friendly name (e.g. "USB Microphone"). | |
| 24 DOMString name; | |
| 25 // True if this is the current active device. | |
| 26 boolean isActive; | |
| 27 // True if this is muted. | |
| 28 boolean isMuted; | |
| 29 // The input gain ranging from 0.0 to 1.0. | |
| 30 double gain; | |
| 31 }; | |
| 32 | |
| 33 dictionary DeviceProperties { | |
| 34 // True if this is muted. | |
| 35 boolean isMuted; | |
| 36 // If this is an output device then this field indicates the output volume. | |
| 37 // If this is an input device then this field is ignored. | |
| 38 double? volume; | |
| 39 // If this is an input device then this field indicates the input gain. | |
| 40 // If this is an output device then this field is ignored. | |
| 41 double? gain; | |
| 42 }; | |
| 43 | |
| 44 callback GetInfoCallback = void(OutputDeviceInfo[] outputInfo, | |
| 45 InputDeviceInfo[] inputInfo); | |
| 46 callback SetActiveDevicesCallback = void(); | |
| 47 callback SetPropertiesCallback = void(); | |
| 48 | |
| 49 interface Functions { | |
| 50 // Get the information of all audio output and input devices. | |
| 51 static void getInfo(GetInfoCallback callback); | |
| 52 | |
| 53 // Select a subset of audio devices as active. | |
| 54 static void setActiveDevices(DOMString[] ids, | |
| 55 SetActiveDevicesCallback callback); | |
| 56 | |
| 57 // Sets the properties for the input or output device. | |
| 58 static void setProperties(DOMString id, | |
| 59 DeviceProperties properties, | |
| 60 SetPropertiesCallback callback); | |
| 61 }; | |
| 62 | |
| 63 interface Events { | |
| 64 // Fired when anything changes to the audio device configuration. | |
| 65 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
| |
| 66 }; | |
| 67 }; | |
| OLD | NEW |