private void OpenSupFileDialog_FileOk(object sender, CancelEventArgs e)
{
RemoveSup();
supFile = PesFile.OpenFile(OpenSupFileDialog.FileName, cbxUseAsyncIO.Checked, backgroundWorker2);
if (supFile.FileType != TsFileType.SUP_ELEMENTARY)
{
MessageBox.Show(String.Format("File \"{0}\" is not a valid SUP file.", OpenSupFileDialog.FileName));
return;
}
ushort pid = Constants.DEFAULT_PRESENTATION_GRAPHICS_PID;
while (PidExists(pid))
pid++;
supFile.StreamInfos[0].ElementaryPID = pid;
pidList.Add(pid);
ElementaryStreamsListBox.Items.Add(String.Format("Presentation Graphics Stream # {0}", supFile.StreamInfos[0].ElementaryPID & 0xf));
ElementaryStreamsListBox.SetItemChecked(ElementaryStreamsListBox.Items.Count - 1, true);
EnableSup();
supPresent = true;
}