Skip to content

Commit

Permalink
Audaspace: porting minor improvements from upstream
Browse files Browse the repository at this point in the history
- NullDevice is now called None
- Automatic choice of best available device.
- Minor formatting, documentation and cmake fixes.
  • Loading branch information
neXyon committed Mar 16, 2021
1 parent 262a098 commit 7b8fc30
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
14 changes: 4 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ if(NOT WIN32)
if(UNIX AND NOT APPLE)
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
endif()
else()
set(WITH_JACK OFF)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF)
Expand Down Expand Up @@ -671,16 +673,8 @@ if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
)
endif()

if(NOT WITH_AUDASPACE)
if(WITH_OPENAL)
message(WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled")
set(WITH_OPENAL OFF)
endif()
if(WITH_JACK)
message(WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled")
set(WITH_JACK OFF)
endif()
endif()
set_and_warn_dependency(WITH_AUDASPACE WITH_OPENAL OFF)
set_and_warn_dependency(WITH_AUDASPACE WITH_JACK OFF)

if(NOT WITH_SDL AND WITH_GHOST_SDL)
message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL")
Expand Down
10 changes: 5 additions & 5 deletions extern/audaspace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,16 @@ if(WITH_C)
bindings/C/AUD_Types.h
)

if(WITH_FFTW)
list(APPEND C_SRC
if(WITH_FFTW)
list(APPEND C_SRC
bindings/C/AUD_HRTF.cpp
bindings/C/AUD_ImpulseResponse.cpp
)
)

list(APPEND C_HDR
bindings/C/AUD_HRTF.h
bindings/C/AUD_ImpulseResponse.h
)
)
endif()

if(NOT SEPARATE_C)
Expand Down Expand Up @@ -504,7 +504,7 @@ if(WITH_JACK)
plugins/jack/JackSymbols.h
)

if(DYNLOAD_JACK)
if(DYNLOAD_JACK)
add_definitions(-DDYNLOAD_JACK)
endif()

Expand Down
2 changes: 1 addition & 1 deletion extern/audaspace/bindings/C/AUD_Special.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ AUD_API AUD_Device* AUD_init(const char* device, AUD_DeviceSpecs specs, int buff
{
try
{
std::shared_ptr<IDeviceFactory> factory = DeviceManager::getDeviceFactory(device);
std::shared_ptr<IDeviceFactory> factory = device ? DeviceManager::getDeviceFactory(device) : DeviceManager::getDefaultDeviceFactory();

if(factory)
{
Expand Down
3 changes: 1 addition & 2 deletions extern/audaspace/plugins/jack/JackLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
#endif

/**
* @file JackDevice.h
* @file JackLibrary.h
* @ingroup plugin
* The JackDevice class.
*/

#include "Audaspace.h"
Expand Down
2 changes: 1 addition & 1 deletion extern/audaspace/src/devices/NULLDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class NULLDeviceFactory : public IDeviceFactory

void NULLDevice::registerPlugin()
{
DeviceManager::registerDevice("Null", std::shared_ptr<IDeviceFactory>(new NULLDeviceFactory));
DeviceManager::registerDevice("None", std::shared_ptr<IDeviceFactory>(new NULLDeviceFactory));
}

AUD_NAMESPACE_END
2 changes: 1 addition & 1 deletion source/blender/windowmanager/intern/wm_playanim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ void WM_main_playanim(int argc, const char **argv)

AUD_initOnce();

if (!(audio_device = AUD_init("OpenAL", specs, 1024, "Blender"))) {
if (!(audio_device = AUD_init(NULL, specs, 1024, "Blender"))) {
audio_device = AUD_init("Null", specs, 0, "Blender");
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/creator/creator_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ static const char arg_handle_audio_set_doc[] =
"\n\t"
"Force sound system to a specific device."
"\n\t"
"'NULL' 'SDL' 'OPENAL' 'JACK'.";
"'None' 'SDL' 'OpenAL' 'JACK'.";
static int arg_handle_audio_set(int argc, const char **argv, void *UNUSED(data))
{
if (argc < 1) {
Expand Down

0 comments on commit 7b8fc30

Please sign in to comment.