public static ChunkFileContext CreateFileContextForReading(string filePath) { var context = new ChunkFileContext(); context.ChunkFile = ChunkFileInfo.OpenRead(filePath); context.CompositionContainer = CreateCompositionContextForReading(); return(context); }
public static ChunkFileContext CreateFileContextForWriting(string filePath, bool littleEndian) { Assert.IsNotNull(filePath); Assert.IsTrue(Directory.Exists(Path.GetDirectoryName(filePath))); var context = new ChunkFileContext(); context.ChunkFile = ChunkFileInfo.OpenWrite(filePath); Assert.IsNotNull(context.ChunkFile); Assert.IsNotNull(context.ChunkFile.BaseStream); context.CompositionContainer = CreateCompositionContext(littleEndian); Assert.IsNotNull(context.CompositionContainer); return(context); }
public static ChunkFileContext CreateFileContextForReading(string filePath, bool littleEndian) { Assert.IsNotNull(filePath); Assert.IsTrue(File.Exists(filePath)); var context = new ChunkFileContext(); context.ChunkFile = ChunkFileInfo.OpenRead(filePath); Assert.IsNotNull(context.ChunkFile); Assert.IsNotNull(context.ChunkFile.BaseStream); context.CompositionContainer = CreateCompositionContext(littleEndian); Assert.IsNotNull(context.CompositionContainer); return(context); }
public MidiFileSerializer(string filePath) { this.context.ChunkFile = ChunkFileInfo.OpenWrite(filePath); this.context.CompositionContainer = CreateCompositionContainer(); }