Audio/OpenAL: Adjust return type of QueryInputDevices and QueryOutputDevices
Former-commit-id: 5f2a07a73bc8903662139067ce0b484c9af86353
This commit is contained in:
parent
47b8aa1f4e
commit
25a767290b
|
|
@ -73,8 +73,8 @@ namespace Nz
|
||||||
|
|
||||||
static bool IsInitialized();
|
static bool IsInitialized();
|
||||||
|
|
||||||
static unsigned int QueryInputDevices(std::vector<String>& devices);
|
static std::size_t QueryInputDevices(std::vector<String>& devices);
|
||||||
static unsigned int QueryOutputDevices(std::vector<String>& devices);
|
static std::size_t QueryOutputDevices(std::vector<String>& devices);
|
||||||
|
|
||||||
static bool SetDevice(const String& deviceName);
|
static bool SetDevice(const String& deviceName);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@ namespace Nz
|
||||||
ALCcontext* s_context = nullptr;
|
ALCcontext* s_context = nullptr;
|
||||||
unsigned int s_version;
|
unsigned int s_version;
|
||||||
|
|
||||||
unsigned int ParseDevices(const char* deviceString, std::vector<String>& devices)
|
std::size_t ParseDevices(const char* deviceString, std::vector<String>& devices)
|
||||||
{
|
{
|
||||||
if (!deviceString)
|
if (!deviceString)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unsigned int startSize = devices.size();
|
std::size_t startSize = devices.size();
|
||||||
|
|
||||||
unsigned int length;
|
std::size_t length;
|
||||||
while ((length = std::strlen(deviceString)) > 0)
|
while ((length = std::strlen(deviceString)) > 0)
|
||||||
{
|
{
|
||||||
devices.push_back(String(deviceString, length));
|
devices.push_back(String(deviceString, length));
|
||||||
|
|
@ -222,7 +222,7 @@ namespace Nz
|
||||||
return s_library.IsLoaded();
|
return s_library.IsLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int OpenAL::QueryInputDevices(std::vector<String>& devices)
|
std::size_t OpenAL::QueryInputDevices(std::vector<String>& devices)
|
||||||
{
|
{
|
||||||
const char* deviceString = reinterpret_cast<const char*>(alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER));
|
const char* deviceString = reinterpret_cast<const char*>(alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER));
|
||||||
if (!deviceString)
|
if (!deviceString)
|
||||||
|
|
@ -231,7 +231,7 @@ namespace Nz
|
||||||
return ParseDevices(deviceString, devices);
|
return ParseDevices(deviceString, devices);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int OpenAL::QueryOutputDevices(std::vector<String>& devices)
|
std::size_t OpenAL::QueryOutputDevices(std::vector<String>& devices)
|
||||||
{
|
{
|
||||||
const char* deviceString = reinterpret_cast<const char*>(alcGetString(nullptr, ALC_ALL_DEVICES_SPECIFIER));
|
const char* deviceString = reinterpret_cast<const char*>(alcGetString(nullptr, ALC_ALL_DEVICES_SPECIFIER));
|
||||||
if (!deviceString)
|
if (!deviceString)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue