This commit is contained in:
wittmannzl103469 committed 2026-11-05 15:08:42 +01:00
1 parent de41a02749
commit 9af09cebd3
764 files changed
+54218 -78859

No files matched your search

@@ -1,14 +1,11 @@
import sys
from typing import Any, Literal, overload
from typing import Any, Dict, Optional, Tuple, Union, final, overload
from pygame.typing import FileLike
from typing_extensions import (
Buffer, # collections.abc 3.12
Self,
deprecated, # added in 3.13
)
import numpy
from pygame.event import Event
from . import mixer_music
from ._common import FileArg
# export mixer_music as mixer.music
music = mixer_music
@@ -18,7 +15,7 @@ def init(
size: int = -16,
channels: int = 2,
buffer: int = 512,
devicename: str | None = None,
devicename: Optional[str] = None,
allowedchanges: int = 5,
) -> None: ...
def pre_init(
@@ -26,33 +23,33 @@ def pre_init(
size: int = -16,
channels: int = 2,
buffer: int = 512,
devicename: str | None = None,
devicename: Optional[str] = None,
allowedchanges: int = 5,
) -> None: ...
def quit() -> None: ...
def get_init() -> tuple[int, int, int] | None: ...
def get_driver() -> str: ...
def get_init() -> Tuple[int, int, int]: ...
def stop() -> None: ...
def pause() -> None: ...
def unpause() -> None: ...
def fadeout(time: int, /) -> None: ...
def set_num_channels(count: int, /) -> None: ...
def fadeout(time: int) -> None: ...
def set_num_channels(count: int) -> None: ...
def get_num_channels() -> int: ...
def set_reserved(count: int, /) -> int: ...
@overload
def find_channel(force: Literal[True]) -> Channel: ...
@overload
def find_channel(force: bool = False) -> Channel | None: ...
def set_soundfont(paths: str | None = None, /) -> None: ...
def get_soundfont() -> str | None: ...
def set_reserved(count: int) -> int: ...
def find_channel(force: bool = False) -> Channel: ...
def get_busy() -> bool: ...
def get_sdl_mixer_version(linked: bool = True) -> tuple[int, int, int]: ...
def get_sdl_mixer_version(linked: bool = True) -> Tuple[int, int, int]: ...
class Sound:
@overload
def __init__(self, file: FileLike) -> None: ...
def __init__(self, file: FileArg) -> None: ...
@overload
def __init__(self, buffer: Buffer) -> None: ...
def __init__(
self, buffer: Any
) -> None: ... # Buffer protocol is still not implemented in typing
@overload
def __init__(
self, array: numpy.ndarray
) -> None: ... # Buffer protocol is still not implemented in typing
def play(
self,
loops: int = 0,
@@ -61,27 +58,19 @@ class Sound:
) -> Channel: ...
# possibly going to be deprecated/removed soon, in which case these
# typestubs must be removed too
@property
def __array_interface__(self) -> dict[str, Any]: ...
@property
def __array_struct__(self) -> Any: ...
if sys.version_info >= (3, 12):
def __buffer__(self, flags: int, /) -> memoryview[int]: ...
def __release_buffer__(self, view: memoryview[int], /) -> None: ...
__array_interface__: Dict[str, Any]
__array_struct__: Any
def stop(self) -> None: ...
def fadeout(self, time: int, /) -> None: ...
def set_volume(self, value: float, /) -> None: ...
def fadeout(self, time: int) -> None: ...
def set_volume(self, value: float) -> None: ...
def get_volume(self) -> float: ...
def get_num_channels(self) -> int: ...
def get_length(self) -> float: ...
def get_raw(self) -> bytes: ...
def copy(self) -> Self: ...
def __copy__(self) -> Self: ...
@final
class Channel:
def __init__(self, id: int) -> None: ...
@property
def id(self) -> int: ...
def play(
self,
sound: Sound,
@@ -92,22 +81,18 @@ class Channel:
def stop(self) -> None: ...
def pause(self) -> None: ...
def unpause(self) -> None: ...
def fadeout(self, time: int, /) -> None: ...
def queue(self, sound: Sound, /) -> None: ...
def set_source_location(self, angle: float, distance: float, /) -> None: ...
def fadeout(self, time: int) -> None: ...
def queue(self, sound: Sound) -> None: ...
@overload
def set_volume(self, value: float, /) -> None: ...
def set_volume(self, value: float) -> None: ...
@overload
def set_volume(self, left: float, right: float, /) -> None: ...
def set_volume(self, left: float, right: float) -> None: ...
def get_volume(self) -> float: ...
def get_busy(self) -> bool: ...
def get_sound(self) -> Sound | None: ...
def get_queue(self) -> Sound | None: ...
def set_endevent(self, type: int = 0, /) -> None: ...
def get_sound(self) -> Sound: ...
def get_queue(self) -> Sound: ...
def set_endevent(self, type: Union[int, Event] = 0) -> None: ...
def get_endevent(self) -> int: ...
@deprecated("Use `Sound` instead (SoundType is an old alias)")
class SoundType(Sound): ...
@deprecated("Use `Channel` instead (ChannelType is an old alias)")
class ChannelType(Channel): ...
SoundType = Sound
ChannelType = Channel