Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - victorclf

Pages: [1]
1
Feature requests / 'Stopped' callback in sf::Sound
« on: July 18, 2011, 09:32:15 pm »
Hmm ok, I'm not familiar with OpenAL API. I thought it had such funcionality implemented.

In that case, I agree it's probably best to leave it to the user to handle it.

I will analyze what will work best in my case (creating/deleting sounds or reusing them as Groogy suggested).

Ty.

2
Feature requests / 'Stopped' callback in sf::Sound
« on: July 18, 2011, 12:55:16 am »
Hello,

I believe sf::Sound lacks a callback for when it finishes playing. Unlike sf::Sprite, it can't be destroyed before it finishes playing, therefore managing sf::Sound instances is tricky.

Currently, you need to manually manage each sf::Sound instance. The best solution I come up with so far was to keep track of all sf::Sound instances created and periodically iterate through them, deleting the ones that have Status::Stopped.

I do not believe this an optimal solution. Having sf::Sound call your callback object when it's done playing would give you the opportunity to delete the now useless sf::Sound instead of having to manually check if it's stopped.

IIRC SDL had support for such a callback.


Cheers and keep up the excellent work,
Victor Freire

Pages: [1]