Skip to content
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

Added loops option for mixer.music.queue #2770

Merged
merged 3 commits into from Oct 16, 2021

Conversation

thorhunter1
Copy link
Contributor

@thorhunter1 thorhunter1 commented Oct 12, 2021

Should resolve #362.

The change introduces loops option for mixer.music.queue, e.g. mixer.music.queue(file, loops=-1) will play the queued track in an infinite loop. This is especially useful when the track is split into an intro+loop parts, e.g. https://www.youtube.com/watch?v=1hmE1aaeJgk

Also changes API of mixer.music.load and mixer.music.queue to utilise keyword arguments.

@Starbuck5
Copy link
Contributor

Starbuck5 commented Oct 15, 2021

Hey @thorhunter1, this is a very high quality looking PR, and I'll be sure to review it when I get the time and motivation. 😄

Just didn't want to leave you hanging.

Do the loop arguments work together? Like you can play something for 3 loops, while queueing up another thing you want to do 5 loops?

@thorhunter1
Copy link
Contributor Author

Hi @Starbuck5,

Do the loop arguments work together? Like you can play something for 3 loops, while queueing up another thing you want to do 5 loops?

Yes, this is also possible.

Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

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

👍 🎉 A very useful set of improvements, thanks.

@illume illume added mixer.music pygame.mixer.music mixer pygame.mixer labels Oct 16, 2021
@illume illume added this to the 2.0.3 milestone Oct 16, 2021
@illume illume merged commit f164ac4 into pygame:main Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mixer.music pygame.mixer.music mixer pygame.mixer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

please give mixer.music.queue a repeat option, or mixer.music.play a repeat_start option
3 participants