mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-08 21:24:34 +00:00
update the settings display for audio devices
This commit is contained in:
parent
8baca526b1
commit
0c94a71c66
2 changed files with 28 additions and 10 deletions
|
|
@ -277,7 +277,11 @@ SFXProvider* SFXSystem::getBestProviderChoice()
|
|||
if (smProviders[i]->mType == OpenAL)
|
||||
{
|
||||
if (smProviders[i]->mDefault)
|
||||
{
|
||||
Con::setVariable("pref::SFX::provider", "OpenAL");
|
||||
Con::setVariable("pref::SFX::device", smProviders[i]->getName());
|
||||
return smProviders[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -314,7 +318,10 @@ SFXProvider* SFXSystem::getBestProviderChoice()
|
|||
if (smProviders[i]->mType == providerType)
|
||||
{
|
||||
if (smProviders[i]->mDefault)
|
||||
{
|
||||
Con::setVariable("pref::SFX::device", smProviders[i]->getName());
|
||||
return smProviders[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ new SimGroup(AudioSettingsGroup)
|
|||
class = "PrimaryOptionsGroup";
|
||||
displayName = "Audio";
|
||||
|
||||
new SimGroup()
|
||||
new SimGroup(AudioDeviceSettingsGroup)
|
||||
{
|
||||
class = "SubOptionsGroup";
|
||||
displayName = "Audio Settings";
|
||||
|
|
@ -65,16 +65,27 @@ function AudioSettingsGroup::populateSettings(%this)
|
|||
for(%i = 0; %i < %pCount; %i++)
|
||||
{
|
||||
%device = sfxGetProviderDevice(%i);
|
||||
//Device Entry
|
||||
%deviceEntry = new ArrayObject()
|
||||
if(%device !$= "SFX Null Device")
|
||||
{
|
||||
class = "OptionsQualityLevel";
|
||||
displayName = %device;
|
||||
provider = %provider; //this is for filtering later, if we need to
|
||||
key["$pref::SFX::device"] = %device;
|
||||
};
|
||||
|
||||
AudioSettingsDeviceGroup.add(%deviceEntry);
|
||||
%start = strpos(%device,"(");
|
||||
%end = strpos(%device,"(", %start);
|
||||
%displayName = %device;
|
||||
if(%start != -1)
|
||||
{
|
||||
%displayName = getSubStr(%device, %start+1, %end-1);
|
||||
}
|
||||
|
||||
//Device Entry
|
||||
%deviceEntry = new ArrayObject()
|
||||
{
|
||||
class = "OptionsQualityLevel";
|
||||
displayName = %displayName;
|
||||
provider = %provider; //this is for filtering later, if we need to
|
||||
key["$pref::SFX::device"] = %device;
|
||||
};
|
||||
|
||||
AudioSettingsDeviceGroup.add(%deviceEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue