From 91e18a78f1d998dbec3a5febc0a5f694efb169c2 Mon Sep 17 00:00:00 2001 From: maxton Date: Sun, 25 Mar 2018 22:55:30 -0400 Subject: [PATCH] Version 0.0.1 release! --- LibForge/ForgeTool/Program.cs | 11 ++++++++ LibForge/ForgeTool/Properties/AssemblyInfo.cs | 4 +-- LibForge/LibForge/Midi/RBMid.cs | 5 ++-- LibForge/LibForge/Midi/RBMidReader.cs | 27 ++++++++++--------- LibForge/LibForge/Midi/RBMidWriter.cs | 2 +- LibForge/LibForge/Properties/AssemblyInfo.cs | 4 +-- 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/LibForge/ForgeTool/Program.cs b/LibForge/ForgeTool/Program.cs index 72bf8d7..81cb6a9 100644 --- a/LibForge/ForgeTool/Program.cs +++ b/LibForge/ForgeTool/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.IO; using LibForge.Midi; @@ -40,6 +41,14 @@ static void Main(string[] args) } } break; + case "version": + var assembly = System.Reflection.Assembly.GetExecutingAssembly(); + var version = FileVersionInfo.GetVersionInfo(assembly.Location).FileVersion; + var libAssembly = System.Reflection.Assembly.GetAssembly(typeof(RBMid)); + var libVersion = FileVersionInfo.GetVersionInfo(libAssembly.Location).FileVersion; + Console.WriteLine($"ForgeTool v{version}"); + Console.WriteLine($"LibForge v{libVersion}"); + break; case "test": { var dir = args[1]; @@ -89,6 +98,8 @@ static void Usage() { Console.WriteLine("Usage: ForgeTool.exe [options]"); Console.WriteLine("Verbs: "); + Console.WriteLine(" version"); + Console.WriteLine(" - Prints the version number and exits"); Console.WriteLine(" rbmid2mid "); Console.WriteLine(" - converts a Forge midi to a Standard Midi File"); Console.WriteLine(" reprocess "); diff --git a/LibForge/ForgeTool/Properties/AssemblyInfo.cs b/LibForge/ForgeTool/Properties/AssemblyInfo.cs index 20ff57f..58a17fb 100644 --- a/LibForge/ForgeTool/Properties/AssemblyInfo.cs +++ b/LibForge/ForgeTool/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.0.1.*")] +[assembly: AssemblyFileVersion("0.0.1.0")] diff --git a/LibForge/LibForge/Midi/RBMid.cs b/LibForge/LibForge/Midi/RBMid.cs index a73c77c..8a14178 100644 --- a/LibForge/LibForge/Midi/RBMid.cs +++ b/LibForge/LibForge/Midi/RBMid.cs @@ -281,8 +281,9 @@ public struct BEAT public float Unknown3; public UNKSTRUCT1[] Unknown4; public UNKSTRUCT2[] Unknown5; - public int Unknown10; - public int NumPlayableTracks; + // Takes values 90, 92, 125, 130, 170, 250 + public int Unknown6; + public uint NumPlayableTracks; public int Unknown12; public byte Unknown13; public float PreviewStartMillis; diff --git a/LibForge/LibForge/Midi/RBMidReader.cs b/LibForge/LibForge/Midi/RBMidReader.cs index 1c0d99d..186ae66 100644 --- a/LibForge/LibForge/Midi/RBMidReader.cs +++ b/LibForge/LibForge/Midi/RBMidReader.cs @@ -23,29 +23,30 @@ private RBMid Read() var r = new RBMid(); r.Format = Check(Int(), 16); r.Lyrics = Arr(ReadLyrics, MaxInstTracks); - r.DrumFills = Arr(ReadDrumFills, MaxInstTracks); - r.Anims = Arr(ReadAnims, MaxKeysAnimTracks); - r.ProMarkers = Arr(ReadMarkers, MaxInstTracks); - r.LaneMarkers = Arr(ReadUnktrack, MaxInstTracks); - r.TrillMarkers = Arr(ReadUnktrack2, MaxInstTracks); - r.DrumMixes = Arr(ReadDrumMixes, MaxInstTracks); - r.GemTracks = Arr(ReadGemTracks, MaxInstTracks); - r.OverdriveSoloSections = Arr(ReadOverdrives, MaxInstTracks); + var numTracks = (uint)r.Lyrics.Length; + r.DrumFills = Arr(ReadDrumFills, numTracks); + r.Anims = Arr(ReadAnims, numTracks); + r.ProMarkers = Arr(ReadMarkers, numTracks); + r.LaneMarkers = Arr(ReadUnktrack, numTracks); + r.TrillMarkers = Arr(ReadUnktrack2, numTracks); + r.DrumMixes = Arr(ReadDrumMixes, numTracks); + r.GemTracks = Arr(ReadGemTracks, numTracks); + r.OverdriveSoloSections = Arr(ReadOverdrives, numTracks); r.VocalTracks = Arr(ReadVocalTrack, MaxVocalTracks); r.Unknown1 = Int(); r.Unknown2 = Int(); r.Unknown3 = Float(); r.Unknown4 = Arr(ReadUnkstruct1); r.Unknown5 = Arr(ReadUnkstruct2); - r.Unknown10 = Int(); - r.NumPlayableTracks = Int(); + r.Unknown6 = Int(); + r.NumPlayableTracks = Check(UInt(), numTracks); r.Unknown12 = Int(); r.Unknown13 = Byte(); r.PreviewStartMillis = Float(); r.PreviewEndMillis = Float(); - r.GuitarHandmap = Arr(ReadHandMap, MaxInstTracks); - r.GuitarLeftHandPos = Arr(ReadHandPos, MaxInstTracks); - r.Unktrack = Arr(ReadUnkTrack, MaxInstTracks); + r.GuitarHandmap = Arr(ReadHandMap, numTracks); + r.GuitarLeftHandPos = Arr(ReadHandPos, numTracks); + r.Unktrack = Arr(ReadUnkTrack, numTracks); r.MarkupSoloNotes1 = Arr(ReadMarkupSoloNotes); r.TwoTicks1 = Arr(ReadTwoTicks); diff --git a/LibForge/LibForge/Midi/RBMidWriter.cs b/LibForge/LibForge/Midi/RBMidWriter.cs index 5b28e7d..19a06e3 100644 --- a/LibForge/LibForge/Midi/RBMidWriter.cs +++ b/LibForge/LibForge/Midi/RBMidWriter.cs @@ -32,7 +32,7 @@ private void WriteStream(RBMid r) Write(r.Unknown3); Write(r.Unknown4, WriteUnkstruct1); Write(r.Unknown5, WriteUnkstruct2); - Write(r.Unknown10); + Write(r.Unknown6); Write(r.NumPlayableTracks); Write(r.Unknown12); Write(r.Unknown13); diff --git a/LibForge/LibForge/Properties/AssemblyInfo.cs b/LibForge/LibForge/Properties/AssemblyInfo.cs index f425682..9700c69 100644 --- a/LibForge/LibForge/Properties/AssemblyInfo.cs +++ b/LibForge/LibForge/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.0.1.*")] +[assembly: AssemblyFileVersion("0.0.1.0")]