blob: 278f37b9cba28a403c8167b6c8b6a8504599c80d [file] [log] [blame]
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -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
Steven Morelandd6e4f032016-11-28 18:37:07 -080017#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
18#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070019
20#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h>
21#include <hidl/Status.h>
22
23#include <hidl/MQDescriptor.h>
24
25#include "Effect.h"
26
27namespace android {
28namespace hardware {
29namespace audio {
30namespace effect {
31namespace V2_0 {
32namespace implementation {
33
34using ::android::hardware::audio::effect::V2_0::IBassBoostEffect;
35using ::android::hardware::audio::effect::V2_0::Result;
36using ::android::hardware::Return;
37using ::android::hardware::Void;
38using ::android::hardware::hidl_vec;
39using ::android::hardware::hidl_string;
40using ::android::sp;
41
42struct BassBoostEffect : public IBassBoostEffect {
43 explicit BassBoostEffect(effect_handle_t handle);
44
45 // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
Kevin Rocard22505e62017-12-14 18:50:12 -080046 Return<Result> init() override;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070047 Return<Result> setConfig(
Kevin Rocard22505e62017-12-14 18:50:12 -080048 const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
49 const sp<IEffectBufferProviderCallback>& outputBufferProvider) override;
50 Return<Result> reset() override;
51 Return<Result> enable() override;
52 Return<Result> disable() override;
53 Return<Result> setDevice(AudioDevice device) override;
54 Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes,
55 setAndGetVolume_cb _hidl_cb) override;
56 Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override;
57 Return<Result> setAudioMode(AudioMode mode) override;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070058 Return<Result> setConfigReverse(
Kevin Rocard22505e62017-12-14 18:50:12 -080059 const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
60 const sp<IEffectBufferProviderCallback>& outputBufferProvider) override;
61 Return<Result> setInputDevice(AudioDevice device) override;
62 Return<void> getConfig(getConfig_cb _hidl_cb) override;
63 Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070064 Return<void> getSupportedAuxChannelsConfigs(
Kevin Rocard22505e62017-12-14 18:50:12 -080065 uint32_t maxConfigs, getSupportedAuxChannelsConfigs_cb _hidl_cb) override;
66 Return<void> getAuxChannelsConfig(getAuxChannelsConfig_cb _hidl_cb) override;
67 Return<Result> setAuxChannelsConfig(const EffectAuxChannelsConfig& config) override;
68 Return<Result> setAudioSource(AudioSource source) override;
69 Return<Result> offload(const EffectOffloadParameter& param) override;
70 Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
71 Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
72 Return<Result> setProcessBuffers(const AudioBuffer& inBuffer,
73 const AudioBuffer& outBuffer) override;
74 Return<void> command(uint32_t commandId, const hidl_vec<uint8_t>& data, uint32_t resultMaxSize,
75 command_cb _hidl_cb) override;
76 Return<Result> setParameter(const hidl_vec<uint8_t>& parameter,
77 const hidl_vec<uint8_t>& value) override;
78 Return<void> getParameter(const hidl_vec<uint8_t>& parameter, uint32_t valueMaxSize,
79 getParameter_cb _hidl_cb) override;
80 Return<void> getSupportedConfigsForFeature(uint32_t featureId, uint32_t maxConfigs,
81 uint32_t configSize,
82 getSupportedConfigsForFeature_cb _hidl_cb) override;
83 Return<void> getCurrentConfigForFeature(uint32_t featureId, uint32_t configSize,
84 getCurrentConfigForFeature_cb _hidl_cb) override;
85 Return<Result> setCurrentConfigForFeature(uint32_t featureId,
86 const hidl_vec<uint8_t>& configData) override;
87 Return<Result> close() override;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070088
89 // Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
Kevin Rocard22505e62017-12-14 18:50:12 -080090 Return<void> isStrengthSupported(isStrengthSupported_cb _hidl_cb) override;
91 Return<Result> setStrength(uint16_t strength) override;
92 Return<void> getStrength(getStrength_cb _hidl_cb) override;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070093
Kevin Rocard22505e62017-12-14 18:50:12 -080094 private:
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070095 sp<Effect> mEffect;
96
97 virtual ~BassBoostEffect();
98};
99
100} // namespace implementation
101} // namespace V2_0
102} // namespace effect
103} // namespace audio
104} // namespace hardware
105} // namespace android
106
Steven Morelandd6e4f032016-11-28 18:37:07 -0800107#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H