summaryrefslogtreecommitdiff
path: root/shared-bindings/audioio
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-10-09 13:28:00 -0700
committerScott Shawcroft <scott@tannewt.org>2018-10-09 13:28:00 -0700
commit6da25c8893afedfc195327f597fd3b0b45fc65d8 (patch)
tree2ae42ed8374e23984c6baf3f4aae13719082c330 /shared-bindings/audioio
parent2b0356c61f71afccbf10a9dcd3ad331bb4b856dd (diff)
Rename stop to stop_voice in case we want stop to stop everything later.
Diffstat (limited to 'shared-bindings/audioio')
-rw-r--r--shared-bindings/audioio/Mixer.c16
-rw-r--r--shared-bindings/audioio/Mixer.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/shared-bindings/audioio/Mixer.c b/shared-bindings/audioio/Mixer.c
index d353daa78..dc7a12ebc 100644
--- a/shared-bindings/audioio/Mixer.c
+++ b/shared-bindings/audioio/Mixer.c
@@ -150,7 +150,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_mixer___exit___obj, 4, 4, aud
//|
//| Sample must be an `audioio.WaveFile`, `audioio.Mixer` or `audioio.RawSample`.
//|
-//| If other samples are already playing, the encodings must match.
+//| The sample must match the Mixer's encoding settings given in the constructor.
//|
STATIC mp_obj_t audioio_mixer_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_sample, ARG_voice, ARG_loop };
@@ -171,24 +171,24 @@ STATIC mp_obj_t audioio_mixer_obj_play(size_t n_args, const mp_obj_t *pos_args,
}
MP_DEFINE_CONST_FUN_OBJ_KW(audioio_mixer_play_obj, 1, audioio_mixer_obj_play);
-//| .. method:: stop(voice=0)
+//| .. method:: stop_voice(voice=0)
//|
-//| Stops playback and resets to the start of the sample on the given channel.
+//| Stops playback of the sample on the given voice.
//|
-STATIC mp_obj_t audioio_mixer_obj_stop(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
+STATIC mp_obj_t audioio_mixer_obj_stop_voice(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_voice };
static const mp_arg_t allowed_args[] = {
- { MP_QSTR_voice, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
+ { MP_QSTR_voice, MP_ARG_INT, {.u_int = 0} },
};
audioio_mixer_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
raise_error_if_deinited(common_hal_audioio_mixer_deinited(self));
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
- common_hal_audioio_mixer_stop(self, args[ARG_voice].u_int);
+ common_hal_audioio_mixer_stop_voice(self, args[ARG_voice].u_int);
return mp_const_none;
}
-MP_DEFINE_CONST_FUN_OBJ_KW(audioio_mixer_stop_obj, 1, audioio_mixer_obj_stop);
+MP_DEFINE_CONST_FUN_OBJ_KW(audioio_mixer_stop_voice_obj, 1, audioio_mixer_obj_stop_voice);
//| .. attribute:: playing
//|
@@ -233,7 +233,7 @@ STATIC const mp_rom_map_elem_t audioio_mixer_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audioio_mixer___exit___obj) },
{ MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audioio_mixer_play_obj) },
- { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&audioio_mixer_stop_obj) },
+ { MP_ROM_QSTR(MP_QSTR_stop_voice), MP_ROM_PTR(&audioio_mixer_stop_voice_obj) },
// Properties
{ MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audioio_mixer_playing_obj) },
diff --git a/shared-bindings/audioio/Mixer.h b/shared-bindings/audioio/Mixer.h
index ad1a9fe05..832072b8f 100644
--- a/shared-bindings/audioio/Mixer.h
+++ b/shared-bindings/audioio/Mixer.h
@@ -44,7 +44,7 @@ void common_hal_audioio_mixer_construct(audioio_mixer_obj_t* self,
void common_hal_audioio_mixer_deinit(audioio_mixer_obj_t* self);
bool common_hal_audioio_mixer_deinited(audioio_mixer_obj_t* self);
void common_hal_audioio_mixer_play(audioio_mixer_obj_t* self, mp_obj_t sample, uint8_t voice, bool loop);
-void common_hal_audioio_mixer_stop(audioio_mixer_obj_t* self, uint8_t voice);
+void common_hal_audioio_mixer_stop_voice(audioio_mixer_obj_t* self, uint8_t voice);
bool common_hal_audioio_mixer_get_playing(audioio_mixer_obj_t* self);
uint32_t common_hal_audioio_mixer_get_sample_rate(audioio_mixer_obj_t* self);