X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsound%2Fsample_queue.cxx;h=4af91d7879502faae48299954a91ef5f9421d640;hb=1f23fb89c01549349204f6fe559a9639b7a4a60b;hp=a7eeac1aa12e8ae3b3bed185a81a5b42a5ee6100;hpb=8a5a1d33019835a648b34d18f0b7d5fc2e4032fc;p=simgear.git diff --git a/simgear/sound/sample_queue.cxx b/simgear/sound/sample_queue.cxx index a7eeac1a..4af91d78 100644 --- a/simgear/sound/sample_queue.cxx +++ b/simgear/sound/sample_queue.cxx @@ -1,3 +1,4 @@ + // queue.cxx -- Audio sample encapsulation class // // Written by Curtis Olson, started April 2004. @@ -26,16 +27,18 @@ # include #endif -#include // rand() +#include // rand() +#include #include #include #include -#include #include "soundmgr_openal.hxx" #include "sample_queue.hxx" +#include "soundmgr_openal_private.hxx" +using std::string; // // SGSampleQueue @@ -43,30 +46,11 @@ // empty constructor SGSampleQueue::SGSampleQueue( int freq, int format ) : - _absolute_pos(SGVec3d::zeros()), - _relative_pos(SGVec3d::zeros()), - _direction(SGVec3d::zeros()), - _velocity(SGVec3f::zeros()), - _orientation(SGQuatd::zeros()), - _orivec(SGVec3f::zeros()), - _base_pos(SGVec3d::zeros()), - _rotation(SGQuatd::zeros()), _refname(random_string()), - _format(format), - _freq(freq), - _valid_source(false), - _source(SGSoundMgr::NO_SOURCE), - _inner_angle(360.0), - _outer_angle(360.0), - _outer_gain(0.0), - _pitch(1.0), - _volume(1.0), - _master_volume(1.0), - _reference_dist(500.0), - _max_dist(3000.0), - _playing(false), - _changed(true) + _playing(false) { + _freq = freq; + _format = format; _buffers.clear(); } @@ -76,6 +60,7 @@ SGSampleQueue::~SGSampleQueue() { void SGSampleQueue::stop() { +#ifdef ENABLE_SOUND ALint num; alGetSourcei(_source, AL_BUFFERS_PROCESSED, &num); for (int i=0; i