Skip to content

Commit ac5ccdb

Browse files
committed
Renamed module
1 parent a950349 commit ac5ccdb

File tree

14 files changed

+232
-223
lines changed

14 files changed

+232
-223
lines changed

py/circuitpy_defns.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ifeq ($(CIRCUITPY_AUDIOCORE),1)
132132
SRC_PATTERNS += audiocore/%
133133
endif
134134
ifeq ($(CIRCUITPY_AUDIOEFFECTS),1)
135-
SRC_PATTERNS += audioeffects/%
135+
SRC_PATTERNS += audiodelays/%
136136
endif
137137
ifeq ($(CIRCUITPY_AUDIOMIXER),1)
138138
SRC_PATTERNS += audiomixer/%
@@ -620,8 +620,8 @@ SRC_SHARED_MODULE_ALL = \
620620
audiocore/RawSample.c \
621621
audiocore/WaveFile.c \
622622
audiocore/__init__.c \
623-
audioeffects/Echo.c \
624-
audioeffects/__init__.c \
623+
audiodelays/Echo.c \
624+
audiodelays/__init__.c \
625625
audioio/__init__.c \
626626
audiomixer/Mixer.c \
627627
audiomixer/MixerVoice.c \
@@ -862,7 +862,6 @@ $(filter $(SRC_PATTERNS), \
862862
displayio/display_core.c \
863863
os/getenv.c \
864864
usb/utf16le.c \
865-
audioeffects/effects_utils.c \
866865
)
867866

868867
SRC_COMMON_HAL_INTERNAL = \

py/circuitpy_mpconfig.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ CFLAGS += -DCIRCUITPY_AUDIOCORE_DEBUG=$(CIRCUITPY_AUDIOCORE_DEBUG)
141141
CIRCUITPY_AUDIOMP3 ?= $(call enable-if-all,$(CIRCUITPY_FULL_BUILD) $(CIRCUITPY_AUDIOCORE))
142142
CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3)
143143

144-
CIRCUITPY_AUDIOEFFECTS ?= 0
145-
CFLAGS += -DCIRCUITPY_AUDIOEFFECTS=$(CIRCUITPY_AUDIOEFFECTS)
144+
CIRCUITPY_AUDIODELAYS ?= 0
145+
CFLAGS += -DCIRCUITPY_AUDIODELAYS=$(CIRCUITPY_AUDIODELAYS)
146146

147147
CIRCUITPY_AURORA_EPAPER ?= 0
148148
CFLAGS += -DCIRCUITPY_AURORA_EPAPER=$(CIRCUITPY_AURORA_EPAPER)

shared-bindings/audioeffects/Echo.c renamed to shared-bindings/audiodelays/Echo.c

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#include <stdint.h>
88

9-
#include "shared-bindings/audioeffects/Echo.h"
10-
#include "shared-module/audioeffects/Echo.h"
9+
#include "shared-bindings/audiodelays/Echo.h"
10+
#include "shared-module/audiodelays/Echo.h"
1111

1212
#include "shared/runtime/context_manager_helpers.h"
1313
#include "py/binary.h"
@@ -20,7 +20,7 @@
2020
//| class Echo:
2121
//| """An Echo effect"""
2222
//|
23-
static mp_obj_t audioeffects_echo_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
23+
static mp_obj_t audiodelays_echo_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
2424
enum { ARG_delay_ms, ARG_decay, ARG_buffer_size, ARG_sample_rate, ARG_bits_per_sample, ARG_samples_signed, ARG_channel_count, };
2525
static const mp_arg_t allowed_args[] = {
2626
{ MP_QSTR_delay_ms, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 50 } },
@@ -49,24 +49,24 @@ static mp_obj_t audioeffects_echo_make_new(const mp_obj_type_t *type, size_t n_a
4949
mp_raise_ValueError(MP_ERROR_TEXT("bits_per_sample must be 8 or 16"));
5050
}
5151

52-
audioeffects_echo_obj_t *self = mp_obj_malloc(audioeffects_echo_obj_t, &audioeffects_echo_type);
53-
common_hal_audioeffects_echo_construct(self, delay_ms, decay, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate);
52+
audiodelays_echo_obj_t *self = mp_obj_malloc(audiodelays_echo_obj_t, &audiodelays_echo_type);
53+
common_hal_audiodelays_echo_construct(self, delay_ms, decay, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate);
5454

