mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
Backed out changeset: a0191140525e
--HG-- branch : minor
This commit is contained in:
@@ -33,11 +33,6 @@ namespace audio
|
||||
namespace openal
|
||||
{
|
||||
|
||||
// Exception message when spatial audio functions are called on stereo sources,
|
||||
// as this is not supported by OpenAL.
|
||||
static const char* NOT_SUPPORTED_IN_STEREO_MSG = "This spatial audio functionality is only available on monaural sources. \
|
||||
Ensure your source is not stereo before calling this function.";
|
||||
|
||||
StaticDataBuffer::StaticDataBuffer(ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
|
||||
{
|
||||
alGenBuffers(1, &buffer);
|
||||
@@ -425,9 +420,6 @@ float Source::tell(Source::Unit unit)
|
||||
|
||||
void Source::setPosition(float *v)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
alSourcefv(source, AL_POSITION, v);
|
||||
|
||||
@@ -436,9 +428,6 @@ void Source::setPosition(float *v)
|
||||
|
||||
void Source::getPosition(float *v) const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
alGetSourcefv(source, AL_POSITION, v);
|
||||
else
|
||||
@@ -447,9 +436,6 @@ void Source::getPosition(float *v) const
|
||||
|
||||
void Source::setVelocity(float *v)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
alSourcefv(source, AL_VELOCITY, v);
|
||||
|
||||
@@ -458,9 +444,6 @@ void Source::setVelocity(float *v)
|
||||
|
||||
void Source::getVelocity(float *v) const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
alGetSourcefv(source, AL_VELOCITY, v);
|
||||
else
|
||||
@@ -469,9 +452,6 @@ void Source::getVelocity(float *v) const
|
||||
|
||||
void Source::setDirection(float *v)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
alSourcefv(source, AL_DIRECTION, v);
|
||||
else
|
||||
@@ -480,8 +460,6 @@ void Source::setDirection(float *v)
|
||||
|
||||
void Source::getDirection(float *v) const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
if (valid)
|
||||
alGetSourcefv(source, AL_DIRECTION, v);
|
||||
else
|
||||
@@ -490,9 +468,6 @@ void Source::getDirection(float *v) const
|
||||
|
||||
void Source::setCone(float innerAngle, float outerAngle, float outerVolume)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
cone.innerAngle = (int) LOVE_TODEG(innerAngle);
|
||||
cone.outerAngle = (int) LOVE_TODEG(outerAngle);
|
||||
cone.outerVolume = outerVolume;
|
||||
@@ -507,9 +482,6 @@ void Source::setCone(float innerAngle, float outerAngle, float outerVolume)
|
||||
|
||||
void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
innerAngle = LOVE_TORAD(cone.innerAngle);
|
||||
outerAngle = LOVE_TORAD(cone.outerAngle);
|
||||
outerVolume = cone.outerVolume;
|
||||
@@ -517,9 +489,6 @@ void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) c
|
||||
|
||||
void Source::setRelative(bool enable)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
alSourcei(source, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
|
||||
|
||||
@@ -528,9 +497,6 @@ void Source::setRelative(bool enable)
|
||||
|
||||
bool Source::isRelative() const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
return relative;
|
||||
}
|
||||
|
||||
@@ -785,9 +751,6 @@ float Source::getMaxVolume() const
|
||||
|
||||
void Source::setReferenceDistance(float distance)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
alSourcef(source, AL_REFERENCE_DISTANCE, distance);
|
||||
@@ -798,9 +761,6 @@ void Source::setReferenceDistance(float distance)
|
||||
|
||||
float Source::getReferenceDistance() const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
ALfloat f;
|
||||
@@ -814,9 +774,6 @@ float Source::getReferenceDistance() const
|
||||
|
||||
void Source::setRolloffFactor(float factor)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
alSourcef(source, AL_ROLLOFF_FACTOR, factor);
|
||||
@@ -827,9 +784,6 @@ void Source::setRolloffFactor(float factor)
|
||||
|
||||
float Source::getRolloffFactor() const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
ALfloat f;
|
||||
@@ -843,9 +797,6 @@ float Source::getRolloffFactor() const
|
||||
|
||||
void Source::setMaxDistance(float distance)
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
alSourcef(source, AL_MAX_DISTANCE, distance);
|
||||
@@ -856,9 +807,6 @@ void Source::setMaxDistance(float distance)
|
||||
|
||||
float Source::getMaxDistance() const
|
||||
{
|
||||
if (channels > 1)
|
||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
||||
|
||||
if (valid)
|
||||
{
|
||||
ALfloat f;
|
||||
|
||||
Reference in New Issue
Block a user