Skip to content

pygame.Music #3110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildconfig/stubs/gen_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"event": ["Event"],
"font": ["Font"],
"mixer": ["Sound", "Channel"],
"mixer_music": ["Music"],
"time": ["Clock"],
"joystick": ["Joystick"],
"window": ["Window"],
Expand Down
1 change: 1 addition & 0 deletions buildconfig/stubs/pygame/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ from ._debug import print_debug_info as print_debug_info
from .event import Event as Event
from .font import Font as Font
from .mixer import Sound as Sound, Channel as Channel
from .mixer_music import Music as Music
from .time import Clock as Clock
from .joystick import Joystick as Joystick
from .window import Window as Window
Expand Down
44 changes: 42 additions & 2 deletions buildconfig/stubs/pygame/mixer_music.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Dict
from typing import Optional, Dict, final

from pygame.typing import FileLike

Expand All @@ -18,4 +18,44 @@ def get_pos() -> int: ...
def queue(filename: FileLike, namehint: str = "", loops: int = 0) -> None: ...
def set_endevent(event_type: int, /) -> None: ...
def get_endevent() -> int: ...
def get_metadata(filename: Optional[FileLike] = None, namehint: str = "") -> Dict[str, str]: ...
def get_metadata(
filename: Optional[FileLike] = None, namehint: str = ""
) -> Dict[str, str]: ...

@final
class Music:
def __init__(self, filename: FileLike, namehint: str = "") -> None: ...
def play(
self, loops: int = 0, startpos: float = 0.0, fade_in: float = 0.0
) -> None: ...
def stop(self) -> None: ...
def rewind(self) -> None: ...

fadein : float

@property
def title(self) -> str: ...
@property
def artist(self) -> str: ...
@property
def album(self) -> str: ...
@property
def copyright(self) -> str: ...
@property
def position(self) -> float: ...
@position.setter
def position(self, value: float) -> None: ...
@property
def duration(self) -> float: ...
@property
def paused(self) -> bool: ...
@property
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing paused setter in stub.

def volume(self) -> float: ...
@volume.setter
def volume(self, value: float) -> None: ...
@property
def ended(self) -> bool: ...
@property
def fadeout(self) -> float: ...
@fadeout.setter
def fadeout(self, value: float) -> None: ...
Loading
Loading