Merge branch 'master' into android-new-control-input-overlay

Conflicts:
	Source/Core/DolphinWX/Src/Android/ButtonManager.h
This commit is contained in:
Ryan Houdek
2013-11-13 16:17:42 -06:00
1107 changed files with 133362 additions and 62766 deletions
+3 -3
View File
@@ -119,7 +119,7 @@
# libraries. Automatically turned for NDK r5x and r6x due to GLESv2
# problems.
#
# LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
# LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_CURRENT_BINARY_DIR} - where to output binary
# files. See additional details below.
#
# ANDROID_SET_OBSOLETE_VARIABLES=ON - if set, then toolchain defines some
@@ -187,7 +187,7 @@
#
# LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
# libraries will be installed.
# Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
# Default is ${CMAKE_CURRENT_BINARY_DIR}, and the android libs will always be
# under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
# (depending on the target ABI). This is convenient for Android packaging.
#
@@ -1431,7 +1431,7 @@ include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLU
link_directories( "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )
# setup output directories
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
if(NOT _CMAKE_IN_TRY_COMPILE)
@@ -190,14 +190,6 @@ public final class VideoSettingsFragment extends PreferenceFragment
// Is a Tegra 4 since it supports 24bit depth
mSupportsGLES3 = true;
}
if (!mSupportsGLES3 &&
m_GLVendor == null &&
m_GLRenderer == null &&
m_GLExtensions == null)
{
// Couldn't get information. Give them the benefit of the doubt
mSupportsGLES3 = true;
}
return mSupportsGLES3;
}
+5 -1
View File
@@ -2,7 +2,11 @@ set(CMAKE_FAKELANG_CREATE_STATIC_LIBRARY "touch <TARGET>")
if(ENABLE_PCH)
# This is actually a .h file, but trick cmake into compiling it as a source file
set(pch_out_filename "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/pch.dir/pch.h")
set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
if (ANDROID)
set(pch_lib_filename "${LIBRARY_OUTPUT_PATH}/libpch.a")
else()
set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
endif()
set(pch_src_filename "${CMAKE_CURRENT_SOURCE_DIR}/pch.h")
if(APPLE)
+27 -171
View File
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugFast|Win32">
<Configuration>DebugFast</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugFast|x64">
<Configuration>DebugFast</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@@ -27,210 +19,74 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{37D007BD-D66C-4EAF-B56C-BD1AAC340A05}</ProjectGuid>
<RootNamespace>AudioCommon</RootNamespace>
<ProjectGuid>{54AA7840-5BEB-4A0C-9452-74BA4CC7FD44}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
<Import Project="..\..\VSProps\CodeGen_Debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
<Import Project="..\..\VSProps\CodeGen_Debug.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
<Import Project="..\..\VSProps\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
<Import Project="..\..\VSProps\CodeGen_DebugFast.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
<Import Project="..\..\VSProps\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
<Import Project="..\..\VSProps\CodeGen_DebugFast.props" />
<Import Project="..\..\VSProps\PrecompiledHeader.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\Core\Src;..\Common\Src;..\..\..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<AdditionalDependencies>SoundTouchD.lib;OpenAL32.lib;dsound.lib;dxerr.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Externals\OpenAL\Win32;..\..\..\Externals\SoundTouch\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\Core\Src;..\Common\Src;..\..\..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<AdditionalDependencies>SoundTouchD.lib;OpenAL32.lib;dsound.lib;dxerr.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Externals\OpenAL\Win64;..\..\..\Externals\SoundTouch\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\Core\Src;..\Common\Src;..\..\..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<AdditionalDependencies>SoundTouch.lib;OpenAL32.lib;dsound.lib;dxerr.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Externals\OpenAL\Win32;..\..\..\Externals\SoundTouch\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\Core\Src;..\Common\Src;..\..\..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<AdditionalDependencies>SoundTouch.lib;OpenAL32.lib;dsound.lib;dxerr.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Externals\OpenAL\Win32;..\..\..\Externals\SoundTouch\Win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\Core\Src;..\Common\Src;..\..\..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<AdditionalDependencies>SoundTouch.lib;OpenAL32.lib;dsound.lib;dxerr.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Externals\OpenAL\Win64;..\..\..\Externals\SoundTouch\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\Core\Src;..\Common\Src;..\..\..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<AdditionalDependencies>SoundTouch.lib;OpenAL32.lib;dsound.lib;dxerr.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Externals\OpenAL\Win64;..\..\..\Externals\SoundTouch\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Src\aldlist.cpp" />
<ClCompile Include="Src\AOSoundStream.cpp" />
<ClCompile Include="Src\AudioCommon.cpp" />
<ClCompile Include="Src\DPL2Decoder.cpp" />
<ClCompile Include="Src\DSoundStream.cpp" />
<ClCompile Include="Src\Mixer.cpp" />
<ClCompile Include="Src\NullSoundStream.cpp" />
<ClCompile Include="Src\OpenALStream.cpp" />
<ClCompile Include="Src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Src\WaveFile.cpp" />
<ClCompile Include="Src\XAudio2Stream.cpp" />
<ClCompile Include="Src\XAudio2_7Stream.cpp">
<AdditionalIncludeDirectories Condition="Exists('$(DXSDK_DIR)')">$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Src\aldlist.h" />
<ClInclude Include="Src\AlsaSoundStream.h" />
<ClInclude Include="Src\AOSoundStream.h" />
<ClInclude Include="Src\AudioCommon.h" />
<ClInclude Include="Src\CoreAudioSoundStream.h" />
<ClInclude Include="Src\DPL2Decoder.h" />
<ClInclude Include="Src\DSoundStream.h" />
<ClInclude Include="Src\Mixer.h" />
<ClInclude Include="Src\NullSoundStream.h" />
<ClInclude Include="Src\OpenALStream.h" />
<ClInclude Include="Src\OpenSLESStream.h" />
<ClInclude Include="Src\PulseAudioStream.h" />
<ClInclude Include="Src\SoundStream.h" />
<ClInclude Include="Src\stdafx.h" />
<ClInclude Include="Src\WaveFile.h" />
<ClInclude Include="Src\XAudio2Stream.h" />
<ClInclude Include="Src\XAudio2_7Stream.h" />
</ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />
<Text Include="CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Externals\SoundTouch\SoundTouch.vcxproj">
<Project>{68a5dd20-7057-448b-8fe0-b6ac8d205509}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
<ProjectReference Include="..\..\..\Externals\soundtouch\SoundTouch.vcxproj">
<Project>{ec082900-b4d8-42e9-9663-77f02f6936ae}</Project>
</ProjectReference>
<ProjectReference Include="..\Common\Common.vcxproj">
<Project>{c87a4178-44f6-49b2-b7aa-c79af1b8c534}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
<Project>{2e6c348c-c75c-4d94-8d1e-9c1fcbf3efe4}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
@@ -1,14 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="SoundStreams">
<UniqueIdentifier>{25ec8f16-fc60-4a63-bc3e-ad0272fd5942}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Src\aldlist.cpp" />
<ClCompile Include="Src\AudioCommon.cpp" />
<ClCompile Include="Src\DPL2Decoder.cpp" />
<ClCompile Include="Src\Mixer.cpp" />
<ClCompile Include="Src\WaveFile.cpp" />
<ClCompile Include="Src\AOSoundStream.cpp">
<ClCompile Include="Src\DSoundStream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="Src\DSoundStream.cpp">
<ClCompile Include="Src\NullSoundStream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="Src\OpenALStream.cpp">
@@ -17,14 +23,15 @@
<ClCompile Include="Src\XAudio2Stream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="Src\NullSoundStream.cpp">
<ClCompile Include="Src\stdafx.cpp" />
<ClCompile Include="Src\XAudio2_7Stream.cpp">
<Filter>SoundStreams</Filter>
</ClCompile>
<ClCompile Include="Src\DPL2Decoder.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Src\aldlist.h" />
<ClInclude Include="Src\AudioCommon.h" />
<ClInclude Include="Src\DPL2Decoder.h" />
<ClInclude Include="Src\Mixer.h" />
<ClInclude Include="Src\SoundStream.h" />
<ClInclude Include="Src\WaveFile.h" />
@@ -43,14 +50,24 @@
<ClInclude Include="Src\XAudio2Stream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="Src\DPL2Decoder.h" />
<ClInclude Include="Src\stdafx.h" />
<ClInclude Include="Src\XAudio2_7Stream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="Src\PulseAudioStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="Src\OpenSLESStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="Src\CoreAudioSoundStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
<ClInclude Include="Src\AlsaSoundStream.h">
<Filter>SoundStreams</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<Filter Include="SoundStreams">
<UniqueIdentifier>{efb9f5b5-ab0c-455d-b78b-26df725386af}</UniqueIdentifier>
</Filter>
<Text Include="CMakeLists.txt" />
</ItemGroup>
</Project>
+2 -2
View File
@@ -42,8 +42,8 @@ public:
return true;
}
virtual bool usesMixer() const {
return true;
virtual bool usesMixer() const {
return true;
}
virtual void Update();
+18 -18
View File
@@ -57,7 +57,7 @@ void AlsaSound::SoundLoop()
// Underrun
snd_pcm_prepare(handle);
}
else if (rc < 0)
else if (rc < 0)
{
ERROR_LOG(AUDIO, "writei fail: %s", snd_strerror(rc));
}
@@ -77,7 +77,7 @@ bool AlsaSound::AlsaInit()
unsigned int periods;
err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Audio open error: %s\n", snd_strerror(err));
return false;
@@ -86,21 +86,21 @@ bool AlsaSound::AlsaInit()
snd_pcm_hw_params_alloca(&hwparams);
err = snd_pcm_hw_params_any(handle, hwparams);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Broken configuration for this PCM: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Access type not available: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_hw_params_set_format(handle, hwparams, SND_PCM_FORMAT_S16_LE);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Sample format not available: %s\n", snd_strerror(err));
return false;
@@ -108,14 +108,14 @@ bool AlsaSound::AlsaInit()
dir = 0;
err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &sample_rate, &dir);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Rate not available: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_hw_params_set_channels(handle, hwparams, 2);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Channels count not available: %s\n", snd_strerror(err));
return false;
@@ -123,7 +123,7 @@ bool AlsaSound::AlsaInit()
periods = BUFFER_SIZE_MAX / FRAME_COUNT_MIN;
err = snd_pcm_hw_params_set_periods_max(handle, hwparams, &periods, &dir);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Cannot set Minimum periods: %s\n", snd_strerror(err));
return false;
@@ -131,34 +131,34 @@ bool AlsaSound::AlsaInit()
buffer_size_max = BUFFER_SIZE_MAX;
err = snd_pcm_hw_params_set_buffer_size_max(handle, hwparams, &buffer_size_max);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Cannot set minimum buffer size: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_hw_params(handle, hwparams);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Unable to install hw params: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Cannot get buffer size: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_hw_params_get_periods_max(hwparams, &periods, &dir);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Cannot get periods: %s\n", snd_strerror(err));
return false;
}
//periods is the number of fragments alsa can wait for during one
//periods is the number of fragments alsa can wait for during one
//buffer_size
frames_to_deliver = buffer_size / periods;
//limit the minimum size. pulseaudio advertises a minimum of 32 samples.
@@ -172,28 +172,28 @@ bool AlsaSound::AlsaInit()
snd_pcm_sw_params_alloca(&swparams);
err = snd_pcm_sw_params_current(handle, swparams);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "cannot init sw params: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_sw_params_set_start_threshold(handle, swparams, 0U);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "cannot set start thresh: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_sw_params(handle, swparams);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "cannot set sw params: %s\n", snd_strerror(err));
return false;
}
err = snd_pcm_prepare(handle);
if (err < 0)
if (err < 0)
{
ERROR_LOG(AUDIO, "Unable to prepare: %s\n", snd_strerror(err));
return false;
@@ -28,8 +28,8 @@ public:
static bool isValid() {
return true;
}
virtual bool usesMixer() const {
return true;
virtual bool usesMixer() const {
return true;
}
virtual void Update();
+36 -21
View File
@@ -7,6 +7,7 @@
#include "Mixer.h"
#include "NullSoundStream.h"
#include "DSoundStream.h"
#include "XAudio2_7Stream.h"
#include "XAudio2Stream.h"
#include "AOSoundStream.h"
#include "AlsaSoundStream.h"
@@ -18,34 +19,47 @@
#include "../../Core/Src/ConfigManager.h"
// This shouldn't be a global, at least not here.
SoundStream *soundStream;
SoundStream *soundStream = nullptr;
namespace AudioCommon
{
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd)
{
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd)
{
// TODO: possible memleak with mixer
std::string backend = SConfig::GetInstance().sBackend;
if (backend == BACKEND_OPENAL && OpenALStream::isValid())
if (backend == BACKEND_OPENAL && OpenALStream::isValid())
soundStream = new OpenALStream(mixer);
else if (backend == BACKEND_NULLSOUND && NullSound::isValid())
soundStream = new NullSound(mixer, hWnd);
else if (backend == BACKEND_DIRECTSOUND && DSound::isValid())
else if (backend == BACKEND_NULLSOUND && NullSound::isValid())
soundStream = new NullSound(mixer);
else if (backend == BACKEND_DIRECTSOUND && DSound::isValid())
soundStream = new DSound(mixer, hWnd);
else if (backend == BACKEND_XAUDIO2 && XAudio2::isValid())
soundStream = new XAudio2(mixer);
else if (backend == BACKEND_AOSOUND && AOSound::isValid())
else if (backend == BACKEND_XAUDIO2)
{
if (XAudio2::isValid())
soundStream = new XAudio2(mixer);
else if (XAudio2_7::isValid())
soundStream = new XAudio2_7(mixer);
}
else if (backend == BACKEND_AOSOUND && AOSound::isValid())
soundStream = new AOSound(mixer);
else if (backend == BACKEND_ALSA && AlsaSound::isValid())
soundStream = new AlsaSound(mixer);
else if (backend == BACKEND_COREAUDIO && CoreAudioSound::isValid())
else if (backend == BACKEND_COREAUDIO && CoreAudioSound::isValid())
soundStream = new CoreAudioSound(mixer);
else if (backend == BACKEND_PULSEAUDIO && PulseAudio::isValid())
soundStream = new PulseAudio(mixer);
else if (backend == BACKEND_OPENSLES && OpenSLESStream::isValid())
soundStream = new OpenSLESStream(mixer);
if (soundStream != NULL)
if (!soundStream && NullSound::isValid())
{
WARN_LOG(DSPHLE, "Could not initialize backend %s, using %s instead.",
backend.c_str(), BACKEND_NULLSOUND);
soundStream = new NullSound(mixer);
}
if (soundStream)
{
UpdateSoundStream();
if (soundStream->Start())
@@ -61,31 +75,32 @@ namespace AudioCommon
}
PanicAlertT("Could not initialize backend %s.", backend.c_str());
}
PanicAlertT("Sound backend %s is not valid.", backend.c_str());
delete soundStream;
soundStream = NULL;
return NULL;
soundStream = nullptr;
return nullptr;
}
void ShutdownSoundStream()
void ShutdownSoundStream()
{
INFO_LOG(DSPHLE, "Shutting down sound stream");
if (soundStream)
if (soundStream)
{
soundStream->Stop();
if (SConfig::GetInstance().m_DumpAudio)
soundStream->GetMixer()->StopLogAudio();
//soundStream->StopLogAudio();
delete soundStream;
soundStream = NULL;
soundStream = nullptr;
}
INFO_LOG(DSPHLE, "Done shutting down sound stream");
INFO_LOG(DSPHLE, "Done shutting down sound stream");
}
std::vector<std::string> GetSoundBackends()
std::vector<std::string> GetSoundBackends()
{
std::vector<std::string> backends;
@@ -93,7 +108,7 @@ namespace AudioCommon
backends.push_back(BACKEND_NULLSOUND);
if (DSound::isValid())
backends.push_back(BACKEND_DIRECTSOUND);
if (XAudio2::isValid())
if (XAudio2_7::isValid() || XAudio2::isValid())
backends.push_back(BACKEND_XAUDIO2);
if (AOSound::isValid())
backends.push_back(BACKEND_AOSOUND);
@@ -110,7 +125,7 @@ namespace AudioCommon
return backends;
}
bool UseJIT()
bool UseJIT()
{
if (!Movie::IsDSPHLE() && Movie::IsPlayingInput() && Movie::IsConfigSaved())
{
+1 -1
View File
@@ -38,7 +38,7 @@ union UDSPControl
UDSPControl(u16 _Hex = 0) : Hex(_Hex) {}
};
namespace AudioCommon
namespace AudioCommon
{
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd);
void ShutdownSoundStream();
+1 -2
View File
@@ -6,7 +6,6 @@
#include <functional>
#include <windows.h>
#include <dxerr.h>
#include "AudioCommon.h"
#include "DSoundStream.h"
@@ -43,7 +42,7 @@ bool DSound::CreateBuffer()
else
{
// Failed.
PanicAlertT("Sound buffer creation failed: %s", DXGetErrorString(res));
PanicAlertT("Sound buffer creation failed: %08x", res);
dsBuffer = NULL;
return false;
}
+4 -3
View File
@@ -9,6 +9,7 @@
#include "Thread.h"
#ifdef _WIN32
#include <Windows.h>
#include <mmsystem.h>
#include <dsound.h>
@@ -47,7 +48,7 @@ class DSound : public SoundStream
bool WriteDataToBuffer(DWORD dwOffset, char* soundData, DWORD dwSoundBytes);
public:
DSound(CMixer *mixer, void *_hWnd = NULL)
DSound(CMixer *mixer, void *_hWnd)
: SoundStream(mixer)
, bufferSize(0)
, currentPos(0)
@@ -58,7 +59,7 @@ public:
{}
virtual ~DSound() {}
virtual bool Start();
virtual void SoundLoop();
virtual void SetVolume(int volume);
@@ -70,7 +71,7 @@ public:
#else
public:
DSound(CMixer *mixer, void *hWnd = NULL)
DSound(CMixer *mixer, void *_hWnd)
: SoundStream(mixer)
{}
#endif
+8 -8
View File
@@ -52,7 +52,7 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
// interpolation loop.
u32 indexR = Common::AtomicLoad(m_indexR);
u32 indexW = Common::AtomicLoad(m_indexW);
if (m_AIplaying) {
numLeft = (numLeft > numSamples) ? numSamples : numLeft;
@@ -125,8 +125,8 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
*(u32*)(samples+i) = *(u32*)(s);
// memset(&samples[numLeft * 2], 0, (numSamples - numLeft) * 4);
}
// Flush cached variable
// Flush cached variable
Common::AtomicStore(m_indexR, indexR);
//when logging, also throttle HLE audio
@@ -158,13 +158,13 @@ void CMixer::PushSamples(const short *samples, unsigned int num_samples)
// indexR isn't allowed to cache in the audio throttling loop as it
// needs to get updates to not deadlock.
u32 indexW = Common::AtomicLoad(m_indexW);
if (m_throttle)
{
// The auto throttle function. This loop will put a ceiling on the CPU MHz.
while (num_samples * 2 + ((indexW - Common::AtomicLoad(m_indexR)) & INDEX_MASK) >= MAX_SAMPLES * 2)
{
if (*PowerPC::GetStatePtr() != PowerPC::CPU_RUNNING || soundStream->IsMuted())
if (*PowerPC::GetStatePtr() != PowerPC::CPU_RUNNING || soundStream->IsMuted())
break;
// Shortcut key for Throttle Skipping
if (Host_GetKeyState('\t'))
@@ -192,9 +192,9 @@ void CMixer::PushSamples(const short *samples, unsigned int num_samples)
{
memcpy(&m_buffer[indexW & INDEX_MASK], samples, num_samples * 4);
}
Common::AtomicAdd(m_indexW, num_samples * 2);
return;
}
@@ -206,7 +206,7 @@ unsigned int CMixer::GetNumSamples()
// We also can't say the current interpolation state (specially
// the frac), so to be sure, subtract one again to be sure not
// to underflow the fifo.
u32 numSamples = ((Common::AtomicLoad(m_indexW) - Common::AtomicLoad(m_indexR)) & INDEX_MASK) / 2;
if (AudioInterface::GetAIDSampleRate() == m_sampleRate)
+2 -2
View File
@@ -14,7 +14,7 @@
#define RESERVED_SAMPLES (256)
class CMixer {
public:
CMixer(unsigned int AISampleRate = 48000, unsigned int DACSampleRate = 48000, unsigned int BackendSampleRate = 32000)
: m_aiSampleRate(AISampleRate)
@@ -89,7 +89,7 @@ protected:
int m_channels;
WaveFileWriter g_wave_writer;
bool m_HLEready;
bool m_logAudio;
@@ -16,7 +16,7 @@ class NullSound : public SoundStream
short realtimeBuffer[BUF_SIZE / sizeof(short)];
public:
NullSound(CMixer *mixer, void *hWnd = NULL)
NullSound(CMixer *mixer)
: SoundStream(mixer)
{}
+5 -3
View File
@@ -48,9 +48,9 @@ public:
OpenALStream(CMixer *mixer, void *hWnd = NULL)
: SoundStream(mixer)
, uiSource(0)
{};
{}
virtual ~OpenALStream() {};
virtual ~OpenALStream() {}
virtual bool Start();
virtual void SoundLoop();
@@ -74,7 +74,9 @@ private:
u8 numBuffers;
#else
public:
OpenALStream(CMixer *mixer, void *hWnd = NULL): SoundStream(mixer) {}
OpenALStream(CMixer *mixer)
: SoundStream(mixer)
{}
#endif // HAVE_OPENAL
};
@@ -21,7 +21,7 @@ static SLPlayItf bqPlayerPlay;
static SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue;
static SLMuteSoloItf bqPlayerMuteSolo;
static SLVolumeItf bqPlayerVolume;
static CMixer *g_mixer;
static CMixer *g_mixer;
#define BUFFER_SIZE 512
#define BUFFER_SIZE_IN_SAMPLES (BUFFER_SIZE / 2)
@@ -24,7 +24,7 @@ public:
PulseAudio(CMixer *mixer);
virtual bool Start();
virtual void Stop();
virtual void Stop();
static bool isValid() {return true;}
+4 -4
View File
@@ -21,11 +21,11 @@ protected:
WaveFileWriter g_wave_writer;
bool m_muted;
public:
SoundStream(CMixer *mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {}
virtual ~SoundStream() { delete m_mixer;}
public:
SoundStream(CMixer *mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {}
virtual ~SoundStream() { delete m_mixer; }
static bool isValid() { return false; }
static bool isValid() { return false; }
virtual CMixer *GetMixer() const { return m_mixer; }
virtual bool Start() { return false; }
virtual void SetVolume(int) {}
+1 -1
View File
@@ -121,7 +121,7 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, u32 count)
if (count > BUF_SIZE * 2)
PanicAlert("WaveFileWriter - buffer too small (count = %u).", count);
if (skip_silence)
if (skip_silence)
{
bool all_zero = true;

Some files were not shown because too many files have changed in this diff Show More