summaryrefslogtreecommitdiffstats
path: root/src/sound/oalsound/channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sound/oalsound/channel.cpp')
-rw-r--r--src/sound/oalsound/channel.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp
index 01ec3de..c5b05fa 100644
--- a/src/sound/oalsound/channel.cpp
+++ b/src/sound/oalsound/channel.cpp
@@ -17,7 +17,8 @@
#include "channel.h"
-Channel::Channel() {
+Channel::Channel()
+{
alGenSources(1, &mSource);
if (alCheck()) {
@@ -35,10 +36,12 @@ Channel::Channel() {
mStartAmplitude = 0.0f;
mStartFrequency = 0.0f;
mChangeFrequency = 0.0f;
+ mVolume = 0.0f;
}
-Channel::~Channel() {
+Channel::~Channel()
+{
if (mReady) {
alSourceStop(mSource);
alSourcei(mSource, AL_BUFFER, 0);
@@ -49,7 +52,8 @@ Channel::~Channel() {
}
-bool Channel::Play() {
+bool Channel::Play()
+{
if (!mReady || mBuffer == nullptr) {
return false;
}
@@ -65,7 +69,8 @@ bool Channel::Play() {
}
-bool Channel::SetPosition(Math::Vector pos) {
+bool Channel::SetPan(Math::Vector pos)
+{
if (!mReady || mBuffer == nullptr) {
return false;
}
@@ -79,6 +84,18 @@ bool Channel::SetPosition(Math::Vector pos) {
}
+void Channel::SetPosition(Math::Vector pos)
+{
+ mPosition = pos;
+}
+
+
+Math::Vector Channel::GetPosition()
+{
+ return mPosition;
+}
+
+
bool Channel::SetFrequency(float freq)
{
if (!mReady || mBuffer == nullptr) {
@@ -143,6 +160,19 @@ float Channel::GetVolume()
}
+void Channel::SetVolumeAtrib(float volume)
+{
+ mVolume = volume;
+}
+
+
+float Channel::GetVolumeAtrib()
+{
+ return mVolume;
+}
+
+
+
int Channel::GetPriority()
{
return mPriority;