]> git.mxchange.org Git - simgear.git/commitdiff
Get soundmgr_aeonwave in a compilig state
authorErik Hofman <erik@ehofman.com>
Mon, 4 Jul 2016 12:26:19 +0000 (14:26 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
CMakeLists.txt
simgear/sound/CMakeLists.txt
simgear/sound/sample.hxx
simgear/sound/soundmgr_aeonwave.cxx
simgear/sound/soundmgr_aeonwave.hxx

index 90bf1d2364590b06d9721fe6987aad22ecdc3573..89604dd56a479ec906b08a9a9863a4c3c8202865 100644 (file)
@@ -131,6 +131,7 @@ option(SIMGEAR_HEADLESS "Set to ON to build SimGear without GUI/graphics support
 option(ENABLE_RTI       "Set to ON to build SimGear with RTI support" OFF)
 option(ENABLE_TESTS     "Set to OFF to disable building SimGear's test applications" ON)
 option(ENABLE_SOUND     "Set to OFF to disable building SimGear's sound support" ON)
+option(USE_AEONWAVE     "set to ON to use AeonWave instead of OpenAL" ON)
 option(ENABLE_PKGUTIL   "Set to ON to build the sg_pkgutil application (default)" ON)
 option(ENABLE_DNS       "Set to ON to use udns library and DNS service resolver" ON)
 
@@ -191,8 +192,12 @@ if (MSVC AND MSVC_3RDPARTY_ROOT)
                        )
   # set (BOOST_ROOT ${MSVC_3RDPARTY_ROOT}/boost_1_44_0)
   message(STATUS "BOOST_ROOT is ${BOOST_ROOT}")
-  set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include)
-  set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib)
+  if (USE_AEONWAVE)
+    find_package(AAX COMPONENTS aax REQUIRED)
+  else()
+    set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include)
+    set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib)
+  endif()
 endif (MSVC AND MSVC_3RDPARTY_ROOT)
 
 if(APPLE)
@@ -207,11 +212,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
     find_package(Threads REQUIRED)
 endif()
 
-# Somehow this only works if included before searching for Boost...
-include(BoostTestTargets)
-
 find_package(Boost REQUIRED)
 set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION")
+include(BoostTestTargets)
 
 if(SIMGEAR_HEADLESS)
     message(STATUS "SimGear mode: HEADLESS")
@@ -399,10 +402,20 @@ include_directories(BEFORE ${PROJECT_BINARY_DIR}/simgear)
 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
     ${Boost_INCLUDE_DIRS}
     ${ZLIB_INCLUDE_DIR}
-    ${OPENAL_INCLUDE_DIR}
     ${CURL_INCLUDE_DIRS}
 )
 
+if (USE_AEONWAVE)
+    find_package(AAX COMPONENTS aax REQUIRED)
+    include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
+        ${AAX_INCLUDE_DIR}
+    )
+else()
+    include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
+        ${OPENAL_INCLUDE_DIR}
+    )
+endif()
+
 add_definitions(-DHAVE_CONFIG_H)
 
 # configure a header file to pass some of the CMake settings
index cd52e6d1cebe18d3494d23cbe36778e79870b718..2f57ca4beefb8ba99bc3f52f5e6e54f028b881e2 100644 (file)
@@ -3,7 +3,7 @@ include (SimGearComponent)
 set(HEADERS 
     sample.hxx
     sample_group.hxx
-    soundmgr_openal.hxx
+    soundmgr_aeonwave.hxx
     xmlsound.hxx
     readwav.hxx
     )
@@ -11,33 +11,54 @@ set(HEADERS
 set(SOURCES 
     sample.cxx
     sample_group.cxx
-    soundmgr_openal.cxx
+    soundmgr_aeonwave.cxx
     xmlsound.cxx
     readwav.cxx
     soundmgr_openal_private.hxx
     )
 
+if (USE_AEONWAVE)
+    set(HEADERS ${HEADERS}
+        soundmgr_aeonwave.hxx
+        )
+    set(SOURCES ${SOURCES}
+        soundmgr_aeonwave.cxx
+        )
+else()
+    set(HEADERS ${HEADERS}
+        soundmgr_openal.hxx
+        )
+    set(SOURCES ${SOURCES}
+        soundmgr_openal.cxx
+        )
+endif()
+
 simgear_scene_component(sound sound "${SOURCES}" "${HEADERS}")
 
 if(ENABLE_TESTS AND ENABLE_SOUND)
 
-if (SIMGEAR_SHARED)
     set( SOUND_TEST_LIBS
-        ${TEST_LIBS})
-else()
-    set(SOUND_TEST_LIBS
         ${TEST_LIBS}
-        ${OPENAL_LIBRARY})
-endif()
+    )
+
+    if (USE_AEONWAVE)
+    else ()
+        if (SIMGEAR_SHARED)
+        else()
+            set(SOUND_TEST_LIBS ${SOUND_TEST_LIBS}
+                ${OPENAL_LIBRARY}
+            )
+        endif()
 
