forked from mirror/openmw-tes3mp
Added setPitch to Sound
This commit is contained in:
parent
85fa6d3923
commit
49f0e4b75f
4 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,7 @@ namespace Mangle
|
|||
void setPan(float f) { client->setPan(f); }
|
||||
void setPos(float x, float y, float z)
|
||||
{ client->setPos(x,y,z); }
|
||||
void setPitch(float p) { client->setPitch(p); }
|
||||
void setRepeat(bool b) { client->setRepeat(b); }
|
||||
void setStreaming(bool b) { client->setStreaming(b); }
|
||||
|
||||
|
|
|
@ -48,6 +48,9 @@ class Sound
|
|||
/// Set left/right pan. -1.0 is left, 0.0 is center and 1.0 is right.
|
||||
virtual void setPan(float) = 0;
|
||||
|
||||
/// Set pitch (1.0 is normal speed)
|
||||
virtual void setPitch(float) = 0;
|
||||
|
||||
/// Set the position. May not work with all backends.
|
||||
virtual void setPos(float x, float y, float z) = 0;
|
||||
|
||||
|
|
|
@ -146,6 +146,12 @@ void OpenAL_Sound::setPos(float x, float y, float z)
|
|||
checkALError("setting position");
|
||||
}
|
||||
|
||||
void OpenAL_Sound::setPitch(float pitch)
|
||||
{
|
||||
alSourcef(inst, AL_PITCH, pitch);
|
||||
checkALError("setting pitch");
|
||||
}
|
||||
|
||||
void OpenAL_Sound::setRepeat(bool rep)
|
||||
{
|
||||
alSourcei(inst, AL_LOOPING, rep?AL_TRUE:AL_FALSE);
|
||||
|
|
|
@ -36,6 +36,7 @@ class OpenAL_Sound : public Sound
|
|||
bool isPlaying() const;
|
||||
void setVolume(float);
|
||||
void setPos(float x, float y, float z);
|
||||
void setPitch(float);
|
||||
void setRepeat(bool);
|
||||
void setStreaming(bool) {} // Not implemented yet
|
||||
SoundPtr clone() const;
|
||||
|
|
Loading…
Reference in a new issue