/* * 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 #include "Effect.h" namespace android::hardware::audio::effect::V7_0::implementation { class LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { public: static const EffectDescriptor& getDescriptor(); LoudnessEnhancerEffect(); // Methods from IEffect interface. ::android::hardware::Return init() override { return mEffect->init(); } ::android::hardware::Return setConfig( const EffectConfig& config, const ::android::sp& inputBufferProvider, const ::android::sp& outputBufferProvider) override { return mEffect->setConfig(config, inputBufferProvider, outputBufferProvider); } ::android::hardware::Return reset() override { return mEffect->reset(); } ::android::hardware::Return enable() override { return mEffect->enable(); } ::android::hardware::Return disable() override { return mEffect->disable(); } ::android::hardware::Return setDevice( const ::android::hardware::audio::common::V7_0::DeviceAddress& device) override { return mEffect->setDevice(device); } ::android::hardware::Return setAndGetVolume( const ::android::hardware::hidl_vec& volumes, setAndGetVolume_cb _hidl_cb) override { return mEffect->setAndGetVolume(volumes, _hidl_cb); } ::android::hardware::Return volumeChangeNotification( const ::android::hardware::hidl_vec& volumes) override { return mEffect->volumeChangeNotification(volumes); } ::android::hardware::Return setAudioMode( ::android::hardware::audio::common::V7_0::AudioMode mode) override { return mEffect->setAudioMode(mode); } ::android::hardware::Return setConfigReverse( const EffectConfig& config, const ::android::sp& inputBufferProvider, const ::android::sp& outputBufferProvider) override { return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } ::android::hardware::Return setInputDevice( const ::android::hardware::audio::common::V7_0::DeviceAddress& device) override { return mEffect->setInputDevice(device); } ::android::hardware::Return getConfig(getConfig_cb _hidl_cb) override { return mEffect->getConfig(_hidl_cb); } ::android::hardware::Return getConfigReverse(getConfigReverse_cb _hidl_cb) override { return mEffect->getConfigReverse(_hidl_cb); } ::android::hardware::Return getSupportedAuxChannelsConfigs( uint32_t maxConfigs, getSupportedAuxChannelsConfigs_cb _hidl_cb) override { return mEffect->getSupportedAuxChannelsConfigs(maxConfigs, _hidl_cb); } ::android::hardware::Return getAuxChannelsConfig( getAuxChannelsConfig_cb _hidl_cb) override { return mEffect->getAuxChannelsConfig(_hidl_cb); } ::android::hardware::Return setAuxChannelsConfig( const EffectAuxChannelsConfig& config) override { return mEffect->setAuxChannelsConfig(config); } ::android::hardware::Return setAudioSource( const ::android::hardware::hidl_string& source) override { return mEffect->setAudioSource(source); } ::android::hardware::Return offload(const EffectOffloadParameter& param) override { return mEffect->offload(param); } ::android::hardware::Return getDescriptor(getDescriptor_cb _hidl_cb) override { return mEffect->getDescriptor(_hidl_cb); } ::android::hardware::Return prepareForProcessing( prepareForProcessing_cb _hidl_cb) override { return mEffect->prepareForProcessing(_hidl_cb); } ::android::hardware::Return setProcessBuffers(const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override { return mEffect->setProcessBuffers(inBuffer, outBuffer); } ::android::hardware::Return command(uint32_t commandId, const ::android::hardware::hidl_vec& data, uint32_t resultMaxSize, command_cb _hidl_cb) override { return mEffect->command(commandId, data, resultMaxSize, _hidl_cb); } ::android::hardware::Return setParameter( const ::android::hardware::hidl_vec& parameter, const ::android::hardware::hidl_vec& value) override { return mEffect->setParameter(parameter, value); } ::android::hardware::Return getParameter( const ::android::hardware::hidl_vec& parameter, uint32_t valueMaxSize, getParameter_cb _hidl_cb) override { return mEffect->getParameter(parameter, valueMaxSize, _hidl_cb); } ::android::hardware::Return 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 getCurrentConfigForFeature( uint32_t featureId, uint32_t configSize, getCurrentConfigForFeature_cb _hidl_cb) override { return mEffect->getCurrentConfigForFeature(featureId, configSize, _hidl_cb); } ::android::hardware::Return setCurrentConfigForFeature( uint32_t featureId, const ::android::hardware::hidl_vec& configData) override { return mEffect->setCurrentConfigForFeature(featureId, configData); } ::android::hardware::Return close() override { return mEffect->close(); } // Methods from ILoudnessEnhancerEffect interface. ::android::hardware::Return setTargetGain(int32_t targetGainMb) override; ::android::hardware::Return getTargetGain(getTargetGain_cb _hidl_cb) override; private: sp mEffect; int32_t mTargetGainMb = 0; }; } // namespace android::hardware::audio::effect::V7_0::implementation