We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a02bbcf commit 83d5e02Copy full SHA for 83d5e02
buildconfig/stubs/pygame/mixer.pyi
@@ -83,7 +83,7 @@ class Channel:
83
def unpause(self) -> None: ...
84
def fadeout(self, time: int) -> None: ...
85
def queue(self, sound: Sound) -> None: ...
86
- def set_position(self, angle:int, distance:int) -> None: ...
+ def set_source_location(self, angle:int, distance:int) -> None: ...
87
@overload
88
def set_volume(self, value: float) -> None: ...
89
docs/reST/ref/mixer.rst
@@ -480,10 +480,10 @@ change the default buffer by calling :func:`pygame.mixer.pre_init` before
480
481
.. ## Channel.fadeout ##
482
483
- .. method:: set_position
+ .. method:: set_source_location
484
485
| :sl:`set the position of a playing channel`
486
- | :sg:`set_volume(angle,distance) -> None`
+ | :sg:`set_source_location(angle,distance) -> None`
487
488
Set the position (angle, distance) of a playing channel.
489
@@ -493,7 +493,7 @@ change the default buffer by calling :func:`pygame.mixer.pre_init` before
493
494
.. versionadded:: 2.3.0
495
496
- .. ## Channel.set_position ##
+ .. ## Channel.set_source_location ##
497
498
.. method:: set_volume
499
src_c/doc/mixer_doc.h
@@ -29,7 +29,7 @@
29
#define DOC_MIXER_CHANNEL_PAUSE "pause() -> None\ntemporarily stop playback of a channel"
30
#define DOC_MIXER_CHANNEL_UNPAUSE "unpause() -> None\nresume pause playback of a channel"
31
#define DOC_MIXER_CHANNEL_FADEOUT "fadeout(time) -> None\nstop playback after fading channel out"
32
-#define DOC_MIXER_CHANNEL_SETPOSITION "set_volume(angle,distance) -> None\nset the position of a playing channel"
+#define DOC_MIXER_CHANNEL_SETSOURCELOCATION "set_source_location(angle,distance) -> None\nset the position of a playing channel"
33
#define DOC_MIXER_CHANNEL_SETVOLUME "set_volume(value) -> None\nset_volume(left, right) -> None\nset the volume of a playing channel"
34
#define DOC_MIXER_CHANNEL_GETVOLUME "get_volume() -> value\nget the volume of the playing channel"
35
#define DOC_MIXER_CHANNEL_GETBUSY "get_busy() -> bool\ncheck if the channel is active"
src_c/mixer.c
@@ -1161,7 +1161,7 @@ chan_unpause(PyObject *self, PyObject *_null)
1161
}
1162
1163
static PyObject *
1164
-chan_set_position(PyObject *self, PyObject *args)
+chan_set_source_location(PyObject *self, PyObject *args)
1165
{
1166
int channelnum = pgChannel_AsInt(self);
1167
Sint16 angle;
@@ -1311,8 +1311,8 @@ static PyMethodDef channel_methods[] = {
1311
{"pause", (PyCFunction)chan_pause, METH_NOARGS, DOC_MIXER_CHANNEL_PAUSE},
1312
{"unpause", (PyCFunction)chan_unpause, METH_NOARGS,
1313
DOC_MIXER_CHANNEL_UNPAUSE},
1314
- {"set_position", chan_set_position, METH_VARARGS,
1315
- DOC_MIXER_CHANNEL_SETPOSITION},
+ {"set_source_location", chan_set_source_location, METH_VARARGS,
+ DOC_MIXER_CHANNEL_SETSOURCELOCATION},
1316
{"set_volume", chan_set_volume, METH_VARARGS, DOC_MIXER_CHANNEL_SETVOLUME},
1317
{"get_volume", (PyCFunction)chan_get_volume, METH_NOARGS,
1318
DOC_MIXER_CHANNEL_GETVOLUME},
test/mixer_test.py
@@ -911,13 +911,13 @@ def setUp(self):
911
filename = example_path(os.path.join("data", "house_lo.mp3"))
912
self.snd = mixer.Sound(filename)
913
914
- def test_set_position(self):
915
- prompt("Please wear earphones before the test for set_position() starts")
+ def test_set_source_location(self):
+ prompt("Please wear earphones before the test for set_source_location() starts")
916
ch = self.snd.play()
917
angle = 0
918
distance = 100
919
while ch.get_busy():
920
- ch.set_position(angle, distance)
+ ch.set_source_location(angle, distance)
921
angle += 1
922
angle %= 360
923
time.sleep(0.01)
@@ -929,7 +929,7 @@ def test_set_position(self):
929
distance = 0
930
direction = 0
931
932
933
if distance == 0 or distance == 255:
934
direction = 1 - direction
935
distance += 1 if direction else -1
0 commit comments