//05-06-2008@Scott private static IRPLAY[] MakeSaveToEdl(VideoInfoCollection videoInfo) { ArrayList arrExistPlays = new ArrayList(); int index = 0; IRPLAY[] plays = new IRPLAY[ProcessInfo.MAX_LEN]; for (int i = 0; i < ProcessInfo.MAX_LEN; i++) { plays[i].bstrGameName = string.Empty; plays[i].nPlayNum = -1; plays[i].nMasterNum = -1; } foreach (VideoInfo vi in videoInfo) { if (arrExistPlays.Contains(vi.GameName + vi.PlayNum.ToString())) { continue; } else { arrExistPlays.Add(vi.GameName + vi.PlayNum.ToString()); } plays[index].bstrGameName = vi.GameName; plays[index].nPlayNum = vi.PlayNum; plays[index].nMasterNum = vi.MasterNum; index++; } return(plays); }
//05-06-2008@Scott public static byte[] MakeIRPLAYToBytes(IRPLAY play) { int len = 0, offset = 0, size = ProcessInfo.PLAY_Length; byte[] allBytes = new byte[size]; byte[] bytesPlayNum = BitConverter.GetBytes(play.nPlayNum); len = bytesPlayNum.Length; Buffer.BlockCopy(bytesPlayNum, 0, allBytes, offset, len); offset += len; byte[] bytesMasterNum = BitConverter.GetBytes(play.nMasterNum); len = bytesMasterNum.Length; Buffer.BlockCopy(bytesMasterNum, 0, allBytes, offset, len); offset += len; byte[] bytesGameName = System.Text.Encoding.Default.GetBytes(play.bstrGameName); len = play.bstrGameName.Length; Buffer.BlockCopy(bytesGameName, 0, allBytes, offset, len); return(allBytes); }