mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Backed out changeset: a0191140525e
--HG-- branch : minor
This commit is contained in:
@@ -33,11 +33,6 @@ namespace audio
|
|||||||
namespace openal
|
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)
|
StaticDataBuffer::StaticDataBuffer(ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
|
||||||
{
|
{
|
||||||
alGenBuffers(1, &buffer);
|
alGenBuffers(1, &buffer);
|
||||||
@@ -425,9 +420,6 @@ float Source::tell(Source::Unit unit)
|
|||||||
|
|
||||||
void Source::setPosition(float *v)
|
void Source::setPosition(float *v)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alSourcefv(source, AL_POSITION, v);
|
alSourcefv(source, AL_POSITION, v);
|
||||||
|
|
||||||
@@ -436,9 +428,6 @@ void Source::setPosition(float *v)
|
|||||||
|
|
||||||
void Source::getPosition(float *v) const
|
void Source::getPosition(float *v) const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alGetSourcefv(source, AL_POSITION, v);
|
alGetSourcefv(source, AL_POSITION, v);
|
||||||
else
|
else
|
||||||
@@ -447,9 +436,6 @@ void Source::getPosition(float *v) const
|
|||||||
|
|
||||||
void Source::setVelocity(float *v)
|
void Source::setVelocity(float *v)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alSourcefv(source, AL_VELOCITY, v);
|
alSourcefv(source, AL_VELOCITY, v);
|
||||||
|
|
||||||
@@ -458,9 +444,6 @@ void Source::setVelocity(float *v)
|
|||||||
|
|
||||||
void Source::getVelocity(float *v) const
|
void Source::getVelocity(float *v) const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alGetSourcefv(source, AL_VELOCITY, v);
|
alGetSourcefv(source, AL_VELOCITY, v);
|
||||||
else
|
else
|
||||||
@@ -469,9 +452,6 @@ void Source::getVelocity(float *v) const
|
|||||||
|
|
||||||
void Source::setDirection(float *v)
|
void Source::setDirection(float *v)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alSourcefv(source, AL_DIRECTION, v);
|
alSourcefv(source, AL_DIRECTION, v);
|
||||||
else
|
else
|
||||||
@@ -480,8 +460,6 @@ void Source::setDirection(float *v)
|
|||||||
|
|
||||||
void Source::getDirection(float *v) const
|
void Source::getDirection(float *v) const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alGetSourcefv(source, AL_DIRECTION, v);
|
alGetSourcefv(source, AL_DIRECTION, v);
|
||||||
else
|
else
|
||||||
@@ -490,9 +468,6 @@ void Source::getDirection(float *v) const
|
|||||||
|
|
||||||
void Source::setCone(float innerAngle, float outerAngle, float outerVolume)
|
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.innerAngle = (int) LOVE_TODEG(innerAngle);
|
||||||
cone.outerAngle = (int) LOVE_TODEG(outerAngle);
|
cone.outerAngle = (int) LOVE_TODEG(outerAngle);
|
||||||
cone.outerVolume = outerVolume;
|
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
|
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);
|
innerAngle = LOVE_TORAD(cone.innerAngle);
|
||||||
outerAngle = LOVE_TORAD(cone.outerAngle);
|
outerAngle = LOVE_TORAD(cone.outerAngle);
|
||||||
outerVolume = cone.outerVolume;
|
outerVolume = cone.outerVolume;
|
||||||
@@ -517,9 +489,6 @@ void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) c
|
|||||||
|
|
||||||
void Source::setRelative(bool enable)
|
void Source::setRelative(bool enable)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
alSourcei(source, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
|
alSourcei(source, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
|
||||||
|
|
||||||
@@ -528,9 +497,6 @@ void Source::setRelative(bool enable)
|
|||||||
|
|
||||||
bool Source::isRelative() const
|
bool Source::isRelative() const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
return relative;
|
return relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -785,9 +751,6 @@ float Source::getMaxVolume() const
|
|||||||
|
|
||||||
void Source::setReferenceDistance(float distance)
|
void Source::setReferenceDistance(float distance)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
alSourcef(source, AL_REFERENCE_DISTANCE, distance);
|
alSourcef(source, AL_REFERENCE_DISTANCE, distance);
|
||||||
@@ -798,9 +761,6 @@ void Source::setReferenceDistance(float distance)
|
|||||||
|
|
||||||
float Source::getReferenceDistance() const
|
float Source::getReferenceDistance() const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
ALfloat f;
|
ALfloat f;
|
||||||
@@ -814,9 +774,6 @@ float Source::getReferenceDistance() const
|
|||||||
|
|
||||||
void Source::setRolloffFactor(float factor)
|
void Source::setRolloffFactor(float factor)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
alSourcef(source, AL_ROLLOFF_FACTOR, factor);
|
alSourcef(source, AL_ROLLOFF_FACTOR, factor);
|
||||||
@@ -827,9 +784,6 @@ void Source::setRolloffFactor(float factor)
|
|||||||
|
|
||||||
float Source::getRolloffFactor() const
|
float Source::getRolloffFactor() const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
ALfloat f;
|
ALfloat f;
|
||||||
@@ -843,9 +797,6 @@ float Source::getRolloffFactor() const
|
|||||||
|
|
||||||
void Source::setMaxDistance(float distance)
|
void Source::setMaxDistance(float distance)
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
alSourcef(source, AL_MAX_DISTANCE, distance);
|
alSourcef(source, AL_MAX_DISTANCE, distance);
|
||||||
@@ -856,9 +807,6 @@ void Source::setMaxDistance(float distance)
|
|||||||
|
|
||||||
float Source::getMaxDistance() const
|
float Source::getMaxDistance() const
|
||||||
{
|
{
|
||||||
if (channels > 1)
|
|
||||||
throw love::Exception(NOT_SUPPORTED_IN_STEREO_MSG);
|
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
ALfloat f;
|
ALfloat f;
|
||||||
|
|||||||
Reference in New Issue
Block a user