This file was deleted.

@@ -60,8 +60,6 @@ Dolphin includes or links code of the following third-party software projects:
[LGPLv2+](http://www.surina.net/soundtouch/license.html)
- [TAP-Windows](https://openvpn.net/):
header only
- [XAudio2](http://msdn.microsoft.com/en-us/library/windows/desktop/hh405049.aspx):
headers only
- [xxHash](https://github.com/Cyan4973/xxHash):
[2-clause BSD](https://github.com/Cyan4973/xxHash/blob/master/LICENSE)
- [zlib](http://www.zlib.net/):
@@ -11,8 +11,6 @@
#include "AudioCommon/OpenSLESStream.h"
#include "AudioCommon/PulseAudioStream.h"
#include "AudioCommon/WASAPIStream.h"
#include "AudioCommon/XAudio2Stream.h"
#include "AudioCommon/XAudio2_7Stream.h"
#include "Common/Common.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
@@ -29,30 +27,37 @@ static bool s_sound_stream_running = false;
constexpr int AUDIO_VOLUME_MIN = 0;
constexpr int AUDIO_VOLUME_MAX = 100;

void InitSoundStream()
static std::unique_ptr<SoundStream> CreateSoundStreamForBackend(std::string_view backend)
{
std::string backend = SConfig::GetInstance().sBackend;
if (backend == BACKEND_CUBEB)
g_sound_stream = std::make_unique<CubebStream>();
return std::make_unique<CubebStream>();
else if (backend == BACKEND_OPENAL && OpenALStream::isValid())
g_sound_stream = std::make_unique<OpenALStream>();
return std::make_unique<OpenALStream>();
else if (backend == BACKEND_NULLSOUND)
g_sound_stream = std::make_unique<NullSound>();
else if (backend == BACKEND_XAUDIO2)
{
if (XAudio2::isValid())
g_sound_stream = std::make_unique<XAudio2>();
else if (XAudio2_7::isValid())
g_sound_stream = std::make_unique<XAudio2_7>();
}
return std::make_unique<NullSound>();
else if (backend == BACKEND_ALSA && AlsaSound::isValid())
g_sound_stream = std::make_unique<AlsaSound>();
return std::make_unique<AlsaSound>();
else if (backend == BACKEND_PULSEAUDIO && PulseAudio::isValid())
g_sound_stream = std::make_unique<PulseAudio>();
return std::make_unique<PulseAudio>();
else if (backend == BACKEND_OPENSLES && OpenSLESStream::isValid())
g_sound_stream = std::make_unique<OpenSLESStream>();
return std::make_unique<OpenSLESStream>();
else if (backend == BACKEND_WASAPI && WASAPIStream::isValid())
g_sound_stream = std::make_unique<WASAPIStream>();
return std::make_unique<WASAPIStream>();
return {};
}

void InitSoundStream()
{
std::string backend = SConfig::GetInstance().sBackend;
g_sound_stream = CreateSoundStreamForBackend(backend);

if (!g_sound_stream)
{
WARN_LOG(AUDIO, "Unknown backend %s, using %s instead.", backend.c_str(),
GetDefaultSoundBackend().c_str());
backend = GetDefaultSoundBackend();
g_sound_stream = CreateSoundStreamForBackend(GetDefaultSoundBackend());
}

if (!g_sound_stream || !g_sound_stream->Init())
{
@@ -101,8 +106,6 @@ std::vector<std::string> GetSoundBackends()

backends.emplace_back(BACKEND_NULLSOUND);
backends.emplace_back(BACKEND_CUBEB);
if (XAudio2_7::isValid() || XAudio2::isValid())
backends.emplace_back(BACKEND_XAUDIO2);
if (AlsaSound::isValid())
backends.emplace_back(BACKEND_ALSA);
if (PulseAudio::isValid())
@@ -127,8 +130,6 @@ bool SupportsDPL2Decoder(std::string_view backend)
return true;
if (backend == BACKEND_PULSEAUDIO)
return true;
if (backend == BACKEND_XAUDIO2)
return true;
return false;
}

@@ -142,8 +143,7 @@ bool SupportsVolumeChanges(std::string_view backend)
// FIXME: this one should ask the backend whether it supports it.
// but getting the backend from string etc. is probably
// too much just to enable/disable a stupid slider...
return backend == BACKEND_CUBEB || backend == BACKEND_OPENAL || backend == BACKEND_XAUDIO2 ||
backend == BACKEND_WASAPI;
return backend == BACKEND_CUBEB || backend == BACKEND_OPENAL || backend == BACKEND_WASAPI;
}

void UpdateSoundStream()
@@ -46,10 +46,6 @@
<ClCompile Include="WASAPIStream.cpp" />
<ClCompile Include="SurroundDecoder.cpp" />
<ClCompile Include="WaveFile.cpp" />
<ClCompile Include="XAudio2Stream.cpp" />
<ClCompile Include="XAudio2_7Stream.cpp">
<AdditionalIncludeDirectories>$(ExternalsDir)XAudio2_7;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AlsaSoundStream.h" />
@@ -66,8 +62,6 @@
<ClInclude Include="WASAPIStream.h" />
<ClInclude Include="SurroundDecoder.h" />
<ClInclude Include="WaveFile.h" />
<ClInclude Include="XAudio2Stream.h" />
<ClInclude Include="XAudio2_7Stream.h" />
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
@@ -17,12 +17,6 @@
<ClCompile Include="OpenALStream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="XAudio2Stream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="XAudio2_7Stream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="CubebStream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
@@ -43,12 +37,6 @@
<ClInclude Include="OpenALStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="XAudio2Stream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="XAudio2_7Stream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="PulseAudioStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
@@ -71,19 +71,7 @@ if(WIN32)

WASAPIStream.cpp
WASAPIStream.h
XAudio2Stream.cpp
XAudio2Stream.h
)

add_library(audiocommon_xaudio27
XAudio2_7Stream.cpp
XAudio2_7Stream.h
)
target_include_directories(audiocommon_xaudio27 PRIVATE
${PROJECT_SOURCE_DIR}/Externals
${PROJECT_SOURCE_DIR}/Externals/XAudio2_7
)
target_link_libraries(audiocommon PRIVATE audiocommon_xaudio27)
endif()

target_link_libraries(audiocommon PRIVATE cubeb SoundTouch FreeSurround)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -53,7 +53,6 @@ struct BootParameters;
#define BACKEND_CUBEB "Cubeb"
#define BACKEND_OPENAL "OpenAL"
#define BACKEND_PULSEAUDIO "Pulse"
#define BACKEND_XAUDIO2 "XAudio2"
#define BACKEND_OPENSLES "OpenSLES"
#define BACKEND_WASAPI _trans("WASAPI (Exclusive Mode)")

@@ -73,10 +73,10 @@
This numeral indicates the "minimum system required" to run the resulting
program. Dolphin targets Vista+, so it should be 0x0600. However in practice,
_WIN32_WINNT just removes up-level API declarations from headers. This is a
problem for XAudio2 and XInput, where Dolphin expects to compile against the
Win8+ versions of their headers. So while we really need Vista+ level of
support, we declare Win8+ here globally. If this becomes a problem, the
higher declaration can be contained to just the XAudio2/XInput related code.
problem for XInput, where Dolphin expects to compile against the Win8+
versions of the headers. So while we really need Vista+ level of support,
we declare Win8+ here globally. If this becomes a problem, the higher
declaration can be contained to just the XInput related code.
-->
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>