Add "Foucs set video position" shortcut

This commit is contained in:
OmrSi 2020-09-10 04:07:25 +03:00
parent 36ffe59692
commit 755e4cbf90
8 changed files with 22 additions and 0 deletions

View File

@ -2001,6 +2001,7 @@ can edit in same subtitle file (collaboration)</Information>
<ListView>List view</ListView>
<TextBox>Text box</TextBox>
<UpdateShortcut>Update</UpdateShortcut>
<FoucsSetVideoPosition>Focus set video position</FoucsSetVideoPosition>
<ToggleDockUndockOfVideoControls>Toggle dock/undock of video controls</ToggleDockUndockOfVideoControls>
<CreateSetEndAddNewAndGoToNew>Set end, add new and go to new</CreateSetEndAddNewAndGoToNew>
<AdjustViaEndAutoStart>Adjust via end position</AdjustViaEndAutoStart>

View File

@ -2295,6 +2295,7 @@ can edit in same subtitle file (collaboration)",
TextBox = "Text box",
ListViewAndTextBox = "List view and text box",
UpdateShortcut = "Update",
FoucsSetVideoPosition = "Focus set video position",
ToggleDockUndockOfVideoControls = "Toggle dock/undock of video controls",
CreateSetEndAddNewAndGoToNew = "Set end, add new and go to new",
AdjustViaEndAutoStart = "Adjust via end position",

View File

@ -5425,6 +5425,9 @@ namespace Nikse.SubtitleEdit.Core
case "Settings/UpdateShortcut":
language.Settings.UpdateShortcut = reader.Value;
break;
case "Settings/FoucsSetVideoPosition":
language.Settings.FoucsSetVideoPosition = reader.Value;
break;
case "Settings/ToggleDockUndockOfVideoControls":
language.Settings.ToggleDockUndockOfVideoControls = reader.Value;
break;

View File

@ -2166,6 +2166,7 @@
public string ListView { get; set; }
public string TextBox { get; set; }
public string UpdateShortcut { get; set; }
public string FoucsSetVideoPosition { get; set; }
public string ToggleDockUndockOfVideoControls { get; set; }
public string CreateSetEndAddNewAndGoToNew { get; set; }
public string AdjustViaEndAutoStart { get; set; }

View File

@ -1801,6 +1801,7 @@ $HorzAlign = Center
public string MainVideoPlayFromJustBefore { get; set; }
public string MainVideoPlayPauseToggle { get; set; }
public string MainVideoShowHideVideo { get; set; }
public string MainVideoFoucsSetVideoPosition { get; set; }
public string MainVideoToggleVideoControls { get; set; }
public string MainVideo1FrameLeft { get; set; }
public string MainVideo1FrameRight { get; set; }
@ -6216,6 +6217,12 @@ $HorzAlign = Center
settings.Shortcuts.MainVideoShowHideVideo = subNode.InnerText;
}
subNode = node.SelectSingleNode("MainVideoFoucsSetVideoPosition");
if (subNode != null)
{
settings.Shortcuts.MainVideoFoucsSetVideoPosition = subNode.InnerText;
}
subNode = node.SelectSingleNode("MainVideoToggleVideoControls");
if (subNode != null)
{
@ -8053,6 +8060,7 @@ $HorzAlign = Center
textWriter.WriteElementString("MainVideoPlayFromJustBefore", settings.Shortcuts.MainVideoPlayFromJustBefore);
textWriter.WriteElementString("MainVideoPlayPauseToggle", settings.Shortcuts.MainVideoPlayPauseToggle);
textWriter.WriteElementString("MainVideoShowHideVideo", settings.Shortcuts.MainVideoShowHideVideo);
textWriter.WriteElementString("MainVideoFoucsSetVideoPosition", settings.Shortcuts.MainVideoFoucsSetVideoPosition);
textWriter.WriteElementString("MainVideoToggleVideoControls", settings.Shortcuts.MainVideoToggleVideoControls);
textWriter.WriteElementString("MainVideo1FrameLeft", settings.Shortcuts.MainVideo1FrameLeft);
textWriter.WriteElementString("MainVideo1FrameRight", settings.Shortcuts.MainVideo1FrameRight);

View File

@ -14340,6 +14340,11 @@ namespace Nikse.SubtitleEdit.Forms
}
e.SuppressKeyPress = true;
}
else if (mediaPlayer.VideoPlayer != null && e.KeyData == _shortcuts.MainVideoFoucsSetVideoPosition)
{
timeUpDownVideoPositionAdjust.Focus();
e.SuppressKeyPress = true;
}
else if (mediaPlayer.VideoPlayer != null && e.KeyData == _shortcuts.Video1FrameLeft)
{
var libMpv = mediaPlayer.VideoPlayer as LibMpvDynamic;

View File

@ -1196,6 +1196,7 @@ namespace Nikse.SubtitleEdit.Forms
AddNode(videoNode, language.Pause, nameof(Configuration.Settings.Shortcuts.MainVideoPause));
AddNode(videoNode, Configuration.Settings.Language.Main.VideoControls.PlayFromJustBeforeText, nameof(Configuration.Settings.Shortcuts.MainVideoPlayFromJustBefore));
AddNode(videoNode, Configuration.Settings.Language.Main.Menu.Video.ShowHideVideo, nameof(Configuration.Settings.Shortcuts.MainVideoShowHideVideo), true);
AddNode(videoNode, language.FoucsSetVideoPosition, nameof(Configuration.Settings.Shortcuts.MainVideoFoucsSetVideoPosition));
AddNode(videoNode, language.ToggleDockUndockOfVideoControls, nameof(Configuration.Settings.Shortcuts.MainVideoToggleVideoControls), true);
AddNode(videoNode, language.GoBack1Frame, nameof(Configuration.Settings.Shortcuts.MainVideo1FrameLeft));
AddNode(videoNode, language.GoForward1Frame, nameof(Configuration.Settings.Shortcuts.MainVideo1FrameRight));

View File

@ -25,6 +25,7 @@ namespace Nikse.SubtitleEdit.Logic
public Keys MainGeneralFileSaveAll { get; set; }
public Keys MainToolsAutoDuration { get; set; }
public Keys MainToolsBeamer { get; set; }
public Keys MainVideoFoucsSetVideoPosition { get; set; }
public Keys ToggleVideoDockUndock { get; set; }
public Keys VideoPause { get; set; }
public Keys VideoPlayPauseToggle { get; set; }
@ -191,6 +192,7 @@ namespace Nikse.SubtitleEdit.Logic
MainGeneralFileSaveAll = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainFileSaveAll);
MainVideoPlayFromJustBefore = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoPlayFromJustBefore);
VideoPause = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoPause);
MainVideoFoucsSetVideoPosition = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoFoucsSetVideoPosition);
ToggleVideoDockUndock = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoToggleVideoControls);
VideoPlayPauseToggle = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoPlayPauseToggle);
Video1FrameLeft = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideo1FrameLeft);