summaryrefslogtreecommitdiffstats
path: root/post_proc/reverb.h
blob: aba2b275c0d0eeab547ed07deb3687c94100b873 (plain)
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
/*
 * Copyright (C) 2014 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.
 */

#ifndef OFFLOAD_REVERB_H_
#define OFFLOAD_REVERB_H_

#include "bundle.h"

#define REVERB_DEFAULT_PRESET REVERB_PRESET_NONE

extern const effect_descriptor_t aux_env_reverb_descriptor;
extern const effect_descriptor_t ins_env_reverb_descriptor;
extern const effect_descriptor_t aux_preset_reverb_descriptor;
extern const effect_descriptor_t ins_preset_reverb_descriptor;

typedef struct reverb_settings_s {
    int16_t     roomLevel;
    int16_t     roomHFLevel;
    uint32_t    decayTime;
    int16_t     decayHFRatio;
    int16_t     reflectionsLevel;
    uint32_t    reflectionsDelay;
    int16_t     reverbLevel;
    uint32_t    reverbDelay;
    int16_t     diffusion;
    int16_t     density;
} reverb_settings_t;

typedef struct reverb_context_s {
    effect_context_t common;

    // Offload vars
    struct mixer_ctl *ctl;
    bool auxiliary;
    bool preset;
    uint16_t cur_preset;
    uint16_t next_preset;
    reverb_settings_t reverb_settings;
    uint32_t device;
    struct reverb_params offload_reverb;
} reverb_context_t;


void reverb_auxiliary_init(reverb_context_t *context);

void reverb_preset_init(reverb_context_t *context);

void reverb_insert_init(reverb_context_t *context);

int reverb_get_parameter(effect_context_t *context, effect_param_t *p,
                            uint32_t *size);

int reverb_set_parameter(effect_context_t *context, effect_param_t *p,
                            uint32_t size);

int reverb_set_device(effect_context_t *context,  uint32_t device);

int reverb_reset(effect_context_t *context);

int reverb_init(effect_context_t *context);

int reverb_enable(effect_context_t *context);

int reverb_disable(effect_context_t *context);

int reverb_start(effect_context_t *context, output_context_t *output);

int reverb_stop(effect_context_t *context, output_context_t *output);

#endif /* OFFLOAD_REVERB_H_ */