-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
pygame.Music
#3110
base: main
Are you sure you want to change the base?
pygame.Music
#3110
Conversation
@@ -19,3 +19,34 @@ 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]: ... | |||
|
|||
class Music: | |||
def __init__(self, filename: FileLike, namehint: Optional[str] = "") -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namehint
cannot be type None
: it should be just str
, not Optional[str]
.
In fact, the type annotation for pygame.mixer.music.load
should be fixed in this way too because it also cannot take None
.
So this is some syntactic sugar around the existing music system. And unlike pygame.Window it's not an OOP-ization of a system because we need to support multiple when before we only supported one, we'll still only support one playing at once. If we add this I'd like it to be easy to maintain, so in that vein, why is this written in C? |
@property | ||
def duration(self) -> float: ... | ||
@property | ||
def paused(self) -> bool: ... |
There was a problem hiding this comment.
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.
For several reasons :
|
Is there a specific reason why there is an |
Hello everyone,
Proud to propose you a first version of the
pygame.Music
object after days of work.Tasks not finished yet :
fadein
andfadeout
propertiesplaying
propertyMUSICENDED
event when the music is stopped / ends.... and many bugs hidden under the carpet to fix ...
Current test code (Use your own musics, who knows, there might be some issues):