SFML community forums

General => General discussions => Topic started by: Jebbs on May 19, 2013, 05:41:21 pm

Title: Naming inconsistency with Music's loading methods?
Post by: Jebbs 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!

Title: Re: Naming inconsistency with Music's loading methods?
Post by: Cornstalks 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.
Title: Re: Naming inconsistency with Music's loading methods?
Post by: Jebbs 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!

Title: Re: Naming inconsistency with Music's loading methods?
Post by: Nexus 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.