protected void MergeAudioEvents() { int count = LoaderSettings.EventPlayerThreads; MIDINoteEvents = new MIDIEvent[count][]; Parallel.For(0, count, new ParallelOptions() { CancellationToken = cancel }, i => { try { MIDINoteEvents[i] = TimedMerger <MIDIEvent> .MergeMany(parsers.Select(p => new SkipIterator <MIDIEvent>(p.NoteEvents, i, count)).ToArray(), e => { return(e.time); }).ToArray(); } catch (OperationCanceledException) { } }); }
protected void MergeControlEvents() { int count = LoaderSettings.EventPlayerThreads; MIDIControlEvents = TimedMerger <MIDIEvent> .MergeMany(parsers.Select(p => p.ControlEvents).ToArray(), e => e.time).ToArray(); }