/// <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); }
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); }
/// <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; } } }
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); }
/// <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); }
/// <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); }
public ChannelData(ReferenceChannel target) { this.target = target; writtenTo = false; lastSamples = null; }