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

Author Topic: Naming inconsistency with Music's loading methods?  (Read 2518 times)

0 Members and 1 Guest are viewing this topic.

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Naming inconsistency with Music's loading methods?
« on: May 19, 2013, 05:41:21 pm »
I'm not sure if this was intentional or not, and I don't know how I have missed this until now, but I feel like there is a naming inconsistency with how Music's loading methods are named.

Everything I checked in the graphical module, plus even the SoundBuffer class' loading methods are named loadFromXXX, but only Music's methods are named openFromXXX.

Not that it really matters or has any kind of serious impact. I was just curious!

DSFML - SFML for the D Programming Language.

Cornstalks

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • My Website
Re: Naming inconsistency with Music's loading methods?
« Reply #1 on: May 19, 2013, 05:43:57 pm »
I think (but could be very wrong) that some music things can be streamed from the disk. Hence, they're not loaded all at once. "Open" makes more sense if the data is streamed.

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: Naming inconsistency with Music's loading methods?
« Reply #2 on: May 19, 2013, 05:47:48 pm »
I was actually thinking this right after I posted. I'm pretty sure you are right. The music class does stream when it plays, so "open" would make more sense than "load."

Thanks for the quick reply!

DSFML - SFML for the D Programming Language.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Naming inconsistency with Music's loading methods?
« Reply #3 on: May 19, 2013, 06:01:37 pm »
The real inconsistency however is that sf::Font uses loadFromFile(), although it has similar semantics to sf::Music: The source must remain valid throughout the whole usage.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything