Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Unified Diff: chrome/common/extensions/api/audio.idl

Issue 13486004: Audio extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to trunk@195702 and fix conflicts. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/extension_manifest_constants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..081889cd14beff5a9271d3769d98db81e0a6d45f
--- /dev/null
+++ b/chrome/common/extensions/api/audio.idl
@@ -0,0 +1,69 @@
+// 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.
+ // TODO(hshi): as suggested by mpcomplete this should pass down the same
+ // data as GetInfoCallback. Implement this once we have getInfo working.
+ static void onDeviceChanged();
+ };
+};
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/extension_manifest_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698