mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Add waveform whisper context menu for long paragraph
This commit is contained in:
parent
1ae0c82635
commit
440312fa54
@ -3374,6 +3374,7 @@ Keep changes?</KeepChangesMessage>
|
||||
<SplitAtCursor>Split at cursor</SplitAtCursor>
|
||||
<MergeWithPrevious>Merge with previous</MergeWithPrevious>
|
||||
<MergeWithNext>Merge with next</MergeWithNext>
|
||||
<RunWhisperSelectedParagraph>Run Whisper on selected paragraph...</RunWhisperSelectedParagraph>
|
||||
<ExtendToPrevious>Extend to previous</ExtendToPrevious>
|
||||
<ExtendToNext>Extend to next</ExtendToNext>
|
||||
<PlaySelection>Play selection</PlaySelection>
|
||||
|
14
src/ui/Forms/Main.Designer.cs
generated
14
src/ui/Forms/Main.Designer.cs
generated
@ -579,6 +579,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.timerOriginalTextUndo = new System.Windows.Forms.Timer(this.components);
|
||||
this.contextMenuStripShowVideoControls = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.toolStripMenuItemShowVideoControls = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.runWhiperOnParagraphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
@ -2721,7 +2722,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripMenuItemSelectedLines,
|
||||
this.toolStripMenuItemGoogleMicrosoftTranslateSelLine});
|
||||
this.contextMenuStripListView.Name = "contextMenuStripListView";
|
||||
this.contextMenuStripListView.Size = new System.Drawing.Size(285, 848);
|
||||
this.contextMenuStripListView.Size = new System.Drawing.Size(285, 826);
|
||||
this.contextMenuStripListView.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.MenuClosed);
|
||||
this.contextMenuStripListView.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListViewOpening);
|
||||
this.contextMenuStripListView.Opened += new System.EventHandler(this.MenuOpened);
|
||||
@ -4459,6 +4460,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.splitToolStripMenuItem1,
|
||||
this.mergeWithPreviousToolStripMenuItem,
|
||||
this.mergeWithNextToolStripMenuItem,
|
||||
this.runWhiperOnParagraphToolStripMenuItem,
|
||||
this.toolStripSeparator11,
|
||||
this.extendToPreviousToolStripMenuItem,
|
||||
this.extendToNextToolStripMenuItem,
|
||||
@ -4475,7 +4477,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.seekSilenceToolStripMenuItem,
|
||||
this.insertSubtitleHereToolStripMenuItem});
|
||||
this.contextMenuStripWaveform.Name = "contextMenuStripWaveform";
|
||||
this.contextMenuStripWaveform.Size = new System.Drawing.Size(275, 490);
|
||||
this.contextMenuStripWaveform.Size = new System.Drawing.Size(275, 534);
|
||||
this.contextMenuStripWaveform.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.ContextMenuStripWaveformClosing);
|
||||
this.contextMenuStripWaveform.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripWaveformOpening);
|
||||
//
|
||||
@ -5879,6 +5881,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripMenuItemShowVideoControls.Text = "Show video controls";
|
||||
this.toolStripMenuItemShowVideoControls.Click += new System.EventHandler(this.ToolStripMenuItemShowVideoControlsClick);
|
||||
//
|
||||
// runWhiperOnParagraphToolStripMenuItem
|
||||
//
|
||||
this.runWhiperOnParagraphToolStripMenuItem.Name = "runWhiperOnParagraphToolStripMenuItem";
|
||||
this.runWhiperOnParagraphToolStripMenuItem.Size = new System.Drawing.Size(274, 22);
|
||||
this.runWhiperOnParagraphToolStripMenuItem.Text = "Run Whiper on paragraph...";
|
||||
this.runWhiperOnParagraphToolStripMenuItem.Click += new System.EventHandler(this.runWhiperOnParagraphToolStripMenuItem_Click);
|
||||
//
|
||||
// Main
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -6497,5 +6506,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemEvenlyDistributeLines;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemVerifyCompleteness;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButtonVideoOpen;
|
||||
private System.Windows.Forms.ToolStripMenuItem runWhiperOnParagraphToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -939,6 +939,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
deleteParagraphToolStripMenuItem.Visible = false;
|
||||
toolStripMenuItemFocusTextbox.Visible = true;
|
||||
splitToolStripMenuItem1.Visible = false;
|
||||
runWhiperOnParagraphToolStripMenuItem.Visible = false;
|
||||
mergeWithPreviousToolStripMenuItem.Visible = false;
|
||||
mergeWithNextToolStripMenuItem.Visible = false;
|
||||
extendToPreviousToolStripMenuItem.Visible = false;
|
||||
@ -1132,6 +1133,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
deleteParagraphToolStripMenuItem.Visible = true;
|
||||
toolStripMenuItemFocusTextbox.Visible = true;
|
||||
splitToolStripMenuItem1.Visible = true;
|
||||
runWhiperOnParagraphToolStripMenuItem.Visible = e.Paragraph.DurationTotalMilliseconds > 8000;
|
||||
mergeWithPreviousToolStripMenuItem.Visible = true;
|
||||
mergeWithNextToolStripMenuItem.Visible = true;
|
||||
toolStripSeparator11.Visible = true;
|
||||
@ -2089,8 +2091,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
toolStripMenuItemFocusTextbox.Text = languageWaveform.FocusTextBox;
|
||||
goToPreviousSubtitleStripMenuItem.Text = languageWaveform.GoToPrevious;
|
||||
goToNextSubtitleStripMenuItem.Text = languageWaveform.GoToNext;
|
||||
|
||||
splitToolStripMenuItem1.Text = languageWaveform.Split;
|
||||
runWhiperOnParagraphToolStripMenuItem.Text = languageWaveform.RunWhisperSelectedParagraph;
|
||||
mergeWithPreviousToolStripMenuItem.Text = languageWaveform.MergeWithPrevious;
|
||||
mergeWithNextToolStripMenuItem.Text = languageWaveform.MergeWithNext;
|
||||
extendToPreviousToolStripMenuItem.Text = languageWaveform.ExtendToPrevious;
|
||||
@ -9840,7 +9842,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
var audioClips = GetAudioClips();
|
||||
if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 10_000)
|
||||
if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 8_000)
|
||||
{
|
||||
var s = new Subtitle();
|
||||
s.Paragraphs.Add(audioClips[0].Paragraph);
|
||||
@ -36710,5 +36712,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
OpenVideoDialog();
|
||||
}
|
||||
|
||||
private void runWhiperOnParagraphToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
AudioToTextWhisperSelectedLines();
|
||||
}
|
||||
}
|
||||
}
|
@ -3796,6 +3796,7 @@ Keep changes?",
|
||||
MergeWithNext = "Merge with next",
|
||||
ExtendToPrevious = "Extend to previous",
|
||||
ExtendToNext = "Extend to next",
|
||||
RunWhisperSelectedParagraph = "Run Whisper on selected paragraph...",
|
||||
PlaySelection = "Play selection",
|
||||
ShowWaveformAndSpectrogram = "Show waveform and spectrogram",
|
||||
ShowWaveformOnly = "Show waveform only",
|
||||
|
@ -9205,6 +9205,9 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
case "Waveform/MergeWithNext":
|
||||
language.Waveform.MergeWithNext = reader.Value;
|
||||
break;
|
||||
case "Waveform/RunWhisperSelectedParagraph":
|
||||
language.Waveform.RunWhisperSelectedParagraph = reader.Value;
|
||||
break;
|
||||
case "Waveform/ExtendToPrevious":
|
||||
language.Waveform.ExtendToPrevious = reader.Value;
|
||||
break;
|
||||
|
@ -3602,6 +3602,7 @@
|
||||
public string SplitAtCursor { get; set; }
|
||||
public string MergeWithPrevious { get; set; }
|
||||
public string MergeWithNext { get; set; }
|
||||
public string RunWhisperSelectedParagraph { get; set; }
|
||||
public string ExtendToPrevious { get; set; }
|
||||
public string ExtendToNext { get; set; }
|
||||
public string PlaySelection { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user