mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 20:52:44 +01:00
Work on SetLayer
This commit is contained in:
parent
7584918f62
commit
4256c5ab8f
20
src/ui/Forms/Main.Designer.cs
generated
20
src/ui/Forms/Main.Designer.cs
generated
@ -279,6 +279,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.contextMenuStripListView = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.setStylesForSelectedLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.setActorForSelectedLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemSetLayer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemAssaTools = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.applyCustomStylesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.setPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@ -574,7 +575,6 @@ 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.toolStripMenuItemSetLayer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
@ -2674,7 +2674,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripMenuItemSelectedLines,
|
||||
this.toolStripMenuItemGoogleMicrosoftTranslateSelLine});
|
||||
this.contextMenuStripListView.Name = "contextMenuStripListView";
|
||||
this.contextMenuStripListView.Size = new System.Drawing.Size(285, 826);
|
||||
this.contextMenuStripListView.Size = new System.Drawing.Size(285, 804);
|
||||
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);
|
||||
@ -2691,6 +2691,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.setActorForSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(284, 22);
|
||||
this.setActorForSelectedLinesToolStripMenuItem.Text = "Set actor";
|
||||
//
|
||||
// toolStripMenuItemSetLayer
|
||||
//
|
||||
this.toolStripMenuItemSetLayer.Name = "toolStripMenuItemSetLayer";
|
||||
this.toolStripMenuItemSetLayer.Size = new System.Drawing.Size(284, 22);
|
||||
this.toolStripMenuItemSetLayer.Text = "Set layer";
|
||||
//
|
||||
// toolStripMenuItemAssaTools
|
||||
//
|
||||
this.toolStripMenuItemAssaTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@ -4581,8 +4587,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
0,
|
||||
-2147483648});
|
||||
this.numericUpDownLayer.Name = "numericUpDownLayer";
|
||||
this.numericUpDownLayer.Size = new System.Drawing.Size(37, 20);
|
||||
this.numericUpDownLayer.TabIndex = 46;
|
||||
this.numericUpDownLayer.Size = new System.Drawing.Size(59, 20);
|
||||
this.numericUpDownLayer.TabIndex = 4;
|
||||
this.numericUpDownLayer.ValueChanged += new System.EventHandler(this.NumericUpDownLayer_ValueChanged);
|
||||
//
|
||||
// labelLayer
|
||||
@ -5615,12 +5621,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripMenuItemShowVideoControls.Text = "Show video controls";
|
||||
this.toolStripMenuItemShowVideoControls.Click += new System.EventHandler(this.toolStripMenuItemShowVideoControls_Click);
|
||||
//
|
||||
// toolStripMenuItemSetLayer
|
||||
//
|
||||
this.toolStripMenuItemSetLayer.Name = "toolStripMenuItemSetLayer";
|
||||
this.toolStripMenuItemSetLayer.Size = new System.Drawing.Size(284, 22);
|
||||
this.toolStripMenuItemSetLayer.Text = "Set layer";
|
||||
//
|
||||
// Main
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -422,6 +422,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
toolStripComboBoxFrameRate.Text = Configuration.Settings.General.DefaultFrameRate.ToString();
|
||||
pictureBoxBookmark.Visible = false;
|
||||
|
||||
labelLayer.Visible = false;
|
||||
numericUpDownLayer.Visible = false;
|
||||
|
||||
UpdateRecentFilesUI();
|
||||
InitializeToolbar();
|
||||
|
||||
@ -3711,7 +3714,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
SubtitleListview1.SelectedIndexChanged -= SubtitleListview1_SelectedIndexChanged;
|
||||
|
||||
RemoveOriginal(true, false);
|
||||
if (format.HasStyleSupport && format.Name == AdvancedSubStationAlpha.NameOfFormat)
|
||||
if (format.HasStyleSupport && format.GetType() == typeof(AdvancedSubStationAlpha))
|
||||
{
|
||||
SubtitleListview1.ShowExtraColumn(_languageGeneral.Style);
|
||||
}
|
||||
@ -5248,6 +5251,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
RemoveOriginal(true, false);
|
||||
_splitDualSami = false;
|
||||
_imageSubFileName = null;
|
||||
labelLayer.Visible = false;
|
||||
numericUpDownLayer.Visible = false;
|
||||
|
||||
SubtitleListview1.HideColumn(SubtitleListView.SubtitleColumn.Extra);
|
||||
|
||||
@ -9481,8 +9486,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string layer = (sender as ToolStripItem).Text;
|
||||
if (!string.IsNullOrEmpty(layer) && int.TryParse(layer, out int number))
|
||||
{
|
||||
MakeHistoryForUndo(LanguageSettings.Current.Main.Menu.ContextMenu.SetLayer + ": " + layer);
|
||||
|
||||
MakeHistoryForUndo(string.Format(_language.BeforeX, $"{_language.Menu.ContextMenu.SetLayer}: {layer}"));
|
||||
foreach (int index in SubtitleListview1.SelectedIndices)
|
||||
{
|
||||
_subtitle.Paragraphs[index].Layer = number;
|
||||
@ -9497,7 +9501,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
if (form.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
MakeHistoryForUndo("Set layer: " + form.Layer);
|
||||
MakeHistoryForUndo(string.Format(_language.BeforeX, $"{_language.Menu.ContextMenu.SetLayer}: {form.Layer}"));
|
||||
var selectedIndices = new List<int>(SubtitleListview1.GetSelectedIndices());
|
||||
foreach (int index in selectedIndices)
|
||||
{
|
||||
@ -9837,6 +9841,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
buttonNext.Enabled = false;
|
||||
buttonUnBreak.Enabled = false;
|
||||
buttonAutoBreak.Enabled = false;
|
||||
numericUpDownLayer.Enabled = false;
|
||||
if (!Configuration.Settings.General.UseDarkTheme)
|
||||
{
|
||||
labelText.Enabled = false;
|
||||
@ -9868,6 +9873,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
buttonNext.Enabled = true;
|
||||
buttonUnBreak.Enabled = true;
|
||||
buttonAutoBreak.Enabled = true;
|
||||
numericUpDownLayer.Enabled = true;
|
||||
labelText.Enabled = true;
|
||||
labelStartTime.Enabled = true;
|
||||
labelDuration.Enabled = true;
|
||||
@ -10770,19 +10776,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void NumericUpDownLayer_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var idx = _subtitleListViewIndex;
|
||||
var p = _subtitle.GetParagraphOrDefault(idx);
|
||||
var p = _subtitle.GetParagraphOrDefault(_subtitleListViewIndex);
|
||||
if (p == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var format = GetCurrentSubtitleFormat();
|
||||
bool isAssa = format.GetType() == typeof(AdvancedSubStationAlpha);
|
||||
var isAssa = GetCurrentSubtitleFormat().GetType() == typeof(AdvancedSubStationAlpha);
|
||||
if (isAssa)
|
||||
{
|
||||
int layer = (int)numericUpDownLayer.Value;
|
||||
MakeHistoryForUndo(LanguageSettings.Current.Main.Controls.SetLayer + ": " + layer);
|
||||
var layer = (int)numericUpDownLayer.Value;
|
||||
MakeHistoryForUndo(string.Format(_language.BeforeX, $"{_language.Menu.ContextMenu.SetLayer}: {layer}"));
|
||||
p.Layer = layer;
|
||||
}
|
||||
}
|
||||
@ -12931,6 +12935,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
labelLayer.Visible = isAssa;
|
||||
if (isAssa)
|
||||
{
|
||||
labelLayer.Text = LanguageSettings.Current.General.Layer;
|
||||
numericUpDownLayer.Left = labelLayer.Right + 5;
|
||||
numericUpDownLayer.ValueChanged -= NumericUpDownLayer_ValueChanged;
|
||||
numericUpDownLayer.Value = p.Layer;
|
||||
numericUpDownLayer.ValueChanged += NumericUpDownLayer_ValueChanged;
|
||||
@ -20504,7 +20510,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
addMs = lastParagraph.EndTime.TotalMilliseconds - tmp.Paragraphs[0].StartTime.TotalMilliseconds + MinGapBetweenLines;
|
||||
}
|
||||
|
||||
if (isAssa && format.Name == AdvancedSubStationAlpha.NameOfFormat)
|
||||
if (isAssa && format.GetType() == typeof(AdvancedSubStationAlpha))
|
||||
{
|
||||
addMs = 0;
|
||||
|
||||
@ -31720,7 +31726,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
var isAssa = IsAssa();
|
||||
var assaStyles = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header);
|
||||
for (int i = 0; i + index < _subtitle.Paragraphs.Count && i < tmp.Paragraphs.Count; i++)
|
||||
for (var i = 0; i + index < _subtitle.Paragraphs.Count && i < tmp.Paragraphs.Count; i++)
|
||||
{
|
||||
if (index + i < _subtitle.Paragraphs.Count)
|
||||
{
|
||||
@ -31729,7 +31735,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_subtitle.Paragraphs[index + i].Text = tmp.Paragraphs[i].Text;
|
||||
_subtitle.Paragraphs[index + i].StartTime.TotalMilliseconds = tmp.Paragraphs[i].StartTime.TotalMilliseconds;
|
||||
_subtitle.Paragraphs[index + i].EndTime.TotalMilliseconds = tmp.Paragraphs[i].EndTime.TotalMilliseconds;
|
||||
if (isAssa && format.Name == AdvancedSubStationAlpha.NameOfFormat)
|
||||
if (isAssa && format.GetType() == typeof(AdvancedSubStationAlpha))
|
||||
{
|
||||
_subtitle.Paragraphs[index + i].Extra = tmp.Paragraphs[i].Extra;
|
||||
_subtitle.Paragraphs[index + i].Actor = tmp.Paragraphs[i].Actor;
|
||||
@ -34727,7 +34733,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void generateBackgroundBoxToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (GetCurrentSubtitleFormat().Name != AdvancedSubStationAlpha.NameOfFormat)
|
||||
if (GetCurrentSubtitleFormat().GetType() != typeof(AdvancedSubStationAlpha))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -857,7 +857,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAcQBLgHEAS4BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAcwBLgHMAS4BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
@ -168,6 +168,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
Actor = "Actor",
|
||||
Gap = "Gap",
|
||||
Region = "Region",
|
||||
Layer = "Layer",
|
||||
NumberSymbol = "#",
|
||||
Number = "Number",
|
||||
Text = "Text",
|
||||
@ -603,7 +604,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
Custom = "Custom",
|
||||
ToDropFrame = "To drop frame",
|
||||
FromDropFrame = "From drop frame",
|
||||
AllowOverlap = "Allow overlap"
|
||||
AllowOverlap = "Allow overlap",
|
||||
};
|
||||
|
||||
CheckForUpdates = new LanguageStructure.CheckForUpdates
|
||||
@ -805,7 +806,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
TextLeftJustifiedText = "Left justified text",
|
||||
TextCenteredText = "Centered text",
|
||||
TextRightJustifiedText = "Right justified text",
|
||||
UseBoxForOneNewLine = "Check 'Use box around text' for only one new-line"
|
||||
UseBoxForOneNewLine = "Check 'Use box around text' for only one new-line",
|
||||
};
|
||||
|
||||
EffectKaraoke = new LanguageStructure.EffectKaraoke
|
||||
@ -813,14 +814,14 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
Title = "Karaoke effect",
|
||||
ChooseColor = "Choose color:",
|
||||
TotalSeconds = "Total seconds:",
|
||||
EndDelayInSeconds = "End delay in seconds:"
|
||||
EndDelayInSeconds = "End delay in seconds:",
|
||||
};
|
||||
|
||||
EffectTypewriter = new LanguageStructure.EffectTypewriter
|
||||
{
|
||||
Title = "Typewriter effect",
|
||||
TotalSeconds = "Total seconds:",
|
||||
EndDelayInSeconds = "End delay in seconds:"
|
||||
EndDelayInSeconds = "End delay in seconds:",
|
||||
};
|
||||
|
||||
ExportCustomText = new LanguageStructure.ExportCustomText
|
||||
@ -960,7 +961,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
WholeWord = "&Whole word",
|
||||
Count = "Coun&t",
|
||||
XNumberOfMatches = "{0:#,##0} matches",
|
||||
OneMatch = "One match"
|
||||
OneMatch = "One match",
|
||||
};
|
||||
|
||||
FindSubtitleLine = new LanguageStructure.FindSubtitleLine
|
||||
@ -1210,7 +1211,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
InputDescription = "Choose input files (browse or drag-n-drop)",
|
||||
ImageFiles = "Image files",
|
||||
Remove = "Remove",
|
||||
RemoveAll = "Remove all"
|
||||
RemoveAll = "Remove all",
|
||||
};
|
||||
|
||||
ImportShotChanges = new LanguageStructure.ImportShotChanges
|
||||
@ -1227,7 +1228,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
GetShotChangesWithFfmpeg = "Generate shot changes with FFmpeg",
|
||||
Sensitivity = "Sensitivity",
|
||||
SensitivityDescription = "Lower value gives more shot changes",
|
||||
NoShotChangesFound = "No shot changes found."
|
||||
NoShotChangesFound = "No shot changes found.",
|
||||
};
|
||||
|
||||
ImportText = new LanguageStructure.ImportText
|
||||
@ -1256,7 +1257,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
TextFiles = "Text files",
|
||||
PreviewLinesModifiedX = "Preview - subtitles modified: {0}",
|
||||
TimeCodes = "Time codes",
|
||||
SplitAtEndChars = "Split at end chars"
|
||||
SplitAtEndChars = "Split at end chars",
|
||||
};
|
||||
|
||||
Interjections = new LanguageStructure.Interjections
|
||||
@ -1276,7 +1277,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
TotalNumberOfLinesX = "Total number of lines: {0:#,###,###}",
|
||||
AlreadyCorrectTimeCodes = "Files already have correct time codes",
|
||||
AppendTimeCodes = "Add end time of previous file",
|
||||
AddMs = "Add milliseconds after each file"
|
||||
AddMs = "Add milliseconds after each file",
|
||||
};
|
||||
|
||||
LanguageNames = new LanguageStructure.LanguageNames
|
||||
@ -1422,7 +1423,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
yoName = "Yoruba",
|
||||
zaName = "Zhuang",
|
||||
zhName = "Chinese",
|
||||
zuName = "Zulu"
|
||||
zuName = "Zulu",
|
||||
};
|
||||
|
||||
Main = new LanguageStructure.Main
|
||||
@ -1905,7 +1906,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
CheckForUpdates = "Check for updates...",
|
||||
Title = "Help",
|
||||
Help = "&Help",
|
||||
About = "&About"
|
||||
About = "&About",
|
||||
},
|
||||
|
||||
Networking = new LanguageStructure.Main.MainMenu.NetworkingMenu
|
||||
@ -2041,7 +2042,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
Next = "Next >",
|
||||
AutoBreak = "Auto &br",
|
||||
Unbreak = "Unbreak",
|
||||
SetLayer = "Set Layer"
|
||||
},
|
||||
|
||||
VideoControls = new LanguageStructure.Main.MainVideoControls
|
||||
@ -2096,7 +2096,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
NewTextInsertAtX = "New text inserted at {0}",
|
||||
|
||||
Center = "Center",
|
||||
PlayRate = "Play rate (speed)"
|
||||
PlayRate = "Play rate (speed)",
|
||||
},
|
||||
};
|
||||
|
||||
@ -2230,7 +2230,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
MillimetersOfMercury = "Millimeters of Mercury",
|
||||
PoundPerSquareInch = "Pound-force per square inch",
|
||||
KilogramPerSquareCentimeter = "Kilogram-force per square centimeter",
|
||||
KiloPascals = "Kilopascals"
|
||||
KiloPascals = "Kilopascals",
|
||||
};
|
||||
|
||||
MergeDoubleLines = new LanguageStructure.MergeDoubleLines
|
||||
@ -2284,7 +2284,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
ExactlyTwoLines = "Exactly two lines",
|
||||
MoreThanTwoLines = "More than two lines",
|
||||
Bookmarked = "Bookmarked",
|
||||
BlankLines = "Blank lines"
|
||||
BlankLines = "Blank lines",
|
||||
};
|
||||
|
||||
MultipleReplace = new LanguageStructure.MultipleReplace
|
||||
@ -2319,7 +2319,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
RulesForGroupX = "Rules for group \"{0}\"",
|
||||
NewGroup = "New group...",
|
||||
NothingToImport = "Nothing to import",
|
||||
RuleInfo = "Rule information"
|
||||
RuleInfo = "Rule information",
|
||||
};
|
||||
|
||||
NetworkChat = new LanguageStructure.NetworkChat
|
||||
@ -2339,7 +2339,7 @@ can edit in same subtitle file (collaboration)",
|
||||
NetworkLogAndInfo = new LanguageStructure.NetworkLogAndInfo
|
||||
{
|
||||
Title = "Network session info and log",
|
||||
Log = "Log:"
|
||||
Log = "Log:",
|
||||
};
|
||||
|
||||
NetworkStart = new LanguageStructure.NetworkStart
|
||||
@ -3537,7 +3537,7 @@ Keep changes?",
|
||||
InvertColors = "Invert colors",
|
||||
OriginalImage = "Original image",
|
||||
PostImage = "Image after preprocessing",
|
||||
YellowToWhite = "Yellow to white"
|
||||
YellowToWhite = "Yellow to white",
|
||||
};
|
||||
|
||||
Watermark = new LanguageStructure.Watermark
|
||||
@ -3685,7 +3685,5 @@ Keep changes?",
|
||||
{
|
||||
File.WriteAllText(fileName, GetCurrentLanguageAsXml(), Encoding.UTF8);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public string Actor { get; set; }
|
||||
public string Gap { get; set; }
|
||||
public string Region { get; set; }
|
||||
public string Layer { get; set; }
|
||||
public string NumberSymbol { get; set; }
|
||||
public string Number { get; set; }
|
||||
public string Text { get; set; }
|
||||
@ -1898,7 +1899,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public string Next { get; set; }
|
||||
public string AutoBreak { get; set; }
|
||||
public string Unbreak { get; set; }
|
||||
public string SetLayer { get; set; }
|
||||
}
|
||||
|
||||
public class MainVideoControls
|
||||
|
Loading…
Reference in New Issue
Block a user