Пример #1
0
        internal RoutingEntry (Source source, EffectSlot target, float gain, Filter filter = null)
        {
            this.Source = source;
            this.Target = target;

            this.Filter = filter;
            this.gain = gain.Clamp (0f, 1f);
            sourceRouteIndex = -1;

        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FreezingArcher.Audio.AudioRouting"/> class.
        /// </summary>
        public AudioRouting ()
        {
            effectSlots = new List<EffectSlot> ();
            currentRouting = new List<RoutingEntry> ();

            var effectSlot = new EffectSlot();
            while (effectSlot.Load())
            {
                effectSlots.Add(effectSlot);
                effectSlot = new EffectSlot();
            }
            effectSlot = null;
            Logger.Log.AddLogEntry(LogLevel.Info, AudioManager.ClassName, "{0} auxiliary effect slots generated.", effectSlots.Count);
        }
Пример #3
0
 /// <summary>
 /// Adds an audio routing entry from the given source to the given target, where a filter can be applied optionally
 /// </summary>
 /// <returns>The audio routing entry</returns>
 /// <param name="source">Where does the signal come from?</param>
 /// <param name="target">Where should the signal go to?</param>
 /// <param name="gain">How loud should the final effect be?</param>
 /// <param name="filter">Should the signal be filtered?</param>
 public RoutingEntry AddAudioRouting(Source source, EffectSlot target, float gain, Filter filter = null)
 {
     var routing = new RoutingEntry (source, target, gain.Clamp (0f, 1f), filter);
     currentRouting.Add (routing);
     routing.Setup ();
     return routing;
 }