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

Author Topic: sf::SoundSource::getStatus()  (Read 3296 times)

0 Members and 1 Guest are viewing this topic.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
sf::SoundSource::getStatus()
« on: August 20, 2012, 06:43:14 pm »
Is there any special reason for sf::SoundSource::getStatus() having protected access only?

Both stock SFML specializations (sf::Sound and sf::SoundStream) override its access to be public, and I do not really see a reason why it should be hidden away by default if anybody is to implement his own additional sound source (whatever that would be). The playing status of a sound source is an important thing to know no matter what the specific source is.

The fact that it is protected now makes it impossible for generic handling of sound sources. I am having this issue now, trying to minimize the amount of native calls to SFML for the Java binding, but I'm sure somebody will eventually run into this with other intentions, cleanup on exit for instance.

So, is there any special thought behind this protected access or may I ask for it to be changed to public? :)
JSFML - The Java binding to SFML.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::SoundSource::getStatus()
« Reply #1 on: August 20, 2012, 08:13:13 pm »
The base class doesn't provide public access to playback functions. It's up to the derived classes to choose what they want to do.

This is not an issue because sf::SoundSource is just a way to put common code into a single class, it's not meant to be used as a polymorphic base class. You don't even have to know about it -- so just do as if it didn't exist ;)
Laurent Gomila - SFML developer

 

anything