mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Audio: device switching and channel count detection (#12246)
This commit is contained in:
parent
4b787b22c8
commit
98b730c806
39 changed files with 1235 additions and 395 deletions
|
@ -5,6 +5,8 @@
|
|||
#include "util/logs.hpp"
|
||||
#include "util/v128.hpp"
|
||||
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
#include <algorithm>
|
||||
#include <string_view>
|
||||
#include "Thread.h"
|
||||
|
@ -13,8 +15,6 @@
|
|||
#include <Windows.h>
|
||||
#else
|
||||
#include <errno.h>
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
#endif
|
||||
|
||||
std::string wchar_to_utf8(std::wstring_view src)
|
||||
|
@ -26,11 +26,17 @@ std::string wchar_to_utf8(std::wstring_view src)
|
|||
WideCharToMultiByte(CP_UTF8, 0, src.data(), src.size(), utf8_string.data(), tmp_size, nullptr, nullptr);
|
||||
return utf8_string;
|
||||
#else
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> converter{};
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter{};
|
||||
return converter.to_bytes(src.data());
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string utf16_to_utf8(std::u16string_view src)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> converter{};
|
||||
return converter.to_bytes(src.data());
|
||||
}
|
||||
|
||||
std::wstring utf8_to_wchar(std::string_view src)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
std::wstring utf8_to_wchar(std::string_view src);
|
||||
std::string wchar_to_utf8(std::wstring_view src);
|
||||
std::string utf16_to_utf8(std::u16string_view src);
|
||||
|
||||
// Copy null-terminated string from a std::string or a char array to a char array with truncation
|
||||
template <typename D, typename T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue