Inheritance: AudioGroupParameterPath
示例#1
0
        public string ResolveExposedParameterPath(GUID parameter, bool getOnlyBasePath)
        {
            // Consult the cache of parameters first.
            if (exposedParamCache.ContainsKey(parameter))
            {
                var path = exposedParamCache[parameter];

                return(path.ResolveStringPath(getOnlyBasePath));
            }

            // Search through the whole mixer!
            List <AudioMixerGroupController> groups = GetAllAudioGroupsSlow();

            foreach (AudioMixerGroupController group in groups)
            {
                if (group.GetGUIDForVolume() == parameter || group.GetGUIDForPitch() == parameter)
                {
                    var newPath = new AudioGroupParameterPath(group, parameter);
                    exposedParamCache[parameter] = newPath;
                    return(newPath.ResolveStringPath(getOnlyBasePath));
                }

                for (var i = 0; i < group.effects.Length; i++)
                {
                    var effect = group.effects[i];

                    if (effect.IsSend() && parameter == effect.GetGUIDForMixLevel())
                    {
                        var newPath = new AudioEffectParameterPath(group, effect, parameter);
                        exposedParamCache[parameter] = newPath;
                        return(newPath.ResolveStringPath(getOnlyBasePath));
                    }

                    var paramDefs = MixerEffectDefinitions.GetEffectParameters(effect.effectName);

                    for (var j = 0; j < paramDefs.Length; j++)
                    {
                        var guid = effect.GetGUIDForParameter(paramDefs[j].name);

                        if (guid == parameter)
                        {
                            var newPath = new AudioEffectParameterPath(group, effect, parameter);
                            exposedParamCache[parameter] = newPath;
                            return(newPath.ResolveStringPath(getOnlyBasePath));
                        }
                    }
                }
            }

            return("Error finding Parameter path");
        }
 public string ResolveExposedParameterPath(GUID parameter, bool getOnlyBasePath)
 {
   if (this.exposedParamCache.ContainsKey(parameter))
     return this.exposedParamCache[parameter].ResolveStringPath(getOnlyBasePath);
   using (List<AudioMixerGroupController>.Enumerator enumerator = this.GetAllAudioGroupsSlow().GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       AudioMixerGroupController current = enumerator.Current;
       if (current.GetGUIDForVolume() == parameter || current.GetGUIDForPitch() == parameter)
       {
         AudioGroupParameterPath groupParameterPath = new AudioGroupParameterPath(current, parameter);
         this.exposedParamCache[parameter] = (AudioParameterPath) groupParameterPath;
         return groupParameterPath.ResolveStringPath(getOnlyBasePath);
       }
       for (int index = 0; index < current.effects.Length; ++index)
       {
         AudioMixerEffectController effect = current.effects[index];
         foreach (MixerParameterDefinition effectParameter in MixerEffectDefinitions.GetEffectParameters(effect.effectName))
         {
           if (effect.GetGUIDForParameter(effectParameter.name) == parameter)
           {
             AudioEffectParameterPath effectParameterPath = new AudioEffectParameterPath(current, effect, parameter);
             this.exposedParamCache[parameter] = (AudioParameterPath) effectParameterPath;
             return effectParameterPath.ResolveStringPath(getOnlyBasePath);
           }
         }
       }
     }
   }
   return "Error finding Parameter path";
 }
		public string ResolveExposedParameterPath(GUID parameter, bool getOnlyBasePath)
		{
			if (this.exposedParamCache.ContainsKey(parameter))
			{
				AudioParameterPath audioParameterPath = this.exposedParamCache[parameter];
				return audioParameterPath.ResolveStringPath(getOnlyBasePath);
			}
			List<AudioMixerGroupController> allAudioGroupsSlow = this.GetAllAudioGroupsSlow();
			foreach (AudioMixerGroupController current in allAudioGroupsSlow)
			{
				if (current.GetGUIDForVolume() == parameter || current.GetGUIDForPitch() == parameter)
				{
					AudioGroupParameterPath audioGroupParameterPath = new AudioGroupParameterPath(current, parameter);
					this.exposedParamCache[parameter] = audioGroupParameterPath;
					string result = audioGroupParameterPath.ResolveStringPath(getOnlyBasePath);
					return result;
				}
				for (int i = 0; i < current.effects.Length; i++)
				{
					AudioMixerEffectController audioMixerEffectController = current.effects[i];
					MixerParameterDefinition[] effectParameters = MixerEffectDefinitions.GetEffectParameters(audioMixerEffectController.effectName);
					for (int j = 0; j < effectParameters.Length; j++)
					{
						GUID gUIDForParameter = audioMixerEffectController.GetGUIDForParameter(effectParameters[j].name);
						if (gUIDForParameter == parameter)
						{
							AudioEffectParameterPath audioEffectParameterPath = new AudioEffectParameterPath(current, audioMixerEffectController, parameter);
							this.exposedParamCache[parameter] = audioEffectParameterPath;
							string result = audioEffectParameterPath.ResolveStringPath(getOnlyBasePath);
							return result;
						}
					}
				}
			}
			return "Error finding Parameter path";
		}