OpenAL Internal name

-Now there is an internal name for openal and a default name for the device to be displayed
This commit is contained in:
marauder2k7 2022-08-16 15:55:56 +01:00
parent 52dc5cf3da
commit 3eca15cb31
6 changed files with 33 additions and 14 deletions

View file

@ -82,7 +82,19 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft )
{
dMemset(&ALDeviceInfo, 0, sizeof(ALDEVICEINFO));
ALDeviceInfo.bSelected = true;
dStrncpy(ALDeviceInfo.strDeviceName, devices, sizeof(ALDeviceInfo.strDeviceName));
dStrncpy(ALDeviceInfo.strInternalDeviceName, devices, sizeof(ALDeviceInfo.strInternalDeviceName));
char* openFind = dStrchr(devices, '(');
if (openFind)
{
devices = openFind + 1;
char* closeFind = dStrchr(devices, ')');
if (closeFind)
(*closeFind) = '\0';
dStrncpy(ALDeviceInfo.strDeviceName, devices, sizeof(ALDeviceInfo.strDeviceName));
}
vDeviceInfo.push_back(ALDeviceInfo);
}
@ -111,14 +123,23 @@ int ALDeviceList::GetNumDevices()
/*
* Returns the device name at an index in the complete device list
*/
const char *ALDeviceList::GetDeviceName(int index)
const char *ALDeviceList::GetInternalDeviceName(int index)
{
if (index < GetNumDevices())
return vDeviceInfo[index].strDeviceName;
return vDeviceInfo[index].strInternalDeviceName;
else
return NULL;
}
const char* ALDeviceList::GetDeviceName(int index)
{
if (index < GetNumDevices())
return vDeviceInfo[index].strDeviceName;
else
return NULL;
}
/*
* Returns the major and minor version numbers for a device at a specified index in the complete list
*/