diff --git a/Qwilight/Qwilight/Compiler/BMSONCompiler.cs b/Qwilight/Qwilight/Compiler/BMSONCompiler.cs index 88bfe29..9427546 100644 --- a/Qwilight/Qwilight/Compiler/BMSONCompiler.cs +++ b/Qwilight/Qwilight/Compiler/BMSONCompiler.cs @@ -285,7 +285,7 @@ readonly Dictionary _bmsonPositionLogicalYMap = new(); readonly SortedDictionary _bmsonPositionWaitMap = new(); - JSON.Bmson _text; + JSON.BMSON _text; bool _hasMedia; long _res; @@ -306,7 +306,7 @@ rms.Position = 0; format = formatComputer != null && formatComputer.Confidence >= 0.875 && formatComputer.Encoding != null ? formatComputer.Encoding.CodePage : 65001; } - _text = Utility.GetJSON(Encoding.GetEncoding(format).GetString(rms.GetBuffer(), 0, (int)rms.Length)); + _text = Utility.GetJSON(Encoding.GetEncoding(format).GetString(rms.GetBuffer(), 0, (int)rms.Length)); } var title = _text.info.title; var titleAssister0 = _text.info.subtitle; diff --git a/Qwilight/Qwilight/JSON.cs b/Qwilight/Qwilight/JSON.cs index e0bcb4c..059b21a 100644 --- a/Qwilight/Qwilight/JSON.cs +++ b/Qwilight/Qwilight/JSON.cs @@ -39,24 +39,24 @@ } } - public struct Bmson + public struct BMSON { public BGA bga = new BGA(); - public BpmEvent[] bpm_events = Array.Empty(); - public BmsonInfo info = new BmsonInfo(); - public BarLine[] lines = Array.Empty(); - public SoundChannel[] mine_channels = Array.Empty(); - public SoundChannel[] sound_channels = Array.Empty(); + public BPMEvent[] bpm_events = Array.Empty(); + public BMSONInfo info = new BMSONInfo(); + public Meter[] lines = Array.Empty(); + public AudioChannel[] mine_channels = Array.Empty(); + public AudioChannel[] sound_channels = Array.Empty(); public StopEvent[] stop_events = Array.Empty(); - public Bmson() + public BMSON() { } public struct BGA { public BGAEvent[] bga_events = Array.Empty(); - public BGAHeader[] bga_header = Array.Empty(); + public BGAID[] bga_header = Array.Empty(); public BGAEvent[] layer_events = Array.Empty(); public BGAEvent[] poor_events = Array.Empty(); @@ -70,24 +70,24 @@ public long y; } - public struct BGAHeader + public struct BGAID { public object id; public string name = string.Empty; - public BGAHeader() + public BGAID() { } } } - public struct BpmEvent + public struct BPMEvent { public double bpm; public long y; } - public struct BmsonInfo + public struct BMSONInfo { public string artist = string.Empty; public string back_image = string.Empty; @@ -107,22 +107,22 @@ public string title_image = string.Empty; public double total = 100.0; - public BmsonInfo() + public BMSONInfo() { } } - public struct BarLine + public struct Meter { public long y; } - public struct SoundChannel + public struct AudioChannel { public string name = string.Empty; public Note[] notes = Array.Empty(); - public SoundChannel() + public AudioChannel() { } diff --git a/Qwilight/Qwilight/ViewModel/MainViewModel.cs b/Qwilight/Qwilight/ViewModel/MainViewModel.cs index c93ce9f..70afac5 100644 --- a/Qwilight/Qwilight/ViewModel/MainViewModel.cs +++ b/Qwilight/Qwilight/ViewModel/MainViewModel.cs @@ -679,7 +679,7 @@ { var date = DateTime.Now; using var fs = File.OpenRead(filePath); - foreach (var eventNote in (new XmlSerializer(typeof(XML.Courselist)).Deserialize(fs) as XML.Courselist).Course) + foreach (var eventNote in (new XmlSerializer(typeof(XML.LR2CRS)).Deserialize(fs) as XML.LR2CRS).Items) { try { @@ -691,7 +691,7 @@ eventNoteID += ":0"; var eventNoteName = eventNote.title; var eventNoteVariety = DB.EventNoteVariety.MD5; - _ = DB.Instance.SetEventNote(eventNoteID, eventNoteName, date, eventNoteVariety); + DB.Instance.SetEventNote(eventNoteID, eventNoteName, date, eventNoteVariety).Wait(); lastEventNoteID = eventNoteID; } catch (SQLiteException) diff --git a/Qwilight/Qwilight/XML.cs b/Qwilight/Qwilight/XML.cs index 94b5fdb..41cd4eb 100644 --- a/Qwilight/Qwilight/XML.cs +++ b/Qwilight/Qwilight/XML.cs @@ -5,16 +5,16 @@ public static class XML { [XmlRoot(ElementName = "courselist")] - public sealed class Courselist + public sealed class LR2CRS { [XmlElement(ElementName = "course")] - public Course[] Course { get; set; } - } + public Item[] Items { get; set; } - public struct Course - { - public string title; - public string hash; + public struct Item + { + public string title; + public string hash; + } } } }