00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "SND_SoundObject.h"
00010
00011 SND_SoundObject::SND_SoundObject() : m_modified(true)
00012 {
00013 m_modified = false;
00014 m_sample = "";
00015 m_pitch = 1;
00016 m_gain = 1;
00017 m_position[0] = 0.0;
00018 m_position[1] = 0.0;
00019 m_position[2] = 0.0;
00020 m_velocity[0] = 0.0;
00021 m_velocity[1] = 0.0;
00022 m_velocity[2] = 0.0;
00023 m_orientation[0][0] = 0.0;
00024 m_orientation[0][1] = 0.0;
00025 m_orientation[0][2] = 1.0;
00026 m_orientation[1][0] = 0.0;
00027 m_orientation[1][1] = 1.0;
00028 m_orientation[1][2] = 0.0;
00029 m_islooping = false;
00030 m_playstate = SND_INITIAL;
00031 }
00032
00033 SND_SoundObject::~SND_SoundObject()
00034 {
00035 ;
00036 }
00037
00038 void SND_SoundObject::startSound()
00039 {
00040 m_playstate = SND_MUST_PLAY;
00041 m_modified = true;
00042 }
00043
00044 void SND_SoundObject::stopSound()
00045 {
00046 m_playstate = SND_MUST_STOP;
00047 m_modified = true;
00048 }
00049
00050 void SND_SoundObject::pauseSound()
00051 {
00052 m_playstate = SND_MUST_PAUSE;
00053 m_modified = true;
00054 }
00055
00056 void SND_SoundObject::setGain(MT_Scalar gain)
00057 {
00058 m_gain = gain;
00059 m_modified = true;
00060 }
00061
00062 void SND_SoundObject::setPitch(MT_Scalar pitch)
00063 {
00064 m_pitch = pitch;
00065 m_modified = true;
00066 }
00067
00068 void SND_SoundObject::setPosition (const MT_Point3& pos)
00069 {
00070 m_position = pos;
00071 m_modified = true;
00072 }
00073
00074 void SND_SoundObject::setVelocity(const MT_Vector3& vel)
00075 {
00076 m_velocity = vel;
00077 m_modified = true;
00078 }
00079
00080 void SND_SoundObject::setOrientation(const MT_Matrix3x3& orient)
00081 {
00082 m_orientation = orient;
00083 m_modified = true;
00084 }
00085
00086 void SND_SoundObject::setLooping(bool isLooping)
00087 {
00088 m_islooping = isLooping;
00089 m_modified = true;
00090 }