-function(create_test TEST_NAME)
-    add_executable(${TEST_NAME} ${TEST_NAME}.cxx)
-    target_link_libraries(${TEST_NAME} ${SOUND_TEST_LIBS})
-    set_target_properties(${TEST_NAME} PROPERTIES
-            COMPILE_DEFINITIONS "SRC_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"" )
-endfunction()
+        function(create_test TEST_NAME)
+            add_executable(${TEST_NAME} ${TEST_NAME}.cxx)
+            target_link_libraries(${TEST_NAME} ${SOUND_TEST_LIBS})
+            set_target_properties(${TEST_NAME} PROPERTIES
+                COMPILE_DEFINITIONS "SRC_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"" )
+        endfunction()
     
-create_test(openal_test1)
-create_test(openal_test2)
-create_test(openal_test3)
+        create_test(openal_test1)
+        create_test(openal_test2)
+        create_test(openal_test3)
+    endif()
 endif()
index 13da128d2b5f985c6d4403925f8ae84b3f34dad7..0efb7d320e89167a2ef4e67c23cd70a26df6e6a6 100644 (file)
@@ -111,6 +111,7 @@ public:
     inline size_t get_size() const {
         return (_samples * _tracks * _bits)/8;
     }
+    inline size_t get_no_samples() { return _samples; }
 
 
     /**
@@ -446,6 +447,10 @@ public:
         _tracks = fmt & 0x3; _bits = fmt & 0x1C; _compressed = fmt & 0x100;
     }
 
+    inline void set_bits_sample( unsigned int b ) { _bits = b; }
+    inline void set_no_tracks( unsigned int t ) { _tracks = t; }
+    inline void set_compressed( bool c ) { _compressed = c; }
+
     /**
      * Set the block alignament for compressed audio.
      * @param block the block alignment in bytes
index 89f3e6310a6f88032a77541243f0a299073d5df0..2bc863a2e92b425efd991c34f1ff69a5aaeb2eb9 100644 (file)
@@ -54,18 +54,23 @@ typedef std::map < unsigned int,AAX::Buffer& > buffer_map;
 typedef buffer_map::iterator buffer_map_iterator;
 typedef buffer_map::const_iterator  const_buffer_map_iterator;
 
+typedef std::map < std::string, SGSharedPtr<SGSampleGroup> > sample_group_map;
+typedef sample_group_map::iterator sample_group_map_iterator;
+typedef sample_group_map::const_iterator const_sample_group_map_iterator;
+
+#define BLOCKSIZE_TO_SMP(a)            ((a) > 1) ? (((a)-4)*2) : 1
+
 class SGSoundMgr::SoundManagerPrivate
 {
 public:
     SoundManagerPrivate() :
-        _buffer_id(0),
-        _source_id(0),
         _base_pos(SGVec3d::zeros()),
+        _buffer_id(0),
+        _source_id(0)
     {
     }
-    
-    void init()
-    {
+
+    void init() {
         _mtx64 = AAX::Matrix64();
     }
     
@@ -73,7 +78,7 @@ public:
     {
         SGVec3d sgv_at = _orientation.backTransform(-SGVec3d::e3());
         SGVec3d sgv_up = _orientation.backTransform(SGVec3d::e2());
-        _mtx64.set(_base_pos, sgv_at, sgv_up);
+        _mtx64.set(_base_pos.data(), sgv_at.data(), sgv_up.data());
     }
         
     AAX::AeonWave _aax;
@@ -84,14 +89,22 @@ public:
 
     unsigned int _buffer_id;
     buffer_map _buffers;
+    AAX::Buffer nullBuffer;
+    AAX::Buffer& get_buffer(unsigned int id) {
+        buffer_map_iterator buffer_it = _buffers.find(id);
+        if ( buffer_it != _buffers.end() )  return buffer_it->second;
+        SG_LOG(SG_SOUND, SG_ALERT, "unknown buffer id requested.");
+        return nullBuffer;
+    }
 
     unsigned int _source_id;
     source_map _sources;
+    AAX::Emitter nullEmitter;
     AAX::Emitter& get_source(unsigned int id) {
-        source_map_iterator source_it = _d->_sources.find(id);
-        if ( source_it != d->_sources.end() )  return source_it->second;
+        source_map_iterator source_it = _sources.find(id);
+        if ( source_it != _sources.end() )  return source_it->second;
         SG_LOG(SG_SOUND, SG_ALERT, "unknown source id requested.");
-        return NULL;
+        return nullEmitter;
     }
 
     sample_group_map _sample_groups;
@@ -106,13 +119,11 @@ public:
 
 // constructor
 SGSoundMgr::SGSoundMgr() :
+    _renderer("unknown"),
+    _vendor("unknown"),
     _active(false),
     _changed(true),
-    _volume(0.0),
-    _offset_pos(SGVec3d::zeros()),
-    _velocity(SGVec3d::zeros()),
-    _renderer("unknown"),
-    _vendor("unknown")
+    _volume(0.0)
 {
     d.reset(new SoundManagerPrivate);
     d->_base_pos = SGVec3d::fromGeod(_geod_pos);
@@ -139,7 +150,7 @@ void SGSoundMgr::init()
 
     SG_LOG( SG_SOUND, SG_INFO, "Initializing AeonWave sound manager" );
 
-    _source_id = 0;
+    d->_source_id = 0;
     d->_sources.clear();
 
     AAX::AeonWave aax;
@@ -154,7 +165,7 @@ void SGSoundMgr::init()
         aax = AAX::AeonWave(devname);
     }
 
-    if ((!devname)||(testForError(device, "Audio device not available, trying default.")) ) {
+    if ((!devname)||(testForError(aax, "Audio device not available, trying default.")) ) {
         aax = AAX::AeonWave(AAX_MODE_WRITE_STEREO);
         if (testForError(aax, "Default audio device not available.") ) {
            return;
@@ -230,10 +241,10 @@ void SGSoundMgr::stop()
         sgrp->stop();
     }
 
-    _bufefr_id = 0;
+    d->_buffer_id = 0;
     d->_buffers.clear();
 
-    _source_id = 0;
+    d->_source_id = 0;
     d->_sources.clear();
 
     if (is_working()) {
@@ -307,15 +318,14 @@ void SGSoundMgr::update( double dt )
             SGQuatd hlOr = SGQuatd::fromLonLat( _geod_pos );
             SGVec3d velocity = SGVec3d::zeros();
             if ( _velocity[0] || _velocity[1] || _velocity[2] ) {
-                velocity = hlOr.backTransform(_velocity*SG_FEET_TO_METER);
-            }
-
-            if ( _bad_doppler ) {
-                velocity *= 100.0f;
+                velocity = SGVec3d( _velocity*SG_FEET_TO_METER );
+                velocity = hlOr.backTransform(velocity);
             }
+            AAX::Vector vel(velocity.data());
+            d->_aax.sensor_velocity(vel);
 
-            d->_aax.sensor_velocity(AAX::Vector(toVec3f(velocity).data()));
-            d->_aax.sensor_matrix(d->_mtx64);
+            AAX::Matrix mtx = d->_mtx64.toMatrix();
+            d->_aax.sensor_matrix(mtx);
 
             testForError("update");
             _changed = false;
@@ -392,14 +402,14 @@ void SGSoundMgr::set_volume( float v )
 unsigned int SGSoundMgr::request_source()
 {
     unsigned int id = d->_source_id++;
-    d->_sources.insert( std::pair<id,AAX::Emitter()> );
+    d->_sources.insert( std::make_pair(id,AAX::Emitter()) );
     return id;
 }
 
 // Free up a source id
 void SGSoundMgr::release_source( unsigned int source )
 {
-    source_map_iterator source_it = _d->_sources.find(source);
+    source_map_iterator source_it = d->_sources.find(source);
     if ( source_it != d->_sources.end() )
     {
         AAX::Emitter& emitter = source_it->second;
@@ -418,71 +428,61 @@ unsigned int  SGSoundMgr::request_buffer(SGSoundSample *sample)
     if ( !sample->is_valid_buffer() ) {
         // sample was not yet loaded or removed again
         std::string sample_name = sample->get_sample_name();
-        void *sample_data = NULL;
-
-        // sample name was not found in the buffer cache.
-        if ( sample->is_file() ) {
-            AAX::Buffer& buf = d->_aax->buffer(sample_name);
-            if (!buf) {
-              SG_LOG(SG_SOUND, SG_ALERT,
-                    "failed to load sound file: " << sample_name);
-              sample->set_buffer( SGSoundMgr::FAILED_BUFFER );
-              return FAILED_BUFFER;
-            }
-
-            buffer = d->_buffer_id++;
-            d->_buffers.insert( std::pair<buffer,buf> );
 
-            sample->set_block_align( buf.get(AAX_BLOCK_ALIGNMENT) );
-            sample->set_frequency( buf.get(AAX_FREQUENCY) );
-            sample->set_no_samples( buf.get(AAX_NO_SAMPLES) );
-            sample->set_no_tracks( buf.get(AAX_TRACKS) );
-
-            enum aaxFormat fmt = buf.get(AAX_FORMAT);
-            sample->set_bits_sample( aaxGetBitsPerSample(fmt) );
+        AAX::Buffer& buf = d->_aax.buffer(sample_name);
+        if (!buf) {
+            SG_LOG(SG_SOUND, SG_ALERT,
+                   "Unable to create buffer: " << sample_name);
+            sample->set_buffer( SGSoundMgr::FAILED_BUFFER );
+            return FAILED_BUFFER;
+        }
 
-            bool c = (fmt == AAX_MULAW || fmt == AAX_IMA4_ADPCM);
-            sample->set_compressed(c);
+        buffer = d->_buffer_id++;
+        d->_buffers.insert( std::make_pair<unsigned int,AAX::Buffer&>(buffer,buf) );
 
-        } else {
+        if ( !sample->is_file() ) {
             enum aaxFormat format = AAX_FORMAT_NONE;
             switch( sample->get_format() )
             {
             case SG_SAMPLE_MONO16:
-                format = AAX_FORMAT_PCM16;
+                format = AAX_PCM16S;
                 break;
             case SG_SAMPLE_MONO8:
-                format = AAX_FORMAT_PCM8;
+                format = AAX_PCM8S;
                 break;
             case SG_SAMPLE_MULAW:
-                format = AAX_FORMAT_MULAW;
+                format = AAX_MULAW;
                 break;
             case SG_SAMPLE_ADPCM:
-                format = AAX_FORMAT_IMA4_ADPCM;
+                format = AAX_IMA4_ADPCM;
                 break;
             default:
                 SG_LOG(SG_SOUND, SG_ALERT, "unsupported audio format");
                 return buffer;
             }
 
-            AAX::Buffer& buf = d->_aax->buffer(sample_name);
-            if ( buf ) {
-                unsigned int no_samples = sample->get_no_samples();
+            unsigned int no_samples = sample->get_no_samples();
+            buf.set(d->_aax, no_samples, 1, format);
+            buf.set( AAX_FREQUENCY, sample->get_frequency() );
+            buf.fill( sample->get_data() );
 
-                buf.set(d->_aax, no_samples, 1, format);
-                buf.set( AAX_FREQUENCY, sample->get_frequency() );
-                buf.fill( sample->get_data() );
-
-                if (format == AAX_FORMAT_IMA4_ADPCM) {
-                    size_t samples_block = BLOCKSIZE_TO_SMP( sample->get_block_align() );
-                    buf.set( AAX_BLOCK_ALIGNMENT, samples_block );
-                }
-
-                buffer = d->_buffer_id++;
-                d->_buffers.insert( std::pair<buffer,buf> );
-                sample->set_buffer(buffer);
+            if (format == AAX_IMA4_ADPCM) {
+                size_t samples_block = BLOCKSIZE_TO_SMP( sample->get_block_align() );
+                buf.set( AAX_BLOCK_ALIGNMENT, samples_block );
             }
         }
+
+        sample->set_buffer(buffer);
+        sample->set_block_align( buf.get(AAX_BLOCK_ALIGNMENT) );
+        sample->set_frequency( buf.get(AAX_FREQUENCY) );
+        sample->set_no_samples( buf.get(AAX_NO_SAMPLES) );
+        sample->set_no_tracks( buf.get(AAX_TRACKS) );
+
+        enum aaxFormat fmt = aaxFormat( buf.get(AAX_FORMAT) );
+        sample->set_bits_sample( aaxGetBitsPerSample(fmt) );
+
+        bool c = (fmt == AAX_MULAW || fmt == AAX_IMA4_ADPCM);
+        sample->set_compressed(c);
     }
     else {
         buffer = sample->get_buffer();
@@ -496,13 +496,13 @@ void SGSoundMgr::release_buffer(SGSoundSample *sample)
     if ( !sample->is_queue() )
     {
         unsigned int buffer = sample->get_buffer();
-        buffer_map_iterator buffer_it = _d->_buffers.find(buffer);
+        buffer_map_iterator buffer_it = d->_buffers.find(buffer);
         if ( buffer_it != d->_buffers.end() )
         {
             sample->no_valid_buffer();
 #ifdef ENABLE_SOUND
             AAX::Buffer& buffer = buffer_it->second;
-            d->_aax->destroy(buffer);
+            d->_aax.destroy(buffer);
 #endif
             d->_buffers.erase(buffer_it);
             testForError("release buffer");
@@ -514,7 +514,7 @@ void SGSoundMgr::sample_suspend( SGSoundSample *sample )
 {
     if ( sample->is_valid_source() && sample->is_playing() ) {
         AAX::Emitter& emitter = d->get_source(sample->get_source());
-        emitter.set(AAX_PASUED);
+        emitter.set(AAX_SUSPENDED);
     }
 }
 
@@ -539,7 +539,8 @@ void SGSoundMgr::sample_play( SGSoundSample *sample )
     AAX::Emitter& emitter = d->get_source(sample->get_source());
 
     if ( !sample->is_queue() ) {
-        emitter.add(request_buffer(sample));
+        unsigned int buffer = request_buffer(sample);
+        emitter.add( d->get_buffer(buffer) );
     }
 
     AAX::DSP dsp = emitter.get(AAX_DISTANCE_FILTER);
@@ -577,7 +578,7 @@ void SGSoundMgr::sample_destroy( SGSoundSample *sample )
 { 
     if ( sample->is_valid_source() ) {
 #ifdef ENABLE_SOUND
-        ALint source = sample->get_source();
+        unsigned int source = sample->get_source();
         if ( sample->is_playing() ) {
             AAX::Emitter& emitter = d->get_source(source);
             emitter.set(AAX_STOPPED);
@@ -610,9 +611,13 @@ void SGSoundMgr::update_sample_config( SGSoundSample *sample, SGVec3d& position,
     AAX::Emitter& emitter = d->get_source(sample->get_source());
     AAX::DSP dsp;
 
-    d->_mtx64.set(position.data(), orientation.data());
-    emitter.velocity(velocity.data());
-    emitter.matrix(d->_mtx64);
+    AAX::Vector64 pos = position.data();
+    AAX::Vector64 ori = orientation.data();
+    AAX::Vector vel = velocity.data();
+    d->_mtx64.set(pos, ori);
+    AAX::Matrix mtx = d->_mtx64;
+    emitter.matrix(mtx);
+    emitter.velocity(vel);
 
     dsp = emitter.get(AAX_VOLUME_FILTER);
     dsp.set(AAX_GAIN, sample->get_volume());
@@ -631,7 +636,7 @@ void SGSoundMgr::update_sample_config( SGSoundSample *sample, SGVec3d& position,
 
         dsp = emitter.get(AAX_DISTANCE_FILTER);
         dsp.set(AAX_REF_DISTANCE, sample->get_reference_dist());
-        sp.set(AAX_MAX_DISTANC, sample->get_max_dist();
+        dsp.set(AAX_MAX_DISTANCE, sample->get_max_dist());
         emitter.set(dsp);
     }
 }
@@ -643,14 +648,13 @@ vector<const char*> SGSoundMgr::get_available_devices()
 #ifdef ENABLE_SOUND
     std::string on = " on ";
     std::string colon = ": ";
-    while (std::string d = d->_aax.drivers()) {
-        while (std::string r = d->_aax.devices()) {
-            while (std::string i = d->_aax.interfaces()) {
-                std::string name;
-                if (!i.empty() && !r.empty()) name = d + on + r + colon + i;
-                else if (!r.empty()) name = d + on + r;
-                else if (!i.empty) name = d + colon + i;
-                else name = d;
+    while (const char* be = d->_aax.drivers()) {
+        while (const char* r = d->_aax.devices()) {
+            while (const char* i = d->_aax.interfaces()) {
+                std::string name = be;
+                if (i && r) name += on + r + colon + i;
+                else if (r) name += on + r;
+                else if (i) name += colon + i;
 
                 d->_devices.push_back(name);
                 devices.push_back(name.c_str());
@@ -685,20 +689,6 @@ bool SGSoundMgr::testForError(std::string s, std::string name)
     return false;
 }
 
-bool SGSoundMgr::testForALCError(std::string s)
-{
-#ifdef ENABLE_SOUND
-    enum aaxErrorType error = d->_aax.error_no();
-    if (error != AAX_ERROR_NONE) {
-        SG_LOG( SG_SOUND, SG_ALERT, "Error (sound manager): "
-                                       << d->_aax.error(error) << " at "
-                                       << s);
-        return true;
-    }
-#endif
-    return false;
-}
-
 bool SGSoundMgr::is_working() const 
 {
     return (d->_aax != NULL);
@@ -717,9 +707,7 @@ void SGSoundMgr::set_orientation( const SGQuatd& ori )
 
 const SGVec3d& SGSoundMgr::get_position() const
 { 
-    aaxVec3d pos, at, up;
-    d->_mtx64.get(pos, at, up);
-    return pos;
+    return d->_base_pos;
 }
 
 void SGSoundMgr::set_position( const SGVec3d& pos, const SGGeod& pos_geod )
@@ -729,7 +717,7 @@ void SGSoundMgr::set_position( const SGVec3d& pos, const SGGeod& pos_geod )
 
 SGVec3f SGSoundMgr::get_direction() const
 {
-    aaxVec3d pos, at, up;
+    aaxVec3f pos, at, up;
     d->_mtx64.get(pos, at, up);
-    return at;
+    return SGVec3f( at );
 }
index 7267738889ec5195bc7be288031b4e68c1d5dfd3..91fb9b57b1fc3d1589a33722d5f24182260ef570 100644 (file)
@@ -127,7 +127,7 @@ public:
     void set_position( const SGVec3d& pos, const SGGeod& pos_geod );
 
     void set_position_offset( const SGVec3d& pos ) {
-        _offset_pos = pos; _changed = true;
+        _offset_pos = pos.data(); _changed = true;
     }
 
     /**
@@ -145,7 +145,7 @@ public:
      * @param vel Velocity vector
      */
     void set_velocity( const SGVec3d& vel ) {
-        _velocity = vel; _changed = true;
+        _velocity = vel.data(); _changed = true;
     }
 
     /**
@@ -154,7 +154,7 @@ public:
      *
      * @return Velocity vector of the OpenAL listener
      */
-    inline SGVec3f get_velocity() { return toVec3f(_velocity); }
+    inline SGVec3f get_velocity() { SGVec3f f(_velocity); return f; }
 
     /**
      * Set the orientation of the sound manager
@@ -299,7 +299,7 @@ public:
      * a problem in the implementation or in out code. Until then
      * this function is used to detect the problematic implementations.
      */
-    inline bool bad_doppler_effect() { return _bad_doppler; }
+    inline bool bad_doppler_effect() { return false; }
 
     /**
      * Get a list of available playback devices.
@@ -316,6 +316,7 @@ public:
 
     static const char* subsystemName() { return "sound"; };
 private:
+    class SoundManagerPrivate;
     /// private implementation object
     std::auto_ptr<SoundManagerPrivate> d;
 
@@ -328,11 +329,11 @@ private:
     float _volume;
 
     // Position of the listener.
-    SGVec3d _offset_pos;
+    AAX::Vector64 _offset_pos;
     SGGeod _geod_pos;
 
     // Velocity of the listener.
-    AAX::Vector _velocity;
+    AAX::Vector64 _velocity;
 
     bool testForError(void *p, std::string s);