Separate XAudio2 from DirectSound in preference and CMake
This commit is contained in:
parent
309996aeb2
commit
b947116937
2 changed files with 16 additions and 3 deletions
|
@ -572,12 +572,18 @@ if(WITH_CSRI)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_compile_definitions(Aegisub PRIVATE "WITH_DIRECTSOUND" "WITH_XAUDIO2")
|
target_compile_definitions(Aegisub PRIVATE "WITH_DIRECTSOUND")
|
||||||
target_link_libraries(Aegisub dsound)
|
target_link_libraries(Aegisub dsound)
|
||||||
target_sources(Aegisub PRIVATE src/audio_player_dsound.cpp src/audio_player_dsound2.cpp src/audio_player_xaudio2.cpp)
|
target_sources(Aegisub PRIVATE src/audio_player_dsound.cpp src/audio_player_dsound2.cpp)
|
||||||
set(WITH_DIRECTSOUND ON)
|
set(WITH_DIRECTSOUND ON)
|
||||||
|
set(WITH_XAUDIO2 ON CACHE BOOL "Enable XAudio2 support")
|
||||||
|
if(WITH_XAUDIO2)
|
||||||
|
target_compile_definitions(Aegisub PRIVATE "WITH_XAUDIO2")
|
||||||
|
target_sources(Aegisub PRIVATE src/audio_player_xaudio2.cpp)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(WITH_DIRECTSOUND OFF)
|
set(WITH_DIRECTSOUND OFF)
|
||||||
|
set(WITH_XAUDIO2 OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(WITH_FFMS2 ON CACHE BOOL "Enable FFMS2 support")
|
set(WITH_FFMS2 ON CACHE BOOL "Enable FFMS2 support")
|
||||||
|
@ -783,6 +789,7 @@ message(STATUS "\n"
|
||||||
" ALSA: ${WITH_ALSA}\n"
|
" ALSA: ${WITH_ALSA}\n"
|
||||||
" DirectSound: ${WITH_DIRECTSOUND}\n"
|
" DirectSound: ${WITH_DIRECTSOUND}\n"
|
||||||
" DirectSound-old: ${WITH_DIRECTSOUND}\n"
|
" DirectSound-old: ${WITH_DIRECTSOUND}\n"
|
||||||
|
" XAudio2: ${WITH_XAUDIO2}\n"
|
||||||
" OpenAL: ${WITH_OPENAL}\n"
|
" OpenAL: ${WITH_OPENAL}\n"
|
||||||
" OSS: ${WITH_OSS}\n"
|
" OSS: ${WITH_OSS}\n"
|
||||||
" PortAudio: ${WITH_PORTAUDIO}\n"
|
" PortAudio: ${WITH_PORTAUDIO}\n"
|
||||||
|
|
|
@ -413,8 +413,14 @@ void Advanced_Audio(wxTreebook *book, Preferences *parent) {
|
||||||
p->OptionBrowse(oss, _("OSS Device"), "Player/Audio/OSS/Device");
|
p->OptionBrowse(oss, _("OSS Device"), "Player/Audio/OSS/Device");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_DIRECTSOUND
|
#if defined(WITH_DIRECTSOUND) && defined(WITH_XAUDIO2)
|
||||||
|
auto dsound = p->PageSizer("DirectSound / XAudio2");
|
||||||
|
#elif defined(WITH_DIRECTSOUND)
|
||||||
auto dsound = p->PageSizer("DirectSound");
|
auto dsound = p->PageSizer("DirectSound");
|
||||||
|
#elif defined(WITH_XAUDIO2)
|
||||||
|
auto dsound = p->PageSizer("XAudio2");
|
||||||
|
#endif
|
||||||
|
#if defined(WITH_DIRECTSOUND) || defined(WITH_XAUDIO2)
|
||||||
p->OptionAdd(dsound, _("Buffer latency"), "Player/Audio/DirectSound/Buffer Latency", 1, 1000);
|
p->OptionAdd(dsound, _("Buffer latency"), "Player/Audio/DirectSound/Buffer Latency", 1, 1000);
|
||||||
p->OptionAdd(dsound, _("Buffer length"), "Player/Audio/DirectSound/Buffer Length", 1, 100);
|
p->OptionAdd(dsound, _("Buffer length"), "Player/Audio/DirectSound/Buffer Length", 1, 100);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue