예제 #1
0
 /// <summary>
 /// Static MTHD loader.
 /// </summary>
 /// <param name="fileName"></param>
 /// <returns></returns>
 public static smf_mthd GetMthd(string fileName)
 {
     smf_mthd SmfFileHandle = null;
     using (FileStream __filestream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
       using (BinaryReader __binaryreader = new BinaryReader(__filestream))
     {
       SmfFileHandle = new smf_mthd(__binaryreader);
       SmfFileHandle.Tracks = new smf_mtrk [SmfFileHandle.NumberOfTracks];
       for (int i=0; i < SmfFileHandle.NumberOfTracks; i++)
     SmfFileHandle.Tracks[i] = new smf_mtrk(__binaryreader);
     }
     return SmfFileHandle;
 }
예제 #2
0
 void ClearAll()
 {
     ResetTiming();
     smfFileHandle = default(smf_mthd);
     midiFileName = null;
     selectedTrackNumber = -1;
     GC.Collect();
 }