internal static InstrumentTuning ReadData(AwesomeReader ar) { InstrumentTuning tuning = new InstrumentTuning(); // 40 bytes tuning.Name = ar.ReadUInt64(); tuning.String1 = ar.ReadInt24() & 0xFF; tuning.String1Alt = ar.ReadByte(); tuning.String2 = ar.ReadInt24() & 0xFF; tuning.String2Alt = ar.ReadByte(); tuning.String3 = ar.ReadInt24() & 0xFF; tuning.String3Alt = ar.ReadByte(); tuning.String4 = ar.ReadInt24() & 0xFF; tuning.String4Alt = ar.ReadByte(); tuning.String5 = ar.ReadInt24() & 0xFF; tuning.String5Alt = ar.ReadByte(); tuning.String6 = ar.ReadInt24() & 0xFF; tuning.String6Alt = ar.ReadByte(); tuning.String7 = ar.ReadInt24() & 0xFF; tuning.String7Alt = ar.ReadByte(); tuning.String8 = ar.ReadInt24() & 0xFF; tuning.String8Alt = ar.ReadByte(); return(tuning); }
internal static void WriteData(AwesomeWriter aw, InstrumentTuning tuning) { // 40 bytes aw.Write((ulong)tuning.Name); aw.Write((int)(tuning.String1 << 8 | tuning.String1Alt)); aw.Write((int)(tuning.String2 << 8 | tuning.String2Alt)); aw.Write((int)(tuning.String3 << 8 | tuning.String3Alt)); aw.Write((int)(tuning.String4 << 8 | tuning.String4Alt)); aw.Write((int)(tuning.String5 << 8 | tuning.String5Alt)); aw.Write((int)(tuning.String6 << 8 | tuning.String6Alt)); aw.Write((int)(tuning.String7 << 8 | tuning.String7Alt)); aw.Write((int)(tuning.String8 << 8 | tuning.String8Alt)); }
protected override void WriteObjectData(AwesomeWriter aw) { aw.Write((ulong)InstrumentType); aw.Write((ulong)Difficulty); aw.BaseStream.Position += 8; // Should be zero'd InstrumentTuning.WriteData(aw, Tuning); aw.Write((int)TrackPaths.Count); aw.Write((int)4); foreach (HKey path in TrackPaths) { aw.Write((ulong)path); } }
internal override void ReadData(AwesomeReader ar) { TrackPaths.Clear(); InstrumentType = ar.ReadUInt64(); Difficulty = ar.ReadUInt64(); ar.BaseStream.Position += 8; // Should be zero'd // Reads tuning info Tuning = InstrumentTuning.ReadData(ar); // Reads track paths int count = ar.ReadInt32(); ar.BaseStream.Position += 4; // Offset - Should be 4 for (int i = 0; i < count; i++) { TrackPaths.Add(ar.ReadUInt64()); } }
internal override void ReadData(AwesomeReader ar) { Entries.Clear(); int entryCount = ar.ReadInt32(); ar.BaseStream.Position += 4; // Should be 4 while (entryCount > 0) { Catalog2Entry entry = new Catalog2Entry(); // 280 bytes entry.Identifier = ar.ReadUInt64(); entry.SongType = ar.ReadInt32(); ar.BaseStream.Position += 4; // Should be 0 entry.Title = ar.ReadUInt64(); entry.Artist = ar.ReadUInt64(); entry.Album = ar.ReadUInt64(); entry.Description = ar.ReadUInt64(); entry.LegendTag = ar.ReadUInt64(); entry.SongLength = ar.ReadSingle(); entry.GuitarIntensity = ar.ReadSingle(); entry.BassIntensity = ar.ReadSingle(); entry.VoxIntensity = ar.ReadSingle(); entry.EraTag = ar.ReadUInt64(); entry.Year = ar.ReadInt32(); ar.BaseStream.Position += 4; // Should be 0 entry.LeadGuitarTuning = InstrumentTuning.ReadData(ar); entry.RhythmGuitarTuning = InstrumentTuning.ReadData(ar); entry.BassTuning = InstrumentTuning.ReadData(ar); // Reads labels int count = ar.ReadInt32(); int offset = ar.ReadInt32(); long previousPosition = ar.BaseStream.Position; ar.BaseStream.Position += offset - 4; for (int i = 0; i < count; i++) { entry.Labels.Add(ar.ReadUInt64()); } ar.BaseStream.Position = previousPosition; entry.SongPath = ar.ReadUInt64(); entry.TexturePath = ar.ReadUInt64(); entry.PreviewPath = ar.ReadUInt64(); // Reads metadata tags count = ar.ReadInt32(); offset = ar.ReadInt32(); previousPosition = ar.BaseStream.Position; ar.BaseStream.Position += offset - 4; for (int i = 0; i < count; i++) { entry.MetadataTags.Add(ar.ReadUInt64()); } ar.BaseStream.Position = previousPosition; // Reads genre tags count = ar.ReadInt32(); offset = ar.ReadInt32(); previousPosition = ar.BaseStream.Position; ar.BaseStream.Position += offset - 4; for (int i = 0; i < count; i++) { entry.GenreTags.Add(ar.ReadUInt64()); } ar.BaseStream.Position = previousPosition; int unknown = ar.ReadInt32(); entry.Unknown1 = (byte)((unknown & 0xFF000000) >> 24); entry.Unknown2 = (byte)((unknown & 0x00FF0000) >> 16); entry.Unknown3 = ar.ReadInt32(); entry.Unknown4 = ar.ReadInt32(); entry.Unknown5 = ar.ReadInt32(); ar.BaseStream.Position += 8; // Should be 0 Entries.Add(entry); entryCount--; } }
protected override void WriteObjectData(AwesomeWriter aw) { // Combines all the tags together List <FString> tags = new List <FString>(); aw.Write((int)Entries.Count); aw.Write((int)4); long tagOffset = aw.BaseStream.Position + (Entries.Count * 280); // Writes entries foreach (Catalog2Entry entry in Entries) { aw.Write((ulong)entry.Identifier); aw.Write((int)entry.SongType); aw.Write((int)0); aw.Write((ulong)entry.Title); aw.Write((ulong)entry.Artist); aw.Write((ulong)entry.Album); aw.Write((ulong)entry.Description); aw.Write((ulong)entry.LegendTag); aw.Write((float)entry.SongLength); aw.Write((float)entry.GuitarIntensity); aw.Write((float)entry.BassIntensity); aw.Write((float)entry.VoxIntensity); aw.Write((ulong)entry.EraTag); aw.Write((int)entry.Year); aw.Write((int)0); // Tunings InstrumentTuning.WriteData(aw, entry.LeadGuitarTuning); InstrumentTuning.WriteData(aw, entry.RhythmGuitarTuning); InstrumentTuning.WriteData(aw, entry.BassTuning); // Labels aw.Write((int)entry.Labels.Count); aw.Write((int)(tagOffset - aw.BaseStream.Position)); tagOffset += entry.Labels.Count * 8; tags.AddRange(entry.Labels); aw.Write((ulong)entry.SongPath); aw.Write((ulong)entry.TexturePath); aw.Write((ulong)entry.PreviewPath); // Metadata tags aw.Write((int)entry.MetadataTags.Count); aw.Write((int)(tagOffset - aw.BaseStream.Position)); tagOffset += entry.MetadataTags.Count * 8; tags.AddRange(entry.MetadataTags); // Genre tags aw.Write((int)entry.GenreTags.Count); aw.Write((int)(tagOffset - aw.BaseStream.Position)); tagOffset += entry.GenreTags.Count * 8; tags.AddRange(entry.GenreTags); aw.Write((int)(entry.Unknown1 << 24 | entry.Unknown2 << 16)); aw.Write((int)entry.Unknown3); aw.Write((int)entry.Unknown4); aw.Write((int)entry.Unknown5); aw.BaseStream.Position += 8; } // Writes tags foreach (FString tag in tags) { aw.Write((ulong)tag); } }
protected override void WriteObjectData(AwesomeWriter aw) { aw.BaseStream.Position += 8; InstrumentTuning.WriteData(aw, InstrumentTuning); }
internal override void ReadData(AwesomeReader ar) { ar.BaseStream.Position += 8; // Skips zeros InstrumentTuning = InstrumentTuning.ReadData(ar); }