// For reading public SF2(string path) { using (var reader = new BinaryReader(File.Open(path, FileMode.Open), Encoding.ASCII)) { char[] chars = reader.ReadChars(4); if (new string(chars) != "RIFF") { throw new InvalidDataException("RIFF header was not found at the start of the file."); } size = reader.ReadUInt32(); chars = reader.ReadChars(4); if (new string(chars) != "sfbk") { throw new InvalidDataException("sfbk header was not found at the expected offset."); } InfoChunk = new InfoListChunk(this, reader); SoundChunk = new SdtaListChunk(this, reader); HydraChunk = new PdtaListChunk(this, reader); } }
private static void AddInfo(Config config, InfoListChunk chunk) { chunk.Bank = config.Name; //chunk.Copyright = config.Creator; chunk.Tools = Util.Utils.ProgramName + " by Kermalis"; }
// For creating public SF2() { InfoChunk = new InfoListChunk(this); SoundChunk = new SdtaListChunk(this); HydraChunk = new PdtaListChunk(this); }