simgear_scene_component(sound sound "${SOURCES}" "${HEADERS}")
if(ENABLE_TESTS AND ENABLE_SOUND)
+ 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()
set( SOUND_TEST_LIBS
${TEST_LIBS}
)
if (USE_AEONWAVE)
+ if (SIMGEAR_SHARED)
+ else()
+ set(SOUND_TEST_LIBS ${SOUND_TEST_LIBS}
+ ${AAX_LIBRARY}
+ )
+ endif()
+
+ create_test(aeonwave_test1)
+ create_test(aeonwave_test2)
+
else ()
if (SIMGEAR_SHARED)
else()
)
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()
-
create_test(openal_test1)
create_test(openal_test2)
create_test(openal_test3)
d->init();
- d->_aax.set(AAX_INITIALIZED);
- testForError("initialization");
-
- dsp = AAX::DSP(d->_aax, AAX_VOLUME_FILTER);
- dsp.set(AAX_GAIN, 0.0f);
- d->_aax.set(dsp);
+ if ( is_working() )
+ {
+ d->_aax.set(AAX_INITIALIZED);
+ testForError("initialization");
- dsp = AAX::DSP(d->_aax, AAX_DISTANCE_FILTER);
- dsp.set(AAX_AL_INVERSE_DISTANCE_CLAMPED);
- d->_aax.set(dsp);
+ dsp = AAX::DSP(d->_aax, AAX_VOLUME_FILTER);
+ dsp.set(AAX_GAIN, 0.0f);
+ d->_aax.set(dsp);
- dsp = AAX::DSP(d->_aax, AAX_VELOCITY_EFFECT);
- dsp.set(AAX_DOPPLER_FACTOR, 1.0f);
- dsp.set(AAX_SOUND_VELOCITY, 340.3f);
- d->_aax.set(dsp);
+ dsp = AAX::DSP(d->_aax, AAX_DISTANCE_FILTER);
+ dsp.set(AAX_AL_INVERSE_DISTANCE_CLAMPED);
+ d->_aax.set(dsp);
- testForError("scenery setup");
+ dsp = AAX::DSP(d->_aax, AAX_VELOCITY_EFFECT);
+ dsp.set(AAX_DOPPLER_FACTOR, 1.0f);
+ dsp.set(AAX_SOUND_VELOCITY, 340.3f);
+ d->_aax.set(dsp);
+ testForError("scenery setup");
- _vendor = (const char *)d->_aax.info(AAX_VENDOR_STRING);
- _renderer = (const char *)d->_aax.info(AAX_RENDERER_STRING);
+ _vendor = (const char *)d->_aax.info(AAX_VENDOR_STRING);
+ _renderer = (const char *)d->_aax.info(AAX_RENDERER_STRING);
+ }
+ testForError("init");
#endif
}
void SGSoundMgr::update( double dt )
{
#ifdef ENABLE_SOUND
- if (_active) {
+ if ( is_working() && _active ) {
if (_changed) {
d->update_pos_and_orientation();
}
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;
+ if (*i && *r) name += on + r + colon + i;
+ else if (*r) name += on + r;
+ else if (*i) name += colon + i;
d->_devices.push_back( strdup(name.c_str()) );
}
bool SGSoundMgr::is_working() const
{
- return (d->_aax != NULL);
+ return ((const void*)d->_aax != NULL ? true : false);
}
const SGQuatd& SGSoundMgr::get_orientation() const