private AddDefinitionRuntime ( string name, |
||
name | string | |
parameters | ||
Результат | void |
public static bool RegisterAudioMixerEffect(string name, MixerParameterDefinition[] definitions) { using (List <MixerEffectDefinition> .Enumerator enumerator = MixerEffectDefinitions.s_MixerEffectDefinitions.GetEnumerator()) { while (enumerator.MoveNext()) { if (enumerator.Current.name == name) { return(false); } } } MixerEffectDefinition effectDefinition = new MixerEffectDefinition(name, definitions); MixerEffectDefinitions.s_MixerEffectDefinitions.Add(effectDefinition); MixerEffectDefinitions.ClearDefinitionsRuntime(); using (List <MixerEffectDefinition> .Enumerator enumerator = MixerEffectDefinitions.s_MixerEffectDefinitions.GetEnumerator()) { while (enumerator.MoveNext()) { MixerEffectDefinition current = enumerator.Current; MixerEffectDefinitions.AddDefinitionRuntime(current.name, current.parameters); } } return(true); }
public static bool RegisterAudioMixerEffect(string name, MixerParameterDefinition[] definitions) { foreach (MixerEffectDefinition current in MixerEffectDefinitions.s_MixerEffectDefinitions) { if (current.name == name) { return(false); } } MixerEffectDefinition item = new MixerEffectDefinition(name, definitions); MixerEffectDefinitions.s_MixerEffectDefinitions.Add(item); MixerEffectDefinitions.ClearDefinitionsRuntime(); foreach (MixerEffectDefinition current2 in MixerEffectDefinitions.s_MixerEffectDefinitions) { MixerEffectDefinitions.AddDefinitionRuntime(current2.name, current2.parameters); } return(true); }
public static void Refresh() { MixerEffectDefinitions.ClearDefinitions(); MixerEffectDefinitions.RegisterAudioMixerEffect("Attenuation", new MixerParameterDefinition[0]); MixerEffectDefinitions.RegisterAudioMixerEffect("Send", new MixerParameterDefinition[0]); MixerEffectDefinitions.RegisterAudioMixerEffect("Receive", new MixerParameterDefinition[0]); MixerParameterDefinition[] parameterDefinitionArray = new MixerParameterDefinition[7] { new MixerParameterDefinition() { name = "Threshold", units = "dB", displayScale = 1f, displayExponent = 1f, minRange = -80f, maxRange = 0.0f, defaultValue = -10f, description = "Threshold of side-chain level detector" }, new MixerParameterDefinition() { name = "Ratio", units = "%", displayScale = 100f, displayExponent = 1f, minRange = 0.2f, maxRange = 10f, defaultValue = 2f, description = "Ratio of compression applied when side-chain signal exceeds threshold" }, new MixerParameterDefinition() { name = "Attack Time", units = "ms", displayScale = 1000f, displayExponent = 3f, minRange = 0.0f, maxRange = 10f, defaultValue = 0.1f, description = "Level detector attack time" }, new MixerParameterDefinition() { name = "Release Time", units = "ms", displayScale = 1000f, displayExponent = 3f, minRange = 0.0f, maxRange = 10f, defaultValue = 0.1f, description = "Level detector release time" }, new MixerParameterDefinition() { name = "Make-up Gain", units = "dB", displayScale = 1f, displayExponent = 1f, minRange = -80f, maxRange = 40f, defaultValue = 0.0f, description = "Make-up gain" }, new MixerParameterDefinition() { name = "Knee", units = "dB", displayScale = 1f, displayExponent = 1f, minRange = 0.0f, maxRange = 50f, defaultValue = 10f, description = "Sharpness of compression curve knee" }, new MixerParameterDefinition() { name = "Sidechain Mix", units = "%", displayScale = 100f, displayExponent = 1f, minRange = 0.0f, maxRange = 1f, defaultValue = 1f, description = "Sidechain/source mix. If set to 100% the compressor detects level entirely from sidechain signal." } }; MixerEffectDefinitions.RegisterAudioMixerEffect("Duck Volume", parameterDefinitionArray); MixerEffectDefinitions.AddDefinitionRuntime("Duck Volume", parameterDefinitionArray); foreach (string audioEffectName in MixerEffectDefinitions.GetAudioEffectNames()) { MixerParameterDefinition[] effectParameterDesc = MixerEffectDefinitions.GetAudioEffectParameterDesc(audioEffectName); MixerEffectDefinitions.RegisterAudioMixerEffect(audioEffectName, effectParameterDesc); } }