public void CreateJob(float inMaxScale, float inDynamics, float inEpsilon) { AudioListener.GetSpectrumData(spectrumBuff, channel, FFTWindow.BlackmanHarris); currentSpectrums.CopyFrom(spectrumBuff); spectrumJob = new SpectrumJob() { maxScale = inMaxScale, dynamics = inDynamics, epsilon = inEpsilon, currentSpectrums = this.currentSpectrums, prevSpectrums = this.prevSpectrums, origins = this.origins, }; jobHandle = spectrumJob.Schedule(transformsAccess); }
JobHandle CreateJob(bool left, Channel channel, JobHandle inputDeps) { AudioListener.GetSpectrumData(channel.spectrumBuff, channel.channelNumber, FFTWindow.BlackmanHarris); channel.currentSpectrums.CopyFrom(channel.spectrumBuff); ComponentDataArray <Position> inPositions; ComponentDataArray <Origin> inOrigins; ComponentDataArray <Scale> inScales; int groupLength; if (left) { inPositions = leftGroup.positions; inOrigins = leftGroup.origins; inScales = leftGroup.scales; groupLength = leftGroup.Length; } else { inPositions = rightGroup.positions; inOrigins = rightGroup.origins; inScales = rightGroup.scales; groupLength = rightGroup.Length; } SpectrumJob spectrumJob = new SpectrumJob() { maxScale = settings.maxScale, dynamics = settings.dynamics, epsilon = settings.epsilon, currentSpectrums = channel.currentSpectrums, prevSpectrums = channel.prevSpectrums, positions = inPositions, origins = inOrigins, scales = inScales }; JobHandle handle = spectrumJob.Schedule(groupLength, 1, inputDeps); return(handle); }