Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 99f1d86

Browse files
authored
1.4.2
1 parent e820773 commit 99f1d86

3 files changed

Lines changed: 23 additions & 29 deletions

File tree

Core/CommonCanvas.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public CommonCanvas(in RenderOptions options) : base(options)
4040

4141
if (Global.EnableNoteBorder)
4242
{
43-
double ratio = Global.NoteAlpha / 255.0;
4443
BorderColors = new RGBAColor[Global.KeyColors.Length];
4544
Array.Copy(Global.KeyColors, BorderColors, Global.KeyColors.Length);
4645
for (int i = 0; i != BorderColors.Length; ++i)

Core/RenderFile.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,29 @@ private void Parse()
320320
arr.Dispose();
321321

322322
Console.WriteLine("Midi 事件处理完成. 音符总数: {0}.", NoteCount);
323+
Console.WriteLine("正在对 Midi 文件进行 OR 处理.");
324+
_ = Parallel.For(0, 128, opt, (i) =>
325+
{
326+
UnmanagedList<Note> nl = Notes[i];
327+
if (nl.Count < 10)
328+
{
329+
return;
330+
}
331+
for (long index = 0, len = nl.Count - 2; index != len;)
332+
{
333+
ref Note curr = ref nl[index++];
334+
ref Note next = ref nl[index];
335+
if (curr.Start < next.Start && curr.End > next.Start && curr.End < next.End)
336+
{
337+
curr.End = next.Start;
338+
}
339+
else if (curr.Start == next.Start && curr.End <= next.End)
340+
{
341+
curr.End = curr.Start;
342+
}
343+
}
344+
});
345+
Console.WriteLine("OR 处理完成.");
323346
}
324347
public RenderFile(string path)
325348
{

Core/RendererBase.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,6 @@ public RendererBase(RenderFile file, in RenderOptions options)
3636
keyHeight = (uint)options.KeyHeight;
3737
isTickBased = options.TickBased;
3838
isPreview = options.PreviewMode;
39-
40-
Console.WriteLine("正在对 Midi 文件进行 OR 处理.");
41-
ParallelOptions opt = new ParallelOptions
42-
{
43-
MaxDegreeOfParallelism = Global.MaxMIDILoaderConcurrency
44-
};
45-
_ = Parallel.For(0, 128, opt, (i) =>
46-
{
47-
UnmanagedList<Note> nl = noteMap[i];
48-
if (nl.Count < 10)
49-
{
50-
return;
51-
}
52-
for (long index = 0, len = nl.Count - 2; index != len;)
53-
{
54-
ref Note curr = ref nl[index++];
55-
ref Note next = ref nl[index];
56-
if (curr.Start < next.Start && curr.End > next.Start && curr.End < next.End)
57-
{
58-
curr.End = next.Start;
59-
}
60-
else if (curr.Start == next.Start && curr.End <= next.End)
61-
{
62-
curr.End = curr.Start;
63-
}
64-
}
65-
});
66-
Console.WriteLine("OR 处理完成.");
6739
}
6840

6941
public abstract void Render();

0 commit comments

Comments
 (0)