Browse Source

commit: preRelease for blog post

HOME 3 years ago
parent
commit
d34bf4de80

+ 3 - 3
BeatLyrics.Tool/Dialogs/TimelineEditDialog.Designer.cs

@@ -132,7 +132,7 @@ namespace BeatLyrics.Tool.Dialogs
             this.EditorControl2.MinSaValue = 0D;
             this.EditorControl2.Name = "EditorControl2";
             this.EditorControl2.PlayPos = 0;
-            this.EditorControl2.Size = new System.Drawing.Size(1117, 230);
+            this.EditorControl2.Size = new System.Drawing.Size(1117, 375);
             this.EditorControl2.TabIndex = 0;
             this.EditorControl2.PosChangeBegin += new System.EventHandler(this.EditorControl_PosChangeBegin);
             this.EditorControl2.PosChange += new System.EventHandler<int>(this.EditorControl_PosChange);
@@ -150,7 +150,7 @@ namespace BeatLyrics.Tool.Dialogs
             this.EditorControl1.MinSaValue = 0D;
             this.EditorControl1.Name = "EditorControl1";
             this.EditorControl1.PlayPos = 0;
-            this.EditorControl1.Size = new System.Drawing.Size(1117, 229);
+            this.EditorControl1.Size = new System.Drawing.Size(1117, 84);
             this.EditorControl1.TabIndex = 0;
             this.EditorControl1.PosChangeBegin += new System.EventHandler(this.EditorControl_PosChangeBegin);
             this.EditorControl1.PosChange += new System.EventHandler<int>(this.EditorControl_PosChange);
@@ -206,7 +206,7 @@ namespace BeatLyrics.Tool.Dialogs
             // 
             this.splitContainer1.Panel2.Controls.Add(this.EditorControl2);
             this.splitContainer1.Size = new System.Drawing.Size(1117, 463);
-            this.splitContainer1.SplitterDistance = 229;
+            this.splitContainer1.SplitterDistance = 84;
             this.splitContainer1.TabIndex = 6;
             // 
             // FreqRangeBar

+ 1 - 1
BeatLyrics.Tool/Dialogs/TimelineEditDialog.cs

@@ -73,7 +73,7 @@ namespace BeatLyrics.Tool.Dialogs
             ValueRangeBar.TotalMaximum = (int)(_sa.Max(p => p.Values.Max()) * 100);
             ValueRangeBar.TotalMinimum = -20000; // ValueRangeBar.TotalMinimum = (int)(_sa.Min(p => p.Values.Min()) * 100);
 
-            EditorControl1.SetSpectrumData(_sa, _blockInMs);
+            //EditorControl1.SetSpectrumData(_sa, _blockInMs);
             EditorControl2.SetSpectrumData(_sa, _blockInMs);
 
             ReSpectrumButton.Enabled = true;

+ 1 - 0
BeatLyrics.Tool/UserControls/TextArrangeUserControl.Designer.cs

@@ -164,6 +164,7 @@
             // 
             this.olvColumn9.AspectName = "DurationMs";
             this.olvColumn9.Text = "Duration";
+            this.olvColumn9.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // olvColumn10
             // 

+ 10 - 12
BeatLyrics.Tool/UserControls/TimelineEditorUserControl.cs

@@ -166,6 +166,9 @@ namespace BeatLyrics.Tool.UserControls
 
                 var blockWidth = _spectrumBlockInMs * DisplayScale;
 
+                var rects = new List<Tuple<RectangleF, byte>>();
+
+
                 for (var i = beginBlockIndex; i < endBlockIndex; i++)
                 {
                     var posX = i * blockWidth;
@@ -175,11 +178,8 @@ namespace BeatLyrics.Tool.UserControls
                     var freqArray = block.FreqAxis.Where(p => p > MinSaFreq && p < MaxSaFreq).ToArray();
                     var height = scaleHeight / freqArray.Length;
 
-                    var rects = new Tuple<RectangleF, byte>[freqArray.Length];
-                    for (var index = 0; index < freqArray.Length; index++)
+                    foreach (var freq in freqArray)
                     {
-                        var freq = freqArray[index];
-
                         var val = block.Values[Array.IndexOf(block.FreqAxis, freq)];
 
                         var posY = scaleHeight * (1 - (freq - MinSaFreq) / freqRange);
@@ -194,16 +194,14 @@ namespace BeatLyrics.Tool.UserControls
                             color = (byte)(255 * ratio);
                         }
 
-                        rects[index] = new Tuple<RectangleF, byte>(
-                            new RectangleF(posX, (float)posY, blockWidth, height), color
-                        );
+                        rects.Add(new Tuple<RectangleF, byte>(new RectangleF(posX, (float)posY, blockWidth, height), color));
                     }
+                }
 
-                    foreach (var item in rects.Where(p => p != null).GroupBy(p => p.Item2).Where(p => p.Key > 0))
-                    {
-                        using Brush brush = new SolidBrush(Color.FromArgb(255 - item.Key, 255 - item.Key, 255));
-                        e.Graphics.FillRectangles(brush, item.Select(p => p.Item1).ToArray());
-                    }
+                foreach (var item in rects.Where(p => p != null).GroupBy(p => p.Item2).Where(p => p.Key > 0))
+                {
+                    using Brush brush = new SolidBrush(Color.FromArgb(255 - item.Key, 255 - item.Key, 255));
+                    e.Graphics.FillRectangles(brush, item.Select(p => p.Item1).ToArray());
                 }
             }