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

bn::music::stop() is raising an error if no music is playing #28

Closed
ultrasuperpingu opened this issue Nov 30, 2022 · 2 comments
Closed

Comments

@ultrasuperpingu
Copy link

ultrasuperpingu commented Nov 30, 2022

In general, I think it is always ok to stop something not running.

But in this case, it seams worst because I didn't see any bn::music::isPlaying() method, or something like this, so, you can't know if it's possible to stop the music...
.
Edit: Sorry, there is a bn::music::playing(). It's late, I'm probably too tired... Still, I think it's ok to stop something not running. It would avoid a useless test. bn::sound::stop_all() don't raise any error.

I'm not sure but I think those methods:

void stop()
bool paused()
void pause()
void resume()
int position()
void set_position(int position)

should be available in bn::music_item also ??

@GValiente
Copy link
Owner

If you want or need that behavior (safe music stop), you can write your own music interface that manages bn::music as you want.

The same happens with bn::music_item, for example you could write a class that inherits bn::music_item with those extra methods, if you think they make sense.

@ultrasuperpingu
Copy link
Author

Yes, it's what I did. I only open this issue because I didn't see any method to check is a music was playing (and I checked twice the doc). And of course, right after doing that, I saw the playing function (I really don't know how I missing that). I was thinking you might be interested to have feedback on the api so I didn't closed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants