mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Minor refact
This commit is contained in:
parent
b3bd422260
commit
6a80c278a3
@ -48,7 +48,6 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
public bool IncompleteModel { get; set; }
|
||||
public string IncompleteModelName { get; set; }
|
||||
|
||||
private static bool? _cudaNoDevice { get; set; }
|
||||
private static bool? _cudaSomeDevice { get; set; }
|
||||
|
||||
public Subtitle TranscribedSubtitle { get; private set; }
|
||||
@ -1752,16 +1751,12 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
|
||||
private static void OutputHandlerCheckCuda(object sendingProcess, DataReceivedEventArgs outLine)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(outLine.Data))
|
||||
if (string.IsNullOrEmpty(outLine.Data))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (outLine.Data.Contains("CUDA device: 0"))
|
||||
{
|
||||
_cudaNoDevice = true;
|
||||
}
|
||||
else if (outLine.Data.Contains("CUDA device:"))
|
||||
if (!outLine.Data.Contains("CUDA device: 0") && outLine.Data.Contains("CUDA device:"))
|
||||
{
|
||||
_cudaSomeDevice = true;
|
||||
}
|
||||
|
@ -429,8 +429,8 @@ namespace Nikse.SubtitleEdit.Forms.BinaryEdit
|
||||
FillListView(_subtitle);
|
||||
found = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!found && (ext == ".mkv" || ext == ".mks"))
|
||||
{
|
||||
if (!OpenMatroskaFile(fileName))
|
||||
@ -550,7 +550,7 @@ namespace Nikse.SubtitleEdit.Forms.BinaryEdit
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found && FileUtil.IsManzanita(fileName))
|
||||
{
|
||||
if (!ImportSubtitleFromManzanitaTransportStream(fileName))
|
||||
@ -2817,8 +2817,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox).
|
||||
_forceClose = true;
|
||||
_dialogResult = DialogResult;
|
||||
SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () =>
|
||||
|
@ -13242,9 +13242,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
e.Cancel = true;
|
||||
e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox).
|
||||
_forceClose = true;
|
||||
// To allow windows in FormClosing...
|
||||
SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () => Application.Exit());
|
||||
}
|
||||
}
|
||||
|
@ -8229,9 +8229,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
// To allow windows in FormClosing...
|
||||
e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox).
|
||||
_forceClose = true;
|
||||
_dialogResult = DialogResult;
|
||||
System.Threading.SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () =>
|
||||
|
@ -333,9 +333,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
_forceClose = true;
|
||||
e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox). _forceClose = true;
|
||||
_dialogResult = DialogResult;
|
||||
System.Threading.SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user