1/* 2 * Copyright (C) 2014 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#ifndef OFFLOAD_REVERB_H_ 18#define OFFLOAD_REVERB_H_ 19 20#include "bundle.h" 21 22#define REVERB_DEFAULT_PRESET REVERB_PRESET_NONE 23 24extern const effect_descriptor_t aux_env_reverb_descriptor; 25extern const effect_descriptor_t ins_env_reverb_descriptor; 26extern const effect_descriptor_t aux_preset_reverb_descriptor; 27extern const effect_descriptor_t ins_preset_reverb_descriptor; 28 29typedef struct reverb_settings_s { 30 int16_t roomLevel; 31 int16_t roomHFLevel; 32 uint32_t decayTime; 33 int16_t decayHFRatio; 34 int16_t reflectionsLevel; 35 uint32_t reflectionsDelay; 36 int16_t reverbLevel; 37 uint32_t reverbDelay; 38 int16_t diffusion; 39 int16_t density; 40} reverb_settings_t; 41 42typedef struct reverb_context_s { 43 effect_context_t common; 44 45 // Offload vars 46 struct mixer_ctl *ctl; 47 bool auxiliary; 48 bool preset; 49 uint16_t cur_preset; 50 uint16_t next_preset; 51 reverb_settings_t reverb_settings; 52 uint32_t device; 53 struct reverb_params offload_reverb; 54} reverb_context_t; 55 56 57void reverb_auxiliary_init(reverb_context_t *context); 58 59void reverb_preset_init(reverb_context_t *context); 60 61void reverb_insert_init(reverb_context_t *context); 62 63int reverb_get_parameter(effect_context_t *context, effect_param_t *p, 64 uint32_t *size); 65 66int reverb_set_parameter(effect_context_t *context, effect_param_t *p, 67 uint32_t size); 68 69int reverb_set_device(effect_context_t *context, uint32_t device); 70 71int reverb_reset(effect_context_t *context); 72 73int reverb_init(effect_context_t *context); 74 75int reverb_enable(effect_context_t *context); 76 77int reverb_disable(effect_context_t *context); 78 79int reverb_start(effect_context_t *context, output_context_t *output); 80 81int reverb_stop(effect_context_t *context, output_context_t *output); 82 83#endif /* OFFLOAD_REVERB_H_ */ 84