Mikhail Naganov | 40be06c | 2016-09-27 17:01:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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.audio.effect@2.0; |
| 18 | |
| 19 | import android.hardware.audio.common@2.0; |
| 20 | import IEffect; |
| 21 | |
| 22 | interface IEqualizerEffect extends IEffect { |
| 23 | /* |
| 24 | * Gets the number of frequency bands that the equalizer supports. |
| 25 | */ |
| 26 | getNumBands() generates (Result retval, uint16_t numBands); |
| 27 | |
| 28 | /* |
| 29 | * Returns the minimum and maximum band levels supported. |
| 30 | */ |
| 31 | getLevelRange() |
| 32 | generates (Result retval, uint16_t minLevel, uint16_t maxLevel); |
| 33 | |
| 34 | /* |
| 35 | * Sets the gain for the given equalizer band. |
| 36 | */ |
| 37 | setBandLevel(uint16_t band, uint16_t level) generates (Result retval); |
| 38 | |
| 39 | /* |
| 40 | * Gets the gain for the given equalizer band. |
| 41 | */ |
| 42 | getBandLevel(uint16_t band) generates (Result retval, uint16_t level); |
| 43 | |
| 44 | /* |
| 45 | * Gets the center frequency of the given band. |
| 46 | */ |
| 47 | getBandCenterFrequency(uint16_t band) |
| 48 | generates (Result retval, uint32_t centerFreq); |
| 49 | |
| 50 | /* |
| 51 | * Gets the frequency range of the given frequency band. |
| 52 | */ |
| 53 | getBandFrequencyRange(uint16_t band) |
| 54 | generates (Result retval, uint32_t minFreqHz, uint32_t maxFreqHz); |
| 55 | |
| 56 | /* |
| 57 | * Gets the band that has the most effect on the given frequency. |
| 58 | */ |
| 59 | getBandForFrequency(uint32_t freq) generates (Result retval, uint16_t band); |
| 60 | |
| 61 | /* |
| 62 | * Gets the names of all presets the equalizer supports. |
| 63 | */ |
| 64 | getPresetNames() generates (Result retval, vec<string> names); |
| 65 | |
| 66 | /* |
| 67 | * Sets the current preset using the index of the preset in the names |
| 68 | * vector returned via 'getPresetNames'. |
| 69 | */ |
| 70 | setCurrentPreset(uint16_t preset) generates (Result retval); |
| 71 | |
| 72 | /* |
| 73 | * Gets the current preset. |
| 74 | */ |
| 75 | getCurrentPreset() generates (Result retval, uint16_t preset); |
| 76 | |
| 77 | struct AllProperties { |
| 78 | uint16_t curPreset; |
| 79 | vec<uint16_t> bandLevels; |
| 80 | }; |
| 81 | |
| 82 | /* |
| 83 | * Sets all properties at once. |
| 84 | */ |
| 85 | setAllProperties(AllProperties properties) generates (Result retval); |
| 86 | |
| 87 | /* |
| 88 | * Gets all properties at once. |
| 89 | */ |
| 90 | getAllProperties() generates (Result retval, AllProperties properties); |
| 91 | }; |