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

A way to stop and dispose all sounds played using _SNDPLAYCOPY #528

Open
a740g opened this issue Aug 7, 2024 · 3 comments
Open

A way to stop and dispose all sounds played using _SNDPLAYCOPY #528

a740g opened this issue Aug 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@a740g
Copy link
Contributor

a740g commented Aug 7, 2024

Is your feature request related to a problem? Please describe.
There is no way to stop and dispose of sound copies until it finishes playing. For example, longer sound copies keep paying after a game level ends.

Describe the solution you'd like
Something like _SNDSTOPCOPIES would allow stopping all sound copies in one go.

Describe alternatives you've considered
This can be done on the BASIC side using arrays, _SNDOPEN, _SNDCOPY, _SNDPLAY & _SNDCLOSE. However, a fair amount of complexity is involved.

Additional context
Stopping _SNDPLAYCOPY? Possible?

@a740g a740g added the enhancement New feature or request label Aug 7, 2024
@SteveMcNeill
Copy link
Member

Instead of a new command, might I suggest a tweaking of the existing commands?

_SNDSTOP handle, (flags$)

Where the optional flag$ would be
"ONLY" <-- this only stops the original
"COPIES" <--- this would stop the original and any _SNDPLAYCOPY
"ALL" <-- this would stop the original and and copies.

Would save creating another sound related keyword for folks to have to chug through and remember, when there's already a boatload of them out there. Usage would be similar to:

h = _SNDOPEN("explosion.wav")
_SNDPLAY h
_SNDPLAYCOPY h
_SNDPLAYCOPY h
_SNDPLAYCOPY h

_SNDSTOP h, "ONLY"   <-- to stop the _SNDPLAY with the original
_SNDSTOP h, "COPIES" <-- to stop all copies using that original handle
_SNDSTOP h, "BOTH"  <--- to stop both at once

@a740g
Copy link
Contributor Author

a740g commented Aug 8, 2024

That would make the implementation a bit complex. However, it's a solid idea. Thanks @SteveMcNeill.

@SteveMcNeill
Copy link
Member

Might also want to keep in mind the other sound commands. I'm not too certain how they all tie together, but it might not be too large a pain to add the same functionality to some of the other commands like the ones for pusing/resuming/volume control and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants