1 /* 2 * Copyright (c) 2013, The Linux Foundation. All rights reserved. 3 * Not a Contribution. 4 * 5 * Copyright (C) 2013 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 #ifndef OFFLOAD_REVERB_H_ 21 #define OFFLOAD_REVERB_H_ 22 23 #include "bundle.h" 24 25 #define REVERB_DEFAULT_PRESET REVERB_PRESET_NONE 26 27 extern const effect_descriptor_t aux_env_reverb_descriptor; 28 extern const effect_descriptor_t ins_env_reverb_descriptor; 29 extern const effect_descriptor_t aux_preset_reverb_descriptor; 30 extern const effect_descriptor_t ins_preset_reverb_descriptor; 31 32 typedef struct reverb_settings_s { 33 int16_t roomLevel; 34 int16_t roomHFLevel; 35 uint32_t decayTime; 36 int16_t decayHFRatio; 37 int16_t reflectionsLevel; 38 uint32_t reflectionsDelay; 39 int16_t reverbLevel; 40 uint32_t reverbDelay; 41 int16_t diffusion; 42 int16_t density; 43 } reverb_settings_t; 44 45 typedef struct reverb_context_s { 46 effect_context_t common; 47 48 // Offload vars 49 struct mixer_ctl *ctl; 50 bool auxiliary; 51 bool preset; 52 uint16_t cur_preset; 53 uint16_t next_preset; 54 reverb_settings_t reverb_settings; 55 uint32_t device; 56 struct reverb_params offload_reverb; 57 } reverb_context_t; 58 59 60 void reverb_auxiliary_init(reverb_context_t *context); 61 62 void reverb_preset_init(reverb_context_t *context); 63 64 int reverb_get_parameter(effect_context_t *context, effect_param_t *p, 65 uint32_t *size); 66 67 int reverb_set_parameter(effect_context_t *context, effect_param_t *p, 68 uint32_t size); 69 70 int reverb_set_device(effect_context_t *context, uint32_t device); 71 72 int reverb_reset(effect_context_t *context); 73 74 int reverb_init(effect_context_t *context); 75 76 int reverb_enable(effect_context_t *context); 77 78 int reverb_disable(effect_context_t *context); 79 80 int reverb_start(effect_context_t *context, output_context_t *output); 81 82 int reverb_stop(effect_context_t *context, output_context_t *output); 83 84 #endif /* OFFLOAD_REVERB_H_ */ 85