5555
return MP_OBJ_FROM_PTR(self);
5656
}
5757

5858
//| def deinit(self) -> None:
5959
//| """Deinitialises the Echo and releases any hardware resources for reuse."""
6060
//| ...
61-
static mp_obj_t audioeffects_echo_deinit(mp_obj_t self_in) {
62-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
63-
common_hal_audioeffects_echo_deinit(self);
61+
static mp_obj_t audiodelays_echo_deinit(mp_obj_t self_in) {
62+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
63+
common_hal_audiodelays_echo_deinit(self);
6464
return mp_const_none;
6565
}
66-
static MP_DEFINE_CONST_FUN_OBJ_1(audioeffects_echo_deinit_obj, audioeffects_echo_deinit);
66+
static MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_deinit_obj, audiodelays_echo_deinit);
6767

68-
static void check_for_deinit(audioeffects_echo_obj_t *self) {
69-
if (common_hal_audioeffects_echo_deinited(self)) {
68+
static void check_for_deinit(audiodelays_echo_obj_t *self) {
69+
if (common_hal_audiodelays_echo_deinited(self)) {
7070
raise_deinited_error();
7171
}
7272
}
@@ -80,61 +80,61 @@ static void check_for_deinit(audioeffects_echo_obj_t *self) {
8080
//| """Automatically deinitializes the hardware when exiting a context. See
8181
//| :ref:`lifetime-and-contextmanagers` for more info."""
8282
//| ...
83-
static mp_obj_t audioeffects_echo_obj___exit__(size_t n_args, const mp_obj_t *args) {
83+
static mp_obj_t audiodelays_echo_obj___exit__(size_t n_args, const mp_obj_t *args) {
8484
(void)n_args;
85-
common_hal_audioeffects_echo_deinit(args[0]);
85+
common_hal_audiodelays_echo_deinit(args[0]);
8686
return mp_const_none;
8787
}
88-
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioeffects_echo___exit___obj, 4, 4, audioeffects_echo_obj___exit__);
88+
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiodelays_echo___exit___obj, 4, 4, audiodelays_echo_obj___exit__);
8989

9090

9191
//| delay_ms: int
9292
//| """Delay of the echo in microseconds. (read-only)"""
9393
//|
94-
static mp_obj_t audioeffects_echo_obj_get_delay_ms(mp_obj_t self_in) {
95-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
94+
static mp_obj_t audiodelays_echo_obj_get_delay_ms(mp_obj_t self_in) {
95+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
9696

97-
return mp_obj_new_float(common_hal_audioeffects_echo_get_delay_ms(self));
97+
return mp_obj_new_float(common_hal_audiodelays_echo_get_delay_ms(self));
9898

9999
}
100-
MP_DEFINE_CONST_FUN_OBJ_1(audioeffects_echo_get_delay_ms_obj, audioeffects_echo_obj_get_delay_ms);
100+
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_delay_ms_obj, audiodelays_echo_obj_get_delay_ms);
101101

102-
static mp_obj_t audioeffects_echo_obj_set_delay_ms(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
102+
static mp_obj_t audiodelays_echo_obj_set_delay_ms(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
103103
enum { ARG_delay_ms };
104104
static const mp_arg_t allowed_args[] = {
105105
{ MP_QSTR_delay_ms, MP_ARG_INT | MP_ARG_REQUIRED, {} },
106106
};
107-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
107+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
108108
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
109109
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
110110

111111
mp_int_t delay_ms = mp_arg_validate_int_range(args[ARG_delay_ms].u_int, 1, 4000, MP_QSTR_delay_ms);
112112

113-
common_hal_audioeffects_echo_set_delay_ms(self, delay_ms);
113+
common_hal_audiodelays_echo_set_delay_ms(self, delay_ms);
114114

115115
return mp_const_none;
116116
}
117-
MP_DEFINE_CONST_FUN_OBJ_KW(audioeffects_echo_set_delay_ms_obj, 1, audioeffects_echo_obj_set_delay_ms);
117+
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_set_delay_ms_obj, 1, audiodelays_echo_obj_set_delay_ms);
118118

119-
MP_PROPERTY_GETSET(audioeffects_echo_delay_ms_obj,
120-
(mp_obj_t)&audioeffects_echo_get_delay_ms_obj,
121-
(mp_obj_t)&audioeffects_echo_set_delay_ms_obj);
119+
MP_PROPERTY_GETSET(audiodelays_echo_delay_ms_obj,
120+
(mp_obj_t)&audiodelays_echo_get_delay_ms_obj,
121+
(mp_obj_t)&audiodelays_echo_set_delay_ms_obj);
122122

123123

124124

125125
//| decay: float
126126
//| """The rate the echo decays between 0 and 1."""
127-
static mp_obj_t audioeffects_echo_obj_get_decay(mp_obj_t self_in) {
128-
return mp_obj_new_float(common_hal_audioeffects_echo_get_decay(self_in));
127+
static mp_obj_t audiodelays_echo_obj_get_decay(mp_obj_t self_in) {
128+
return mp_obj_new_float(common_hal_audiodelays_echo_get_decay(self_in));
129129
}
130-
MP_DEFINE_CONST_FUN_OBJ_1(audioeffects_echo_get_decay_obj, audioeffects_echo_obj_get_decay);
130+
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_decay_obj, audiodelays_echo_obj_get_decay);
131131

132-
static mp_obj_t audioeffects_echo_obj_set_decay(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
132+
static mp_obj_t audiodelays_echo_obj_set_decay(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
133133
enum { ARG_decay };
134134
static const mp_arg_t allowed_args[] = {
135135
{ MP_QSTR_decay, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
136136
};
137-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
137+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
138138
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
139139
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
140140

@@ -144,28 +144,28 @@ static mp_obj_t audioeffects_echo_obj_set_decay(size_t n_args, const mp_obj_t *p
144144
mp_raise_ValueError(MP_ERROR_TEXT("decay must be between 0 and 1"));
145145
}
146146

147-
common_hal_audioeffects_echo_set_decay(self, decay);
147+
common_hal_audiodelays_echo_set_decay(self, decay);
148148

149149
return mp_const_none;
150150
}
151-
MP_DEFINE_CONST_FUN_OBJ_KW(audioeffects_echo_set_decay_obj, 1, audioeffects_echo_obj_set_decay);
151+
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_set_decay_obj, 1, audiodelays_echo_obj_set_decay);
152152

153-
MP_PROPERTY_GETSET(audioeffects_echo_decay_obj,
154-
(mp_obj_t)&audioeffects_echo_get_decay_obj,
155-
(mp_obj_t)&audioeffects_echo_set_decay_obj);
153+
MP_PROPERTY_GETSET(audiodelays_echo_decay_obj,
154+
(mp_obj_t)&audiodelays_echo_get_decay_obj,
155+
(mp_obj_t)&audiodelays_echo_set_decay_obj);
156156

157157

158158
//| playing: bool
159159
//| """True when any voice is being output. (read-only)"""
160-
static mp_obj_t audioeffects_echo_obj_get_playing(mp_obj_t self_in) {
161-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
160+
static mp_obj_t audiodelays_echo_obj_get_playing(mp_obj_t self_in) {
161+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
162162
check_for_deinit(self);
163-
return mp_obj_new_bool(common_hal_audioeffects_echo_get_playing(self));
163+
return mp_obj_new_bool(common_hal_audiodelays_echo_get_playing(self));
164164
}
165-
MP_DEFINE_CONST_FUN_OBJ_1(audioeffects_echo_get_playing_obj, audioeffects_echo_obj_get_playing);
165+
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_playing_obj, audiodelays_echo_obj_get_playing);
166166

167-
MP_PROPERTY_GETTER(audioeffects_echo_playing_obj,
168-
(mp_obj_t)&audioeffects_echo_get_playing_obj);
167+
MP_PROPERTY_GETTER(audiodelays_echo_playing_obj,
168+
(mp_obj_t)&audiodelays_echo_get_playing_obj);
169169

170170
//| def play(
171171
//| self, sample: circuitpython_typing.AudioSample, *, voice: int = 0, loop: bool = False
@@ -177,69 +177,69 @@ MP_PROPERTY_GETTER(audioeffects_echo_playing_obj,
177177
//|
178178
//| The sample must match the Effect's encoding settings given in the constructor."""
179179
//| ...
180-
static mp_obj_t audioeffects_echo_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
180+
static mp_obj_t audiodelays_echo_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
181181
enum { ARG_sample, ARG_loop };
182182
static const mp_arg_t allowed_args[] = {
183183
{ MP_QSTR_sample, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
184184
{ MP_QSTR_loop, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
185185
};
186-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
186+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
187187
check_for_deinit(self);
188188
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
189189
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
190190

191191

192192
mp_obj_t sample = args[ARG_sample].u_obj;
193-
common_hal_audioeffects_echo_play(self, sample, args[ARG_loop].u_bool);
193+
common_hal_audiodelays_echo_play(self, sample, args[ARG_loop].u_bool);
194194

195195
return mp_const_none;
196196
}
197-
MP_DEFINE_CONST_FUN_OBJ_KW(audioeffects_echo_play_obj, 1, audioeffects_echo_obj_play);
197+
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_play_obj, 1, audiodelays_echo_obj_play);
198198

199199
//| def stop_voice(self, voice: int = 0) -> None:
200200
//| """Stops playback of the sample."""
201201
//| ...
202202
//|
203-
static mp_obj_t audioeffects_echo_obj_stop(mp_obj_t self_in) {
204-
audioeffects_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
203+
static mp_obj_t audiodelays_echo_obj_stop(mp_obj_t self_in) {
204+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
205205

206-
common_hal_audioeffects_echo_stop(self);
206+
common_hal_audiodelays_echo_stop(self);
207207
return mp_const_none;
208208
}
209-
MP_DEFINE_CONST_FUN_OBJ_1(audioeffects_echo_stop_obj, audioeffects_echo_obj_stop);
209+
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_stop_obj, audiodelays_echo_obj_stop);
210210

211211

212212

213-
static const mp_rom_map_elem_t audioeffects_echo_locals_dict_table[] = {
213+
static const mp_rom_map_elem_t audiodelays_echo_locals_dict_table[] = {
214214
// Methods
215-
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audioeffects_echo_deinit_obj) },
215+
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiodelays_echo_deinit_obj) },
216216
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },
217-
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audioeffects_echo___exit___obj) },
218-
{ MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audioeffects_echo_play_obj) },
219-
{ MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&audioeffects_echo_stop_obj) },
217+
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audiodelays_echo___exit___obj) },
218+
{ MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiodelays_echo_play_obj) },
219+
{ MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&audiodelays_echo_stop_obj) },
220220

