-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapi.h
More file actions
83 lines (72 loc) · 2.36 KB
/
mapi.h
File metadata and controls
83 lines (72 loc) · 2.36 KB
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 2025-2026 Filipe Coelho <falktx@falktx.com>
// SPDX-License-Identifier: ISC
#pragma once
#ifdef __cplusplus
extern "C" {
# define MAPI_API extern "C"
#else
# define MAPI_API
#endif
/* Define MAPI_EXPORT for exporting function symbols */
#ifdef _WIN32
# define MAPI_EXPORT MAPI_API __declspec (dllexport)
#else
# define MAPI_EXPORT MAPI_API __attribute__ ((visibility("default")))
#endif
/** Handle used through-out this API. */
typedef void* mapi_handle_t;
/**
Create an effect.
@param sample_rate Sample rate in Hz to use for the effect.
@param buffer_size Nominal/expected audio buffer size, can be smaller.
@return A handle for the new effect, or NULL if creation failed.
*/
MAPI_EXPORT
mapi_handle_t mapi_create(unsigned int sample_rate, unsigned int buffer_size);
/**
Process an effect.
@param handle A previously created effect.
@param ins An array of audio buffers used for audio input.
@param outs An array of audio buffers used for audio output.
@param frames How many frames to process.
@note Input and output buffers might share the same location in memory,
typically referred to as "in-place processing".
*/
MAPI_EXPORT
void mapi_process(mapi_handle_t handle,
const float* const* ins,
float** outs,
unsigned int frames);
/**
Get an effect parameter.
@param handle A previously created effect.
@param symbol A known parameter symbol for this effect, must not be NULL or empty.
@return value A full-ranged value.
*/
MAPI_EXPORT
float mapi_get_parameter(mapi_handle_t handle, const char* symbol);
/**
Set an effect parameter.
@param handle A previously created effect.
@param symbol A known parameter symbol for this effect, must not be NULL or empty.
@param value A full-ranged value.
*/
MAPI_EXPORT
void mapi_set_parameter(mapi_handle_t handle, const char* symbol, float value);
/**
Set an effect state, using strings for both key and value.
@param handle A previously created effect.
@param key A known key for this effect, must not be NULL or empty.
@param value A non-NULL value.
*/
MAPI_EXPORT
void mapi_set_state(mapi_handle_t handle, const char* key, const void* value);
/**
Destroy a previously created effect.
@param handle A previously created effect.
*/
MAPI_EXPORT
void mapi_destroy(mapi_handle_t handle);
#ifdef __cplusplus
}
#endif