Beispiel #1
0
 /// <summary>
 /// Returns an array of all channels that are required to play this upmixed <see cref="source"/>.
 /// </summary>
 public ReferenceChannel[] GetChannels()
 {
     ReferenceChannel[] result = new ReferenceChannel[output.Length];
     for (int channel = 0; channel < output.Length; ++channel)
     {
         result[channel] = output[channel].target;
     }
     return(result);
 }
Beispiel #2
0
 public SpatializedChannel(ReferenceChannel source, Cavernizer master, int updateRate)
 {
     Channel = ChannelPrototype.Mapping[(int)source];
     filter  = new Filters.Cavernize(AudioListener3D.Current.SampleRate, 250);
     filter.PresetOutput(updateRate);
     Output = new float[updateRate];
     CreateSource(master, true);
     CreateSource(master, false);
 }
Beispiel #3
0
 /// <summary>
 /// Apply a filter set on the target system's selected channel.
 /// </summary>
 public void SetFilters(ReferenceChannel channel, BiquadFilter[] filterSet)
 {
     for (int i = 0; i < guids.Length; ++i)
     {
         if (MultEQMatrix[guids.Length][i] == channel)
         {
             filters[i] = filterSet;
         }
     }
 }
Beispiel #4
0
 int GetChannelId(ReferenceChannel channel)
 {
     if ((int)channel < 8)
     {
         return((int)channel);
     }
     for (int i = 8; i < output.Length; ++i)
     {
         if (output[i].target == channel)
         {
             return(i);
         }
     }
     return(-1);
 }
Beispiel #5
0
 /// <summary>
 /// Retrieve samples generated with <see cref="GenerateSamples(int)"/>.
 /// </summary>
 /// <remarks>This function doesn't check if a channel contains fresh data or not.
 /// Use <see cref="Readable(ReferenceChannel)"/> for this check.</remarks>
 public float[] RetrieveSamples(ReferenceChannel channel)
 {
     if ((int)channel < 8)
     {
         return(output[(int)channel].lastSamples);
     }
     for (int i = 8; i < output.Length; ++i)
     {
         if (output[i].target == channel)
         {
             return(output[i].lastSamples);
         }
     }
     return(null);
 }
Beispiel #6
0
 /// <summary>
 /// Returns if the given channel was updated the last time <see cref="GenerateSamples(int)"/> was called.
 /// </summary>
 public bool Readable(ReferenceChannel channel)
 {
     if ((int)channel < 8)
     {
         return(output[(int)channel].writtenTo);
     }
     for (int i = 8; i < output.Length; ++i)
     {
         if (output[i].target == channel)
         {
             return(output[i].writtenTo);
         }
     }
     return(false);
 }
Beispiel #7
0
 public ChannelData(ReferenceChannel target)
 {
     this.target = target;
     writtenTo   = false;
     lastSamples = null;
 }