221221
// Properties
222-
{ MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audioeffects_echo_playing_obj) },
223-
{ MP_ROM_QSTR(MP_QSTR_delay_ms), MP_ROM_PTR(&audioeffects_echo_delay_ms_obj) },
224-
{ MP_ROM_QSTR(MP_QSTR_decay), MP_ROM_PTR(&audioeffects_echo_decay_obj) },
222+
{ MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audiodelays_echo_playing_obj) },
223+
{ MP_ROM_QSTR(MP_QSTR_delay_ms), MP_ROM_PTR(&audiodelays_echo_delay_ms_obj) },
224+
{ MP_ROM_QSTR(MP_QSTR_decay), MP_ROM_PTR(&audiodelays_echo_decay_obj) },
225225
};
226-
static MP_DEFINE_CONST_DICT(audioeffects_echo_locals_dict, audioeffects_echo_locals_dict_table);
226+
static MP_DEFINE_CONST_DICT(audiodelays_echo_locals_dict, audiodelays_echo_locals_dict_table);
227227

228-
static const audiosample_p_t audioeffects_echo_proto = {
228+
static const audiosample_p_t audiodelays_echo_proto = {
229229
MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample)
230-
.sample_rate = (audiosample_sample_rate_fun)common_hal_audioeffects_echo_get_sample_rate,
231-
.bits_per_sample = (audiosample_bits_per_sample_fun)common_hal_audioeffects_echo_get_bits_per_sample,
232-
.channel_count = (audiosample_channel_count_fun)common_hal_audioeffects_echo_get_channel_count,
233-
.reset_buffer = (audiosample_reset_buffer_fun)audioeffects_echo_reset_buffer,
234-
.get_buffer = (audiosample_get_buffer_fun)audioeffects_echo_get_buffer,
235-
.get_buffer_structure = (audiosample_get_buffer_structure_fun)audioeffects_echo_get_buffer_structure,
230+
.sample_rate = (audiosample_sample_rate_fun)common_hal_audiodelays_echo_get_sample_rate,
231+
.bits_per_sample = (audiosample_bits_per_sample_fun)common_hal_audiodelays_echo_get_bits_per_sample,
232+
.channel_count = (audiosample_channel_count_fun)common_hal_audiodelays_echo_get_channel_count,
233+
.reset_buffer = (audiosample_reset_buffer_fun)audiodelays_echo_reset_buffer,
234+
.get_buffer = (audiosample_get_buffer_fun)audiodelays_echo_get_buffer,
235+
.get_buffer_structure = (audiosample_get_buffer_structure_fun)audiodelays_echo_get_buffer_structure,
236236
};
237237

