private static ISampleProvider CreateSampleProvider(BinaryReader binaryReader) { var reader = new StreamSequentialReader(binaryReader); var header = HeaderReader.Read(reader); var commands = CommandsReader.Read(header, reader); var values = Renderer.Render(commands); var provider = new EnumerableSampleProvider(values); return(provider); }
private static void ProcessVgm(string fileName, VgmFileProcessor processor) { var fileInfo = new FileInfo(fileName); using (var stream = new GZipStream(fileInfo.OpenRead(), CompressionMode.Decompress)) { using (var binaryReader = new BinaryReader(stream)) { var reader = new StreamSequentialReader(binaryReader); var header = HeaderReader.Read(reader); var commands = CommandsReader.Read(header, reader); processor(fileName, header, commands); } } }