Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Next MinVersion: 3 | 5 // Next MinVersion: 4 |
| 6 | 6 |
| 7 module arc.mojom; | 7 module arc.mojom; |
| 8 | 8 |
| 9 // Use same switch values as kernel switch events. | 9 // Use same switch values as kernel switch events. |
| 10 [Extensible] | 10 [Extensible] |
| 11 enum AudioSwitch { | 11 enum AudioSwitch { |
| 12 SW_HEADPHONE_INSERT = 0x02, | 12 SW_HEADPHONE_INSERT = 0x02, |
| 13 SW_MICROPHONE_INSERT = 0x04 | 13 SW_MICROPHONE_INSERT = 0x04 |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 // Next method ID:2 | |
| 16 interface AudioHost { | 17 interface AudioHost { |
| 17 // Tells the host to show the volume controls. | 18 // Tells the host to show the volume controls. |
| 18 ShowVolumeControls@0(); | 19 ShowVolumeControls@0(); |
| 20 | |
| 21 // Request that the volume be changed to |volume|. | |
| 22 // This is a privileged API and should only be used on whitelisted cases. | |
| 23 // |volume| is of the range [0, 100]. | |
| 24 [MinVersion=3] OnSystemVolumeUpdateRequest@1(float volume); | |
|
dcheng
2017/06/02 23:25:35
Nit: I would suggest calling this parameter |perce
yueli
2017/06/06 16:43:09
Done.
| |
| 19 }; | 25 }; |
| 20 | 26 |
| 21 // Next method ID: 3 | 27 // Next method ID: 3 |
| 22 interface AudioInstance { | 28 interface AudioInstance { |
| 23 // Establishes full-duplex communication with the host. | 29 // Establishes full-duplex communication with the host. |
| 24 [MinVersion=1] Init@1(AudioHost host); | 30 [MinVersion=1] Init@1(AudioHost host); |
| 25 | 31 |
| 26 // Notify plug states of headphone, microphone, etc. Each switch state is | 32 // Notify plug states of headphone, microphone, etc. Each switch state is |
| 27 // represented by the corresponding bit, if the bit is set then the switch | 33 // represented by the corresponding bit, if the bit is set then the switch |
| 28 // is plugged/inserted. | 34 // is plugged/inserted. |
| 29 NotifySwitchState@0(uint32 state); | 35 NotifySwitchState@0(uint32 state); |
| 30 | 36 |
| 31 // Notify volume and mute state. | 37 // Notify volume and mute state. |
| 32 // volume ranges from 0 to 100. | 38 // volume ranges from 0 to 100. |
| 33 // muted == true if audio is muted. | 39 // muted == true if audio is muted. |
| 34 [MinVersion=2] NotifyVolumeState@2(uint32 volume, bool muted); | 40 [MinVersion=2] NotifyVolumeState@2(uint32 volume, bool muted); |
| 35 }; | 41 }; |
| OLD | NEW |