238238
MP_DEFINE_CONST_OBJ_TYPE(
239-
audioeffects_echo_type,
239+
audiodelays_echo_type,
240240
MP_QSTR_Echo,
241241
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
242-
make_new, audioeffects_echo_make_new,
243-
locals_dict, &audioeffects_echo_locals_dict,
244-
protocol, &audioeffects_echo_proto
242+
make_new, audiodelays_echo_make_new,
243+
locals_dict, &audiodelays_echo_locals_dict,
244+
protocol, &audiodelays_echo_proto
245245
);

shared-bindings/audiodelays/Echo.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#pragma once
8+
9+
#include "shared-module/audiodelays/Echo.h"
10+
11+
extern const mp_obj_type_t audiodelays_echo_type;
12+
13+
void common_hal_audiodelays_echo_construct(audiodelays_echo_obj_t *self,
14+
uint32_t delay_ms, mp_float_t decay,
15+
uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed,
16+
uint8_t channel_count, uint32_t sample_rate);
17+
18+
void common_hal_audiodelays_echo_deinit(audiodelays_echo_obj_t *self);
19+
bool common_hal_audiodelays_echo_deinited(audiodelays_echo_obj_t *self);
20+
21+
uint32_t common_hal_audiodelays_echo_get_sample_rate(audiodelays_echo_obj_t *self);
22+
uint8_t common_hal_audiodelays_echo_get_channel_count(audiodelays_echo_obj_t *self);
23+
uint8_t common_hal_audiodelays_echo_get_bits_per_sample(audiodelays_echo_obj_t *self);
24+
25+
uint32_t common_hal_audiodelays_echo_get_delay_ms(audiodelays_echo_obj_t *self);
26+
void common_hal_audiodelays_echo_set_delay_ms(audiodelays_echo_obj_t *self, uint32_t delay_ms);
27+
28+
mp_float_t common_hal_audiodelays_echo_get_decay(audiodelays_echo_obj_t *self);
29+
void common_hal_audiodelays_echo_set_decay(audiodelays_echo_obj_t *self, mp_float_t decay);
30+
31+
bool common_hal_audiodelays_echo_get_playing(audiodelays_echo_obj_t *self);
32+
void common_hal_audiodelays_echo_play(audiodelays_echo_obj_t *self, mp_obj_t sample, bool loop);
33+
void common_hal_audiodelays_echo_stop(audiodelays_echo_obj_t *self);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include <stdint.h>
8+
9+
#include "py/obj.h"
10+
#include "py/runtime.h"
11+
12+
#include "shared-bindings/audiodelays/__init__.h"
13+
#include "shared-bindings/audiodelays/Echo.h"
14+
15+
//| """Support for audio delay effects
16+
//|
17+
//| The `audiodelays` module contains classes to provide access to audio delay effects.
18+
//|
19+
//| """
20+
21+
static const mp_rom_map_elem_t audiodelays_module_globals_table[] = {
22+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiodelays) },
23+
{ MP_ROM_QSTR(MP_QSTR_Echo), MP_ROM_PTR(&audiodelays_echo_type) },
24+
};
25+
26+
static MP_DEFINE_CONST_DICT(audiodelays_module_globals, audiodelays_module_globals_table);
27+
28+
const mp_obj_module_t audiodelays_module = {
29+
.base = { &mp_type_module },
30+
.globals = (mp_obj_dict_t *)&audiodelays_module_globals,
31+
};
32+
33+
MP_REGISTER_MODULE(MP_QSTR_audiodelays, audiodelays_module);

0 commit comments

Comments
 (0)