blob: 1528e0df238ac72671172e03d3e6d7a3354a87d8 [file] [log] [blame]
Mikhail Naganov40be06c2016-09-27 17:01:34 -07001/*
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
17package android.hardware.audio.effect@2.0;
18
19import android.hardware.audio.common@2.0;
20import IEffect;
21
22interface IEqualizerEffect extends IEffect {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070023 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070024 * Gets the number of frequency bands that the equalizer supports.
25 */
26 getNumBands() generates (Result retval, uint16_t numBands);
27
Andreas Huber40d3a9b2017-03-28 16:19:16 -070028 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070029 * Returns the minimum and maximum band levels supported.
30 */
31 getLevelRange()
Mikhail Naganov9f289042017-02-23 08:39:36 -080032 generates (Result retval, int16_t minLevel, int16_t maxLevel);
Mikhail Naganov40be06c2016-09-27 17:01:34 -070033
Andreas Huber40d3a9b2017-03-28 16:19:16 -070034 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070035 * Sets the gain for the given equalizer band.
36 */
Mikhail Naganov9f289042017-02-23 08:39:36 -080037 setBandLevel(uint16_t band, int16_t level) generates (Result retval);
Mikhail Naganov40be06c2016-09-27 17:01:34 -070038
Andreas Huber40d3a9b2017-03-28 16:19:16 -070039 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070040 * Gets the gain for the given equalizer band.
41 */
Mikhail Naganov9f289042017-02-23 08:39:36 -080042 getBandLevel(uint16_t band) generates (Result retval, int16_t level);
Mikhail Naganov40be06c2016-09-27 17:01:34 -070043
Andreas Huber40d3a9b2017-03-28 16:19:16 -070044 /**
Mikhail Naganov9f289042017-02-23 08:39:36 -080045 * Gets the center frequency of the given band, in milliHertz.
Mikhail Naganov40be06c2016-09-27 17:01:34 -070046 */
47 getBandCenterFrequency(uint16_t band)
Mikhail Naganov9f289042017-02-23 08:39:36 -080048 generates (Result retval, uint32_t centerFreqmHz);
Mikhail Naganov40be06c2016-09-27 17:01:34 -070049
Andreas Huber40d3a9b2017-03-28 16:19:16 -070050 /**
Mikhail Naganov9f289042017-02-23 08:39:36 -080051 * Gets the frequency range of the given frequency band, in milliHertz.
Mikhail Naganov40be06c2016-09-27 17:01:34 -070052 */
53 getBandFrequencyRange(uint16_t band)
Mikhail Naganov9f289042017-02-23 08:39:36 -080054 generates (Result retval, uint32_t minFreqmHz, uint32_t maxFreqmHz);
Mikhail Naganov40be06c2016-09-27 17:01:34 -070055
Andreas Huber40d3a9b2017-03-28 16:19:16 -070056 /**
Mikhail Naganov9f289042017-02-23 08:39:36 -080057 * Gets the band that has the most effect on the given frequency
58 * in milliHertz.
Mikhail Naganov40be06c2016-09-27 17:01:34 -070059 */
Mikhail Naganov9f289042017-02-23 08:39:36 -080060 getBandForFrequency(uint32_t freqmHz)
61 generates (Result retval, uint16_t band);
Mikhail Naganov40be06c2016-09-27 17:01:34 -070062
Andreas Huber40d3a9b2017-03-28 16:19:16 -070063 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070064 * Gets the names of all presets the equalizer supports.
65 */
66 getPresetNames() generates (Result retval, vec<string> names);
67
Andreas Huber40d3a9b2017-03-28 16:19:16 -070068 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070069 * Sets the current preset using the index of the preset in the names
70 * vector returned via 'getPresetNames'.
71 */
72 setCurrentPreset(uint16_t preset) generates (Result retval);
73
Andreas Huber40d3a9b2017-03-28 16:19:16 -070074 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070075 * Gets the current preset.
76 */
77 getCurrentPreset() generates (Result retval, uint16_t preset);
78
79 struct AllProperties {
80 uint16_t curPreset;
Mikhail Naganov9f289042017-02-23 08:39:36 -080081 vec<int16_t> bandLevels;
Mikhail Naganov40be06c2016-09-27 17:01:34 -070082 };
83
Andreas Huber40d3a9b2017-03-28 16:19:16 -070084 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070085 * Sets all properties at once.
86 */
87 setAllProperties(AllProperties properties) generates (Result retval);
88
Andreas Huber40d3a9b2017-03-28 16:19:16 -070089 /**
Mikhail Naganov40be06c2016-09-27 17:01:34 -070090 * Gets all properties at once.
91 */
92 getAllProperties() generates (Result retval, AllProperties properties);
93};