| 1 | /* -*- Mode: C ; c-basic-offset: 2 -*- */ |
|---|
| 2 | /* |
|---|
| 3 | Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name> |
|---|
| 4 | |
|---|
| 5 | This program is free software; you can redistribute it and/or modify |
|---|
| 6 | it under the terms of the GNU General Public License as published by |
|---|
| 7 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | (at your option) any later version. |
|---|
| 9 | |
|---|
| 10 | This program is distributed in the hope that it will be useful, |
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | GNU General Public License for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU General Public License |
|---|
| 16 | along with this program; if not, write to the Free Software |
|---|
| 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef FILTER_H__D5DC5ADF_211A_48F6_93A5_68CD3B73D6C5__INCLUDED |
|---|
| 21 | #define FILTER_H__D5DC5ADF_211A_48F6_93A5_68CD3B73D6C5__INCLUDED |
|---|
| 22 | |
|---|
| 23 | typedef struct {int unused; } * filter_handle; |
|---|
| 24 | |
|---|
| 25 | #define GLOBAL_PARAMETER_ACTIVE 0 |
|---|
| 26 | #define GLOBAL_PARAMETER_GAIN 1 |
|---|
| 27 | #define GLOBAL_PARAMETERS_COUNT 2 |
|---|
| 28 | |
|---|
| 29 | #define BAND_PARAMETER_ACTIVE 0 |
|---|
| 30 | #define BAND_PARAMETER_FREQUENCY 1 |
|---|
| 31 | #define BAND_PARAMETER_BANDWIDTH 2 |
|---|
| 32 | #define BAND_PARAMETER_GAIN 3 |
|---|
| 33 | #define BAND_PARAMETERS_COUNT 4 |
|---|
| 34 | |
|---|
| 35 | bool |
|---|
| 36 | filter_create( |
|---|
| 37 | float sample_rate, |
|---|
| 38 | unsigned int bands_count, |
|---|
| 39 | filter_handle * handle_ptr); |
|---|
| 40 | |
|---|
| 41 | void |
|---|
| 42 | filter_connect_global_parameter( |
|---|
| 43 | filter_handle handle, |
|---|
| 44 | unsigned int global_parameter, |
|---|
| 45 | const float * value_ptr); |
|---|
| 46 | |
|---|
| 47 | void |
|---|
| 48 | filter_connect_band_parameter( |
|---|
| 49 | filter_handle handle, |
|---|
| 50 | unsigned int band_index, |
|---|
| 51 | unsigned int band_parameter, |
|---|
| 52 | const float * value_ptr); |
|---|
| 53 | |
|---|
| 54 | void |
|---|
| 55 | filter_run( |
|---|
| 56 | filter_handle handle, |
|---|
| 57 | const float * input_buffer, |
|---|
| 58 | float * output_buffer, |
|---|
| 59 | unsigned long samples_count); |
|---|
| 60 | |
|---|
| 61 | void |
|---|
| 62 | filter_destroy( |
|---|
| 63 | filter_handle handle); |
|---|
| 64 | |
|---|
| 65 | #endif /* #ifndef FILTER_H__D5DC5ADF_211A_48F6_93A5_68CD3B73D6C5__INCLUDED */ |
|---|