Scott Randolph | 46bc128 | 2017-07-27 18:26:27 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.hardware.automotive.audiocontrol@1.0; |
| 18 | |
| 19 | import IAudioControlCallback; |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * Interacts with the car's audio subsystem to manage audio sources and volumes |
| 24 | */ |
| 25 | interface IAudioControl { |
| 26 | |
| 27 | /** |
| 28 | * Registers the required callback object so that we can be notified when the state |
| 29 | * of the car's audio system changes. This call must be made when the interface is |
| 30 | * initialized. |
| 31 | */ |
| 32 | setCallback(IAudioControlCallback notificationObject) |
| 33 | generates (AudioResult result); |
| 34 | |
| 35 | |
| 36 | /** |
| 37 | * Called at startup once per context to get the mapping from ContextNumber to |
| 38 | * busAddress. This lets the car tell the framework to which physical output stream |
| 39 | * each context should be routed. |
| 40 | * |
| 41 | * For every context, a valid bus number (0 - num busses-1) must be returned. If an |
| 42 | * unrecognized contextNumber is encountered, then -1 shall be returned. |
| 43 | * |
| 44 | * Any context for which an invalid busNumber is returned must be routed to bus 0. |
| 45 | */ |
| 46 | getBusForContext(uint32_t contextNumber) |
| 47 | generates (int32_t busNumber); |
| 48 | |
| 49 | |
| 50 | /** |
| 51 | * Control the right/left balance setting of the car speakers. |
| 52 | * |
| 53 | * This is intended to shift the speaker volume toward the right (+) or left (-) side of |
| 54 | * the car. 0.0 means "centered". +1.0 means fully right. -1.0 means fully left. |
| 55 | * |
| 56 | * A value outside the range -1 to 1 must be clamped by the implementation to the -1 to 1 |
| 57 | * range. |
| 58 | */ |
| 59 | oneway setBalanceTowardRight(float value); |
| 60 | |
| 61 | |
| 62 | /** |
| 63 | * Control the fore/aft fade setting of the car speakers. |
| 64 | * |
| 65 | * This is intended to shift the speaker volume toward the front (+) or back (-) of the car. |
| 66 | * 0.0 means "centered". +1.0 means fully forward. -1.0 means fully rearward. |
| 67 | * |
| 68 | * A value outside the range -1 to 1 must be clamped by the implementation to the -1 to 1 |
| 69 | * range. |
| 70 | */ |
| 71 | oneway setFadeTowardFront(float value); |
| 72 | }; |
| 73 | |