X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsound%2Fsample_queue.cxx;h=4af91d7879502faae48299954a91ef5f9421d640;hb=1f23fb89c01549349204f6fe559a9639b7a4a60b;hp=a367ed25355cb6cfa6c09cf5ab6ea2e7785eb4b0;hpb=879dc295a89adea906ed8aac7d82cb35c8ee346c;p=simgear.git diff --git a/simgear/sound/sample_queue.cxx b/simgear/sound/sample_queue.cxx index a367ed25..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,31 +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), - _loop(false), - _playing(false), - _changed(true) + _playing(false) { + _freq = freq; + _format = format; _buffers.clear(); } @@ -77,6 +60,7 @@ SGSampleQueue::~SGSampleQueue() { void SGSampleQueue::stop() { +#ifdef ENABLE_SOUND ALint num; alGetSourcei(_source, AL_BUFFERS_PROCESSED, &num); for (int i=0; i