diff --git a/osu.Game.Rulesets.IGPlayer/Feature/Gosumemory/Tracker/AbstractTracker.cs b/osu.Game.Rulesets.IGPlayer/Feature/Gosumemory/Tracker/AbstractTracker.cs index 243128c..cbcb8d0 100644 --- a/osu.Game.Rulesets.IGPlayer/Feature/Gosumemory/Tracker/AbstractTracker.cs +++ b/osu.Game.Rulesets.IGPlayer/Feature/Gosumemory/Tracker/AbstractTracker.cs @@ -16,7 +16,6 @@ public AbstractTracker(TrackerHub hub) AlwaysPresent = true; #if DEBUG - InternalChild = new OsuSpriteText { Text = $"{this}", diff --git a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/LyricPlugin.cs b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/LyricPlugin.cs index da41985..baee2d2 100644 --- a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/LyricPlugin.cs +++ b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/LyricPlugin.cs @@ -190,8 +190,8 @@ public void GetLyricFor(long id) public readonly BindableDouble Offset = new BindableDouble { - MaxValue = 3000, - MinValue = -3000 + MaxValue = 60000, + MinValue = -60000 }; private readonly Bindable autoSave = new Bindable(); diff --git a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/APILyricResponseRoot.cs b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/APILyricResponseRoot.cs index d5c1fec..72d60f0 100644 --- a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/APILyricResponseRoot.cs +++ b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/APILyricResponseRoot.cs @@ -61,16 +61,14 @@ public List ToLyricList() propertyDetected = false; //处理属性 - //时间 - string timeProperty = propertyName.Replace(":", "."); //如果是时间属性 - if (timeProperty[0].IsDigit()) + if (propertyName[0].IsDigit()) { lyrics.Add(new Lyric { - Time = timeProperty.ToMilliseconds() + Time = propertyName.ToMilliseconds() }); } @@ -130,13 +128,12 @@ public List ToLyricList() //处理属性 //时间 - string timeProperty = propertyName.Replace(":", "."); //如果是时间属性 - if (timeProperty[0].IsDigit()) + if (propertyName[0].IsDigit()) { //添加当前时间到times - times.Add(timeProperty.ToMilliseconds()); + times.Add(propertyName.ToMilliseconds()); } //todo: 在此放置对其他属性的处理逻辑 diff --git a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/StringExtensions.cs b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/StringExtensions.cs index 9acc459..6d60cc8 100644 --- a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/StringExtensions.cs +++ b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Misc/StringExtensions.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using System.Globalization; namespace osu.Game.Rulesets.IGPlayer.Feature.Player.Plugins.Bundle.CloudMusic.Misc { @@ -10,51 +9,11 @@ public static class StringExtensions { public static int ToMilliseconds(this string src) { - int result; - string[] spilt = src.Split("."); + string[] spilt = src.Split(":"); + int.TryParse(spilt[0], out int minutes); + double.TryParse(spilt[1], out double seconds); - string formatString = ""; - - for (int i = 0; i < spilt.Length; i++) - { - int length = spilt[i].Length; - - switch (i) - { - case 0: - formatString += new string('m', length); - break; - - case 1: - formatString += new string('s', length); - break; - - case 2: - formatString += new string('f', length); - break; - } - - if (i < spilt.Length - 1) - formatString += @"\."; - } - - try - { - var timeSpan = TimeSpan.ParseExact($"{src}", formatString, new DateTimeFormatInfo()); - result = (int)timeSpan.TotalMilliseconds; - } - catch (Exception e) - { - string reason = e.Message; - - if (e is FormatException) - reason = "格式有误, 请检查原歌词是否正确"; - - Logging.LogError(e, $"无法将\"{src}\"转换为歌词时间: {reason}"); - result = int.MaxValue; - } - - return result; + return minutes * 60000 + (int)Math.Round(seconds * 1000); } } } diff --git a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Sidebar/Graphic/Toolbox.cs b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Sidebar/Graphic/Toolbox.cs index 792cf98..342bcbb 100644 --- a/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Sidebar/Graphic/Toolbox.cs +++ b/osu.Game.Rulesets.IGPlayer/Feature/Player/Plugins/Bundle/CloudMusic/Sidebar/Graphic/Toolbox.cs @@ -182,6 +182,7 @@ private void initToolbox() Origin = Anchor.TopRight, Current = plugin.Offset, LabelText = CloudMusicStrings.LocalOffset, + KeyboardStep = 100, RelativeSizeAxes = Axes.X, Padding = new MarginPadding { Right = 10 } },