Issues

Issue #829 resolved

Add warning for source:setPosition on stereo sounds

ragzouken
created an issue

It'd be great if when doing :setPosition on stereo audio sources that there'd be a warning that this doesn't do anything. This has caught me out more than once!

Comments (8)

  1. hahawoo

    This seems like a good idea, since setting the position of a stereo source seems to be useless and it's better than "silently failing". It could also error for the other methods which don't work on stereo sources.

  2. hahawoo

    I'd say error.

    I kind of think: one is either using a function correctly, or isn't. If they're not, then error. In this example, setting the position of a stereo Source isn't the correct way to use the function, so error and alert the lover of their mistake.

    And plus, warnings would add complexity. I'd assume there would have to be a "warning callback", and a line would need to be drawn between what is an error and what is a warning.

  3. Aesthete

    I think this should error, as it seems to cause a bunch of confusion for people expecting it to do something it's not capable of. The following functions also seem to be unaffected by OpenAL spatial functionality:

    • love::audio::openal::source::setPosition
    • love::audio::openal::source::getPosition
    • love::audio::openal::source::setVelocity
    • love::audio::openal::source::getVelocity
    • love::audio::openal::source::setDirection
    • love::audio::openal::source::getDirection
    • love::audio::openal::source::setCone
    • love::audio::openal::source::getCone
    • love::audio::openal::source::setRelative
    • love::audio::openal::source::isRelative
    • love::audio::openal::source::setAttenuationDistances
    • love::audio::openal::source::getAttenuationDistances
    • love::audio::openal::source::setRolloff
    • love::audio::openal::source::getRolloff
  4. Alex Szpakowski

    I think the getters shouldn't cause an error when they're called on stereo Sources, since they don't (fail to) change any state and they'd return the default values anyway.

  5. Log in to comment