1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <android/hardware/audio/effect/7.0/IEqualizerEffect.h>
#include "Effect.h"
namespace android::hardware::audio::effect::V7_0::implementation {
class EqualizerEffect : public IEqualizerEffect {
public:
static const EffectDescriptor& getDescriptor();
EqualizerEffect();
// Methods from IEffect interface.
::android::hardware::Return<Result> init() override { return mEffect->init(); }
::android::hardware::Return<Result> setConfig(
const EffectConfig& config,
const ::android::sp<IEffectBufferProviderCallback>& inputBufferProvider,
const ::android::sp<IEffectBufferProviderCallback>& outputBufferProvider) override {
return mEffect->setConfig(config, inputBufferProvider, outputBufferProvider);
}
::android::hardware::Return<Result> reset() override { return mEffect->reset(); }
::android::hardware::Return<Result> enable() override { return mEffect->enable(); }
::android::hardware::Return<Result> disable() override { return mEffect->disable(); }
::android::hardware::Return<Result> setDevice(
const ::android::hardware::audio::common::V7_0::DeviceAddress& device) override {
return mEffect->setDevice(device);
}
::android::hardware::Return<void> setAndGetVolume(
const ::android::hardware::hidl_vec<uint32_t>& volumes,
setAndGetVolume_cb _hidl_cb) override {
return mEffect->setAndGetVolume(volumes, _hidl_cb);
}
::android::hardware::Return<Result> volumeChangeNotification(
const ::android::hardware::hidl_vec<uint32_t>& volumes) override {
return mEffect->volumeChangeNotification(volumes);
}
::android::hardware::Return<Result> setAudioMode(
::android::hardware::audio::common::V7_0::AudioMode mode) override {
return mEffect->setAudioMode(mode);
}
::android::hardware::Return<Result> setConfigReverse(
const EffectConfig& config,
const ::android::sp<IEffectBufferProviderCallback>& inputBufferProvider,
const ::android::sp<IEffectBufferProviderCallback>& outputBufferProvider) override {
return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider);
}
::android::hardware::Return<Result> setInputDevice(
const ::android::hardware::audio::common::V7_0::DeviceAddress& device) override {
return mEffect->setInputDevice(device);
}
::android::hardware::Return<void> getConfig(getConfig_cb _hidl_cb) override {
return mEffect->getConfig(_hidl_cb);
}
::android::hardware::Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override {
return mEffect->getConfigReverse(_hidl_cb);
}
::android::hardware::Return<void> getSupportedAuxChannelsConfigs(
uint32_t maxConfigs, getSupportedAuxChannelsConfigs_cb _hidl_cb) override {
return mEffect->getSupportedAuxChannelsConfigs(maxConfigs, _hidl_cb);
}
::android::hardware::Return<void> getAuxChannelsConfig(
getAuxChannelsConfig_cb _hidl_cb) override {
return mEffect->getAuxChannelsConfig(_hidl_cb);
}
::android::hardware::Return<Result> setAuxChannelsConfig(
const EffectAuxChannelsConfig& config) override {
return mEffect->setAuxChannelsConfig(config);
}
::android::hardware::Return<Result> setAudioSource(
const ::android::hardware::hidl_string& source) override {
return mEffect->setAudioSource(source);
}
::android::hardware::Return<Result> offload(const EffectOffloadParameter& param) override {
return mEffect->offload(param);
}
::android::hardware::Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override {
return mEffect->getDescriptor(_hidl_cb);
}
::android::hardware::Return<void> prepareForProcessing(
prepareForProcessing_cb _hidl_cb) override {
return mEffect->prepareForProcessing(_hidl_cb);
}
::android::hardware::Return<Result> setProcessBuffers(const AudioBuffer& inBuffer,
const AudioBuffer& outBuffer) override {
return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
::android::hardware::Return<void> command(uint32_t commandId,
const ::android::hardware::hidl_vec<uint8_t>& data,
uint32_t resultMaxSize,
command_cb _hidl_cb) override {
return mEffect->command(commandId, data, resultMaxSize, _hidl_cb);
}
::android::hardware::Return<Result> setParameter(
const ::android::hardware::hidl_vec<uint8_t>& parameter,
const ::android::hardware::hidl_vec<uint8_t>& value) override {
return mEffect->setParameter(parameter, value);
}
::android::hardware::Return<void> getParameter(
const ::android::hardware::hidl_vec<uint8_t>& parameter, uint32_t valueMaxSize,
getParameter_cb _hidl_cb) override {
return mEffect->getParameter(parameter, valueMaxSize, _hidl_cb);
}
::android::hardware::Return<void> getSupportedConfigsForFeature(
uint32_t featureId, uint32_t maxConfigs, uint32_t configSize,
getSupportedConfigsForFeature_cb _hidl_cb) override {
return mEffect->getSupportedConfigsForFeature(featureId, maxConfigs, configSize, _hidl_cb);
}
::android::hardware::Return<void> getCurrentConfigForFeature(
uint32_t featureId, uint32_t configSize,
getCurrentConfigForFeature_cb _hidl_cb) override {
return mEffect->getCurrentConfigForFeature(featureId, configSize, _hidl_cb);
}
::android::hardware::Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const ::android::hardware::hidl_vec<uint8_t>& configData) override {
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
::android::hardware::Return<Result> close() override { return mEffect->close(); }
// Methods from IEqualizerEffect interface.
::android::hardware::Return<void> getNumBands(getNumBands_cb _hidl_cb) override;
::android::hardware::Return<void> getLevelRange(getLevelRange_cb _hidl_cb) override;
::android::hardware::Return<Result> setBandLevel(uint16_t band, int16_t level) override;
::android::hardware::Return<void> getBandLevel(uint16_t band,
getBandLevel_cb _hidl_cb) override;
::android::hardware::Return<void> getBandCenterFrequency(
uint16_t band, getBandCenterFrequency_cb _hidl_cb) override;
::android::hardware::Return<void> getBandFrequencyRange(
uint16_t band, getBandFrequencyRange_cb _hidl_cb) override;
::android::hardware::Return<void> getBandForFrequency(uint32_t freq,
getBandForFrequency_cb _hidl_cb) override;
::android::hardware::Return<void> getPresetNames(getPresetNames_cb _hidl_cb) override;
::android::hardware::Return<Result> setCurrentPreset(uint16_t preset) override;
::android::hardware::Return<void> getCurrentPreset(getCurrentPreset_cb _hidl_cb) override;
::android::hardware::Return<Result> setAllProperties(
const IEqualizerEffect::AllProperties& properties) override;
::android::hardware::Return<void> getAllProperties(getAllProperties_cb _hidl_cb) override;
private:
static constexpr size_t kNumBands = 1;
static constexpr size_t kNumPresets = 1;
sp<Effect> mEffect;
IEqualizerEffect::AllProperties mProperties{};
};
} // namespace android::hardware::audio::effect::V7_0::implementation
|