From 45be0a95e8fd74079cd8c593ce6e839fb7ba3430 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Fri, 7 Jun 2024 16:10:01 +0200 Subject: [PATCH 01/42] Update Finnish translation - thx Teijo S :) --- src/ui/Languages/fi-FI.xml | 113 +++++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 42 deletions(-) diff --git a/src/ui/Languages/fi-FI.xml b/src/ui/Languages/fi-FI.xml index 9993141aa..db4532e25 100644 --- a/src/ui/Languages/fi-FI.xml +++ b/src/ui/Languages/fi-FI.xml @@ -3,7 +3,7 @@ Subtitle Edit 4.0.6 - Suomentanut vm, päivittänyt Teijo S. [15-04-2024] + Suomentanut vm, päivittänyt Teijo S. [04-06-2024] fi-FI &OK @@ -19,6 +19,7 @@ Esikatselu Näytä esikatselu Piilota esikatselu + Tekstitystiedosto Tekstitystiedostot Kaikki tiedostot Videotiedostot @@ -55,7 +56,7 @@ Kuvataajuus Nimi Tiedostonimi: {0} ({1}) - Resoluutio: {0} + Tarkkuus: {0} Kuvataajuus: {0:0.0 ###} Kuvia yhteensä: {0: #,## 0.##} Videokoodaus: {0} @@ -260,14 +261,14 @@ HUOM! Tarkista vapaa levytila. Kaappaa videon sijainti - Muuta ASSA-resoluutiota - Lähderesoluutio - Kohderesoluutio - Muuta reunuksen resoluutiota - Muuta fonttikoon resoluutiota - Muuta sijainnin resoluutiota - Muuta piirustuksen resoluutiota - Lähde- ja kohderesoluutiot ovat samat - ei muutettavaa. + Muuta ASSA-tarkkuutta + Lähdetarkkuuus + Kohdetarkkuuus + Muuta reunuksen tarkkuutta + Muuta fonttikoon tarkkuutta + Muuta sijainnin tarkkuutta + Muuta piirustuksen tarkkuutta + Lähde- ja kohdetarkkuudet ovat samat - ei muutettavaa. Värinpoimintatyökalu @@ -302,7 +303,7 @@ rostiedosto Tekstin sijainti: {0} Napsauta videota paikan asettamiseksi/siirtämiseksi Leikepöytä - ToistoResoX/ToistoResoY ei ole asetettu - asetaanko tarkkuus nyt? + ToistoTarkkX/ToistoTarkkY ei ole asetettu - asetaanko tarkkuus nyt? Kierrä {0}-akselia Vääristä {0} @@ -382,8 +383,8 @@ rostiedosto Etsi videotiedostoja myös hakukansiosta (hidas) - Kaunista aikaleimat - Kaunista aikaleimat ({0} valittua riviä) + Sievistä aikaleimat + Sievistä aikaleimat ({0} valittua riviä) Aikaleimat Tahdista aikaleimat kehysten aikaleimoihin Käytä FFprobea kehysten tarkkojen aikaleimojen purkamiseksi @@ -729,7 +730,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Vasemmalle tasattu teksti Keskitetty teksti Oikealle tasattu teksti - *KESKEN* + Valinta 'Käytä taustaväriä' vain yhdelle uudelle riville Karaoke tehoste @@ -800,7 +801,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Syvyys Vie kaikki rivit Tallennettu {0} kuvaa kohteeseen {1} - Resoluutio + Tarkkuuus Tasaus Vasen Oikea @@ -1025,6 +1026,9 @@ Hyödynnämme kuvan sisäistä rytmiä. Tasaus oikealle Lue aloituskohta Lue lopetuskohta + Käytä lähdettä + Käytä lähteen tarkkuutta + Tulostiedosto/kansio... Luo video lisätyin/poistetuin upotetuin tekstityksin @@ -1065,13 +1069,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Mihin: Käännä Odota... kestää vähän aikaa - Käytetty Google-kääntäjää - Käytetty Microsoft-kääntäjää Käytetty {0} - Uusimman Microsoft-kääntäjän käyttö edellyttää Microsoftin "Kääntäjä-teksti" -avainta. Syötä avain käyttämällä valikkopolkua Valinnat -> Asetukset -> Työkalut. - - Yritä kääntämistä ilman API-avainta (hidas, rajoitettu sanavarasto) - Palvelu: Rivien yhdistäminen: Yhdistä enintään kaksi riviä Yhdistä rivit @@ -1091,6 +1089,13 @@ Hyödynnämme kuvan sisäistä rytmiä. "{0}" vaatii API-avaimen. Halautko lisätietoja? Muodollisuus + Käännä vain nykyinen rivi + Käännä nykyinen rivi uudelleen + Jakauta käsittely + Palvelinkutsujen viive + Palvelinkutsujen enimmäiskoko (tavua) + Pyydä syöte: {0} + Käännä jokainen rivi erikseen Google vastaan Microsoft-kääntäjä @@ -1418,7 +1423,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Kesto Luetteloi virheet.. Netflix-laadun tarkistus - Kaunista aikaleimat... + Sievistä aikaleimat... Teksti - aakkosjärjestyksessä Teksti - suurin yhden rivin pituus Teksti - pituus yhteensä @@ -1513,7 +1518,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Visuaalinen tahdistus Oikoluku Netflix-laaduntarkastus - Kaunista aikaleimat + Sievistä aikaleimat Asetukset Ohje Asettelu @@ -1590,7 +1595,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Karaoketehoste Näytä valitut rivit aikaisemmin/myöhemmin Valittujen rivien visuaalinen tahdistus - Kaunista valittujen rivien aikaleimat... + Sievistä valittujen rivien aikaleimat... Google/Microsoft-käännös alkuperäiselle riville Valitut rivit Käännä valitut rivit @@ -1614,6 +1619,7 @@ Hyödynnämme kuvan sisäistä rytmiä. Siirry lähdenäkymään Siirry luettelonäkymään Irroita ääni + Mediatiedot @@ -1743,10 +1749,10 @@ Haluatko aloittaa asiakirjan alusta ja hakea kerran vielä? Yleisiä virheitä korjattu Ennen uudelleennumerointia Uudelleen numeroitiin alkaen: {0} - Ennen aikaleimojen kaunistamista - Ennen aikaleimojen kaunistamista valituilla riveillä - Aikaleimat kaunistettu - Valittujen rivien aikaleimat kaunistettu + Ennen aikaleimojen sievistämistä + Ennen aikaleimojen sievistämistä valituilla riveillä + Aikaleimat sievistetty + Valittujen rivien aikaleimat sievistetty Ennen tekstityksen poistamista kuulovammaisille Tekstitys kuulovammaisille poistettu: Yksi rivi Tekstitys kuulovammaisille poistettu: {0} riviä @@ -2123,6 +2129,11 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Parilliset rivit Kesto alle Kesto yli + Merkkejä sekunnissa vähemmän kuin + Merkkejä sekunnissa enemmän kuin + Pituus vähemmän kuin + Pituus en +emmän kuin Tasan yksi rivi Tasan kaksi riviä Enemmän kuin kaksi riviä @@ -2304,7 +2315,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Sanaluettelot Sub Station Alpha Verkko - Tiedostotyyppien liitännät + Tiedostotyyppien liitokset Säännöt Työkalupalkin kuvakkeet Uusi @@ -2317,7 +2328,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Upotettu Oikoluku Netflix-laaduntarkastus - Kaunista aikaleimat + Sievistä aikaleimat Asetukset Kirjanmerkit päälle/pois Tarkenna tekstilaatikkoon @@ -2370,9 +2381,9 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Käynnistä lähdenäkymässä Poista tekstityksestä tyhjät rivit avattaessa Poista tekstityksestä tyhjät rivit - Käytä valintaan ASSA päällekirjoitusmerkintöjä - Aseta/hae ASSA sijainti - Aseta ASSA tarkkuus (ToistoResoX/ToistoResoY) + Käytä valintaan ASSA-päällekirjoitusmerkintöjä + Aseta/hae ASSA-sijainti + Aseta ASSA-tarkkuus (ToistoResoX/ToistoResoY) Aseta ASSA taustalaatikko Luo varmuuskopio nyt Rivinvaihtojen esitystapa luettelonäkymässä: @@ -2527,13 +2538,15 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Laske kaikki paitsi välilyönnit CJK 1, latin 0.5 CJK 1, latin 0.5, välilyönti 0 + Sisällytä sävellysmerkit + Sisällytä sävellysmerkit, ei välilyöntejä Ei välilyöntiä tai välimerkkejä ()[]-:;,.!? Ei välilyöntiä tai välimerkkejä, vain merkit Musiikkisymboli Korvattavat musiikkisymbolit (pilkuin eroteltuina) Korjaa yleiset tekstintunnistusvirheet Käytä sanottejan ositusluetteloa (OCR + FCE) - Vältä erisinimiä + Vältä erisnimiä Korjaa liian lyhyet kestot aloitusaikaa muuttamalla Ohita ensimmäinen vaihe (korjaussääntöjen ohitus) Oletusmuoto @@ -2770,7 +2783,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Sarake, teksti ylös Sarake, teksti alas Siirry seuraavaan virheeseen - Luetteloi virheeet + Luetteloi virheet Järjestä {0} mukaan Käynnistä tyylinhallinta Siirrä viimeinen sana seuraavalle riville @@ -2806,7 +2819,9 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Tilinluontiohje Avain Avainten tarjontapalvelu - HUOM! Nämä fonttiasetukset vaikuttavat ainostaan Subtitle Editorin käyttöliittymään. Tekstityksen fontti määritetään yleensä videosoittimessa, mutta se voidaan määrittää myös käyttäen tekstitysmuotoa "Advanced Sub Station Alfa". + HUOM! Nämä fonttiasetukset vaikuttavat ainostaan Subtitle Editorin käyttöliittymään. + Tekstityksen fontti määritetään yleensä videosoittimessa, + mutta se voidaan määrittää myös käyttäen tekstitysmuotoa "Advanced Sub Station Alfa". Palauta oletusarvoihin Palautetaanko kaikki asetukset oletusarvoihinsa? Poista aikaleimat @@ -2828,8 +2843,8 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Muokkaa Pikavalinnat: Salli yksittäinen kirjain/numero tekstilaatikossa Pikavalinnat: Mukautettu alku/loppu päälle/pois - Päivitä tiedostotyyppien kytkennät - Tiedostotyyppien kytkennät päivitetty + Päivitä tiedostotyyppien liitokset + Tiedostotyyppien liitokset päivitetty Muokkaa omaa jatkamistyyliä Lataa tyyli Pääte @@ -3039,8 +3054,8 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Tahdistus kohta Päivittäjä Päivityksen tiedot - Resoluutio - Videon resoluutio + Tarkkuuus + Videon tarkkuuus Nykyisestä videosta Valinnat Rivitysmuoto @@ -3153,6 +3168,12 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Säädetään nopeutta: {0} / {1}... Sulautetaan ääniraitaa: {0} / {1}... Muunnetaan tektiä puheeksi: {0} / {1}... + Ääninäytteiden esikatselu + Esikatsele ja muokkaa/poista äänipätkiä + Toista + Jatka automaattisesti + Luo uudelleen + Nopeus SMPTE-aikakoodaus @@ -3300,7 +3321,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Tekstinsulautus käytössä - ORC - manuaalinen kuva tekstiksi + ORC - Kuva tekstiksi manuaalisesti Pienennä valintaa Laajenna valintaa Tekstityskuva @@ -3321,6 +3342,13 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Tarkista kohteet Lisää parempi vastine Lisää + Lisää parempi monivastaavuus + Lisää tai päivitä vastaavuus + Valitse edellinen vastaavuus + Valitse seuraava vastaavuus + Siirry edelliseen puuttuvaan vastaavuuteen + Siirry seuraavaan puuttuvaan vastaavuuteen + Terävöitä tekstisyöte Uusi kansio @@ -3386,6 +3414,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Arvaa aikaleimat Etsi hiljaisuutta Lisää tähän tekstitys + Lisää tähän tekstitystiedosto M/S: {0:0.00} S/M: {0:0.00} @@ -3420,7 +3449,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett Whisper Advanced - komentorivin lisäparametrit Whisper Advanced - komentorivin lisäparametrit: - HUOM! Eri Whisper sovelluksilla on erilaiset komentorivin lisäparametrit! + HUOM! Eri Whisper-sovelluksilla on erilaiset komentorivin lisäparametrit! Vakio Vakio (Aasia) Korosta nykyinen sana From ecafda839450d6eed1e7489c4b42aea34eea4527 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 9 Jun 2024 08:04:15 +0200 Subject: [PATCH 02/42] Validate prompt chars - thx nyck33 :) Fix #8506 --- src/ui/Forms/Translate/AutoTranslateSettings.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/Forms/Translate/AutoTranslateSettings.cs b/src/ui/Forms/Translate/AutoTranslateSettings.cs index 4369f7519..83a194619 100644 --- a/src/ui/Forms/Translate/AutoTranslateSettings.cs +++ b/src/ui/Forms/Translate/AutoTranslateSettings.cs @@ -89,6 +89,18 @@ namespace Nikse.SubtitleEdit.Forms.Translate private void buttonOk_Click(object sender, EventArgs e) { + if (nikseTextBoxPrompt.Text.Contains('{')) + { + MessageBox.Show("Character not allowed: {"); + return; + } + + if (nikseTextBoxPrompt.Text.Contains('}')) + { + MessageBox.Show("Character not allowed: }"); + return; + } + Configuration.Settings.Tools.AutoTranslateDelaySeconds = (int)nikseUpDownDelay.Value; Configuration.Settings.Tools.AutoTranslateMaxBytes = (int)nikseUpDownMaxBytes.Value; From 93367dd9d750046a61aad27c0b4daff405b70b9d Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 9 Jun 2024 08:57:23 +0200 Subject: [PATCH 03/42] Add audio settings for TTS final video file --- src/libse/Common/Settings.cs | 24 ++ src/ui/Forms/Main.cs | 4 +- .../Forms/Translate/AutoTranslateSettings.cs | 10 +- src/ui/Forms/Tts/TextToSpeech.Designer.cs | 261 ++++++++++-------- src/ui/Forms/Tts/TextToSpeech.cs | 28 +- src/ui/Forms/Tts/TtsAudioEncoding.Designer.cs | 147 ++++++++++ src/ui/Forms/Tts/TtsAudioEncoding.cs | 41 +++ src/ui/Forms/Tts/TtsAudioEncoding.resx | 120 ++++++++ src/ui/Logic/Language.cs | 1 + src/ui/Logic/LanguageStructure.cs | 1 + src/ui/Logic/VideoPreviewGenerator.cs | 7 +- src/ui/SubtitleEdit.csproj | 9 + 12 files changed, 529 insertions(+), 124 deletions(-) create mode 100644 src/ui/Forms/Tts/TtsAudioEncoding.Designer.cs create mode 100644 src/ui/Forms/Tts/TtsAudioEncoding.cs create mode 100644 src/ui/Forms/Tts/TtsAudioEncoding.resx diff --git a/src/libse/Common/Settings.cs b/src/libse/Common/Settings.cs index 1c2ac9891..c3b12af0d 100644 --- a/src/libse/Common/Settings.cs +++ b/src/libse/Common/Settings.cs @@ -199,6 +199,9 @@ namespace Nikse.SubtitleEdit.Core.Common public string TextToSpeechAzureApiKey { get; set; } public string TextToSpeechAzureRegion { get; set; } public bool TextToSpeechPreview { get; set; } + public bool TextToSpeechCustomAudio { get; set; } + public bool TextToSpeechCustomAudioStereo { get; set; } + public string TextToSpeechCustomAudioEncoding { get; set; } public bool TextToSpeechAddToVideoFile { get; set; } public bool ListViewSyntaxColorDurationSmall { get; set; } public bool ListViewSyntaxColorDurationBig { get; set; } @@ -5538,6 +5541,24 @@ $HorzAlign = Center settings.Tools.TextToSpeechPreview = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture); } + subNode = node.SelectSingleNode("TextToSpeechCustomAudio"); + if (subNode != null) + { + settings.Tools.TextToSpeechCustomAudio = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture); + } + + subNode = node.SelectSingleNode("TextToSpeechCustomAudioStereo"); + if (subNode != null) + { + settings.Tools.TextToSpeechCustomAudioStereo = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture); + } + + subNode = node.SelectSingleNode("TextToSpeechCustomAudioEncoding"); + if (subNode != null) + { + settings.Tools.TextToSpeechCustomAudioEncoding = subNode.InnerText; + } + subNode = node.SelectSingleNode("TextToSpeechAddToVideoFile"); if (subNode != null) { @@ -12092,6 +12113,9 @@ $HorzAlign = Center textWriter.WriteElementString("TextToSpeechAzureApiKey", settings.Tools.TextToSpeechAzureApiKey); textWriter.WriteElementString("TextToSpeechAzureRegion", settings.Tools.TextToSpeechAzureRegion); textWriter.WriteElementString("TextToSpeechPreview", settings.Tools.TextToSpeechPreview.ToString(CultureInfo.InvariantCulture)); + textWriter.WriteElementString("TextToSpeechCustomAudio", settings.Tools.TextToSpeechCustomAudio.ToString(CultureInfo.InvariantCulture)); + textWriter.WriteElementString("TextToSpeechCustomAudioStereo", settings.Tools.TextToSpeechCustomAudioStereo.ToString(CultureInfo.InvariantCulture)); + textWriter.WriteElementString("TextToSpeechCustomAudioEncoding", settings.Tools.TextToSpeechCustomAudioEncoding); textWriter.WriteElementString("TextToSpeechAddToVideoFile", settings.Tools.TextToSpeechAddToVideoFile.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ListViewSyntaxColorDurationSmall", settings.Tools.ListViewSyntaxColorDurationSmall.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ListViewSyntaxColorDurationBig", settings.Tools.ListViewSyntaxColorDurationBig.ToString(CultureInfo.InvariantCulture)); diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index eb430e4c6..b22d6bd5c 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -1086,7 +1086,7 @@ namespace Nikse.SubtitleEdit.Forms private void AudioWaveform_OnSingleClick(object sender, AudioVisualizer.ParagraphEventArgs e) { - timerWaveform.Stop(); + timerWaveform?.Stop(); ResetPlaySelection(); if (mediaPlayer.VideoPlayer != null) { @@ -1108,7 +1108,7 @@ namespace Nikse.SubtitleEdit.Forms SelectListViewIndexAndEnsureVisible(_subtitle.GetIndex(e.Paragraph)); } - timerWaveform.Start(); + timerWaveform?.Start(); } private void AudioWaveform_OnParagraphRightClicked(object sender, AudioVisualizer.ParagraphEventArgs e) diff --git a/src/ui/Forms/Translate/AutoTranslateSettings.cs b/src/ui/Forms/Translate/AutoTranslateSettings.cs index 83a194619..2543d9389 100644 --- a/src/ui/Forms/Translate/AutoTranslateSettings.cs +++ b/src/ui/Forms/Translate/AutoTranslateSettings.cs @@ -91,13 +91,19 @@ namespace Nikse.SubtitleEdit.Forms.Translate { if (nikseTextBoxPrompt.Text.Contains('{')) { - MessageBox.Show("Character not allowed: {"); + MessageBox.Show("Character not allowed in prompt: {"); return; } if (nikseTextBoxPrompt.Text.Contains('}')) { - MessageBox.Show("Character not allowed: }"); + MessageBox.Show("Character not allowed in prompt: }"); + return; + } + + if (nikseTextBoxPrompt.Text.Length > 1000) + { + MessageBox.Show("Too many characters in prompt"); return; } diff --git a/src/ui/Forms/Tts/TextToSpeech.Designer.cs b/src/ui/Forms/Tts/TextToSpeech.Designer.cs index 57e6a91c9..aef54b24c 100644 --- a/src/ui/Forms/Tts/TextToSpeech.Designer.cs +++ b/src/ui/Forms/Tts/TextToSpeech.Designer.cs @@ -35,26 +35,28 @@ this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.labelEngine = new System.Windows.Forms.Label(); this.groupBoxSettings = new System.Windows.Forms.GroupBox(); + this.linkLabelCustomAudio = new System.Windows.Forms.LinkLabel(); + this.checkBoxAudioEncoding = new System.Windows.Forms.CheckBox(); this.labelRegion = new System.Windows.Forms.Label(); - this.nikseComboBoxRegion = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.labelVoiceCount = new System.Windows.Forms.Label(); this.checkBoxShowPreview = new System.Windows.Forms.CheckBox(); this.labelApiKey = new System.Windows.Forms.Label(); - this.nikseTextBoxApiKey = new Nikse.SubtitleEdit.Controls.NikseTextBox(); - this.TextBoxTest = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.buttonTestVoice = new System.Windows.Forms.Button(); this.checkBoxAddToVideoFile = new System.Windows.Forms.CheckBox(); this.labelVoice = new System.Windows.Forms.Label(); - this.nikseComboBoxVoice = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.contextMenuStripVoices = new System.Windows.Forms.ContextMenuStrip(this.components); this.refreshVoicesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.nikseComboBoxEngine = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.listViewActors = new System.Windows.Forms.ListView(); this.columnHeaderActor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderVoice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStripActors = new System.Windows.Forms.ContextMenuStrip(this.components); this.labelActors = new System.Windows.Forms.Label(); this.buttonCancel = new System.Windows.Forms.Button(); + this.nikseComboBoxRegion = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.nikseTextBoxApiKey = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.TextBoxTest = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.nikseComboBoxVoice = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.nikseComboBoxEngine = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.groupBoxSettings.SuspendLayout(); this.contextMenuStripVoices.SuspendLayout(); this.SuspendLayout(); @@ -63,7 +65,7 @@ // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonOK.Location = new System.Drawing.Point(686, 456); + this.buttonOK.Location = new System.Drawing.Point(720, 486); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 100; @@ -76,7 +78,7 @@ this.labelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.labelProgress.AutoSize = true; this.labelProgress.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.labelProgress.Location = new System.Drawing.Point(12, 433); + this.labelProgress.Location = new System.Drawing.Point(12, 463); this.labelProgress.Name = "labelProgress"; this.labelProgress.Size = new System.Drawing.Size(70, 13); this.labelProgress.TabIndex = 9; @@ -86,7 +88,7 @@ // this.buttonGenerateTTS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonGenerateTTS.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonGenerateTTS.Location = new System.Drawing.Point(614, 423); + this.buttonGenerateTTS.Location = new System.Drawing.Point(648, 453); this.buttonGenerateTTS.Name = "buttonGenerateTTS"; this.buttonGenerateTTS.Size = new System.Drawing.Size(228, 23); this.buttonGenerateTTS.TabIndex = 90; @@ -98,9 +100,9 @@ // this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.progressBar1.Location = new System.Drawing.Point(12, 456); + this.progressBar1.Location = new System.Drawing.Point(12, 486); this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(665, 10); + this.progressBar1.Size = new System.Drawing.Size(699, 10); this.progressBar1.TabIndex = 12; // // labelEngine @@ -117,6 +119,8 @@ // this.groupBoxSettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); + this.groupBoxSettings.Controls.Add(this.linkLabelCustomAudio); + this.groupBoxSettings.Controls.Add(this.checkBoxAudioEncoding); this.groupBoxSettings.Controls.Add(this.labelRegion); this.groupBoxSettings.Controls.Add(this.nikseComboBoxRegion); this.groupBoxSettings.Controls.Add(this.labelVoiceCount); @@ -132,11 +136,34 @@ this.groupBoxSettings.Controls.Add(this.nikseComboBoxEngine); this.groupBoxSettings.Location = new System.Drawing.Point(15, 12); this.groupBoxSettings.Name = "groupBoxSettings"; - this.groupBoxSettings.Size = new System.Drawing.Size(391, 405); + this.groupBoxSettings.Size = new System.Drawing.Size(391, 435); this.groupBoxSettings.TabIndex = 1; this.groupBoxSettings.TabStop = false; this.groupBoxSettings.Text = "Settings"; // + // linkLabelCustomAudio + // + this.linkLabelCustomAudio.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.linkLabelCustomAudio.AutoSize = true; + this.linkLabelCustomAudio.Location = new System.Drawing.Point(169, 400); + this.linkLabelCustomAudio.Name = "linkLabelCustomAudio"; + this.linkLabelCustomAudio.Size = new System.Drawing.Size(45, 13); + this.linkLabelCustomAudio.TabIndex = 34; + this.linkLabelCustomAudio.TabStop = true; + this.linkLabelCustomAudio.Text = "Settings"; + this.linkLabelCustomAudio.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelCustomAudio_LinkClicked); + // + // checkBoxAudioEncoding + // + this.checkBoxAudioEncoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxAudioEncoding.AutoSize = true; + this.checkBoxAudioEncoding.Location = new System.Drawing.Point(32, 401); + this.checkBoxAudioEncoding.Name = "checkBoxAudioEncoding"; + this.checkBoxAudioEncoding.Size = new System.Drawing.Size(137, 17); + this.checkBoxAudioEncoding.TabIndex = 33; + this.checkBoxAudioEncoding.Text = "Custom audio encoding"; + this.checkBoxAudioEncoding.UseVisualStyleBackColor = true; + // // labelRegion // this.labelRegion.AutoSize = true; @@ -147,31 +174,6 @@ this.labelRegion.TabIndex = 32; this.labelRegion.Text = "Region"; // - // nikseComboBoxRegion - // - this.nikseComboBoxRegion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.nikseComboBoxRegion.BackColor = System.Drawing.SystemColors.Window; - this.nikseComboBoxRegion.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); - this.nikseComboBoxRegion.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); - this.nikseComboBoxRegion.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); - this.nikseComboBoxRegion.ButtonForeColor = System.Drawing.SystemColors.ControlText; - this.nikseComboBoxRegion.ButtonForeColorDown = System.Drawing.Color.Orange; - this.nikseComboBoxRegion.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.nikseComboBoxRegion.DropDownHeight = 400; - this.nikseComboBoxRegion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.nikseComboBoxRegion.DropDownWidth = 0; - this.nikseComboBoxRegion.FormattingEnabled = false; - this.nikseComboBoxRegion.Location = new System.Drawing.Point(17, 286); - this.nikseComboBoxRegion.MaxLength = 32767; - this.nikseComboBoxRegion.Name = "nikseComboBoxRegion"; - this.nikseComboBoxRegion.SelectedIndex = -1; - this.nikseComboBoxRegion.SelectedItem = null; - this.nikseComboBoxRegion.SelectedText = ""; - this.nikseComboBoxRegion.Size = new System.Drawing.Size(351, 23); - this.nikseComboBoxRegion.TabIndex = 31; - this.nikseComboBoxRegion.UsePopupWindow = false; - // // labelVoiceCount // this.labelVoiceCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -188,7 +190,7 @@ this.checkBoxShowPreview.AutoSize = true; this.checkBoxShowPreview.Checked = true; this.checkBoxShowPreview.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxShowPreview.Location = new System.Drawing.Point(17, 333); + this.checkBoxShowPreview.Location = new System.Drawing.Point(17, 352); this.checkBoxShowPreview.Name = "checkBoxShowPreview"; this.checkBoxShowPreview.Size = new System.Drawing.Size(115, 17); this.checkBoxShowPreview.TabIndex = 25; @@ -205,28 +207,6 @@ this.labelApiKey.TabIndex = 28; this.labelApiKey.Text = "API key"; // - // nikseTextBoxApiKey - // - this.nikseTextBoxApiKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.nikseTextBoxApiKey.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.nikseTextBoxApiKey.Location = new System.Drawing.Point(17, 237); - this.nikseTextBoxApiKey.Name = "nikseTextBoxApiKey"; - this.nikseTextBoxApiKey.Size = new System.Drawing.Size(351, 20); - this.nikseTextBoxApiKey.TabIndex = 27; - // - // TextBoxTest - // - this.TextBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TextBoxTest.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.TextBoxTest.Location = new System.Drawing.Point(17, 172); - this.TextBoxTest.Name = "TextBoxTest"; - this.TextBoxTest.Size = new System.Drawing.Size(351, 20); - this.TextBoxTest.TabIndex = 20; - this.TextBoxTest.Text = "Hello, how are you?"; - this.TextBoxTest.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxTest_KeyDown); - // // buttonTestVoice // this.buttonTestVoice.Location = new System.Drawing.Point(17, 141); @@ -243,7 +223,7 @@ this.checkBoxAddToVideoFile.AutoSize = true; this.checkBoxAddToVideoFile.Checked = true; this.checkBoxAddToVideoFile.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxAddToVideoFile.Location = new System.Drawing.Point(17, 357); + this.checkBoxAddToVideoFile.Location = new System.Drawing.Point(17, 376); this.checkBoxAddToVideoFile.Name = "checkBoxAddToVideoFile"; this.checkBoxAddToVideoFile.Size = new System.Drawing.Size(176, 17); this.checkBoxAddToVideoFile.TabIndex = 26; @@ -260,32 +240,6 @@ this.labelVoice.TabIndex = 16; this.labelVoice.Text = "Voice"; // - // nikseComboBoxVoice - // - this.nikseComboBoxVoice.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.nikseComboBoxVoice.BackColor = System.Drawing.SystemColors.Window; - this.nikseComboBoxVoice.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); - this.nikseComboBoxVoice.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); - this.nikseComboBoxVoice.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); - this.nikseComboBoxVoice.ButtonForeColor = System.Drawing.SystemColors.ControlText; - this.nikseComboBoxVoice.ButtonForeColorDown = System.Drawing.Color.Orange; - this.nikseComboBoxVoice.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.nikseComboBoxVoice.ContextMenuStrip = this.contextMenuStripVoices; - this.nikseComboBoxVoice.DropDownHeight = 400; - this.nikseComboBoxVoice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.nikseComboBoxVoice.DropDownWidth = 0; - this.nikseComboBoxVoice.FormattingEnabled = false; - this.nikseComboBoxVoice.Location = new System.Drawing.Point(17, 110); - this.nikseComboBoxVoice.MaxLength = 32767; - this.nikseComboBoxVoice.Name = "nikseComboBoxVoice"; - this.nikseComboBoxVoice.SelectedIndex = -1; - this.nikseComboBoxVoice.SelectedItem = null; - this.nikseComboBoxVoice.SelectedText = ""; - this.nikseComboBoxVoice.Size = new System.Drawing.Size(351, 23); - this.nikseComboBoxVoice.TabIndex = 10; - this.nikseComboBoxVoice.UsePopupWindow = false; - // // contextMenuStripVoices // this.contextMenuStripVoices.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -301,33 +255,6 @@ this.refreshVoicesToolStripMenuItem.Text = "Refresh voices"; this.refreshVoicesToolStripMenuItem.Click += new System.EventHandler(this.refreshVoicesToolStripMenuItem_Click); // - // nikseComboBoxEngine - // - this.nikseComboBoxEngine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.nikseComboBoxEngine.BackColor = System.Drawing.SystemColors.Window; - this.nikseComboBoxEngine.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); - this.nikseComboBoxEngine.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); - this.nikseComboBoxEngine.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); - this.nikseComboBoxEngine.ButtonForeColor = System.Drawing.SystemColors.ControlText; - this.nikseComboBoxEngine.ButtonForeColorDown = System.Drawing.Color.Orange; - this.nikseComboBoxEngine.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.nikseComboBoxEngine.DropDownHeight = 400; - this.nikseComboBoxEngine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; - this.nikseComboBoxEngine.DropDownWidth = 391; - this.nikseComboBoxEngine.FormattingEnabled = false; - this.nikseComboBoxEngine.Location = new System.Drawing.Point(17, 40); - this.nikseComboBoxEngine.MaxLength = 32767; - this.nikseComboBoxEngine.Name = "nikseComboBoxEngine"; - this.nikseComboBoxEngine.SelectedIndex = -1; - this.nikseComboBoxEngine.SelectedItem = null; - this.nikseComboBoxEngine.SelectedText = ""; - this.nikseComboBoxEngine.Size = new System.Drawing.Size(351, 23); - this.nikseComboBoxEngine.TabIndex = 5; - this.nikseComboBoxEngine.TabStop = false; - this.nikseComboBoxEngine.Text = "nikseComboBox1"; - this.nikseComboBoxEngine.UsePopupWindow = false; - // // listViewActors // this.listViewActors.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -342,7 +269,7 @@ this.listViewActors.HideSelection = false; this.listViewActors.Location = new System.Drawing.Point(412, 42); this.listViewActors.Name = "listViewActors"; - this.listViewActors.Size = new System.Drawing.Size(430, 375); + this.listViewActors.Size = new System.Drawing.Size(464, 405); this.listViewActors.TabIndex = 40; this.listViewActors.UseCompatibleStateImageBehavior = false; this.listViewActors.View = System.Windows.Forms.View.Details; @@ -377,7 +304,7 @@ this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonCancel.Location = new System.Drawing.Point(767, 456); + this.buttonCancel.Location = new System.Drawing.Point(801, 486); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 101; @@ -385,11 +312,111 @@ this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // + // nikseComboBoxRegion + // + this.nikseComboBoxRegion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.nikseComboBoxRegion.BackColor = System.Drawing.SystemColors.Window; + this.nikseComboBoxRegion.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.nikseComboBoxRegion.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.nikseComboBoxRegion.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.nikseComboBoxRegion.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.nikseComboBoxRegion.ButtonForeColorDown = System.Drawing.Color.Orange; + this.nikseComboBoxRegion.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.nikseComboBoxRegion.DropDownHeight = 400; + this.nikseComboBoxRegion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.nikseComboBoxRegion.DropDownWidth = 0; + this.nikseComboBoxRegion.FormattingEnabled = false; + this.nikseComboBoxRegion.Location = new System.Drawing.Point(17, 286); + this.nikseComboBoxRegion.MaxLength = 32767; + this.nikseComboBoxRegion.Name = "nikseComboBoxRegion"; + this.nikseComboBoxRegion.SelectedIndex = -1; + this.nikseComboBoxRegion.SelectedItem = null; + this.nikseComboBoxRegion.SelectedText = ""; + this.nikseComboBoxRegion.Size = new System.Drawing.Size(351, 23); + this.nikseComboBoxRegion.TabIndex = 31; + this.nikseComboBoxRegion.UsePopupWindow = false; + // + // nikseTextBoxApiKey + // + this.nikseTextBoxApiKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.nikseTextBoxApiKey.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.nikseTextBoxApiKey.Location = new System.Drawing.Point(17, 237); + this.nikseTextBoxApiKey.Name = "nikseTextBoxApiKey"; + this.nikseTextBoxApiKey.Size = new System.Drawing.Size(351, 20); + this.nikseTextBoxApiKey.TabIndex = 27; + // + // TextBoxTest + // + this.TextBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TextBoxTest.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.TextBoxTest.Location = new System.Drawing.Point(17, 172); + this.TextBoxTest.Name = "TextBoxTest"; + this.TextBoxTest.Size = new System.Drawing.Size(351, 20); + this.TextBoxTest.TabIndex = 20; + this.TextBoxTest.Text = "Hello, how are you?"; + this.TextBoxTest.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxTest_KeyDown); + // + // nikseComboBoxVoice + // + this.nikseComboBoxVoice.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.nikseComboBoxVoice.BackColor = System.Drawing.SystemColors.Window; + this.nikseComboBoxVoice.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.nikseComboBoxVoice.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.nikseComboBoxVoice.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.nikseComboBoxVoice.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.nikseComboBoxVoice.ButtonForeColorDown = System.Drawing.Color.Orange; + this.nikseComboBoxVoice.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.nikseComboBoxVoice.ContextMenuStrip = this.contextMenuStripVoices; + this.nikseComboBoxVoice.DropDownHeight = 400; + this.nikseComboBoxVoice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.nikseComboBoxVoice.DropDownWidth = 0; + this.nikseComboBoxVoice.FormattingEnabled = false; + this.nikseComboBoxVoice.Location = new System.Drawing.Point(17, 110); + this.nikseComboBoxVoice.MaxLength = 32767; + this.nikseComboBoxVoice.Name = "nikseComboBoxVoice"; + this.nikseComboBoxVoice.SelectedIndex = -1; + this.nikseComboBoxVoice.SelectedItem = null; + this.nikseComboBoxVoice.SelectedText = ""; + this.nikseComboBoxVoice.Size = new System.Drawing.Size(351, 23); + this.nikseComboBoxVoice.TabIndex = 10; + this.nikseComboBoxVoice.UsePopupWindow = false; + // + // nikseComboBoxEngine + // + this.nikseComboBoxEngine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.nikseComboBoxEngine.BackColor = System.Drawing.SystemColors.Window; + this.nikseComboBoxEngine.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.nikseComboBoxEngine.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.nikseComboBoxEngine.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.nikseComboBoxEngine.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.nikseComboBoxEngine.ButtonForeColorDown = System.Drawing.Color.Orange; + this.nikseComboBoxEngine.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.nikseComboBoxEngine.DropDownHeight = 400; + this.nikseComboBoxEngine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; + this.nikseComboBoxEngine.DropDownWidth = 391; + this.nikseComboBoxEngine.FormattingEnabled = false; + this.nikseComboBoxEngine.Location = new System.Drawing.Point(17, 40); + this.nikseComboBoxEngine.MaxLength = 32767; + this.nikseComboBoxEngine.Name = "nikseComboBoxEngine"; + this.nikseComboBoxEngine.SelectedIndex = -1; + this.nikseComboBoxEngine.SelectedItem = null; + this.nikseComboBoxEngine.SelectedText = ""; + this.nikseComboBoxEngine.Size = new System.Drawing.Size(351, 23); + this.nikseComboBoxEngine.TabIndex = 5; + this.nikseComboBoxEngine.TabStop = false; + this.nikseComboBoxEngine.Text = "nikseComboBox1"; + this.nikseComboBoxEngine.UsePopupWindow = false; + // // TextToSpeech // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(854, 491); + this.ClientSize = new System.Drawing.Size(888, 521); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.labelActors); this.Controls.Add(this.listViewActors); @@ -446,5 +473,7 @@ private Controls.NikseComboBox nikseComboBoxRegion; private System.Windows.Forms.ContextMenuStrip contextMenuStripVoices; private System.Windows.Forms.ToolStripMenuItem refreshVoicesToolStripMenuItem; + private System.Windows.Forms.CheckBox checkBoxAudioEncoding; + private System.Windows.Forms.LinkLabel linkLabelCustomAudio; } } \ No newline at end of file diff --git a/src/ui/Forms/Tts/TextToSpeech.cs b/src/ui/Forms/Tts/TextToSpeech.cs index 0a747733a..83de73571 100644 --- a/src/ui/Forms/Tts/TextToSpeech.cs +++ b/src/ui/Forms/Tts/TextToSpeech.cs @@ -121,6 +121,9 @@ namespace Nikse.SubtitleEdit.Forms.Tts buttonGenerateTTS.Text = LanguageSettings.Current.TextToSpeech.GenerateSpeech; labelRegion.Text = LanguageSettings.Current.General.Region; checkBoxShowPreview.Text = LanguageSettings.Current.TextToSpeech.ReviewAudioClips; + checkBoxAudioEncoding.Text = LanguageSettings.Current.TextToSpeech.CustomAudioEncoding; + linkLabelCustomAudio.Text = LanguageSettings.Current.Settings.Title; + linkLabelCustomAudio.Left = checkBoxAudioEncoding.Right + 3; buttonOK.Text = LanguageSettings.Current.General.Ok; buttonCancel.Text = LanguageSettings.Current.General.Cancel; UiUtil.FixLargeFonts(this, buttonOK); @@ -179,7 +182,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts nikseComboBoxVoice.Text = Configuration.Settings.Tools.TextToSpeechLastVoice; checkBoxAddToVideoFile.Checked = Configuration.Settings.Tools.TextToSpeechAddToVideoFile; checkBoxShowPreview.Checked = Configuration.Settings.Tools.TextToSpeechPreview; - + checkBoxAudioEncoding.Checked = Configuration.Settings.Tools.TextToSpeechCustomAudio; checkBoxAddToVideoFile.Enabled = _videoFileName != null; } @@ -392,7 +395,20 @@ namespace Nikse.SubtitleEdit.Forms.Tts labelProgress.Text = "Add audio to video file..."; var outputFileName = Path.Combine(_waveFolder, Path.GetFileNameWithoutExtension(audioFileName) + videoExt); - var addAudioProcess = VideoPreviewGenerator.AddAudioTrack(_videoFileName, audioFileName, outputFileName); + + var audioEncoding = Configuration.Settings.Tools.TextToSpeechCustomAudioEncoding; + if (string.IsNullOrWhiteSpace(audioEncoding) || !checkBoxAudioEncoding.Checked) + { + audioEncoding = string.Empty; + } + + bool? stereo = null; + if (Configuration.Settings.Tools.TextToSpeechCustomAudioStereo && checkBoxAudioEncoding.Checked) + { + stereo = true; + } + + var addAudioProcess = VideoPreviewGenerator.AddAudioTrack(_videoFileName, audioFileName, outputFileName, audioEncoding, stereo); addAudioProcess.Start(); while (!addAudioProcess.HasExited) { @@ -2313,5 +2329,13 @@ namespace Nikse.SubtitleEdit.Forms.Tts Cursor = Cursors.Default; } } + + private void linkLabelCustomAudio_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + using (var form = new TtsAudioEncoding()) + { + form.ShowDialog(this); + } + } } } \ No newline at end of file diff --git a/src/ui/Forms/Tts/TtsAudioEncoding.Designer.cs b/src/ui/Forms/Tts/TtsAudioEncoding.Designer.cs new file mode 100644 index 000000000..465ebe1bf --- /dev/null +++ b/src/ui/Forms/Tts/TtsAudioEncoding.Designer.cs @@ -0,0 +1,147 @@ +namespace Nikse.SubtitleEdit.Forms.Tts +{ + sealed partial class TtsAudioEncoding + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.checkBoxMakeStereo = new System.Windows.Forms.CheckBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelAudioEnc = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.comboBoxAudioEnc = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.SuspendLayout(); + // + // checkBoxMakeStereo + // + this.checkBoxMakeStereo.AutoSize = true; + this.checkBoxMakeStereo.Checked = true; + this.checkBoxMakeStereo.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxMakeStereo.Location = new System.Drawing.Point(102, 50); + this.checkBoxMakeStereo.Name = "checkBoxMakeStereo"; + this.checkBoxMakeStereo.Size = new System.Drawing.Size(57, 17); + this.checkBoxMakeStereo.TabIndex = 2; + this.checkBoxMakeStereo.Text = "Stereo"; + this.checkBoxMakeStereo.UseVisualStyleBackColor = true; + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonOK.Location = new System.Drawing.Point(179, 110); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(75, 23); + this.buttonOK.TabIndex = 92; + this.buttonOK.Text = "&OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonCancel.Location = new System.Drawing.Point(263, 110); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 93; + this.buttonCancel.Text = "C&ancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // labelAudioEnc + // + this.labelAudioEnc.AutoSize = true; + this.labelAudioEnc.Location = new System.Drawing.Point(25, 23); + this.labelAudioEnc.Name = "labelAudioEnc"; + this.labelAudioEnc.Size = new System.Drawing.Size(52, 13); + this.labelAudioEnc.TabIndex = 0; + this.labelAudioEnc.Text = "Encoding"; + // + // comboBoxAudioEnc + // + this.comboBoxAudioEnc.BackColor = System.Drawing.SystemColors.Window; + this.comboBoxAudioEnc.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.comboBoxAudioEnc.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.comboBoxAudioEnc.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.comboBoxAudioEnc.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.comboBoxAudioEnc.ButtonForeColorDown = System.Drawing.Color.Orange; + this.comboBoxAudioEnc.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.comboBoxAudioEnc.DropDownHeight = 400; + this.comboBoxAudioEnc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxAudioEnc.DropDownWidth = 121; + this.comboBoxAudioEnc.FormattingEnabled = true; + this.comboBoxAudioEnc.Items.AddRange(new string[] { + "copy", + "aac", + "ac3", + "eac3", + "truehd", + "libvorbis", + "libmp3lame", + "libopus"}); + this.comboBoxAudioEnc.Location = new System.Drawing.Point(102, 21); + this.comboBoxAudioEnc.MaxLength = 32767; + this.comboBoxAudioEnc.Name = "comboBoxAudioEnc"; + this.comboBoxAudioEnc.SelectedIndex = -1; + this.comboBoxAudioEnc.SelectedItem = null; + this.comboBoxAudioEnc.SelectedText = ""; + this.comboBoxAudioEnc.Size = new System.Drawing.Size(121, 21); + this.comboBoxAudioEnc.TabIndex = 1; + this.comboBoxAudioEnc.UsePopupWindow = false; + // + // TtsAudioEncoding + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(350, 145); + this.Controls.Add(this.labelAudioEnc); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.comboBoxAudioEnc); + this.Controls.Add(this.checkBoxMakeStereo); + this.Controls.Add(this.buttonCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.KeyPreview = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "TtsAudioEncoding"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "TtsAudioEncoding"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private Controls.NikseLabel labelAudioEnc; + private Controls.NikseComboBox comboBoxAudioEnc; + private System.Windows.Forms.CheckBox checkBoxMakeStereo; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + } +} \ No newline at end of file diff --git a/src/ui/Forms/Tts/TtsAudioEncoding.cs b/src/ui/Forms/Tts/TtsAudioEncoding.cs new file mode 100644 index 000000000..69d76fed7 --- /dev/null +++ b/src/ui/Forms/Tts/TtsAudioEncoding.cs @@ -0,0 +1,41 @@ +using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Logic; +using System.Windows.Forms; + +namespace Nikse.SubtitleEdit.Forms.Tts +{ + public sealed partial class TtsAudioEncoding : Form + { + public TtsAudioEncoding() + { + UiUtil.PreInitialize(this); + InitializeComponent(); + UiUtil.FixFonts(this); + Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.Audio; + buttonCancel.Text = LanguageSettings.Current.General.Cancel; + buttonOK.Text = LanguageSettings.Current.General.Ok; + UiUtil.FixLargeFonts(this, buttonOK); + + if (string.IsNullOrWhiteSpace(Configuration.Settings.Tools.TextToSpeechCustomAudioEncoding)) + { + Configuration.Settings.Tools.TextToSpeechCustomAudioEncoding = "copy"; + } + + checkBoxMakeStereo.Checked = Configuration.Settings.Tools.TextToSpeechCustomAudioStereo; + comboBoxAudioEnc.Text = Configuration.Settings.Tools.TextToSpeechCustomAudioEncoding; + } + + private void buttonOK_Click(object sender, System.EventArgs e) + { + Configuration.Settings.Tools.TextToSpeechCustomAudioStereo = checkBoxMakeStereo.Checked; + Configuration.Settings.Tools.TextToSpeechCustomAudioEncoding = comboBoxAudioEnc.Text; + + DialogResult = DialogResult.OK; + } + + private void buttonCancel_Click(object sender, System.EventArgs e) + { + DialogResult = DialogResult.Cancel; + } + } +} diff --git a/src/ui/Forms/Tts/TtsAudioEncoding.resx b/src/ui/Forms/Tts/TtsAudioEncoding.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/src/ui/Forms/Tts/TtsAudioEncoding.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index 64b2817e3..981d6bee1 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -3574,6 +3574,7 @@ can edit in same subtitle file (collaboration)", GeneratingSpeechFromTextXOfY = "Generating speech from text: {0} / {1}...", ReviewAudioClips = "Review audio clips", ReviewInfo = "Review and edit/remove audio clips", + CustomAudioEncoding = "Custom audio encoding", AutoContinue = "Auto-continue", Play = "Play", Regenerate = "Regenerate", diff --git a/src/ui/Logic/LanguageStructure.cs b/src/ui/Logic/LanguageStructure.cs index 258b7dca4..37ad030e5 100644 --- a/src/ui/Logic/LanguageStructure.cs +++ b/src/ui/Logic/LanguageStructure.cs @@ -3384,6 +3384,7 @@ public string MergingAudioTrackXOfY { get; set; } public string GeneratingSpeechFromTextXOfY { get; set; } public string ReviewAudioClips { get; set; } + public string CustomAudioEncoding { get; set; } public string ReviewInfo { get; set; } public string Play { get; set; } public string AutoContinue { get; set; } diff --git a/src/ui/Logic/VideoPreviewGenerator.cs b/src/ui/Logic/VideoPreviewGenerator.cs index ee10c5121..28338011e 100644 --- a/src/ui/Logic/VideoPreviewGenerator.cs +++ b/src/ui/Logic/VideoPreviewGenerator.cs @@ -626,14 +626,17 @@ namespace Nikse.SubtitleEdit.Logic return processMakeVideo; } - public static Process AddAudioTrack(string inputFileName, string audioFileName, string outputFileName, DataReceivedEventHandler dataReceivedHandler = null) + public static Process AddAudioTrack(string inputFileName, string audioFileName, string outputFileName, string audioEncoding, bool? stereo, DataReceivedEventHandler dataReceivedHandler = null) { + var audioEncodingString = !string.IsNullOrEmpty(audioEncoding) ? "-c:a " + audioEncoding + " " : "-c:a copy "; + var stereoString = stereo == true ? "-ac 2 " : string.Empty; + var processMakeVideo = new Process { StartInfo = { FileName = GetFfmpegLocation(), - Arguments = $"-i \"{inputFileName}\" -i \"{audioFileName}\" -c copy -map 0:v:0 -map 1:a:0 \"{outputFileName}\"", + Arguments = $"-i \"{inputFileName}\" -i \"{audioFileName}\" -c:v copy -map 0:v:0 -map 1:a:0 {audioEncodingString}{stereoString}\"{outputFileName}\"", UseShellExecute = false, CreateNoWindow = true } diff --git a/src/ui/SubtitleEdit.csproj b/src/ui/SubtitleEdit.csproj index 430771e4b..ddff10534 100644 --- a/src/ui/SubtitleEdit.csproj +++ b/src/ui/SubtitleEdit.csproj @@ -1434,6 +1434,12 @@ ReviewAudioClips.cs + + Form + + + TtsAudioEncoding.cs + Form @@ -2338,6 +2344,9 @@ ReviewAudioClips.cs + + TtsAudioEncoding.cs + UnknownSubtitle.cs Designer From 4917de0c4bbf5120845b898bdbd79f52536a707e Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Tue, 11 Jun 2024 22:46:30 +0100 Subject: [PATCH 04/42] Remove spell check functionality from FixCommonErrors The `IFixCallbacks` interface no longer inherits from `IDoSpell` as it is unnecessary. This is due to the removal of the `DoSpell` method and the associated Hunspell functionality in the `FixCommonErrors` class. This commit simplifies the code by removing unused or unnecessary pieces. Signed-off-by: Ivandro Jao --- src/libse/Interfaces/IFixCallbacks.cs | 2 +- src/ui/Forms/FixCommonErrors.cs | 29 --------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/libse/Interfaces/IFixCallbacks.cs b/src/libse/Interfaces/IFixCallbacks.cs index 4c474043e..dda6aa575 100644 --- a/src/libse/Interfaces/IFixCallbacks.cs +++ b/src/libse/Interfaces/IFixCallbacks.cs @@ -5,7 +5,7 @@ using System.Text; namespace Nikse.SubtitleEdit.Core.Interfaces { - public interface IFixCallbacks : IDoSpell + public interface IFixCallbacks { bool AllowFix(Paragraph p, string action); void AddFixToListView(Paragraph p, string action, string before, string after); diff --git a/src/ui/Forms/FixCommonErrors.cs b/src/ui/Forms/FixCommonErrors.cs index 65d35f812..391532591 100644 --- a/src/ui/Forms/FixCommonErrors.cs +++ b/src/ui/Forms/FixCommonErrors.cs @@ -1899,35 +1899,6 @@ namespace Nikse.SubtitleEdit.Forms } } - private Hunspell _hunspell; - - public bool DoSpell(string word) - { - if (_hunspell == null && Language != null) - { - var fileMatches = Directory.GetFiles(Utilities.DictionaryFolder, Language + "*.dic"); - if (fileMatches.Length > 0) - { - var dictionary = fileMatches[0].Substring(0, fileMatches[0].Length - 4); - try - { - _hunspell = Hunspell.GetHunspell(dictionary); - } - catch - { - _hunspell = null; - } - } - } - - if (_hunspell == null) - { - return false; - } - - return _hunspell.Spell(word); - } - private void toolStripMenuItemSelectAll_Click(object sender, EventArgs e) { listViewFixes.CheckAll(); From 252dbda6cf1cadacd188ce64863c5006ed85c171 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Wed, 12 Jun 2024 14:07:19 +0100 Subject: [PATCH 05/42] Update csproj files to simplify project structure Simplified and cleaned up the structure of multiple csproj files. This includes removing unnecessary tags and attributes, and adopting the new Project Sdk format. This change should have no functional impact but makes the project files streamlined and easier to read. Signed-off-by: Ivandro Jao --- .../UpdateAssemblyInfo.csproj | 58 +- .../UpdateLanguageFiles.csproj | 56 +- .../UpdateResourceScript.csproj | 56 +- src/ui/SubtitleEdit.csproj | 2555 +---------------- 4 files changed, 55 insertions(+), 2670 deletions(-) diff --git a/src/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj b/src/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj index 131966a3b..48d55b770 100644 --- a/src/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj +++ b/src/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj @@ -1,60 +1,8 @@ - - - + - Properties - UpdateAssemblyInfo - Debug - 512 + net48 Exe - AnyCPU - {DBD4656C-5F40-4067-A70B-C4460DE20F77} - UpdateAssemblyInfo - - - v4.8 - - + false AllRules.ruleset - true - full - DEBUG;TRACE - prompt - false - bin\Debug\ - AnyCPU - 4 - false - - AllRules.ruleset - pdbonly - TRACE - prompt - true - bin\Release\ - AnyCPU - 4 - false - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/UpdateLanguageFiles/UpdateLanguageFiles.csproj b/src/UpdateLanguageFiles/UpdateLanguageFiles.csproj index b059de2a2..df835bc0c 100644 --- a/src/UpdateLanguageFiles/UpdateLanguageFiles.csproj +++ b/src/UpdateLanguageFiles/UpdateLanguageFiles.csproj @@ -1,46 +1,10 @@ - - - + - Properties - UpdateLanguageFiles - Debug - 512 + net48 Exe - AnyCPU - {36BCA2A7-EE6B-45FD-AF90-D3F76A84DA76} - UpdateLanguageFiles - - - v4.8 - - + false AllRules.ruleset - true - full - DEBUG;TRACE - prompt - false - bin\Debug\ - AnyCPU - 4 - false - - AllRules.ruleset - pdbonly - TRACE - prompt - true - bin\Release\ - AnyCPU - 4 - false - - - - - Language.cs @@ -51,19 +15,5 @@ LanguageStructure.cs - - - - - - - - \ No newline at end of file diff --git a/src/UpdateResourceScript/UpdateResourceScript.csproj b/src/UpdateResourceScript/UpdateResourceScript.csproj index f9acd2a4e..10312f35f 100644 --- a/src/UpdateResourceScript/UpdateResourceScript.csproj +++ b/src/UpdateResourceScript/UpdateResourceScript.csproj @@ -1,58 +1,8 @@ - - - + - Properties - UpdateResourceScript - Debug - 512 + net48 Exe - AnyCPU - {2CB9698C-F0A8-42FF-8938-DE047292D5FE} - UpdateResourceScript - - - v4.8 - - + false AllRules.ruleset - true - full - DEBUG;TRACE - prompt - false - bin\Debug\ - AnyCPU - 4 - false - - AllRules.ruleset - pdbonly - TRACE - prompt - true - bin\Release\ - AnyCPU - 4 - false - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ui/SubtitleEdit.csproj b/src/ui/SubtitleEdit.csproj index ddff10534..eb0f5a4ad 100644 --- a/src/ui/SubtitleEdit.csproj +++ b/src/ui/SubtitleEdit.csproj @@ -1,58 +1,20 @@ - - - + - Properties + net48 SE.ico - SubtitleEdit true - Debug - 512 DCCE7922B5E425ADB221E06DC2FB405664CF8F63 true WinExe - AnyCPU - {511A5B59-1C35-4719-8536-23B19AF9B21A} true true Nikse.SubtitleEdit .\ - - - v4.8 - - - - + false + true + true true - AllRules.ruleset - true - full - TRACE;DEBUG - prompt - Off - false - bin\Debug\ - AnyCPU - true - 4 - false - - true - AllRules.ruleset - pdbonly - TRACE - prompt - Off - true - bin\Release\ - AnyCPU - true - 4 - false - - app.manifest @@ -62,2419 +24,72 @@ DLLs\Interop.QuartzTypeLib.dll False - - ..\..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll - - - ..\..\packages\NAudio.Core.2.2.1\lib\netstandard2.0\NAudio.Core.dll - - - ..\..\packages\NAudio.WinMM.2.2.1\lib\netstandard2.0\NAudio.WinMM.dll - - - ..\..\packages\ncalc.1.3.8\lib\NCalc.dll - - - ..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\..\packages\NHunspell.1.2.5554.16953\lib\net\NHunspell.dll - - - - - - - - ..\..\packages\System.Security.AccessControl.6.0.1\lib\net461\System.Security.AccessControl.dll - - - ..\..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll - - - - - - ..\..\packages\Vosk.0.3.38\lib\netstandard2.0\Vosk.dll - - - + Component - - + Component - - - Form - - - NikseComboBoxPopUp.cs - - + Component - + Component - + Component - + Component - + Component - + Component - + Component - + Component - + Component - + Component - + Component - + UserControl - - AudioVisualizer.cs - - - Form - - - AlignmentPickerJapanese.cs - - - Form - - - AdvancedSelectionHelper.cs - - - Form - - - AssaProgressBar.cs - - - Form - - - AssaProperties.cs - - - Form - - - ImageColorPicker.cs - - - Form - - - ReplaceStyleWith.cs - - - Form - - - ResolutionResampler.cs - - - Form - - - AssSetBackground.cs - - - Form - - - SetLayer.cs - - - Form - - - SetPosition.cs - - - Form - - - ApplyCustomStyles.cs - - - Form - - - AssaTagTemplate.cs - - - Form - - - AssaStyles.cs - - - Form - - - TagHistory.cs - - - Form - - - AudioClipsGet.cs - - - - Form - - - PostProcessingSettings.cs - - - Form - - - WhisperAdvanced.cs - - - Form - - - WhisperDownload.cs - - - Form - - - WhisperAudioToTextSelectedLines.cs - - - Form - - - WhisperModelDownload.cs - - - Form - - - VoskAudioToTextSelectedLines.cs - - - Form - - - VoskAudioToText.cs - - - Form - - - BatchConvertOcrLanguage.cs - - - Form - - - BatchConvertMkvEnding.cs - - - Form - - - BatchConvertTsSettings.cs - - - Form - - - BeautifyTimeCodes.cs - - - Form - - - BeautifyTimeCodesProfile.cs - - - Form - - - BeautifyTimeCodesProfileSimple.cs - - - Form - - - BeautifyTimeCodesUnfixableParagraphs.cs - - - Form - - - BinEdit.cs - - - Form - - - BinEditAlpha.cs - - - Form - - - BinEditNewText.cs - - - Form - - - BinEditBrightness.cs - - - Form - - - BinEditResize.cs - - - Form - - - BinEditSettings.cs - - - Form - - - BookmarkAdd.cs - - - Form - - - AddWaveformBatch.cs - - - Form - - - VoskModelDownload.cs - - - Form - - - GenerateVideoWithHardSubsOutFile.cs - - - Form - - - GenerateVideoWithSoftSubsLanguage.cs - - - Form - - - ConvertColorsToDialog.cs - - - Form - - - WhisperAudioToText.cs - - - Form - - - VoskDictate.cs - - - Form - - - DownloadVosk.cs - - - Form - - - GenerateVideoFFmpegPrompt.cs - - - Form - - - GenerateVideoWithSoftSubs.cs - - - Form - - - GenerateVideoWithSoftSubsOutFileName.cs - - - Form - - - InterjectionsEditSkipList.cs - - - Form - - - InterjectionsEditList.cs - - - Form - - - LayoutPicker.cs - - - Form - - - WordSplitDictionaryGenerator.cs - - - Form - - - ChooseIsoLanguage.cs - - - Form - - - DefaultLanguagesChooser.cs - - - Form - - - DoNotBreakAfterListNew.cs - - - Form - - - SettingsCustomContinuationStyle.cs - - - Form - - - TranslationAutoSuffix.cs - - - Form - - - WordLists.cs - - - Form - - - GetVideoPosition.cs - - - Form - - - PreviewVideo.cs - - - - Form - - - MessageBoxForm.cs - - - Form - - - ShotChangesList.cs - - - Form - - - DownloadYouTubeDl.cs - - - Form - - - ErrorsGoTo.cs - - - Form - - - BookmarksGoTo.cs - - - Form - - - Cavena890SaveOptions.cs - - - Form - - - CheckForUpdates.cs - - - Form - - - ChooseFontName.cs - - - Form - - - Form - - - DCinemaPropertiesInterop.cs - - - Form - - - DCinemaPropertiesSmpte.cs - - - Form - - - DoNotBreakAfterListEdit.cs - - - Form - - - About.cs - - + Component - - Form - - - AddToNames.cs - - - Form - - - DownloadFfmpeg.cs - - - Form - - - DvdStudioProProperties.cs - - - Form - - - EbuLanguageCode.cs - - - Form - - - ExportFcpXmlAdvanced.cs - - - Form - - - ExportPngXmlDialogOpenFolder.cs - - - Form - - - WebVttProperties.cs - - - Form - - - GenerateVideo.cs - - - Form - - - GenerateVideoWithHardSubs.cs - - - Form - - - AttachmentPreviewText.cs - - - Form - - - Attachments.cs - - - Form - - - ChooseAssaFontName.cs - - - Form - - - SubStationAlphaStylesCategoriesImportExport.cs - - - Form - - - SubStationAlphaStylesCategoriesManager.cs - - - Form - - - AdjustTimingViaShotChanges.cs - - - Form - - - SeJobExport.cs - - - Form - - - AutoTranslateSettings.cs - - - Form - - - PiperDownload.cs - - - Form - - - RegenerateAudioClip.cs - - - Form - - - TextToSpeech.cs - - - Form - - - TimedTextPropertiesImsc11.cs - - - Form - - - TimedTextPropertiesItunes.cs - - - Form - - - TimedTextSmpteTiming.cs - - - Form - - - AutoTranslate.cs - - - Form - - - ImportCdg.cs - - - Form - - - ImportFinalDraft.cs - - - Form - - - MultipleReplaceExportImport.cs - - - Form - - - NetflixFixErrors.cs - - - Form - - - AddBetterMultiMatch.cs - - - Form - - - AddBetterMultiMatchNOcr.cs - - - Form - - - AddToOcrReplaceList.cs - - - Form - - - AddToUserDic.cs - - - Form - - - AddWaveform.cs - - - Form - - - AlignmentPicker.cs - - - Form - - - ApplyDurationLimits.cs - - - Form - - - AutoBreakUnbreakLines.cs - - - Form - - - BatchConvert.cs - - - Form - - - ChangeCasing.cs - - - Form - - - ChangeCasingNames.cs - - - Form - - - ChangeFrameRate.cs - - - Form - - - ChangeSpeedInPercent.cs - - - Form - - - ChooseAudioTrack.cs - - - Form - - - ChooseLanguage.cs - - - Form - - - ChooseEncoding.cs - - - Form - - - ChooseResolution.cs - - - Form - - - ChooseStyle.cs - - - Form - - - Compare.cs - - - Form - - - AdjustDisplayDuration.cs - - - Form - - - DurationsBridgeGaps.cs - - - Form - - - EbuColorPicker.cs - - - Form - - - ExportCustomText.cs - - - Form - - - ExportCustomTextFormat.cs - - - Form - - - ExportPngXmlPreview.cs - - - Form - - - ExportTextST.cs - - - Form - - - FcpProperties.cs - - - Form - - - ImportImages.cs - - - Form - - - ImportShotChanges.cs - - - Form - - - ImportUnknownFormat.cs - - - Form - - - MeasurementConverter.cs - - - Form - - - MergeTextWithSameTimeCodes.cs - - - Form - - - MultipleReplaceNewGroup.cs - - - Form - - - NuendoProperties.cs - - - Form - - - EbuSaveOptions.cs - - - Form - - - EffectKaraoke.cs - - - Form - - - EffectTypewriter.cs - - - Form - - - ExportPngXml.cs - - - Form - - - ExportText.cs - - - Form - - - ExtractDateTimeInfo.cs - - - Form - - - FindDialog.cs - - - Form - - - FindSubtitleLine.cs - - - Form - - - FixCommonErrors.cs - - - Form - - - DvdSubRip.cs - - - Form - - - DvdSubRipChooseLanguage.cs - - - Form - - - GetDictionaries.cs - - - Form - - - BinaryOcrChooseEditDb.cs - - - Form - - - BinaryOcrTrain.cs - - - Form - - - GetTesseractDictionaries.cs - - - Form - - - HardSubExtract.cs - - - Form - - - JoinSubtitles.cs - - - Form - - - MergeDoubleLines.cs - - - Form - - - ModifySelection.cs - - - Form - - - NetworkChat.cs - - - Form - - - NetworkJoin.cs - - - Form - - - NetworkLogAndInfo.cs - - - Form - - - NetworkStart.cs - - - Form - - - DownloadTesseract5.cs - - - Form - - - DownloadTesseract302.cs - - - Form - - - GetTesseract302Dictionaries.cs - - - Form - - - OcrPreprocessingT4.cs - - - Form - - - OcrPreprocessingSettings.cs - - - Form - - - OpenVideoDvd.cs - - - Form - - - PacEncoding.cs - - - Form - - - ColumnPaste.cs - - - Form - - - PluginsGet.cs - - - Form - - - Form - - - ProfileChoose.cs - - - Form - - - RestoreAutoBackup.cs - - - Form - - - RubyJapanese.cs - - - Form - - - SeekSilence.cs - - - Form - - - SetSyncPoint.cs - - - Form - - - GoToLine.cs - - - Form - - - ImportText.cs - - - Form - - - Main.cs - - - Form - - - MatroskaSubtitleChooser.cs - - - Form - - - MergeShortLines.cs - - - Form - - - MultipleReplace.cs - - - Form - - - OCRSpellCheck.cs - - - Form - - - RemoveTextForHearImpaired.cs - - - Form - - - ReplaceDialog.cs - - - Form - - - SetMinimumDisplayTimeBetweenParagraphs.cs - - - Form - - - Settings.cs - - - Form - - - SettingsFixContinuationStyle.cs - - - Form - - - SettingsGapChoose.cs - - - Form - - - SettingsLineWidth.cs - - - Form - - - SettingsMpv.cs - - - Form - - - SettingsProfile.cs - - - Form - - - SettingsProfileExport.cs - - - Form - - - SetVideoOffset.cs - - - Form - - - ShowEarlierLater.cs - - - Form - - - ShowHistory.cs - - - Form - - - SpellCheck.cs - - - Form - - - DialogDoNotShowAgain.cs - - - Form - - - Split.cs - - - Form - - - SplitLongLines.cs - - - Form - - - SplitSubtitle.cs - - - Form - - - StartNumberingFrom.cs - - - Form - - - Statistics.cs - - - Form - - - StatusLog.cs - - - Form - - - Form - - - SubStationAlphaStylesBatchConvert.cs - - - Form - - - SubStationAlphaStylesExport.cs - - - Form - - - SubStationAlphaProperties.cs - - - Form - - - SubStationAlphaStyles.cs - - - Form - - - TimedTextNewLanguage.cs - - - Form - - - TimedTextProperties.cs - - - Form - - - TimedTextStyles.cs - - - - - - - Form - - - TranslateBlock.cs - - - Form - - - TranslateViaCopyPaste.cs - - - Form - - - SubtitleViewer.cs - - - Form - - - TransportStreamSubtitleChooser.cs - - - Form - - - ReviewAudioClips.cs - - - Form - - - TtsAudioEncoding.cs - - - Form - - - UnknownSubtitle.cs - - - Form - - - VerifyCompleteness.cs - - - Form - - - VideoControlsUndocked.cs - - - Form - - - VideoError.cs - - - Form - - - VideoPlayerUndocked.cs - - - Form - - - VisualSync.cs - - - Form - - - VobSubCharactersImport.cs - - - Form - - - VobSubEditCharacters.cs - - - Form - - - VobSubNOcrCharacterInspect.cs - - - Form - - - VobSubNOcrEdit.cs - - - Form - - - VobSubNOcrTrain.cs - - - Form - - - VobSubOcr.cs - - - Form - - - VobSubOcrCharacter.cs - - - Form - - - VobSubOcrCharacterInspect.cs - - - Form - - - VobSubOcrNewFolder.cs - - - Form - - - VobSubOcrNOcrCharacter.cs - - - Form - - - VobSubOcrSetItalicFactor.cs - - - Form - - - WebVttStylePicker.cs - - - Form - - - WebVttImportExport.cs - - - Form - - - Watermark.cs - - - Form - - - WaveformGenerateTimeCodes.cs - - - Form - - - WaveformUndocked.cs - - - Form - - - GoogleOrMicrosoftTranslate.cs - - - Form - - - TextPrompt.cs - - - Form - - - WebVttStyleManager.cs - - - Form - - - YouTubeAnnotationsImport.cs - - - - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - MessageHandlerWindow.cs - - - - - - - - - - - - - - - - - - Form - - - SyncPointsSync.cs - - - AudioVisualizer.cs - - - NikseComboBoxPopUp.cs - - - AlignmentPickerJapanese.cs - - - AdvancedSelectionHelper.cs - - - AssaProgressBar.cs - - - AssaProperties.cs - - - ImageColorPicker.cs - - - ReplaceStyleWith.cs - - - ResolutionResampler.cs - - - AssSetBackground.cs - Designer - - - SetLayer.cs - - - SetPosition.cs - - - ApplyCustomStyles.cs - - - AssaTagTemplate.cs - - - AssaStyles.cs - - - TagHistory.cs - - - AudioClipsGet.cs - - - PostProcessingSettings.cs - - - WhisperAdvanced.cs - Designer - - - WhisperDownload.cs - - - WhisperAudioToTextSelectedLines.cs - - - WhisperModelDownload.cs - - - VoskAudioToTextSelectedLines.cs - - - VoskAudioToText.cs - - - BatchConvertOcrLanguage.cs - - - BatchConvertMkvEnding.cs - - - BatchConvertTsSettings.cs - - - BeautifyTimeCodes.cs - - - BeautifyTimeCodesProfile.cs - - - BeautifyTimeCodesProfileSimple.cs - - - BeautifyTimeCodesUnfixableParagraphs.cs - - - BinEdit.cs - - - BinEditAlpha.cs - - - BinEditNewText.cs - - - BinEditBrightness.cs - - - BinEditResize.cs - - - BinEditSettings.cs - - - BookmarkAdd.cs - - - AddWaveformBatch.cs - - - VoskModelDownload.cs - - - ConvertColorsToDialog.cs - - - WhisperAudioToText.cs - - - VoskDictate.cs - - - DownloadVosk.cs - - - GenerateVideoFFmpegPrompt.cs - - - GenerateVideoWithHardSubsOutFile.cs - - - GenerateVideoWithSoftSubs.cs - - - GenerateVideoWithSoftSubsLanguage.cs - - - GenerateVideoWithSoftSubsOutFileName.cs - - - GetVideoPosition.cs - - - InterjectionsEditSkipList.cs - - - InterjectionsEditList.cs - - - LayoutPicker.cs - Designer - - - WordSplitDictionaryGenerator.cs - - - ChooseIsoLanguage.cs - Designer - - - DefaultLanguagesChooser.cs - - - DoNotBreakAfterListNew.cs - - - SettingsCustomContinuationStyle.cs - - - TranslationAutoSuffix.cs - - - WordLists.cs - - - PreviewVideo.cs - - - MessageBoxForm.cs - - - ShotChangesList.cs - - - DownloadYouTubeDl.cs - - - ErrorsGoTo.cs - - - BookmarksGoTo.cs - - - Cavena890SaveOptions.cs - - - CheckForUpdates.cs - - - ChooseFontName.cs - - - ColorChooser.cs - - - DCinemaPropertiesInterop.cs - - - DCinemaPropertiesSmpte.cs - - - DoNotBreakAfterListEdit.cs - - - About.cs - Designer - - - AddToNames.cs - - - DownloadFfmpeg.cs - - - DvdStudioProProperties.cs - - - EbuLanguageCode.cs - - - ExportFcpXmlAdvanced.cs - - - ExportPngXmlDialogOpenFolder.cs - - - WebVttProperties.cs - - - GenerateVideo.cs - - - GenerateVideoWithHardSubs.cs - - - AttachmentPreviewText.cs - - - Attachments.cs - - - ChooseAssaFontName.cs - - - SubStationAlphaStylesCategoriesImportExport.cs - - - SubStationAlphaStylesCategoriesManager.cs - - - SeJobExport.cs - - - AdjustTimingViaShotChanges.cs - - - AutoTranslateSettings.cs - - - PiperDownload.cs - - - RegenerateAudioClip.cs - - - TextToSpeech.cs - - - TimedTextPropertiesImsc11.cs - - - TimedTextPropertiesItunes.cs - - - TimedTextSmpteTiming.cs - - - AutoTranslate.cs - - - ImportCdg.cs - - - ImportFinalDraft.cs - - - MultipleReplaceExportImport.cs - - - NetflixFixErrors.cs - - - AddBetterMultiMatch.cs - - - AddBetterMultiMatchNOcr.cs - - - AddToOcrReplaceList.cs - - - AddToUserDic.cs - - - AddWaveform.cs - - - AlignmentPicker.cs - - - ApplyDurationLimits.cs - - - BatchConvert.cs - - - ChangeCasing.cs - Designer - - - ChangeFrameRate.cs - Designer - - - ChangeSpeedInPercent.cs - - - ChooseAudioTrack.cs - - - ChooseEncoding.cs - Designer - - - AdjustDisplayDuration.cs - Designer - - - ChooseResolution.cs - - - ChooseStyle.cs - - - DurationsBridgeGaps.cs - - - EbuColorPicker.cs - - - ExportCustomText.cs - - - ExportCustomTextFormat.cs - - - ExportPngXmlPreview.cs - - - ExportTextST.cs - - - FcpProperties.cs - - - ImportImages.cs - - - ImportShotChanges.cs - - - ImportUnknownFormat.cs - - - MeasurementConverter.cs - - - MergeTextWithSameTimeCodes.cs - - - MultipleReplaceNewGroup.cs - - - NuendoProperties.cs - - - EbuSaveOptions.cs - - - EffectKaraoke.cs - Designer - - - EffectTypewriter.cs - Designer - - - ExportPngXml.cs - - - ExportText.cs - - - ExtractDateTimeInfo.cs - - - FindDialog.cs - Designer - - - FindSubtitleLine.cs - Designer - - - FixCommonErrors.cs - Designer - - - DvdSubRip.cs - - - DvdSubRipChooseLanguage.cs - - - BinaryOcrChooseEditDb.cs - - - BinaryOcrTrain.cs - - - GetTesseractDictionaries.cs - - - HardSubExtract.cs - - - JoinSubtitles.cs - - - MergeDoubleLines.cs - - - ModifySelection.cs - - - NetworkChat.cs - - - NetworkJoin.cs - - - NetworkLogAndInfo.cs - - - NetworkStart.cs - - - DownloadTesseract5.cs - - - DownloadTesseract302.cs - - - GetTesseract302Dictionaries.cs - - - OcrPreprocessingT4.cs - - - OcrPreprocessingSettings.cs - - - OpenVideoDvd.cs - - - PacEncoding.cs - - - ColumnPaste.cs - - - PluginsGet.cs - - - ProfileChoose.cs - - - RestoreAutoBackup.cs - - - RubyJapanese.cs - - - SeekSilence.cs - - - SetSyncPoint.cs - - - GoToLine.cs - Designer - - - ImportText.cs - - - MatroskaSubtitleChooser.cs - Designer - - - MergeShortLines.cs - - - RemoveTextForHearImpaired.cs - Designer - - - ReplaceDialog.cs - Designer - - - SetMinimumDisplayTimeBetweenParagraphs.cs - - - Settings.cs - Designer - - - SettingsFixContinuationStyle.cs - - - SettingsGapChoose.cs - - - SettingsLineWidth.cs - - - SettingsMpv.cs - - - SettingsProfile.cs - - - SettingsProfileExport.cs - - - SetVideoOffset.cs - - - ShowHistory.cs - Designer - - - SpellCheck.cs - Designer - - - DialogDoNotShowAgain.cs - - - Split.cs - - - SplitLongLines.cs - - - SplitSubtitle.cs - Designer - - - StartNumberingFrom.cs - Designer - - - Statistics.cs - - - StatusLog.cs - - - SubStationAlphaStylesBatchConvert.cs - - - SubStationAlphaStylesExport.cs - - - SubStationAlphaProperties.cs - - - SubStationAlphaStyles.cs - - - TimedTextNewLanguage.cs - - - TimedTextProperties.cs - - - TimedTextStyles.cs - - - TranslateBlock.cs - - - TranslateViaCopyPaste.cs - - - SubtitleViewer.cs - - - TransportStreamSubtitleChooser.cs - - - ReviewAudioClips.cs - - - TtsAudioEncoding.cs - - - UnknownSubtitle.cs - Designer - - - VerifyCompleteness.cs - - - VideoControlsUndocked.cs - - - VideoPlayerUndocked.cs - - - VisualSync.cs - Designer - - - VobSubCharactersImport.cs - - - VobSubNOcrCharacterInspect.cs - - - VobSubNOcrEdit.cs - - - VobSubNOcrTrain.cs - - - VobSubOcr.cs - Designer - - - VobSubOcrCharacter.cs - Designer - - - VobSubOcrCharacterInspect.cs - - - VobSubOcrNewFolder.cs - Designer - - - VobSubOcrNOcrCharacter.cs - - - VobSubOcrSetItalicFactor.cs - - - WebVttStylePicker.cs - - - WebVttImportExport.cs - - - Watermark.cs - - - WaveformGenerateTimeCodes.cs - - - WaveformUndocked.cs - - - GoogleOrMicrosoftTranslate.cs - - - TextPrompt.cs - - - WebVttStyleManager.cs - - - YouTubeAnnotationsImport.cs - - - MessageHandlerWindow.cs - - - PublicResXFileCodeGenerator - Designer - Resources.Designer.cs - - - Main.cs - Designer - - - SyncPointsSync.cs - - - - - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - True - Resources.resx - - - True - Settings.settings - True - - - + Designer - + Designer - + Designer @@ -2482,21 +97,11 @@ - - - - - - - - - - - + PreserveNewest - + PreserveNewest @@ -2622,49 +227,6 @@ Always - - - VideoPlayerContainer.cs - Designer - - - AutoBreakUnbreakLines.cs - Designer - - - ChangeCasingNames.cs - Designer - - - ChooseLanguage.cs - Designer - - - Compare.cs - Designer - - - MultipleReplace.cs - Designer - - - OCRSpellCheck.cs - Designer - - - ShowEarlierLater.cs - Designer - - - VideoError.cs - Designer - - - VobSubEditCharacters.cs - Designer - - - @@ -2680,36 +242,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer @@ -2758,13 +290,8 @@ - - {3e3cb28f-3a7b-430f-9eb3-0d6c1e53b753} - LibSE - True - + - false @@ -2773,7 +300,24 @@ false - + + + + + + + + + + + + + + + + + + @@ -2781,18 +325,11 @@ ..\..\packages\NHunspell.$(HunspellVersion)\content\ - + - + - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file From 172900a24747b500133d59a05f37f5eb84a17df4 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Thu, 13 Jun 2024 19:25:46 +0200 Subject: [PATCH 06/42] Add PodcastIndexer json - thx rjgout :) Related to #8522 --- LanguageBaseEnglish.xml | 1 + src/libse/SubtitleFormats/PodcastIndexer.cs | 96 +++++++++++++++++++++ src/libse/SubtitleFormats/SubtitleFormat.cs | 1 + src/ui/Logic/LanguageDeserializer.cs | 3 + 4 files changed, 101 insertions(+) create mode 100644 src/libse/SubtitleFormats/PodcastIndexer.cs diff --git a/LanguageBaseEnglish.xml b/LanguageBaseEnglish.xml index 9cf359e31..490571b45 100644 --- a/LanguageBaseEnglish.xml +++ b/LanguageBaseEnglish.xml @@ -3175,6 +3175,7 @@ Continue? Merging audio track: {0} / {1}... Generating speech from text: {0} / {1}... Review audio clips + Custom audio encoding Review and edit/remove audio clips Play Auto-continue diff --git a/src/libse/SubtitleFormats/PodcastIndexer.cs b/src/libse/SubtitleFormats/PodcastIndexer.cs new file mode 100644 index 000000000..c02fb27e0 --- /dev/null +++ b/src/libse/SubtitleFormats/PodcastIndexer.cs @@ -0,0 +1,96 @@ +using Nikse.SubtitleEdit.Core.Common; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +namespace Nikse.SubtitleEdit.Core.SubtitleFormats +{ + public class PodcastIndexer : SubtitleFormat + { + public override string Extension => ".json"; + + public override string Name => "PodcastIndexer"; + + public override string ToText(Subtitle subtitle, string title) + { + var sb = new StringBuilder("{" + + Environment.NewLine + " \"version\": \"1.0.0\"" + + Environment.NewLine + " \"segments\": ["); + var count = 0; + foreach (var p in subtitle.Paragraphs) + { + if (count > 0) + { + sb.Append(','); + } + + count++; + sb.AppendLine(); + sb.AppendLine(" {"); + + if (!string.IsNullOrEmpty(p.Actor)) + { + sb.AppendLine($" \"speaker\": \"{p.Actor}\""); + } + + sb.AppendLine($" \"startTime\": {p.StartTime.TotalSeconds.ToString(CultureInfo.InvariantCulture)},"); + sb.AppendLine($" \"endTime\": {p.EndTime.TotalSeconds.ToString(CultureInfo.InvariantCulture)},"); + sb.AppendLine($" \"body\": \"{Json.EncodeJsonText(p.Text, "\\n")}\""); + sb.Append(" }"); + } + + sb.Append(" ]" + Environment.NewLine + "}"); + + return sb.ToString().Trim(); + } + + public override void LoadSubtitle(Subtitle subtitle, List lines, string fileName) + { + _errorCount = 0; + var sb = new StringBuilder(); + foreach (var s in lines) + { + sb.Append(s); + } + + var text = sb.ToString().TrimStart(); + if (!text.Contains("\"segments\"", StringComparison.Ordinal)) + { + return; + } + + var parser = new SeJsonParser(); + var words = parser.GetArrayElementsByName(text, "segments"); + foreach (var word in words) + { + var startTimeObject = parser.GetFirstObject(word, "startTime"); + var endTimeObject = parser.GetFirstObject(word, "endTime"); + var actorObject = parser.GetFirstObject(word, "speaker"); + var s = parser.GetFirstObject(word, "body"); + if (!string.IsNullOrEmpty(s) && !string.IsNullOrEmpty(startTimeObject) && !string.IsNullOrEmpty(endTimeObject)) + { + if (double.TryParse(startTimeObject, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var startSecs) && + double.TryParse(endTimeObject, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var endSecs)) + { + var pText = Json.DecodeJsonText(s); + var p = new Paragraph(pText, startSecs * 1000.0, endSecs * 1000.0); + + if (!string.IsNullOrEmpty(actorObject)) + { + p.Actor = actorObject; + } + + subtitle.Paragraphs.Add(p); + } + else + { + _errorCount++; + } + } + } + + subtitle.Renumber(); + } + } +} diff --git a/src/libse/SubtitleFormats/SubtitleFormat.cs b/src/libse/SubtitleFormats/SubtitleFormat.cs index 78472db01..4bfbf3373 100644 --- a/src/libse/SubtitleFormats/SubtitleFormat.cs +++ b/src/libse/SubtitleFormats/SubtitleFormat.cs @@ -177,6 +177,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats new PhoenixSubtitle(), new PinnacleImpression(), new PListCaption(), + new PodcastIndexer(), new ProjectionSubtitleList(), new QubeMasterImport(), new QuickTimeText(), diff --git a/src/ui/Logic/LanguageDeserializer.cs b/src/ui/Logic/LanguageDeserializer.cs index d2097b01e..041e02979 100644 --- a/src/ui/Logic/LanguageDeserializer.cs +++ b/src/ui/Logic/LanguageDeserializer.cs @@ -8707,6 +8707,9 @@ namespace Nikse.SubtitleEdit.Logic case "TextToSpeech/ReviewAudioClips": language.TextToSpeech.ReviewAudioClips = reader.Value; break; + case "TextToSpeech/CustomAudioEncoding": + language.TextToSpeech.CustomAudioEncoding = reader.Value; + break; case "TextToSpeech/ReviewInfo": language.TextToSpeech.ReviewInfo = reader.Value; break; From e879fb6ef3e0e6b521ec7a4fb4d28a738eeb1c76 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Thu, 13 Jun 2024 19:33:55 +0200 Subject: [PATCH 07/42] Add actor for podcaster json to UI Related to #8522 --- src/ui/Forms/Main.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index b22d6bd5c..9df26a569 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -2324,7 +2324,8 @@ namespace Nikse.SubtitleEdit.Forms if ((formatType == typeof(AdvancedSubStationAlpha) || formatType == typeof(SubStationAlpha) || - formatType == typeof(CsvNuendo)) && (_subtitle.Paragraphs.Any(p => !string.IsNullOrEmpty(p.Actor)) || + formatType == typeof(CsvNuendo) || + formatType == typeof(PodcastIndexer)) && (_subtitle.Paragraphs.Any(p => !string.IsNullOrEmpty(p.Actor)) || Configuration.Settings.Tools.ListViewShowColumnActor)) { bool wasVisible = SubtitleListview1.ColumnIndexActor >= 0; @@ -4140,6 +4141,20 @@ namespace Nikse.SubtitleEdit.Forms } } } + else if (formatType == typeof(PodcastIndexer)) + { + if (_subtitle.Paragraphs.Any(p => !string.IsNullOrEmpty(p.Actor))) + { + bool wasVisible = SubtitleListview1.ColumnIndexActor >= 0; + SubtitleListview1.ShowActorColumn(LanguageSettings.Current.General.Actor); + if (!wasVisible) + { + SaveSubtitleListviewIndices(); + SubtitleListview1.Fill(_subtitle, _subtitleOriginal); + RestoreSubtitleListviewIndices(); + } + } + } SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged; @@ -8952,7 +8967,7 @@ namespace Nikse.SubtitleEdit.Forms }; cm.Items.Add(contextMenuStripLvHeaderGapToolStripMenuItem); - if (formatType == typeof(AdvancedSubStationAlpha) || formatType == typeof(SubStationAlpha) || formatType == typeof(CsvNuendo)) + if (formatType == typeof(AdvancedSubStationAlpha) || formatType == typeof(SubStationAlpha) || formatType == typeof(CsvNuendo) || formatType == typeof(PodcastIndexer)) { // ACTOR var actorTitle = formatType == typeof(CsvNuendo) ? LanguageSettings.Current.General.Character : LanguageSettings.Current.General.Actor; @@ -9171,7 +9186,7 @@ namespace Nikse.SubtitleEdit.Forms toolStripMenuItemSetLanguage.Visible = false; toolStripMenuItemSetLayer.Visible = false; List actors = null; - if ((formatType == typeof(AdvancedSubStationAlpha) || formatType == typeof(SubStationAlpha) || formatType == typeof(CsvNuendo)) && SubtitleListview1.SelectedItems.Count > 0) + if ((formatType == typeof(AdvancedSubStationAlpha) || formatType == typeof(SubStationAlpha) || formatType == typeof(CsvNuendo) || formatType == typeof(PodcastIndexer)) && SubtitleListview1.SelectedItems.Count > 0) { actors = new List(); toolStripMenuItemWebVTT.Visible = false; From 03353706a50e62f94629b2705a13725996f14493 Mon Sep 17 00:00:00 2001 From: bovirus <1262554+bovirus@users.noreply.github.com> Date: Fri, 14 Jun 2024 11:40:55 +0200 Subject: [PATCH 08/42] Update Italian language --- src/ui/Languages/it-IT.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/Languages/it-IT.xml b/src/ui/Languages/it-IT.xml index b22ea01a0..c0f2418d5 100644 --- a/src/ui/Languages/it-IT.xml +++ b/src/ui/Languages/it-IT.xml @@ -3,7 +3,7 @@ Subtitle Edit 4.0.6 - Tradotto da NAMP e bovirus - Data traduzione: 04.06.2024 + Tradotto da NAMP e bovirus - Data traduzione: 14.06.2024 it-IT OK @@ -3175,6 +3175,7 @@ Vuoi continuare? Unione traccia audio: {0} / {1}... Generazione parlato dal testo: {0} / {1}... Rivedi clip audio + Codifica audio personalizzata Rivedi e modifica/rimuovi clip audio Riproduci Continua automaticamente From 37d821130c198ec00fd70be154106f89b3cac9ad Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 15 Jun 2024 12:15:54 +0200 Subject: [PATCH 09/42] Minor updates --- src/libse/LibSE.csproj | 2 +- .../Forms/AudioToText/WhisperAudioToText.cs | 2 + .../Forms/Translate/AutoTranslate.Designer.cs | 30 +++++++ src/ui/Forms/Translate/AutoTranslate.cs | 81 ++++++++++++------- src/ui/Forms/Translate/AutoTranslate.resx | 3 + 5 files changed, 88 insertions(+), 30 deletions(-) diff --git a/src/libse/LibSE.csproj b/src/libse/LibSE.csproj index 8e2e84a8e..06b8c3776 100644 --- a/src/libse/LibSE.csproj +++ b/src/libse/LibSE.csproj @@ -51,7 +51,7 @@ - + diff --git a/src/ui/Forms/AudioToText/WhisperAudioToText.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.cs index f4a37e29f..8ca04bac2 100644 --- a/src/ui/Forms/AudioToText/WhisperAudioToText.cs +++ b/src/ui/Forms/AudioToText/WhisperAudioToText.cs @@ -911,6 +911,8 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText if (!_useCenterChannelOnly && (comboBoxWhisperEngine.Text == WhisperChoice.PurfviewFasterWhisper || comboBoxWhisperEngine.Text == WhisperChoice.PurfviewFasterWhisperXXL) && + (videoFileName.EndsWith(".mkv", StringComparison.OrdinalIgnoreCase) || + videoFileName.EndsWith(".mp4", StringComparison.OrdinalIgnoreCase)) && _audioTrackNumber <= 0) { inputFile = videoFileName; diff --git a/src/ui/Forms/Translate/AutoTranslate.Designer.cs b/src/ui/Forms/Translate/AutoTranslate.Designer.cs index 87c1fb49b..8056cdf86 100644 --- a/src/ui/Forms/Translate/AutoTranslate.Designer.cs +++ b/src/ui/Forms/Translate/AutoTranslate.Designer.cs @@ -52,6 +52,9 @@ this.translateCurrentLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.labelApiKey = new System.Windows.Forms.Label(); this.buttonStrategy = new System.Windows.Forms.Button(); + this.contextMenuStripOlamaModels = new System.Windows.Forms.ContextMenuStrip(this.components); + this.updateLocalModelsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.findModelsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.labelFormality = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.comboBoxFormality = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.nikseTextBoxApiKey = new Nikse.SubtitleEdit.Controls.NikseTextBox(); @@ -63,6 +66,7 @@ this.subtitleListViewSource = new Nikse.SubtitleEdit.Controls.SubtitleListView(); this.contextMenuStrip2.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); + this.contextMenuStripOlamaModels.SuspendLayout(); this.SuspendLayout(); // // progressBar1 @@ -262,6 +266,28 @@ this.buttonStrategy.UseVisualStyleBackColor = true; this.buttonStrategy.Click += new System.EventHandler(this.buttonStrategy_Click); // + // contextMenuStripOlamaModels + // + this.contextMenuStripOlamaModels.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.updateLocalModelsToolStripMenuItem, + this.findModelsToolStripMenuItem}); + this.contextMenuStripOlamaModels.Name = "contextMenuStripOlamaModels"; + this.contextMenuStripOlamaModels.Size = new System.Drawing.Size(184, 70); + // + // updateLocalModelsToolStripMenuItem + // + this.updateLocalModelsToolStripMenuItem.Name = "updateLocalModelsToolStripMenuItem"; + this.updateLocalModelsToolStripMenuItem.Size = new System.Drawing.Size(183, 22); + this.updateLocalModelsToolStripMenuItem.Text = "Refresh local models"; + this.updateLocalModelsToolStripMenuItem.Click += new System.EventHandler(this.UpdateLocalModelsToolStripMenuItem_Click); + // + // findModelsToolStripMenuItem + // + this.findModelsToolStripMenuItem.Name = "findModelsToolStripMenuItem"; + this.findModelsToolStripMenuItem.Size = new System.Drawing.Size(183, 22); + this.findModelsToolStripMenuItem.Text = "Find models online"; + this.findModelsToolStripMenuItem.Click += new System.EventHandler(this.findModelsToolStripMenuItem_Click); + // // labelFormality // this.labelFormality.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -495,6 +521,7 @@ this.Resize += new System.EventHandler(this.AutoTranslate_Resize); this.contextMenuStrip2.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); + this.contextMenuStripOlamaModels.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -534,5 +561,8 @@ private System.Windows.Forms.Button buttonStrategy; private System.Windows.Forms.ToolStripMenuItem translateCurrentLineToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem translateCurrentLineToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStripOlamaModels; + private System.Windows.Forms.ToolStripMenuItem updateLocalModelsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem findModelsToolStripMenuItem; } } \ No newline at end of file diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index ff3a288c0..b8d95cdf6 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; +using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -170,6 +171,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate nikseTextBoxApiKey.Top = nikseComboBoxUrl.Top; labelApiKey.Text = LanguageSettings.Current.Settings.GoogleTranslateApiKey; labelFormality.Visible = false; + comboBoxFormality.ContextMenuStrip = null; comboBoxFormality.Visible = false; var engineType = _autoTranslator.GetType(); @@ -343,36 +345,8 @@ namespace Nikse.SubtitleEdit.Forms.Translate var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); - //TODO: move to refresh models context menu - //using (var httpClient = new HttpClient()) - //{ - // try - // { - // httpClient.Timeout = TimeSpan.FromSeconds(5); - // var url = "http://localhost:11434/api/tags"; - // var resultTask = httpClient.GetAsync(new Uri(url)); - - // var result = resultTask.Result; - // var bytes = result.Content.ReadAsByteArrayAsync().Result; - // if (result.IsSuccessStatusCode) - // { - // var parser = new SeJsonParser(); - // var resultJson = Encoding.UTF8.GetString(bytes); - // var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); - // foreach (var name in names.OrderByDescending(p => p)) - // { - // models.Remove(name); - // models.Insert(0, name); - // } - // } - // } - // catch (Exception exception) - // { - // SeLogger.Error(exception, "Unable to get ollama models"); - // } - //} - labelFormality.Text = LanguageSettings.Current.AudioToText.Model; + labelFormality.Enabled = true; labelFormality.Visible = true; comboBoxFormality.DropDownStyle = ComboBoxStyle.DropDown; @@ -386,6 +360,8 @@ namespace Nikse.SubtitleEdit.Forms.Translate } comboBoxFormality.Text = Configuration.Settings.Tools.OllamaModel; + comboBoxFormality.ContextMenuStrip = contextMenuStripOlamaModels; + return; } @@ -1466,5 +1442,52 @@ namespace Nikse.SubtitleEdit.Forms.Translate SetupLanguageSettings(); } } + + private void UpdateLocalModelsToolStripMenuItem_Click(object sender, EventArgs e) + { + using (var httpClient = new HttpClient()) + { + try + { + var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); + var url = nikseComboBoxUrl.Text.Replace("generate", "tags"); + var resultTask = httpClient.GetAsync(new Uri(url)); + + var result = resultTask.Result; + var bytes = result.Content.ReadAsByteArrayAsync().Result; + if (result.IsSuccessStatusCode) + { + var parser = new SeJsonParser(); + var resultJson = Encoding.UTF8.GetString(bytes); + var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); + foreach (var name in names.OrderByDescending(p => p)) + { + models.Remove(name); + models.Insert(0, name); + } + + Configuration.Settings.Tools.OllamaModels = string.Join(",", models); + + var v = comboBoxFormality.Text; + comboBoxFormality.Items.Clear(); + foreach (var model in models) + { + comboBoxFormality.Items.Add(model); + } + comboBoxFormality.Text = v; + } + } + catch (Exception exception) + { + MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); + SeLogger.Error(exception, "Unable to get ollama models"); + } + } + } + + private void findModelsToolStripMenuItem_Click(object sender, EventArgs e) + { + UiUtil.OpenUrl("https://ollama.com/library"); + } } } diff --git a/src/ui/Forms/Translate/AutoTranslate.resx b/src/ui/Forms/Translate/AutoTranslate.resx index b5844921f..ef53063fa 100644 --- a/src/ui/Forms/Translate/AutoTranslate.resx +++ b/src/ui/Forms/Translate/AutoTranslate.resx @@ -123,4 +123,7 @@ 17, 17 + + 327, 17 + \ No newline at end of file From f2084692d2a4a33bc8e077316b3a05b921f5d773 Mon Sep 17 00:00:00 2001 From: nkh0472 <67589323+nkh0472@users.noreply.github.com> Date: Sat, 15 Jun 2024 21:25:50 +0800 Subject: [PATCH 10/42] Update zh-Hans.xml for commit 172900a24747b500133d59a05f37f5eb84a17df4 --- src/ui/Languages/zh-Hans.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/Languages/zh-Hans.xml b/src/ui/Languages/zh-Hans.xml index f90794e8e..e35e47dcf 100644 --- a/src/ui/Languages/zh-Hans.xml +++ b/src/ui/Languages/zh-Hans.xml @@ -3163,6 +3163,7 @@ Command line: {1} {2} 合并音轨:{0} / {1}... 从文本生成语音:{0} / {1}... 审阅音频剪辑 + 自定义音频编码 查看和编辑/删除音频剪辑 播放 自动继续 From 8810ecd9500f959810848921c162d1e3eda2433a Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 15 Jun 2024 17:58:21 +0200 Subject: [PATCH 11/42] Fix crash in Vosk audio to text on selected lines - thx MediaExpres :) Fix #8530 Fix crash when Vosk is not installed --- src/ui/Forms/Main.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 9df26a569..694ec8e56 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -9832,6 +9832,28 @@ namespace Nikse.SubtitleEdit.Forms return; } + var voskFolder = Path.Combine(Configuration.DataDirectory, "Vosk"); + if (!Directory.Exists(voskFolder)) + { + Directory.CreateDirectory(voskFolder); + } + + if (Configuration.IsRunningOnWindows && !HasCurrentVosk(voskFolder)) + { + if (MessageBox.Show(string.Format(LanguageSettings.Current.Settings.DownloadX, "libvosk"), "Subtitle Edit", MessageBoxButtons.YesNoCancel) != DialogResult.Yes) + { + return; + } + + using (var form = new DownloadVosk()) + { + if (form.ShowDialog(this) != DialogResult.OK) + { + return; + } + } + } + var audioClips = GetAudioClips(); if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 10_000) From d53d2728a3b39682509645157a6d54d77e005bc9 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 15 Jun 2024 19:26:24 +0200 Subject: [PATCH 12/42] Prompt for overwrite in "Multiple replace" export - thx redactedscribe :) Fix #8516 --- src/ui/Forms/MultipleReplaceExportImport.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/Forms/MultipleReplaceExportImport.cs b/src/ui/Forms/MultipleReplaceExportImport.cs index e71207e71..2afd07218 100644 --- a/src/ui/Forms/MultipleReplaceExportImport.cs +++ b/src/ui/Forms/MultipleReplaceExportImport.cs @@ -92,6 +92,7 @@ namespace Nikse.SubtitleEdit.Forms saveFileDialogStyle.FileName = "multiple_replace_groups.template"; saveFileDialogStyle.Title = LanguageSettings.Current.MultipleReplace.ExportRulesTitle; saveFileDialogStyle.Filter = LanguageSettings.Current.MultipleReplace.Rules + "|*.template"; + saveFileDialogStyle.OverwritePrompt = true; if (saveFileDialogStyle.ShowDialog(this) == DialogResult.OK) { From 4cdd35e5217ca59edcdb4a19bdb0f7a7581ea7b5 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 16 Jun 2024 12:19:04 +0200 Subject: [PATCH 13/42] Update mpv to 2024-06-09 --- src/ui/Forms/Options/SettingsMpv.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/Forms/Options/SettingsMpv.cs b/src/ui/Forms/Options/SettingsMpv.cs index 1c46cc608..22a19b748 100644 --- a/src/ui/Forms/Options/SettingsMpv.cs +++ b/src/ui/Forms/Options/SettingsMpv.cs @@ -31,7 +31,7 @@ namespace Nikse.SubtitleEdit.Forms.Options private void ButtonDownloadClick(object sender, EventArgs e) { - _downloadUrl = "https://github.com/SubtitleEdit/support-files/releases/download/20240317-git-3afcaeb/libmpv2-" + IntPtr.Size * 8 + ".zip"; + _downloadUrl = "https://github.com/SubtitleEdit/support-files/releases/download/libmpv-2024-06-09/libmpv2-" + IntPtr.Size * 8 + ".zip"; try { labelPleaseWait.Text = LanguageSettings.Current.General.PleaseWait; @@ -82,8 +82,8 @@ namespace Nikse.SubtitleEdit.Forms.Options var hash = Utilities.GetSha512Hash(downloadStream.ToArray()); string[] validHashes = { - "9efe0a9bb2fad034c1abf1d7d13b138d94e0c2d68252c9eb023adbc56856cd8825f3ed7ec77fd46c90d44b590d92bbbdf1db6f2c73669ebd30142dd112030a7c", // 32-bit - "0fc41264b94045a5d72f5ae078afc27b65c8525cb9283113c7f467ffdc2833b4dfc208faf81cd6855d9f147ee2212f0db668f7fceb721a58c933bb6b2e762af6", // 64-bit + "a6d6ee7b2a1173a77ee07e046d6f9875842d88ee41a8a935ff5f906300553a704c0b39ae8a1a42eb7c7b1dc06b4e6e9d28d62a2d93384b70ce45de9d9ac8f8d7", // 32-bit + "ae62aa72a7678199c8470cbec38f94e930469332f90a2da77dab1d89ef86e3ba71a0d5258cbf1fe8680e84736ea123ebdc5737a93384de1106fba6c0b78ea560", // 64-bit }; if (!validHashes.Contains(hash)) { From 1d8773d1b62881ce293f9cd964725bac3eec6023 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 16 Jun 2024 12:19:26 +0200 Subject: [PATCH 14/42] Update yt-dlp to 2024.05.27 --- src/ui/Forms/DownloadYouTubeDl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/Forms/DownloadYouTubeDl.cs b/src/ui/Forms/DownloadYouTubeDl.cs index a8d6daf95..332e87075 100644 --- a/src/ui/Forms/DownloadYouTubeDl.cs +++ b/src/ui/Forms/DownloadYouTubeDl.cs @@ -11,8 +11,8 @@ namespace Nikse.SubtitleEdit.Forms { public sealed partial class DownloadYouTubeDl : Form { - public const string Url = "https://github.com/yt-dlp/yt-dlp/releases/download/2024.03.10/yt-dlp.exe"; - public const string Sha512Hash = "643bb41bb7590a1c79f2e10e5a7948e9897e18196e3399548b842673d4bb1a00f7060338ee9756dfb74e6aa24ac6282641398299f3937150f247d8bfe5f76b52"; + public const string Url = "https://github.com/yt-dlp/yt-dlp/releases/download/2024.05.27/yt-dlp.exe"; + public const string Sha512Hash = "4b786138bbea8664cdec97da44d0bc6521ac17c9277bc6a08f845a1c037a3d3c19642c06dc2ffa23f4267f17222f7950ec293fc42e90ad7e9cf85521e375cac9"; public bool AutoClose { get; internal set; } private readonly CancellationTokenSource _cancellationTokenSource; From 41cc9bf4c70a07de628673df3f4b81ef111482f1 Mon Sep 17 00:00:00 2001 From: May Kittens Devour Your Soul Date: Mon, 17 Jun 2024 11:34:23 +0200 Subject: [PATCH 15/42] Update hrv_OCRFixReplaceList.xml --- Dictionaries/hrv_OCRFixReplaceList.xml | 34 +++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/Dictionaries/hrv_OCRFixReplaceList.xml b/Dictionaries/hrv_OCRFixReplaceList.xml index 860a91b0e..bdda6ee22 100644 --- a/Dictionaries/hrv_OCRFixReplaceList.xml +++ b/Dictionaries/hrv_OCRFixReplaceList.xml @@ -77,6 +77,7 @@ + @@ -395,6 +396,7 @@ + @@ -643,6 +645,7 @@ + @@ -1461,6 +1464,8 @@ + + @@ -1478,6 +1483,7 @@ + @@ -1492,6 +1498,7 @@ + @@ -1523,7 +1530,6 @@ - @@ -1558,6 +1564,7 @@ + @@ -1671,6 +1678,7 @@ + @@ -1769,6 +1777,7 @@ + @@ -1791,6 +1800,7 @@ + @@ -1809,6 +1819,7 @@ + @@ -1964,6 +1975,7 @@ + @@ -1981,7 +1993,6 @@ - @@ -2007,6 +2018,7 @@ + @@ -2200,6 +2212,7 @@ + @@ -2232,6 +2245,7 @@ + @@ -2441,6 +2455,7 @@ + @@ -2537,6 +2552,7 @@ + @@ -2899,6 +2915,7 @@ + @@ -3260,6 +3277,7 @@ + @@ -4296,6 +4314,7 @@ + @@ -4484,6 +4503,7 @@ + @@ -4532,6 +4552,7 @@ + @@ -4943,6 +4964,7 @@ + @@ -5316,7 +5338,7 @@ - + @@ -5372,6 +5394,8 @@ + + @@ -5548,6 +5572,7 @@ + @@ -5557,7 +5582,7 @@ - + @@ -5697,6 +5722,7 @@ + From b609fa180e1d444e4c015c4ae41824bf82588dfd Mon Sep 17 00:00:00 2001 From: elfriob <107931221+elfriob@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:51:19 +0000 Subject: [PATCH 16/42] Update Russian translation --- src/ui/Languages/ru-RU.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/Languages/ru-RU.xml b/src/ui/Languages/ru-RU.xml index 56a52a6c4..22218aa12 100644 --- a/src/ui/Languages/ru-RU.xml +++ b/src/ui/Languages/ru-RU.xml @@ -198,7 +198,7 @@ https://github.com/SubtitleEdit/subtitleedit Аудио в текст Создание текста из аудио с помощью системы распознавания речи Vosk/Kaldi Создание текста из аудио с помощью системы распознавания речи Whisper - Движок: + Движок Сайт Vosk Сайт Whisper Модель @@ -1080,7 +1080,7 @@ https://github.com/SubtitleEdit/subtitleedit Переведите исходный текст, затем скопируйте результат в буфер обмена и нажмите кнопку ниже Получить переведённый текст из буфера обмена (Ctrl + V) - Копировать исходный текст в буфер обмена + Копировать исходный текст Буфер обмена содержит исходный текст! Переведите исходный текст, затем скопируйте результат в буфер обмена и повторите попытку Запустить веб-сервер «{0}» @@ -2144,6 +2144,8 @@ https://github.com/SubtitleEdit/subtitleedit Продолжите-ность больше Симв./сек. меньше Симв./сек. больше + Длина меньше + Длина больше Ровно одна строка Ровно две строчки Более двух строк @@ -3184,6 +3186,7 @@ https://github.com/SubtitleEdit/subtitleedit Объединение аудиодорожек: {0} / {1}… Создание речи из текста: {0} / {1}... Просмотр аудиоклипов + Пользовательское кодирование звука Просмотр и редактирование/удаление аудиоклипов Воспроизвести Автопродолжение From fb5a8fd67783ff2aca76ccb1c937909186e9f66f Mon Sep 17 00:00:00 2001 From: Hugo Carvalho Date: Tue, 18 Jun 2024 00:14:06 +0100 Subject: [PATCH 17/42] Update pt-PT.xml --- src/ui/Languages/pt-PT.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/Languages/pt-PT.xml b/src/ui/Languages/pt-PT.xml index c949603fa..38a5d9e33 100644 --- a/src/ui/Languages/pt-PT.xml +++ b/src/ui/Languages/pt-PT.xml @@ -3176,6 +3176,7 @@ Continuar? A combinar a faixa de áudio: {0} / {1}... A gerar voz a partir de texto: {0} / {1}... Rever clipes de áudio + Codificação áudio personalizada Rever e editar/remover clipes de áudio Reproduzir Continuar automaticamente @@ -3465,4 +3466,4 @@ Manter as alterações? Palavras individuais Frase - \ No newline at end of file + From 5fb752fa0e07630f988f635468feb7f4abbec7ac Mon Sep 17 00:00:00 2001 From: Hugo Carvalho Date: Tue, 18 Jun 2024 00:22:02 +0100 Subject: [PATCH 18/42] Update pt-PT.xml --- src/ui/Languages/pt-PT.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/Languages/pt-PT.xml b/src/ui/Languages/pt-PT.xml index 38a5d9e33..156a1a068 100644 --- a/src/ui/Languages/pt-PT.xml +++ b/src/ui/Languages/pt-PT.xml @@ -3466,4 +3466,4 @@ Manter as alterações? Palavras individuais Frase - + \ No newline at end of file From c695ed7b351bb3b434f329b14fa81ea02fa69eb2 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Tue, 18 Jun 2024 19:28:34 +0200 Subject: [PATCH 19/42] Fix #8543 --- src/ui/Forms/Translate/AutoTranslate.cs | 91 ++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index b8d95cdf6..94701781d 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -6,6 +6,7 @@ using Nikse.SubtitleEdit.Forms.Options; using Nikse.SubtitleEdit.Logic; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; @@ -34,6 +35,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate private bool _breakTranslation; private bool _translationInProgress; private bool _singleLineMode; + private bool _ollamaModelsDone; private CancellationTokenSource _cancellationTokenSource; public AutoTranslate(Subtitle subtitle, Subtitle targetLines, string title, Encoding encoding) @@ -1168,6 +1170,60 @@ namespace Nikse.SubtitleEdit.Forms.Translate { SetAutoTranslatorEngine(); SetupLanguageSettings(); + + if (GetCurrentEngine().GetType() == typeof(OllamaTranslate)) + { + var bw = new BackgroundWorker(); + bw.DoWork += (o, args) => + { + using (var httpClient = new HttpClient()) + { + try + { + var url = nikseComboBoxUrl.Text.Replace("generate", "tags"); + var resultTask = httpClient.GetAsync(new Uri(url)); + + var result = resultTask.Result; + var bytes = result.Content.ReadAsByteArrayAsync().Result; + if (result.IsSuccessStatusCode) + { + _ollamaModelsDone = true; + var parser = new SeJsonParser(); + var resultJson = Encoding.UTF8.GetString(bytes); + var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); + args.Result = names; + } + } + catch + { + // ignore + } + } + }; + bw.RunWorkerCompleted += (o, args) => + { + if (args.Result is List names) + { + var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); + var newModels = false; + foreach (var name in names.OrderByDescending(p => p)) + { + if (!models.Contains(name)) + { + models.Insert(0, name); + newModels = true; + } + } + + if (newModels) + { + Configuration.Settings.Tools.OllamaModels = string.Join(",", models); + FillOllamaModels(models); + } + } + }; + bw.RunWorkerAsync(); + } } private void nikseComboBoxUrl_SelectedIndexChanged(object sender, EventArgs e) @@ -1460,21 +1516,21 @@ namespace Nikse.SubtitleEdit.Forms.Translate var parser = new SeJsonParser(); var resultJson = Encoding.UTF8.GetString(bytes); var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); + var newModels = false; foreach (var name in names.OrderByDescending(p => p)) { - models.Remove(name); - models.Insert(0, name); + if (!models.Contains(name)) + { + models.Insert(0, name); + newModels = true; + } } - Configuration.Settings.Tools.OllamaModels = string.Join(",", models); - - var v = comboBoxFormality.Text; - comboBoxFormality.Items.Clear(); - foreach (var model in models) + if (newModels) { - comboBoxFormality.Items.Add(model); + Configuration.Settings.Tools.OllamaModels = string.Join(",", models); + FillOllamaModels(models); } - comboBoxFormality.Text = v; } } catch (Exception exception) @@ -1485,6 +1541,23 @@ namespace Nikse.SubtitleEdit.Forms.Translate } } + private void FillOllamaModels(List models) + { + if (!(GetCurrentEngine() is OllamaTranslate)) + { + return; + } + + var v = comboBoxFormality.Text; + comboBoxFormality.Items.Clear(); + foreach (var model in models) + { + comboBoxFormality.Items.Add(model); + } + + comboBoxFormality.Text = v; + } + private void findModelsToolStripMenuItem_Click(object sender, EventArgs e) { UiUtil.OpenUrl("https://ollama.com/library"); From 2b7bffc396a6a2c5244ce0ffa45c234e433054fa Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Tue, 18 Jun 2024 19:29:31 +0200 Subject: [PATCH 20/42] Add Ollama to batch translate - thx TobbyTravel :) Fix #8544 --- src/ui/Forms/BatchConvert.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/Forms/BatchConvert.cs b/src/ui/Forms/BatchConvert.cs index bb71bfa24..05ad1591c 100644 --- a/src/ui/Forms/BatchConvert.cs +++ b/src/ui/Forms/BatchConvert.cs @@ -735,6 +735,7 @@ namespace Nikse.SubtitleEdit.Forms new LibreTranslate(), new NoLanguageLeftBehindServe(), new NoLanguageLeftBehindApi(), + new OllamaTranslate(), }; nikseComboBoxEngine.Items.Clear(); nikseComboBoxEngine.Items.AddRange(_autoTranslatorEngines.Select(p => p.Name).ToArray()); From 060e7c9e7d866ef42eaf93a33aa1428cfdef3d0e Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Wed, 19 Jun 2024 19:30:19 +0200 Subject: [PATCH 21/42] Only allow single line select in auto-translate - thx TobbyTravel :) Fix #8548 --- src/ui/Forms/Translate/AutoTranslate.Designer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.Designer.cs b/src/ui/Forms/Translate/AutoTranslate.Designer.cs index 8056cdf86..6093dfaf9 100644 --- a/src/ui/Forms/Translate/AutoTranslate.Designer.cs +++ b/src/ui/Forms/Translate/AutoTranslate.Designer.cs @@ -272,7 +272,7 @@ this.updateLocalModelsToolStripMenuItem, this.findModelsToolStripMenuItem}); this.contextMenuStripOlamaModels.Name = "contextMenuStripOlamaModels"; - this.contextMenuStripOlamaModels.Size = new System.Drawing.Size(184, 70); + this.contextMenuStripOlamaModels.Size = new System.Drawing.Size(184, 48); // // updateLocalModelsToolStripMenuItem // @@ -446,6 +446,7 @@ this.subtitleListViewTarget.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.subtitleListViewTarget.HideSelection = false; this.subtitleListViewTarget.Location = new System.Drawing.Point(465, 53); + this.subtitleListViewTarget.MultiSelect = false; this.subtitleListViewTarget.Name = "subtitleListViewTarget"; this.subtitleListViewTarget.OwnerDraw = true; this.subtitleListViewTarget.Size = new System.Drawing.Size(428, 431); @@ -469,6 +470,7 @@ this.subtitleListViewSource.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.subtitleListViewSource.HideSelection = false; this.subtitleListViewSource.Location = new System.Drawing.Point(12, 53); + this.subtitleListViewSource.MultiSelect = false; this.subtitleListViewSource.Name = "subtitleListViewSource"; this.subtitleListViewSource.OwnerDraw = true; this.subtitleListViewSource.Size = new System.Drawing.Size(430, 431); From c9e20b0aa9e399adc2572ddf2ae7888249121216 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Wed, 19 Jun 2024 22:20:43 +0100 Subject: [PATCH 22/42] Refactor AutoTranslate code to use async/await Removed the BackgroundWorker in the `nikseComboBoxEngine_SelectedIndexChanged` method, replacing it with async/await for better readability and performance. Extracted a `DownloadOllamaModelsAsync` method to download models, which also replaced the synchronous approach in `UpdateLocalModelsToolStripMenuItem_Click`. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.cs | 117 +++++++----------------- 1 file changed, 35 insertions(+), 82 deletions(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index 94701781d..e961246bb 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -6,7 +6,6 @@ using Nikse.SubtitleEdit.Forms.Options; using Nikse.SubtitleEdit.Logic; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; @@ -35,7 +34,6 @@ namespace Nikse.SubtitleEdit.Forms.Translate private bool _breakTranslation; private bool _translationInProgress; private bool _singleLineMode; - private bool _ollamaModelsDone; private CancellationTokenSource _cancellationTokenSource; public AutoTranslate(Subtitle subtitle, Subtitle targetLines, string title, Encoding encoding) @@ -1166,63 +1164,16 @@ namespace Nikse.SubtitleEdit.Forms.Translate DialogResult = DialogResult.Cancel; } - private void nikseComboBoxEngine_SelectedIndexChanged(object sender, EventArgs e) + private async void nikseComboBoxEngine_SelectedIndexChanged(object sender, EventArgs e) { SetAutoTranslatorEngine(); SetupLanguageSettings(); if (GetCurrentEngine().GetType() == typeof(OllamaTranslate)) { - var bw = new BackgroundWorker(); - bw.DoWork += (o, args) => - { - using (var httpClient = new HttpClient()) - { - try - { - var url = nikseComboBoxUrl.Text.Replace("generate", "tags"); - var resultTask = httpClient.GetAsync(new Uri(url)); - - var result = resultTask.Result; - var bytes = result.Content.ReadAsByteArrayAsync().Result; - if (result.IsSuccessStatusCode) - { - _ollamaModelsDone = true; - var parser = new SeJsonParser(); - var resultJson = Encoding.UTF8.GetString(bytes); - var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); - args.Result = names; - } - } - catch - { - // ignore - } - } - }; - bw.RunWorkerCompleted += (o, args) => - { - if (args.Result is List names) - { - var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); - var newModels = false; - foreach (var name in names.OrderByDescending(p => p)) - { - if (!models.Contains(name)) - { - models.Insert(0, name); - newModels = true; - } - } - - if (newModels) - { - Configuration.Settings.Tools.OllamaModels = string.Join(",", models); - FillOllamaModels(models); - } - } - }; - bw.RunWorkerAsync(); + nikseComboBoxEngine.Enabled = false; + await DownloadOllamaModelsAsync().ConfigureAwait(true); + nikseComboBoxEngine.Enabled = true; } } @@ -1499,39 +1450,44 @@ namespace Nikse.SubtitleEdit.Forms.Translate } } - private void UpdateLocalModelsToolStripMenuItem_Click(object sender, EventArgs e) + private async void UpdateLocalModelsToolStripMenuItem_Click(object sender, EventArgs e) + { + await DownloadOllamaModelsAsync(); + } + + private async Task DownloadOllamaModelsAsync() { using (var httpClient = new HttpClient()) { try { - var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); var url = nikseComboBoxUrl.Text.Replace("generate", "tags"); - var resultTask = httpClient.GetAsync(new Uri(url)); - - var result = resultTask.Result; - var bytes = result.Content.ReadAsByteArrayAsync().Result; - if (result.IsSuccessStatusCode) + var result = await httpClient.GetAsync(new Uri(url)).ConfigureAwait(true); + var bytes = await result.Content.ReadAsByteArrayAsync().ConfigureAwait(true); + if (!result.IsSuccessStatusCode) { - var parser = new SeJsonParser(); - var resultJson = Encoding.UTF8.GetString(bytes); - var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); - var newModels = false; - foreach (var name in names.OrderByDescending(p => p)) - { - if (!models.Contains(name)) - { - models.Insert(0, name); - newModels = true; - } - } + return; + } - if (newModels) + var parser = new SeJsonParser(); + var resultJson = Encoding.UTF8.GetString(bytes); + var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); + var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); + var newModels = false; + foreach (var name in names.OrderByDescending(p => p)) + { + if (!models.Contains(name)) { - Configuration.Settings.Tools.OllamaModels = string.Join(",", models); - FillOllamaModels(models); + models.Insert(0, name); + newModels = true; } } + + if (newModels) + { + Configuration.Settings.Tools.OllamaModels = string.Join(",", models); + FillOllamaModels(models.ToArray()); + } } catch (Exception exception) { @@ -1540,22 +1496,19 @@ namespace Nikse.SubtitleEdit.Forms.Translate } } } - - private void FillOllamaModels(List models) + private void FillOllamaModels(string[] models) { if (!(GetCurrentEngine() is OllamaTranslate)) { return; } + comboBoxFormality.BeginUpdate(); var v = comboBoxFormality.Text; comboBoxFormality.Items.Clear(); - foreach (var model in models) - { - comboBoxFormality.Items.Add(model); - } - + comboBoxFormality.Items.AddRange(models); comboBoxFormality.Text = v; + comboBoxFormality.EndUpdate(); } private void findModelsToolStripMenuItem_Click(object sender, EventArgs e) From a9b7da3dc1b7834b06f0c178103e61588835796a Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 20 Jun 2024 18:42:33 +0100 Subject: [PATCH 23/42] Refactor model fetching in AutoTranslate.cs The process for downloading Ollama Models has been refactored for brevity and clarity. A private async method, 'GetModelsAsync', was introduced by extracting code from 'DownloadOllamaModelsAsync'. This change enhances code readability and makes possible errors easier to trace. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.cs | 35 ++++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index e961246bb..36c61c835 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1457,42 +1457,45 @@ namespace Nikse.SubtitleEdit.Forms.Translate private async Task DownloadOllamaModelsAsync() { - using (var httpClient = new HttpClient()) + try { - try + var models = await GetModelsAsync(nikseComboBoxUrl.Text.Replace("generate", "tags")); + if (models.Count > 0) + { + Configuration.Settings.Tools.OllamaModels = string.Join(",", models); + FillOllamaModels(models.ToArray()); + } + } + catch (Exception exception) + { + MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); + SeLogger.Error(exception, "Unable to get ollama models"); + } + + async Task> GetModelsAsync(string url) + { + using (var httpClient = new HttpClient()) { - var url = nikseComboBoxUrl.Text.Replace("generate", "tags"); var result = await httpClient.GetAsync(new Uri(url)).ConfigureAwait(true); var bytes = await result.Content.ReadAsByteArrayAsync().ConfigureAwait(true); if (!result.IsSuccessStatusCode) { - return; + return new List(); } var parser = new SeJsonParser(); var resultJson = Encoding.UTF8.GetString(bytes); var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); - var newModels = false; foreach (var name in names.OrderByDescending(p => p)) { if (!models.Contains(name)) { models.Insert(0, name); - newModels = true; } } - if (newModels) - { - Configuration.Settings.Tools.OllamaModels = string.Join(",", models); - FillOllamaModels(models.ToArray()); - } - } - catch (Exception exception) - { - MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); - SeLogger.Error(exception, "Unable to get ollama models"); + return models; } } } From a9d737aff51b52d943975e1eef2306de16da3738 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Thu, 20 Jun 2024 19:45:05 +0200 Subject: [PATCH 24/42] Add new Claude 3.5 Sonnet model - thx Flash :) --- src/libse/AutoTranslate/AnthropicTranslate.cs | 2 +- src/libse/Common/Settings.cs | 2 +- src/ui/Forms/Main.Designer.cs | 64 +++++++++++-------- src/ui/Forms/Main.cs | 17 ++++- src/ui/Forms/Main.resx | 9 ++- src/ui/Forms/Translate/AutoTranslate.cs | 1 + 6 files changed, 62 insertions(+), 33 deletions(-) diff --git a/src/libse/AutoTranslate/AnthropicTranslate.cs b/src/libse/AutoTranslate/AnthropicTranslate.cs index b6cd29dbf..77b122735 100644 --- a/src/libse/AutoTranslate/AnthropicTranslate.cs +++ b/src/libse/AutoTranslate/AnthropicTranslate.cs @@ -51,7 +51,7 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate var model = Configuration.Settings.Tools.AnthropicApiModel; if (string.IsNullOrEmpty(model)) { - model = "claude-3-opus-20240229"; + model = "claude-3-5-sonnet-20240620"; Configuration.Settings.Tools.AnthropicApiModel = model; } diff --git a/src/libse/Common/Settings.cs b/src/libse/Common/Settings.cs index c3b12af0d..d6947b9d9 100644 --- a/src/libse/Common/Settings.cs +++ b/src/libse/Common/Settings.cs @@ -570,7 +570,7 @@ namespace Nikse.SubtitleEdit.Core.Common OllamaPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments or notes:"; AnthropicApiUrl = "https://api.anthropic.com/v1/messages"; AnthropicPrompt = "Translate from {0} to {1}, keep sentences in {1} as they are, do not censor the translation, give only the output without comments:"; - AnthropicApiModel = "claude-3-opus-20240229"; + AnthropicApiModel = "claude-3-5-sonnet-20240620"; TextToSpeechAzureRegion = "westeurope"; AutoTranslateMaxBytes = 2000; TextToSpeechAddToVideoFile = true; diff --git a/src/ui/Forms/Main.Designer.cs b/src/ui/Forms/Main.Designer.cs index 3f3f07806..7dc4d95c4 100644 --- a/src/ui/Forms/Main.Designer.cs +++ b/src/ui/Forms/Main.Designer.cs @@ -41,9 +41,9 @@ namespace Nikse.SubtitleEdit.Forms { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); - Nikse.SubtitleEdit.Core.Common.TimeCode timeCode1 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); - Nikse.SubtitleEdit.Core.Common.TimeCode timeCode2 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); - Nikse.SubtitleEdit.Core.Common.TimeCode timeCode3 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); + Nikse.SubtitleEdit.Core.Common.TimeCode timeCode7 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); + Nikse.SubtitleEdit.Core.Common.TimeCode timeCode8 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); + Nikse.SubtitleEdit.Core.Common.TimeCode timeCode9 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.labelStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripSelected = new System.Windows.Forms.ToolStripStatusLabel(); @@ -586,6 +586,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.generaeTransparentVideoWithSubtitleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -2302,6 +2303,7 @@ namespace Nikse.SubtitleEdit.Forms this.generateBlankVideoToolStripMenuItem, this.generateVideoWithSoftcodedSubtitlesToolStripMenuItem, this.generateVideoWithHardcodedSubtitleToolStripMenuItem, + this.generaeTransparentVideoWithSubtitleToolStripMenuItem, this.audioToTextWhisperTolStripMenuItem, this.videoaudioToTextToolStripMenuItem, this.textToSpeechAndAddToVideoToolStripMenuItem, @@ -3914,14 +3916,14 @@ namespace Nikse.SubtitleEdit.Forms this.timeUpDownVideoPosition.Size = new System.Drawing.Size(113, 23); this.timeUpDownVideoPosition.TabIndex = 12; this.timeUpDownVideoPosition.TabStop = false; - timeCode1.Hours = 0; - timeCode1.Milliseconds = 0; - timeCode1.Minutes = 0; - timeCode1.Seconds = 0; - timeCode1.TimeSpan = System.TimeSpan.Parse("00:00:00"); - timeCode1.TotalMilliseconds = 0D; - timeCode1.TotalSeconds = 0D; - this.timeUpDownVideoPosition.TimeCode = timeCode1; + timeCode7.Hours = 0; + timeCode7.Milliseconds = 0; + timeCode7.Minutes = 0; + timeCode7.Seconds = 0; + timeCode7.TimeSpan = System.TimeSpan.Parse("00:00:00"); + timeCode7.TotalMilliseconds = 0D; + timeCode7.TotalSeconds = 0D; + this.timeUpDownVideoPosition.TimeCode = timeCode7; this.timeUpDownVideoPosition.UseVideoOffset = false; // // buttonGotoSub @@ -4194,14 +4196,14 @@ namespace Nikse.SubtitleEdit.Forms this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(113, 23); this.timeUpDownVideoPositionAdjust.TabIndex = 13; this.timeUpDownVideoPositionAdjust.TabStop = false; - timeCode2.Hours = 0; - timeCode2.Milliseconds = 0; - timeCode2.Minutes = 0; - timeCode2.Seconds = 0; - timeCode2.TimeSpan = System.TimeSpan.Parse("00:00:00"); - timeCode2.TotalMilliseconds = 0D; - timeCode2.TotalSeconds = 0D; - this.timeUpDownVideoPositionAdjust.TimeCode = timeCode2; + timeCode8.Hours = 0; + timeCode8.Milliseconds = 0; + timeCode8.Minutes = 0; + timeCode8.Seconds = 0; + timeCode8.TimeSpan = System.TimeSpan.Parse("00:00:00"); + timeCode8.TotalMilliseconds = 0D; + timeCode8.TotalSeconds = 0D; + this.timeUpDownVideoPositionAdjust.TimeCode = timeCode8; this.timeUpDownVideoPositionAdjust.UseVideoOffset = false; // // buttonAdjustSetEndTime @@ -5558,14 +5560,14 @@ namespace Nikse.SubtitleEdit.Forms this.timeUpDownStartTime.Size = new System.Drawing.Size(113, 23); this.timeUpDownStartTime.TabIndex = 0; this.timeUpDownStartTime.TabStop = false; - timeCode3.Hours = 0; - timeCode3.Milliseconds = 0; - timeCode3.Minutes = 0; - timeCode3.Seconds = 0; - timeCode3.TimeSpan = System.TimeSpan.Parse("00:00:00"); - timeCode3.TotalMilliseconds = 0D; - timeCode3.TotalSeconds = 0D; - this.timeUpDownStartTime.TimeCode = timeCode3; + timeCode9.Hours = 0; + timeCode9.Milliseconds = 0; + timeCode9.Minutes = 0; + timeCode9.Seconds = 0; + timeCode9.TimeSpan = System.TimeSpan.Parse("00:00:00"); + timeCode9.TotalMilliseconds = 0D; + timeCode9.TotalSeconds = 0D; + this.timeUpDownStartTime.TimeCode = timeCode9; this.timeUpDownStartTime.UseVideoOffset = false; // // numericUpDownDuration @@ -5919,6 +5921,13 @@ namespace Nikse.SubtitleEdit.Forms this.toolStripMenuItemShowVideoControls.Text = "Show video controls"; this.toolStripMenuItemShowVideoControls.Click += new System.EventHandler(this.ToolStripMenuItemShowVideoControlsClick); // + // generaeTransparentVideoWithSubtitleToolStripMenuItem + // + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Name = "generaeTransparentVideoWithSubtitleToolStripMenuItem"; + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Size = new System.Drawing.Size(295, 22); + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Text = "Generae transparent video with subtitle"; + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Click += new System.EventHandler(this.generaeTransparentVideoWithSubtitleToolStripMenuItem_Click); + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -6545,5 +6554,6 @@ namespace Nikse.SubtitleEdit.Forms private ToolStripMenuItem videoInfoToolStripMenuItem; private ToolStripMenuItem openContainingFolderToolStripMenuItem; private ToolStripMenuItem insertNewSubtitleHereToolStripMenuItem; + private ToolStripMenuItem generaeTransparentVideoWithSubtitleToolStripMenuItem; } } \ No newline at end of file diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 694ec8e56..e6d9da106 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -36898,5 +36898,20 @@ namespace Nikse.SubtitleEdit.Forms ShowStatus(string.Format(_language.VideoControls.NewTextInsertAtX, newParagraph.StartTime.ToShortString())); } + + private void generaeTransparentVideoWithSubtitleToolStripMenuItem_Click(object sender, EventArgs e) + { + using (var saveDialog = new SaveFileDialog + { + FileName = string.Empty, + Filter = "mkv|*.mkv|mp4|*.mp4|mov|*.mov" + }) + { + if (saveDialog.ShowDialog(this) != DialogResult.OK) + { + return; + } + } + } } -} \ No newline at end of file +} diff --git a/src/ui/Forms/Main.resx b/src/ui/Forms/Main.resx index 34a87c2c9..c577e339f 100644 --- a/src/ui/Forms/Main.resx +++ b/src/ui/Forms/Main.resx @@ -690,6 +690,9 @@ 652, 56 + + 652, 56 + iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -772,12 +775,12 @@ 981, 56 - - 668, 17 - 193, 17 + + 668, 17 + 17, 95 diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index e961246bb..d083cde92 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -384,6 +384,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate comboBoxFormality.Visible = true; comboBoxFormality.DropDownStyle = ComboBoxStyle.DropDown; comboBoxFormality.Items.Clear(); + comboBoxFormality.Items.Add("claude-3-5-sonnet-20240620"); comboBoxFormality.Items.Add("claude-3-opus-20240229"); comboBoxFormality.Items.Add("claude-3-sonnet-20240229"); comboBoxFormality.Items.Add("claude-3-haiku-20240307"); From 1b6ec6d9f2442177c0e1deeada41587ed008d3ff Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 20 Jun 2024 18:57:02 +0100 Subject: [PATCH 25/42] Refactor HttpClient handling in AutoTranslate HttpClient is optimized, now a single instance is shared instead of creating new for each request. The 'ConfigureAwait' statements have been adjusted in the async calls to improve asynchronous handling. Reorganized the downloading of Ollama models which simplifies and increases program efficiency. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.cs | 57 ++++++++++++++----------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index 36c61c835..bcaa45318 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1172,7 +1172,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate if (GetCurrentEngine().GetType() == typeof(OllamaTranslate)) { nikseComboBoxEngine.Enabled = false; - await DownloadOllamaModelsAsync().ConfigureAwait(true); + await DownloadOllamaModelsAsync(); nikseComboBoxEngine.Enabled = true; } } @@ -1455,14 +1455,14 @@ namespace Nikse.SubtitleEdit.Forms.Translate await DownloadOllamaModelsAsync(); } + private async Task DownloadOllamaModelsAsync() { try { - var models = await GetModelsAsync(nikseComboBoxUrl.Text.Replace("generate", "tags")); + var models = await GetModelsAsync(nikseComboBoxUrl.Text.Replace("generate", "tags")).ConfigureAwait(true); if (models.Count > 0) { - Configuration.Settings.Tools.OllamaModels = string.Join(",", models); FillOllamaModels(models.ToArray()); } } @@ -1474,31 +1474,40 @@ namespace Nikse.SubtitleEdit.Forms.Translate async Task> GetModelsAsync(string url) { - using (var httpClient = new HttpClient()) + var result = await GetOllamaClient().GetAsync(new Uri(url)).ConfigureAwait(false); + var bytes = await result.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (!result.IsSuccessStatusCode) { - var result = await httpClient.GetAsync(new Uri(url)).ConfigureAwait(true); - var bytes = await result.Content.ReadAsByteArrayAsync().ConfigureAwait(true); - if (!result.IsSuccessStatusCode) - { - return new List(); - } - - var parser = new SeJsonParser(); - var resultJson = Encoding.UTF8.GetString(bytes); - var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); - var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); - foreach (var name in names.OrderByDescending(p => p)) - { - if (!models.Contains(name)) - { - models.Insert(0, name); - } - } - - return models; + return new List(); } + + var parser = new SeJsonParser(); + var resultJson = Encoding.UTF8.GetString(bytes); + var names = parser.GetAllTagsByNameAsStrings(resultJson, "name"); + var models = Configuration.Settings.Tools.OllamaModels.Split(',').ToList(); + foreach (var name in names.OrderByDescending(name => name)) + { + if (!models.Contains(name)) + { + models.Insert(0, name); + } + } + + Configuration.Settings.Tools.OllamaModels = string.Join(",", models); + return models; } } + + private HttpClient _httpClient; + + private HttpClient GetOllamaClient() + { + return _httpClient ?? (_httpClient = new HttpClient + { + Timeout = TimeSpan.FromSeconds(3) + }); + } + private void FillOllamaModels(string[] models) { if (!(GetCurrentEngine() is OllamaTranslate)) From be16964b95bbf0b432b0765d44730b0f84b88bc6 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 20 Jun 2024 19:17:05 +0100 Subject: [PATCH 26/42] Remove unnecessary whitespace and dispose HttpClient An unnecessary whitespace line was removed from the AutoTranslate.cs file to improve code readability. Additionally, the HttpClient in the AutoTranslate.Designer.cs file was disposed to free up system resources and prevent potential memory leaks. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.Designer.cs | 2 ++ src/ui/Forms/Translate/AutoTranslate.cs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.Designer.cs b/src/ui/Forms/Translate/AutoTranslate.Designer.cs index 6093dfaf9..676d44da7 100644 --- a/src/ui/Forms/Translate/AutoTranslate.Designer.cs +++ b/src/ui/Forms/Translate/AutoTranslate.Designer.cs @@ -17,6 +17,8 @@ { components.Dispose(); } + + _httpClient.Dispose(); base.Dispose(disposing); } diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index bcaa45318..bc1baa10a 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1455,7 +1455,6 @@ namespace Nikse.SubtitleEdit.Forms.Translate await DownloadOllamaModelsAsync(); } - private async Task DownloadOllamaModelsAsync() { try From b915d491c71069cb393851ea29c4403db51dd6cf Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Thu, 20 Jun 2024 19:21:03 +0100 Subject: [PATCH 27/42] Add debug-specific error message in AutoTranslate.cs In a wrap catch of the AutoTranslate.cs file, a conditional directive was added to display different error messages for DEBUG and RELEASE modes. This ensures that detailed exception information is shown during debugging for better troubleshooting, while a more user-friendly message is used in the release build. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index bc1baa10a..6d93d6759 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1467,8 +1467,12 @@ namespace Nikse.SubtitleEdit.Forms.Translate } catch (Exception exception) { +#if DEBUG + MessageBox.Show(exception.Message); +#else MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); SeLogger.Error(exception, "Unable to get ollama models"); +#endif } async Task> GetModelsAsync(string url) From 40e4b004c1d3e403b95bf70707f70d11b8a9f238 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Fri, 21 Jun 2024 09:02:17 +0100 Subject: [PATCH 28/42] Add new classes for settings This commit adds new classes for settings including 'MultipleSearchAndReplaceGroup', 'MultipleSearchAndReplaceSetting', 'NetworkSettings', 'AssaStorageCategory', and 'GeneralSettings'. Each class represents different groups of settings. These classes will be utilized to manage the settings in a more organized way. Signed-off-by: Ivandro Jao --- .../Common/Settings/AssaStorageCategory.cs | 11 + .../Settings/BeautifyTimeCodesSettings.cs | 220 ++ src/libse/Common/Settings/CompareSettings.cs | 16 + .../Common/Settings/FcpExportSettings.cs | 22 + .../Settings/FixCommonErrorsSettings.cs | 340 ++ src/libse/Common/Settings/GeneralSettings.cs | 835 +++++ .../Settings/MultipleSearchAndReplaceGroup.cs | 11 + .../MultipleSearchAndReplaceSetting.cs | 11 + src/libse/Common/Settings/NetworkSettings.cs | 21 + src/libse/Common/Settings/ProxySettings.cs | 24 + src/libse/Common/Settings/RecentFileEntry.cs | 14 + .../Common/Settings/RecentFilesSettings.cs | 92 + .../RemoveTextForHearingImpairedSettings.cs | 38 + src/libse/Common/{ => Settings}/Settings.cs | 3224 ----------------- src/libse/Common/Settings/Shortcuts.cs | 539 +++ src/libse/Common/Settings/SubtitleBeaming.cs | 22 + src/libse/Common/Settings/SubtitleSettings.cs | 223 ++ src/libse/Common/Settings/ToolsSettings.cs | 669 ++++ .../Settings/VerifyCompletenessSettings.cs | 18 + .../Common/Settings/VideoControlsSettings.cs | 87 + .../Common/Settings/VobSubOcrSettings.cs | 77 + src/libse/Common/Settings/WordListSettings.cs | 15 + 22 files changed, 3305 insertions(+), 3224 deletions(-) create mode 100644 src/libse/Common/Settings/AssaStorageCategory.cs create mode 100644 src/libse/Common/Settings/BeautifyTimeCodesSettings.cs create mode 100644 src/libse/Common/Settings/CompareSettings.cs create mode 100644 src/libse/Common/Settings/FcpExportSettings.cs create mode 100644 src/libse/Common/Settings/FixCommonErrorsSettings.cs create mode 100644 src/libse/Common/Settings/GeneralSettings.cs create mode 100644 src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs create mode 100644 src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs create mode 100644 src/libse/Common/Settings/NetworkSettings.cs create mode 100644 src/libse/Common/Settings/ProxySettings.cs create mode 100644 src/libse/Common/Settings/RecentFileEntry.cs create mode 100644 src/libse/Common/Settings/RecentFilesSettings.cs create mode 100644 src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs rename src/libse/Common/{ => Settings}/Settings.cs (76%) create mode 100644 src/libse/Common/Settings/Shortcuts.cs create mode 100644 src/libse/Common/Settings/SubtitleBeaming.cs create mode 100644 src/libse/Common/Settings/SubtitleSettings.cs create mode 100644 src/libse/Common/Settings/ToolsSettings.cs create mode 100644 src/libse/Common/Settings/VerifyCompletenessSettings.cs create mode 100644 src/libse/Common/Settings/VideoControlsSettings.cs create mode 100644 src/libse/Common/Settings/VobSubOcrSettings.cs create mode 100644 src/libse/Common/Settings/WordListSettings.cs diff --git a/src/libse/Common/Settings/AssaStorageCategory.cs b/src/libse/Common/Settings/AssaStorageCategory.cs new file mode 100644 index 000000000..1b4ea681f --- /dev/null +++ b/src/libse/Common/Settings/AssaStorageCategory.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class AssaStorageCategory + { + public string Name { get; set; } + public bool IsDefault { get; set; } + public List Styles { get; set; } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/BeautifyTimeCodesSettings.cs b/src/libse/Common/Settings/BeautifyTimeCodesSettings.cs new file mode 100644 index 000000000..cb0e2d651 --- /dev/null +++ b/src/libse/Common/Settings/BeautifyTimeCodesSettings.cs @@ -0,0 +1,220 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class BeautifyTimeCodesSettings + { + public bool AlignTimeCodes { get; set; } + public bool ExtractExactTimeCodes { get; set; } + public bool SnapToShotChanges { get; set; } + public int OverlapThreshold { get; set; } + public BeautifyTimeCodesProfile Profile { get; set; } + + public BeautifyTimeCodesSettings() + { + AlignTimeCodes = true; + ExtractExactTimeCodes = false; + SnapToShotChanges = true; + OverlapThreshold = 1000; + Profile = new BeautifyTimeCodesProfile(); + } + + public class BeautifyTimeCodesProfile + { + // General + public int Gap { get; set; } + + // In cues + public int InCuesGap { get; set; } + public int InCuesLeftGreenZone { get; set; } + public int InCuesLeftRedZone { get; set; } + public int InCuesRightRedZone { get; set; } + public int InCuesRightGreenZone { get; set; } + + // Out cues + public int OutCuesGap { get; set; } + public int OutCuesLeftGreenZone { get; set; } + public int OutCuesLeftRedZone { get; set; } + public int OutCuesRightRedZone { get; set; } + public int OutCuesRightGreenZone { get; set; } + + // Connected subtitles + public int ConnectedSubtitlesInCueClosestLeftGap { get; set; } + public int ConnectedSubtitlesInCueClosestRightGap { get; set; } + public int ConnectedSubtitlesOutCueClosestLeftGap { get; set; } + public int ConnectedSubtitlesOutCueClosestRightGap { get; set; } + public int ConnectedSubtitlesLeftGreenZone { get; set; } + public int ConnectedSubtitlesLeftRedZone { get; set; } + public int ConnectedSubtitlesRightRedZone { get; set; } + public int ConnectedSubtitlesRightGreenZone { get; set; } + public int ConnectedSubtitlesTreatConnected { get; set; } + + // Chaining + public bool ChainingGeneralUseZones { get; set; } + public int ChainingGeneralMaxGap { get; set; } + public int ChainingGeneralLeftGreenZone { get; set; } + public int ChainingGeneralLeftRedZone { get; set; } + public ChainingShotChangeBehaviorEnum ChainingGeneralShotChangeBehavior { get; set; } + public bool ChainingInCueOnShotUseZones { get; set; } + public int ChainingInCueOnShotMaxGap { get; set; } + public int ChainingInCueOnShotLeftGreenZone { get; set; } + public int ChainingInCueOnShotLeftRedZone { get; set; } + public ChainingShotChangeBehaviorEnum ChainingInCueOnShotShotChangeBehavior { get; set; } + public bool ChainingInCueOnShotCheckGeneral { get; set; } + public bool ChainingOutCueOnShotUseZones { get; set; } + public int ChainingOutCueOnShotMaxGap { get; set; } + public int ChainingOutCueOnShotRightRedZone { get; set; } + public int ChainingOutCueOnShotRightGreenZone { get; set; } + public ChainingShotChangeBehaviorEnum ChainingOutCueOnShotShotChangeBehavior { get; set; } + public bool ChainingOutCueOnShotCheckGeneral { get; set; } + + public enum Preset : int + { + Default = 0, + Netflix = 1, + SDI = 2, + } + + public enum ChainingShotChangeBehaviorEnum : int + { + DontChain = 0, + ExtendCrossingShotChange = 1, + ExtendUntilShotChange = 2 + } + + public BeautifyTimeCodesProfile(Preset preset = Preset.Default) + { + switch (preset) + { + case Preset.Netflix: + Gap = 2; + + InCuesGap = 0; + InCuesLeftGreenZone = 12; + InCuesLeftRedZone = 7; + InCuesRightRedZone = 7; + InCuesRightGreenZone = 12; + + OutCuesGap = 2; + OutCuesLeftGreenZone = 12; + OutCuesLeftRedZone = 7; + OutCuesRightRedZone = 7; + OutCuesRightGreenZone = 12; + + ConnectedSubtitlesInCueClosestLeftGap = 2; + ConnectedSubtitlesInCueClosestRightGap = 0; + ConnectedSubtitlesOutCueClosestLeftGap = 2; + ConnectedSubtitlesOutCueClosestRightGap = 0; + ConnectedSubtitlesLeftGreenZone = 12; + ConnectedSubtitlesLeftRedZone = 7; + ConnectedSubtitlesRightRedZone = 7; + ConnectedSubtitlesRightGreenZone = 12; + ConnectedSubtitlesTreatConnected = 180; + + ChainingGeneralUseZones = false; + ChainingGeneralMaxGap = 500; + ChainingGeneralLeftGreenZone = 12; + ChainingGeneralLeftRedZone = 11; + ChainingGeneralShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; + ChainingInCueOnShotUseZones = false; + ChainingInCueOnShotMaxGap = 500; + ChainingInCueOnShotLeftGreenZone = 12; + ChainingInCueOnShotLeftRedZone = 11; + ChainingInCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; + ChainingInCueOnShotCheckGeneral = true; + ChainingOutCueOnShotUseZones = false; + ChainingOutCueOnShotMaxGap = 500; + ChainingOutCueOnShotRightRedZone = 11; + ChainingOutCueOnShotRightGreenZone = 12; + ChainingOutCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; + ChainingOutCueOnShotCheckGeneral = true; + break; + case Preset.SDI: + Gap = 4; + + InCuesGap = 2; + InCuesLeftGreenZone = 12; + InCuesLeftRedZone = 7; + InCuesRightRedZone = 7; + InCuesRightGreenZone = 12; + + OutCuesGap = 2; + OutCuesLeftGreenZone = 12; + OutCuesLeftRedZone = 7; + OutCuesRightRedZone = 7; + OutCuesRightGreenZone = 12; + + ConnectedSubtitlesInCueClosestLeftGap = 2; + ConnectedSubtitlesInCueClosestRightGap = 2; + ConnectedSubtitlesOutCueClosestLeftGap = 2; + ConnectedSubtitlesOutCueClosestRightGap = 2; + ConnectedSubtitlesLeftGreenZone = 12; + ConnectedSubtitlesLeftRedZone = 7; + ConnectedSubtitlesRightRedZone = 7; + ConnectedSubtitlesRightGreenZone = 12; + ConnectedSubtitlesTreatConnected = 240; + + ChainingGeneralUseZones = false; + ChainingGeneralMaxGap = 1000; + ChainingGeneralLeftGreenZone = 25; + ChainingGeneralLeftRedZone = 24; + ChainingGeneralShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendCrossingShotChange; + ChainingInCueOnShotUseZones = false; + ChainingInCueOnShotMaxGap = 1000; + ChainingInCueOnShotLeftGreenZone = 25; + ChainingInCueOnShotLeftRedZone = 24; + ChainingInCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendCrossingShotChange; + ChainingInCueOnShotCheckGeneral = true; + ChainingOutCueOnShotUseZones = true; + ChainingOutCueOnShotMaxGap = 500; + ChainingOutCueOnShotRightRedZone = 7; + ChainingOutCueOnShotRightGreenZone = 12; + ChainingOutCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendCrossingShotChange; + ChainingOutCueOnShotCheckGeneral = true; + break; + default: + Gap = 3; + + InCuesGap = 0; + InCuesLeftGreenZone = 3; + InCuesLeftRedZone = 3; + InCuesRightRedZone = 5; + InCuesRightGreenZone = 5; + + OutCuesGap = 0; + OutCuesLeftGreenZone = 10; + OutCuesLeftRedZone = 10; + OutCuesRightRedZone = 3; + OutCuesRightGreenZone = 12; + + ConnectedSubtitlesInCueClosestLeftGap = 3; + ConnectedSubtitlesInCueClosestRightGap = 0; + ConnectedSubtitlesOutCueClosestLeftGap = 0; + ConnectedSubtitlesOutCueClosestRightGap = 3; + ConnectedSubtitlesLeftGreenZone = 3; + ConnectedSubtitlesLeftRedZone = 3; + ConnectedSubtitlesRightRedZone = 3; + ConnectedSubtitlesRightGreenZone = 3; + ConnectedSubtitlesTreatConnected = 180; + + ChainingGeneralUseZones = false; + ChainingGeneralMaxGap = 1000; + ChainingGeneralLeftGreenZone = 25; + ChainingGeneralLeftRedZone = 24; + ChainingGeneralShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; + ChainingInCueOnShotUseZones = false; + ChainingInCueOnShotMaxGap = 1000; + ChainingInCueOnShotLeftGreenZone = 25; + ChainingInCueOnShotLeftRedZone = 24; + ChainingInCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; + ChainingInCueOnShotCheckGeneral = true; + ChainingOutCueOnShotUseZones = false; + ChainingOutCueOnShotMaxGap = 500; + ChainingOutCueOnShotRightRedZone = 11; + ChainingOutCueOnShotRightGreenZone = 12; + ChainingOutCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; + ChainingOutCueOnShotCheckGeneral = true; + break; + } + } + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/CompareSettings.cs b/src/libse/Common/Settings/CompareSettings.cs new file mode 100644 index 000000000..ac68f050f --- /dev/null +++ b/src/libse/Common/Settings/CompareSettings.cs @@ -0,0 +1,16 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class CompareSettings + { + public bool ShowOnlyDifferences { get; set; } + public bool OnlyLookForDifferenceInText { get; set; } + public bool IgnoreLineBreaks { get; set; } + public bool IgnoreWhitespace { get; set; } + public bool IgnoreFormatting { get; set; } + + public CompareSettings() + { + OnlyLookForDifferenceInText = true; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/FcpExportSettings.cs b/src/libse/Common/Settings/FcpExportSettings.cs new file mode 100644 index 000000000..d2fbbc485 --- /dev/null +++ b/src/libse/Common/Settings/FcpExportSettings.cs @@ -0,0 +1,22 @@ +using System.Drawing; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class FcpExportSettings + { + public string FontName { get; set; } + public int FontSize { get; set; } + public string Alignment { get; set; } + public int Baseline { get; set; } + public Color Color { get; set; } + + public FcpExportSettings() + { + FontName = "Lucida Sans"; + FontSize = 36; + Alignment = "center"; + Baseline = 29; + Color = Color.WhiteSmoke; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/FixCommonErrorsSettings.cs b/src/libse/Common/Settings/FixCommonErrorsSettings.cs new file mode 100644 index 000000000..17633cd8a --- /dev/null +++ b/src/libse/Common/Settings/FixCommonErrorsSettings.cs @@ -0,0 +1,340 @@ +using System.Linq; +using System.Text; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class FixCommonErrorsSettings + { + public string StartPosition { get; set; } + public string StartSize { get; set; } + public bool EmptyLinesTicked { get; set; } + public bool OverlappingDisplayTimeTicked { get; set; } + public bool TooShortDisplayTimeTicked { get; set; } + public bool TooLongDisplayTimeTicked { get; set; } + public bool TooShortGapTicked { get; set; } + public bool InvalidItalicTagsTicked { get; set; } + public bool BreakLongLinesTicked { get; set; } + public bool MergeShortLinesTicked { get; set; } + public bool MergeShortLinesAllTicked { get; set; } + public bool MergeShortLinesPixelWidthTicked { get; set; } + public bool UnneededSpacesTicked { get; set; } + public bool UnneededPeriodsTicked { get; set; } + public bool FixCommasTicked { get; set; } + public bool MissingSpacesTicked { get; set; } + public bool AddMissingQuotesTicked { get; set; } + public bool Fix3PlusLinesTicked { get; set; } + public bool FixHyphensTicked { get; set; } + public bool FixHyphensRemoveSingleLineTicked { get; set; } + public bool UppercaseIInsideLowercaseWordTicked { get; set; } + public bool DoubleApostropheToQuoteTicked { get; set; } + public bool AddPeriodAfterParagraphTicked { get; set; } + public bool StartWithUppercaseLetterAfterParagraphTicked { get; set; } + public bool StartWithUppercaseLetterAfterPeriodInsideParagraphTicked { get; set; } + public bool StartWithUppercaseLetterAfterColonTicked { get; set; } + public bool AloneLowercaseIToUppercaseIEnglishTicked { get; set; } + public bool FixOcrErrorsViaReplaceListTicked { get; set; } + public bool RemoveSpaceBetweenNumberTicked { get; set; } + public bool FixDialogsOnOneLineTicked { get; set; } + public bool RemoveDialogFirstLineInNonDialogs { get; set; } + public bool TurkishAnsiTicked { get; set; } + public bool DanishLetterITicked { get; set; } + public bool SpanishInvertedQuestionAndExclamationMarksTicked { get; set; } + public bool FixDoubleDashTicked { get; set; } + public bool FixDoubleGreaterThanTicked { get; set; } + public bool FixEllipsesStartTicked { get; set; } + public bool FixMissingOpenBracketTicked { get; set; } + public bool FixMusicNotationTicked { get; set; } + public bool FixContinuationStyleTicked { get; set; } + public bool FixUnnecessaryLeadingDotsTicked { get; set; } + public bool NormalizeStringsTicked { get; set; } + public string DefaultFixes { get; set; } + + + public FixCommonErrorsSettings() + { + SetDefaultFixes(); + } + + public void SaveUserDefaultFixes() + { + var sb = new StringBuilder(); + + if (EmptyLinesTicked) + { + sb.Append(nameof(EmptyLinesTicked) + ";"); + } + + if (OverlappingDisplayTimeTicked) + { + sb.Append(nameof(OverlappingDisplayTimeTicked) + ";"); + } + + if (TooShortDisplayTimeTicked) + { + sb.Append(nameof(TooShortDisplayTimeTicked) + ";"); + } + + if (TooLongDisplayTimeTicked) + { + sb.Append(nameof(TooLongDisplayTimeTicked) + ";"); + } + + if (TooShortGapTicked) + { + sb.Append(nameof(TooShortGapTicked) + ";"); + } + + if (InvalidItalicTagsTicked) + { + sb.Append(nameof(InvalidItalicTagsTicked) + ";"); + } + + if (BreakLongLinesTicked) + { + sb.Append(nameof(BreakLongLinesTicked) + ";"); + } + + if (MergeShortLinesTicked) + { + sb.Append(nameof(MergeShortLinesTicked) + ";"); + } + + if (MergeShortLinesAllTicked) + { + sb.Append(nameof(MergeShortLinesAllTicked) + ";"); + } + + if (MergeShortLinesPixelWidthTicked) + { + sb.Append(nameof(MergeShortLinesPixelWidthTicked) + ";"); + } + + if (UnneededSpacesTicked) + { + sb.Append(nameof(UnneededSpacesTicked) + ";"); + } + + if (UnneededPeriodsTicked) + { + sb.Append(nameof(UnneededPeriodsTicked) + ";"); + } + + if (FixCommasTicked) + { + sb.Append(nameof(FixCommasTicked) + ";"); + } + + if (MissingSpacesTicked) + { + sb.Append(nameof(MissingSpacesTicked) + ";"); + } + + if (AddMissingQuotesTicked) + { + sb.Append(nameof(AddMissingQuotesTicked) + ";"); + } + + if (Fix3PlusLinesTicked) + { + sb.Append(nameof(Fix3PlusLinesTicked) + ";"); + } + + if (FixHyphensTicked) + { + sb.Append(nameof(FixHyphensTicked) + ";"); + } + + if (FixHyphensRemoveSingleLineTicked) + { + sb.Append(nameof(FixHyphensRemoveSingleLineTicked) + ";"); + } + + if (UppercaseIInsideLowercaseWordTicked) + { + sb.Append(nameof(UppercaseIInsideLowercaseWordTicked) + ";"); + } + + if (DoubleApostropheToQuoteTicked) + { + sb.Append(nameof(DoubleApostropheToQuoteTicked) + ";"); + } + + if (AddPeriodAfterParagraphTicked) + { + sb.Append(nameof(AddPeriodAfterParagraphTicked) + ";"); + } + + if (StartWithUppercaseLetterAfterParagraphTicked) + { + sb.Append(nameof(StartWithUppercaseLetterAfterParagraphTicked) + ";"); + } + + if (StartWithUppercaseLetterAfterPeriodInsideParagraphTicked) + { + sb.Append(nameof(StartWithUppercaseLetterAfterPeriodInsideParagraphTicked) + ";"); + } + + if (StartWithUppercaseLetterAfterColonTicked) + { + sb.Append(nameof(StartWithUppercaseLetterAfterColonTicked) + ";"); + } + + if (AloneLowercaseIToUppercaseIEnglishTicked) + { + sb.Append(nameof(AloneLowercaseIToUppercaseIEnglishTicked) + ";"); + } + + if (FixOcrErrorsViaReplaceListTicked) + { + sb.Append(nameof(FixOcrErrorsViaReplaceListTicked) + ";"); + } + + if (RemoveSpaceBetweenNumberTicked) + { + sb.Append(nameof(RemoveSpaceBetweenNumberTicked) + ";"); + } + + if (FixDialogsOnOneLineTicked) + { + sb.Append(nameof(FixDialogsOnOneLineTicked) + ";"); + } + + if (RemoveDialogFirstLineInNonDialogs) + { + sb.Append(nameof(RemoveDialogFirstLineInNonDialogs) + ";"); + } + + if (TurkishAnsiTicked) + { + sb.Append(nameof(TurkishAnsiTicked) + ";"); + } + + if (DanishLetterITicked) + { + sb.Append(nameof(DanishLetterITicked) + ";"); + } + + if (SpanishInvertedQuestionAndExclamationMarksTicked) + { + sb.Append(nameof(SpanishInvertedQuestionAndExclamationMarksTicked) + ";"); + } + + if (FixDoubleDashTicked) + { + sb.Append(nameof(FixDoubleDashTicked) + ";"); + } + + if (FixEllipsesStartTicked) + { + sb.Append(nameof(FixEllipsesStartTicked) + ";"); + } + + if (FixMissingOpenBracketTicked) + { + sb.Append(nameof(FixMissingOpenBracketTicked) + ";"); + } + + if (FixMusicNotationTicked) + { + sb.Append(nameof(FixMusicNotationTicked) + ";"); + } + + if (FixContinuationStyleTicked) + { + sb.Append(nameof(FixContinuationStyleTicked) + ";"); + } + + if (FixUnnecessaryLeadingDotsTicked) + { + sb.Append(nameof(FixUnnecessaryLeadingDotsTicked) + ";"); + } + + if (NormalizeStringsTicked) + { + sb.Append(nameof(NormalizeStringsTicked) + ";"); + } + + DefaultFixes = sb.ToString().TrimEnd(';'); + } + + public void LoadUserDefaultFixes(string fixes) + { + var list = fixes.Split(';'); + EmptyLinesTicked = list.Contains(nameof(EmptyLinesTicked)); + OverlappingDisplayTimeTicked = list.Contains(nameof(OverlappingDisplayTimeTicked)); + TooShortDisplayTimeTicked = list.Contains(nameof(TooShortDisplayTimeTicked)); + TooLongDisplayTimeTicked = list.Contains(nameof(TooLongDisplayTimeTicked)); + TooShortGapTicked = list.Contains(nameof(TooShortGapTicked)); + InvalidItalicTagsTicked = list.Contains(nameof(InvalidItalicTagsTicked)); + BreakLongLinesTicked = list.Contains(nameof(BreakLongLinesTicked)); + MergeShortLinesTicked = list.Contains(nameof(MergeShortLinesTicked)); + MergeShortLinesAllTicked = list.Contains(nameof(MergeShortLinesAllTicked)); + MergeShortLinesPixelWidthTicked = list.Contains(nameof(MergeShortLinesPixelWidthTicked)); + UnneededSpacesTicked = list.Contains(nameof(UnneededSpacesTicked)); + UnneededPeriodsTicked = list.Contains(nameof(UnneededPeriodsTicked)); + FixCommasTicked = list.Contains(nameof(FixCommasTicked)); + MissingSpacesTicked = list.Contains(nameof(MissingSpacesTicked)); + AddMissingQuotesTicked = list.Contains(nameof(AddMissingQuotesTicked)); + Fix3PlusLinesTicked = list.Contains(nameof(Fix3PlusLinesTicked)); + FixHyphensTicked = list.Contains(nameof(FixHyphensTicked)); + FixHyphensRemoveSingleLineTicked = list.Contains(nameof(FixHyphensRemoveSingleLineTicked)); + UppercaseIInsideLowercaseWordTicked = list.Contains(nameof(UppercaseIInsideLowercaseWordTicked)); + DoubleApostropheToQuoteTicked = list.Contains(nameof(DoubleApostropheToQuoteTicked)); + AddPeriodAfterParagraphTicked = list.Contains(nameof(AddPeriodAfterParagraphTicked)); + StartWithUppercaseLetterAfterParagraphTicked = list.Contains(nameof(StartWithUppercaseLetterAfterParagraphTicked)); + StartWithUppercaseLetterAfterPeriodInsideParagraphTicked = list.Contains(nameof(StartWithUppercaseLetterAfterPeriodInsideParagraphTicked)); + StartWithUppercaseLetterAfterColonTicked = list.Contains(nameof(StartWithUppercaseLetterAfterColonTicked)); + AloneLowercaseIToUppercaseIEnglishTicked = list.Contains(nameof(AloneLowercaseIToUppercaseIEnglishTicked)); + FixOcrErrorsViaReplaceListTicked = list.Contains(nameof(FixOcrErrorsViaReplaceListTicked)); + RemoveSpaceBetweenNumberTicked = list.Contains(nameof(RemoveSpaceBetweenNumberTicked)); + FixDialogsOnOneLineTicked = list.Contains(nameof(FixDialogsOnOneLineTicked)); + RemoveDialogFirstLineInNonDialogs = list.Contains(nameof(RemoveDialogFirstLineInNonDialogs)); + TurkishAnsiTicked = list.Contains(nameof(TurkishAnsiTicked)); + DanishLetterITicked = list.Contains(nameof(DanishLetterITicked)); + SpanishInvertedQuestionAndExclamationMarksTicked = list.Contains(nameof(SpanishInvertedQuestionAndExclamationMarksTicked)); + FixDoubleDashTicked = list.Contains(nameof(FixDoubleDashTicked)); + FixEllipsesStartTicked = list.Contains(nameof(FixEllipsesStartTicked)); + FixMissingOpenBracketTicked = list.Contains(nameof(FixMissingOpenBracketTicked)); + FixMusicNotationTicked = list.Contains(nameof(FixMusicNotationTicked)); + FixContinuationStyleTicked = list.Contains(nameof(FixContinuationStyleTicked)); + FixUnnecessaryLeadingDotsTicked = list.Contains(nameof(FixUnnecessaryLeadingDotsTicked)); + NormalizeStringsTicked = list.Contains(nameof(NormalizeStringsTicked)); + } + + public void SetDefaultFixes() + { + LoadUserDefaultFixes(string.Empty); + EmptyLinesTicked = true; + OverlappingDisplayTimeTicked = true; + TooShortDisplayTimeTicked = true; + TooLongDisplayTimeTicked = true; + TooShortGapTicked = false; + InvalidItalicTagsTicked = true; + BreakLongLinesTicked = true; + MergeShortLinesTicked = true; + MergeShortLinesPixelWidthTicked = false; + UnneededPeriodsTicked = true; + FixCommasTicked = true; + UnneededSpacesTicked = true; + MissingSpacesTicked = true; + UppercaseIInsideLowercaseWordTicked = true; + DoubleApostropheToQuoteTicked = true; + AddPeriodAfterParagraphTicked = false; + StartWithUppercaseLetterAfterParagraphTicked = true; + StartWithUppercaseLetterAfterPeriodInsideParagraphTicked = false; + StartWithUppercaseLetterAfterColonTicked = false; + AloneLowercaseIToUppercaseIEnglishTicked = false; + TurkishAnsiTicked = false; + DanishLetterITicked = false; + FixDoubleDashTicked = true; + FixDoubleGreaterThanTicked = true; + FixEllipsesStartTicked = true; + FixMissingOpenBracketTicked = true; + FixMusicNotationTicked = true; + FixContinuationStyleTicked = false; + FixUnnecessaryLeadingDotsTicked = true; + NormalizeStringsTicked = false; + SaveUserDefaultFixes(); + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/GeneralSettings.cs b/src/libse/Common/Settings/GeneralSettings.cs new file mode 100644 index 000000000..cdad4897e --- /dev/null +++ b/src/libse/Common/Settings/GeneralSettings.cs @@ -0,0 +1,835 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using Nikse.SubtitleEdit.Core.Common.TextLengthCalculator; +using Nikse.SubtitleEdit.Core.Enums; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class GeneralSettings + { + public List Profiles { get; set; } + public string CurrentProfile { get; set; } + public bool ShowToolbarNew { get; set; } + public bool ShowToolbarOpen { get; set; } + public bool ShowToolbarOpenVideo { get; set; } + public bool ShowToolbarSave { get; set; } + public bool ShowToolbarSaveAs { get; set; } + public bool ShowToolbarFind { get; set; } + public bool ShowToolbarReplace { get; set; } + public bool ShowToolbarFixCommonErrors { get; set; } + public bool ShowToolbarRemoveTextForHi { get; set; } + public bool ShowToolbarToggleSourceView { get; set; } + public bool ShowToolbarVisualSync { get; set; } + public bool ShowToolbarBurnIn { get; set; } + public bool ShowToolbarSpellCheck { get; set; } + public bool ShowToolbarNetflixGlyphCheck { get; set; } + public bool ShowToolbarBeautifyTimeCodes { get; set; } + public bool ShowToolbarSettings { get; set; } + public bool ShowToolbarHelp { get; set; } + + public int LayoutNumber { get; set; } + public string LayoutSizes { get; set; } + public bool ShowVideoPlayer { get; set; } + public bool ShowAudioVisualizer { get; set; } + public bool ShowWaveform { get; set; } + public bool ShowSpectrogram { get; set; } + public bool ShowFrameRate { get; set; } + public bool ShowVideoControls { get; set; } + public bool TextAndOrigianlTextBoxesSwitched { get; set; } + public double DefaultFrameRate { get; set; } + public double CurrentFrameRate { get; set; } + public string DefaultSubtitleFormat { get; set; } + public string DefaultSaveAsFormat { get; set; } + public string FavoriteSubtitleFormats { get; set; } + public string DefaultEncoding { get; set; } + public bool AutoConvertToUtf8 { get; set; } + public bool AutoGuessAnsiEncoding { get; set; } + public string TranslationAutoSuffixes { get; set; } + public string TranslationAutoSuffixDefault { get; set; } + public string SystemSubtitleFontNameOverride { get; set; } + public int SystemSubtitleFontSizeOverride { get; set; } + + public string SubtitleFontName { get; set; } + public int SubtitleTextBoxFontSize { get; set; } + public bool SubtitleTextBoxSyntaxColor { get; set; } + public Color SubtitleTextBoxHtmlColor { get; set; } + public Color SubtitleTextBoxAssColor { get; set; } + public int SubtitleListViewFontSize { get; set; } + public bool SubtitleTextBoxFontBold { get; set; } + public bool SubtitleListViewFontBold { get; set; } + public Color SubtitleFontColor { get; set; } + public Color SubtitleBackgroundColor { get; set; } + public string MeasureFontName { get; set; } + public int MeasureFontSize { get; set; } + public bool MeasureFontBold { get; set; } + public int SubtitleLineMaximumPixelWidth { get; set; } + public bool CenterSubtitleInTextBox { get; set; } + public bool ShowRecentFiles { get; set; } + public bool RememberSelectedLine { get; set; } + public bool StartLoadLastFile { get; set; } + public bool StartRememberPositionAndSize { get; set; } + public string StartPosition { get; set; } + public string StartSize { get; set; } + public bool StartInSourceView { get; set; } + public bool RemoveBlankLinesWhenOpening { get; set; } + public bool RemoveBadCharsWhenOpening { get; set; } + public int SubtitleLineMaximumLength { get; set; } + public int MaxNumberOfLines { get; set; } + public int MaxNumberOfLinesPlusAbort { get; set; } + public int MergeLinesShorterThan { get; set; } + public int SubtitleMinimumDisplayMilliseconds { get; set; } + public int SubtitleMaximumDisplayMilliseconds { get; set; } + public int MinimumMillisecondsBetweenLines { get; set; } + public int SetStartEndHumanDelay { get; set; } + public bool AutoWrapLineWhileTyping { get; set; } + public double SubtitleMaximumCharactersPerSeconds { get; set; } + public double SubtitleOptimalCharactersPerSeconds { get; set; } + public string CpsLineLengthStrategy { get; set; } + public double SubtitleMaximumWordsPerMinute { get; set; } + public DialogType DialogStyle { get; set; } + public ContinuationStyle ContinuationStyle { get; set; } + public int ContinuationPause { get; set; } + public string CustomContinuationStyleSuffix { get; set; } + public bool CustomContinuationStyleSuffixApplyIfComma { get; set; } + public bool CustomContinuationStyleSuffixAddSpace { get; set; } + public bool CustomContinuationStyleSuffixReplaceComma { get; set; } + public string CustomContinuationStylePrefix { get; set; } + public bool CustomContinuationStylePrefixAddSpace { get; set; } + public bool CustomContinuationStyleUseDifferentStyleGap { get; set; } + public string CustomContinuationStyleGapSuffix { get; set; } + public bool CustomContinuationStyleGapSuffixApplyIfComma { get; set; } + public bool CustomContinuationStyleGapSuffixAddSpace { get; set; } + public bool CustomContinuationStyleGapSuffixReplaceComma { get; set; } + public string CustomContinuationStyleGapPrefix { get; set; } + public bool CustomContinuationStyleGapPrefixAddSpace { get; set; } + public bool FixContinuationStyleUncheckInsertsAllCaps { get; set; } + public bool FixContinuationStyleUncheckInsertsItalic { get; set; } + public bool FixContinuationStyleUncheckInsertsLowercase { get; set; } + public bool FixContinuationStyleHideContinuationCandidatesWithoutName { get; set; } + public bool FixContinuationStyleIgnoreLyrics { get; set; } + public string SpellCheckLanguage { get; set; } + public string VideoPlayer { get; set; } + public int VideoPlayerDefaultVolume { get; set; } + public string VideoPlayerPreviewFontName { get; set; } + public int VideoPlayerPreviewFontSize { get; set; } + public bool VideoPlayerPreviewFontBold { get; set; } + public bool VideoPlayerShowStopButton { get; set; } + public bool VideoPlayerShowFullscreenButton { get; set; } + public bool VideoPlayerShowMuteButton { get; set; } + public string Language { get; set; } + public string ListViewLineSeparatorString { get; set; } + public int ListViewDoubleClickAction { get; set; } + public string SaveAsUseFileNameFrom { get; set; } + public string UppercaseLetters { get; set; } + public int DefaultAdjustMilliseconds { get; set; } + public bool AutoRepeatOn { get; set; } + public int AutoRepeatCount { get; set; } + public bool AutoContinueOn { get; set; } + public int AutoContinueDelay { get; set; } + public bool ReturnToStartAfterRepeat { get; set; } + public bool SyncListViewWithVideoWhilePlaying { get; set; } + public int AutoBackupSeconds { get; set; } + public int AutoBackupDeleteAfterMonths { get; set; } + public string SpellChecker { get; set; } + public bool AllowEditOfOriginalSubtitle { get; set; } + public bool PromptDeleteLines { get; set; } + public bool Undocked { get; set; } + public string UndockedVideoPosition { get; set; } + public bool UndockedVideoFullscreen { get; set; } + public string UndockedWaveformPosition { get; set; } + public string UndockedVideoControlsPosition { get; set; } + public bool WaveformCenter { get; set; } + public bool WaveformAutoGenWhenOpeningVideo { get; set; } + public int WaveformUpdateIntervalMs { get; set; } + public int SmallDelayMilliseconds { get; set; } + public int LargeDelayMilliseconds { get; set; } + public bool ShowOriginalAsPreviewIfAvailable { get; set; } + public int LastPacCodePage { get; set; } + public string OpenSubtitleExtraExtensions { get; set; } + public bool ListViewColumnsRememberSize { get; set; } + + public int ListViewNumberWidth { get; set; } + public int ListViewStartWidth { get; set; } + public int ListViewEndWidth { get; set; } + public int ListViewDurationWidth { get; set; } + public int ListViewCpsWidth { get; set; } + public int ListViewWpmWidth { get; set; } + public int ListViewGapWidth { get; set; } + public int ListViewActorWidth { get; set; } + public int ListViewRegionWidth { get; set; } + public int ListViewTextWidth { get; set; } + + public int ListViewNumberDisplayIndex { get; set; } = -1; + public int ListViewStartDisplayIndex { get; set; } = -1; + public int ListViewEndDisplayIndex { get; set; } = -1; + public int ListViewDurationDisplayIndex { get; set; } = -1; + public int ListViewCpsDisplayIndex { get; set; } = -1; + public int ListViewWpmDisplayIndex { get; set; } = -1; + public int ListViewGapDisplayIndex { get; set; } = -1; + public int ListViewActorDisplayIndex { get; set; } = -1; + public int ListViewRegionDisplayIndex { get; set; } = -1; + public int ListViewTextDisplayIndex { get; set; } = -1; + + public bool DirectShowDoubleLoad { get; set; } + public string VlcWaveTranscodeSettings { get; set; } + public string VlcLocation { get; set; } + public string VlcLocationRelative { get; set; } + public string MpvVideoOutputWindows { get; set; } + public string MpvVideoOutputLinux { get; set; } + public string MpvVideoVf { get; set; } + public string MpvVideoAf { get; set; } + public string MpvExtraOptions { get; set; } + public bool MpvLogging { get; set; } + public bool MpvHandlesPreviewText { get; set; } + public Color MpvPreviewTextPrimaryColor { get; set; } + public Color MpvPreviewTextOutlineColor { get; set; } + public Color MpvPreviewTextBackgroundColor { get; set; } + public decimal MpvPreviewTextOutlineWidth { get; set; } + public decimal MpvPreviewTextShadowWidth { get; set; } + public bool MpvPreviewTextOpaqueBox { get; set; } + public string MpvPreviewTextOpaqueBoxStyle { get; set; } + public string MpvPreviewTextAlignment { get; set; } + public int MpvPreviewTextMarginVertical { get; set; } + public string MpcHcLocation { get; set; } + public string MkvMergeLocation { get; set; } + public bool UseFFmpegForWaveExtraction { get; set; } + public bool FFmpegUseCenterChannelOnly { get; set; } + public string FFmpegLocation { get; set; } + public string FFmpegSceneThreshold { get; set; } + public bool UseTimeFormatHHMMSSFF { get; set; } + public int SplitBehavior { get; set; } + public bool SplitRemovesDashes { get; set; } + public int ClearStatusBarAfterSeconds { get; set; } + public string Company { get; set; } + public bool MoveVideo100Or500MsPlaySmallSample { get; set; } + public bool DisableVideoAutoLoading { get; set; } + public bool DisableShowingLoadErrors { get; set; } + public bool AllowVolumeBoost { get; set; } + public int NewEmptyDefaultMs { get; set; } + public bool NewEmptyUseAutoDuration { get; set; } + public bool RightToLeftMode { get; set; } + public string LastSaveAsFormat { get; set; } + public bool CheckForUpdates { get; set; } + public DateTime LastCheckForUpdates { get; set; } + public bool AutoSave { get; set; } + public string PreviewAssaText { get; set; } + public string TagsInToggleHiTags { get; set; } + public string TagsInToggleCustomTags { get; set; } + public bool ShowProgress { get; set; } + public bool ShowNegativeDurationInfoOnSave { get; set; } + public bool ShowFormatRequiresUtf8Warning { get; set; } + public long DefaultVideoOffsetInMs { get; set; } + public string DefaultVideoOffsetInMsList { get; set; } + public long CurrentVideoOffsetInMs { get; set; } + public bool CurrentVideoIsSmpte { get; set; } + public bool AutoSetVideoSmpteForTtml { get; set; } + public bool AutoSetVideoSmpteForTtmlPrompt { get; set; } + public string TitleBarAsterisk { get; set; } // Show asteriks "before" or "after" file name (any other value will hide asteriks) + public bool TitleBarFullFileName { get; set; } // Show full file name with path or just file name + public bool MeasurementConverterCloseOnInsert { get; set; } + public string MeasurementConverterCategories { get; set; } + public bool SubtitleTextBoxAutoVerticalScrollBars { get; set; } + public int SubtitleTextBoxMaxHeight { get; set; } + public bool AllowLetterShortcutsInTextBox { get; set; } + public Color DarkThemeForeColor { get; set; } + public Color DarkThemeBackColor { get; set; } + public Color DarkThemeSelectedBackgroundColor { get; set; } + public Color DarkThemeDisabledColor { get; set; } + public Color LastColorPickerColor { get; set; } + public Color LastColorPickerColor1 { get; set; } + public Color LastColorPickerColor2 { get; set; } + public Color LastColorPickerColor3 { get; set; } + public Color LastColorPickerColor4 { get; set; } + public Color LastColorPickerColor5 { get; set; } + public Color LastColorPickerColor6 { get; set; } + public Color LastColorPickerColor7 { get; set; } + public Color LastColorPickerDropper { get; set; } + public string ToolbarIconTheme { get; set; } + public bool UseDarkTheme { get; set; } + public bool DarkThemeShowListViewGridLines { get; set; } + public bool ShowBetaStuff { get; set; } + public bool DebugTranslationSync { get; set; } + public bool UseLegacyDownloader { get; set; } + public bool UseLegacyHtmlColor { get; set; } = true; + public string DefaultLanguages { get; set; } + + public GeneralSettings() + { + ShowToolbarNew = true; + ShowToolbarOpen = true; + ShowToolbarSave = true; + ShowToolbarSaveAs = false; + ShowToolbarFind = true; + ShowToolbarReplace = true; + ShowToolbarFixCommonErrors = false; + ShowToolbarVisualSync = true; + ShowToolbarSpellCheck = true; + ShowToolbarNetflixGlyphCheck = true; + ShowToolbarBeautifyTimeCodes = false; + ShowToolbarSettings = true; + ShowToolbarHelp = true; + ShowToolbarToggleSourceView = false; + ShowVideoPlayer = true; + ShowAudioVisualizer = true; + ShowWaveform = true; + ShowSpectrogram = true; + ShowFrameRate = false; + ShowVideoControls = true; + DefaultFrameRate = 23.976; + CurrentFrameRate = DefaultFrameRate; + SubtitleFontName = "Tahoma"; + SubtitleTextBoxFontSize = 12; + SubtitleListViewFontSize = 10; + SubtitleTextBoxSyntaxColor = false; + SubtitleTextBoxHtmlColor = Color.CornflowerBlue; + SubtitleTextBoxAssColor = Color.BlueViolet; + SubtitleTextBoxFontBold = true; + SubtitleFontColor = Color.Black; + MeasureFontName = "Arial"; + MeasureFontSize = 24; + MeasureFontBold = false; + SubtitleLineMaximumPixelWidth = 576; + SubtitleBackgroundColor = Color.White; + CenterSubtitleInTextBox = false; + DefaultSubtitleFormat = "SubRip"; + DefaultEncoding = TextEncoding.Utf8WithBom; + AutoConvertToUtf8 = false; + AutoGuessAnsiEncoding = true; + TranslationAutoSuffixes = ";.translation;_translation;.en;_en"; + TranslationAutoSuffixDefault = ""; + ShowRecentFiles = true; + RememberSelectedLine = true; + StartLoadLastFile = true; + StartRememberPositionAndSize = true; + SubtitleLineMaximumLength = 43; + MaxNumberOfLines = 2; + MaxNumberOfLinesPlusAbort = 1; + MergeLinesShorterThan = 33; + SubtitleMinimumDisplayMilliseconds = 1000; + SubtitleMaximumDisplayMilliseconds = 8 * 1000; + RemoveBadCharsWhenOpening = true; + MinimumMillisecondsBetweenLines = 24; + SetStartEndHumanDelay = 100; + AutoWrapLineWhileTyping = false; + SubtitleMaximumCharactersPerSeconds = 25.0; + SubtitleOptimalCharactersPerSeconds = 15.0; + SubtitleMaximumWordsPerMinute = 400; + DialogStyle = DialogType.DashBothLinesWithSpace; + ContinuationStyle = ContinuationStyle.None; + ContinuationPause = 300; + CustomContinuationStyleSuffix = ""; + CustomContinuationStyleSuffixApplyIfComma = false; + CustomContinuationStyleSuffixAddSpace = false; + CustomContinuationStyleSuffixReplaceComma = false; + CustomContinuationStylePrefix = ""; + CustomContinuationStylePrefixAddSpace = false; + CustomContinuationStyleUseDifferentStyleGap = true; + CustomContinuationStyleGapSuffix = "..."; + CustomContinuationStyleGapSuffixApplyIfComma = true; + CustomContinuationStyleGapSuffixAddSpace = false; + CustomContinuationStyleGapSuffixReplaceComma = true; + CustomContinuationStyleGapPrefix = "..."; + CustomContinuationStyleGapPrefixAddSpace = false; + FixContinuationStyleUncheckInsertsAllCaps = true; + FixContinuationStyleUncheckInsertsItalic = true; + FixContinuationStyleUncheckInsertsLowercase = true; + FixContinuationStyleHideContinuationCandidatesWithoutName = true; + FixContinuationStyleIgnoreLyrics = true; + SpellCheckLanguage = null; + VideoPlayer = string.Empty; + VideoPlayerDefaultVolume = 75; + VideoPlayerPreviewFontName = "Tahoma"; + VideoPlayerPreviewFontSize = 12; + VideoPlayerPreviewFontBold = true; + VideoPlayerShowStopButton = true; + VideoPlayerShowMuteButton = true; + VideoPlayerShowFullscreenButton = true; + ListViewLineSeparatorString = "
"; + ListViewDoubleClickAction = 1; + SaveAsUseFileNameFrom = "video"; + UppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWZYXÆØÃÅÄÖÉÈÁÂÀÇÊÍÓÔÕÚŁАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯĞİŞÜÙÁÌÑÎΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"; + DefaultAdjustMilliseconds = 1000; + AutoRepeatOn = true; + AutoRepeatCount = 2; + AutoContinueOn = false; + AutoContinueDelay = 2; + ReturnToStartAfterRepeat = false; + SyncListViewWithVideoWhilePlaying = false; + AutoBackupSeconds = 60 * 5; + AutoBackupDeleteAfterMonths = 3; + SpellChecker = "hunspell"; + AllowEditOfOriginalSubtitle = true; + PromptDeleteLines = true; + Undocked = false; + UndockedVideoPosition = "-32000;-32000"; + UndockedWaveformPosition = "-32000;-32000"; + UndockedVideoControlsPosition = "-32000;-32000"; + WaveformUpdateIntervalMs = 40; + SmallDelayMilliseconds = 500; + LargeDelayMilliseconds = 5000; + OpenSubtitleExtraExtensions = "*.mp4;*.m4v;*.mkv;*.ts"; // matroska/mp4/m4v files (can contain subtitles) + ListViewColumnsRememberSize = true; + DirectShowDoubleLoad = true; + VlcWaveTranscodeSettings = "acodec=s16l"; // "acodec=s16l,channels=1,ab=64,samplerate=8000"; + MpvVideoOutputWindows = string.Empty; // could also be e.g. "gpu" or "directshow" + MpvVideoOutputLinux = "x11"; // could also be e.g. "x11"; + MpvHandlesPreviewText = true; + MpvPreviewTextPrimaryColor = Color.White; + MpvPreviewTextOutlineColor = Color.Black; + MpvPreviewTextBackgroundColor = Color.Black; + MpvPreviewTextOutlineWidth = 1; + MpvPreviewTextShadowWidth = 1; + MpvPreviewTextOpaqueBox = false; + MpvPreviewTextOpaqueBoxStyle = "1"; + MpvPreviewTextAlignment = "2"; + MpvPreviewTextMarginVertical = 10; + FFmpegSceneThreshold = "0.4"; // threshold for generating shot changes - 0.2 is sensitive (more shot changes), 0.6 is less sensitive (fewer shot changes) + UseTimeFormatHHMMSSFF = false; + SplitBehavior = 1; // 0=take gap from left, 1=divide evenly, 2=take gap from right + SplitRemovesDashes = true; + ClearStatusBarAfterSeconds = 10; + MoveVideo100Or500MsPlaySmallSample = false; + DisableVideoAutoLoading = false; + NewEmptyUseAutoDuration = true; + RightToLeftMode = false; + LastSaveAsFormat = string.Empty; + SystemSubtitleFontNameOverride = string.Empty; + CheckForUpdates = true; + LastCheckForUpdates = DateTime.Now; + ShowProgress = false; + ShowNegativeDurationInfoOnSave = true; + ShowFormatRequiresUtf8Warning = true; + DefaultVideoOffsetInMs = 10 * 60 * 60 * 1000; + DefaultVideoOffsetInMsList = "36000000;3600000"; + DarkThemeForeColor = Color.FromArgb(155, 155, 155); + DarkThemeBackColor = Color.FromArgb(30, 30, 30); + DarkThemeSelectedBackgroundColor = Color.FromArgb(24, 52, 75); + DarkThemeDisabledColor = Color.FromArgb(120, 120, 120); + LastColorPickerColor = Color.Yellow; + LastColorPickerColor1 = Color.Red; + LastColorPickerColor2 = Color.Green; + LastColorPickerColor3 = Color.Blue; + LastColorPickerColor4 = Color.White; + LastColorPickerColor5 = Color.Black; + LastColorPickerColor6 = Color.Cyan; + LastColorPickerColor7 = Color.DarkOrange; + LastColorPickerDropper = Color.Transparent; + ToolbarIconTheme = "Auto"; + UseDarkTheme = false; + DarkThemeShowListViewGridLines = false; + AutoSetVideoSmpteForTtml = true; + AutoSetVideoSmpteForTtmlPrompt = true; + TitleBarAsterisk = "before"; + MeasurementConverterCloseOnInsert = true; + MeasurementConverterCategories = "Length;Kilometers;Meters"; + PreviewAssaText = "ABCDEFGHIJKL abcdefghijkl 123"; + TagsInToggleHiTags = "[;]"; + TagsInToggleCustomTags = "(Æ)"; + SubtitleTextBoxMaxHeight = 300; + ShowBetaStuff = false; + DebugTranslationSync = false; + NewEmptyDefaultMs = 2000; + DialogStyle = DialogType.DashBothLinesWithSpace; + ContinuationStyle = ContinuationStyle.None; + + if (Configuration.IsRunningOnLinux) + { + SubtitleFontName = Configuration.DefaultLinuxFontName; + VideoPlayerPreviewFontName = Configuration.DefaultLinuxFontName; + } + + Profiles = new List(); + CurrentProfile = "Default"; + Profiles.Add(new RulesProfile + { + Name = CurrentProfile, + SubtitleLineMaximumLength = SubtitleLineMaximumLength, + MaxNumberOfLines = MaxNumberOfLines, + MergeLinesShorterThan = MergeLinesShorterThan, + SubtitleMaximumCharactersPerSeconds = (decimal)SubtitleMaximumCharactersPerSeconds, + SubtitleOptimalCharactersPerSeconds = (decimal)SubtitleOptimalCharactersPerSeconds, + SubtitleMaximumDisplayMilliseconds = SubtitleMaximumDisplayMilliseconds, + SubtitleMinimumDisplayMilliseconds = SubtitleMinimumDisplayMilliseconds, + SubtitleMaximumWordsPerMinute = (decimal)SubtitleMaximumWordsPerMinute, + CpsLineLengthStrategy = CpsLineLengthStrategy, + MinimumMillisecondsBetweenLines = MinimumMillisecondsBetweenLines, + DialogStyle = DialogStyle, + ContinuationStyle = ContinuationStyle + }); + AddExtraProfiles(Profiles); + } + + internal static void AddExtraProfiles(List profiles) + { + profiles.Add(new RulesProfile + { + Name = "Netflix (English)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 20, + SubtitleOptimalCharactersPerSeconds = 15, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 833, + SubtitleMaximumWordsPerMinute = 240, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithoutSpace, + ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis + }); + profiles.Add(new RulesProfile + { + Name = "Netflix (Other languages)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 833, + SubtitleMaximumWordsPerMinute = 204, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis + }); + profiles.Add(new RulesProfile + { + Name = "Netflix (Dutch)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 833, + SubtitleMaximumWordsPerMinute = 204, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashSecondLineWithoutSpace, + ContinuationStyle = ContinuationStyle.LeadingTrailingEllipsis + }); + profiles.Add(new RulesProfile + { + Name = "Netflix (Simplified Chinese)", + SubtitleLineMaximumLength = 16, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 17, + SubtitleMaximumCharactersPerSeconds = 9, + SubtitleOptimalCharactersPerSeconds = 9, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 833, + SubtitleMaximumWordsPerMinute = 100, + CpsLineLengthStrategy = "CalcAll", + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithoutSpace, + ContinuationStyle = ContinuationStyle.LeadingTrailingEllipsis + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (English/Spanish/French)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 204, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis, + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (Arabic)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 20, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 240, + CpsLineLengthStrategy = typeof(CalcAll).Name, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis, + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (Danish)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 204, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithoutSpace, + ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis, + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (Dutch)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 204, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashSecondLineWithoutSpace, + ContinuationStyle = ContinuationStyle.OnlyTrailingEllipsis, + }); + profiles.Add(new RulesProfile + { + Name = "TikTok/YouTube-shorts (9:16)", + SubtitleLineMaximumLength = 24, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 0, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5000, + SubtitleMinimumDisplayMilliseconds = 700, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 0, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "Arte (German/English)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 20, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 10000, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 240, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 200, // 5 frames for 25 fps videos + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "Dutch professional subtitles (23.976/24 fps)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 15, + SubtitleOptimalCharactersPerSeconds = 11, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 1400, + SubtitleMaximumWordsPerMinute = 180, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 125, + DialogStyle = DialogType.DashSecondLineWithoutSpace, + ContinuationStyle = ContinuationStyle.OnlyTrailingDots + }); + profiles.Add(new RulesProfile + { + Name = "Dutch professional subtitles (25 fps)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 43, + SubtitleMaximumCharactersPerSeconds = 15, + SubtitleOptimalCharactersPerSeconds = 11, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1400, + SubtitleMaximumWordsPerMinute = 180, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 120, + DialogStyle = DialogType.DashSecondLineWithoutSpace, + ContinuationStyle = ContinuationStyle.OnlyTrailingDots + }); + profiles.Add(new RulesProfile + { + Name = "Dutch fansubs (23.976/24 fps)", + SubtitleLineMaximumLength = 45, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 46, + SubtitleMaximumCharactersPerSeconds = 22.5m, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7007, + SubtitleMinimumDisplayMilliseconds = 1200, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 125, + DialogStyle = DialogType.DashSecondLineWithSpace, + ContinuationStyle = ContinuationStyle.OnlyTrailingDots + }); + profiles.Add(new RulesProfile + { + Name = "Dutch fansubs (25 fps)", + SubtitleLineMaximumLength = 45, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 46, + SubtitleMaximumCharactersPerSeconds = 22.5m, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1200, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 120, + DialogStyle = DialogType.DashSecondLineWithSpace, + ContinuationStyle = ContinuationStyle.OnlyTrailingDots + }); + profiles.Add(new RulesProfile + { + Name = "Danish professional subtitles (23.976/24 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 15, + SubtitleOptimalCharactersPerSeconds = 10, + SubtitleMaximumDisplayMilliseconds = 8008, + SubtitleMinimumDisplayMilliseconds = 2002, + SubtitleMaximumWordsPerMinute = 180, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 125, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.LeadingTrailingDashDots + }); + profiles.Add(new RulesProfile + { + Name = "Danish professional subtitles (25 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 15, + SubtitleOptimalCharactersPerSeconds = 10, + SubtitleMaximumDisplayMilliseconds = 8000, + SubtitleMinimumDisplayMilliseconds = 2000, + SubtitleMaximumWordsPerMinute = 180, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 120, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.LeadingTrailingDashDots + }); + profiles.Add(new RulesProfile + { + Name = "SDI (Dutch)", + SubtitleLineMaximumLength = 37, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 38, + SubtitleMaximumCharactersPerSeconds = 18.75m, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1320, + SubtitleMaximumWordsPerMinute = 225, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 160, + DialogStyle = DialogType.DashSecondLineWithoutSpace, + ContinuationStyle = ContinuationStyle.OnlyTrailingDots + }); + profiles.Add(new RulesProfile + { + Name = "SW2 (French) (23.976/24 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5005, + SubtitleMinimumDisplayMilliseconds = 792, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 125, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "SW2 (French) (25 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5000, + SubtitleMinimumDisplayMilliseconds = 800, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 120, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "SW3 (French) (23.976/24 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5005, + SubtitleMinimumDisplayMilliseconds = 792, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 167, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "SW3 (French) (25 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5000, + SubtitleMinimumDisplayMilliseconds = 800, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 160, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "SW4 (French) (23.976/24 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5005, + SubtitleMinimumDisplayMilliseconds = 792, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 250, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + profiles.Add(new RulesProfile + { + Name = "SW4 (French) (25 fps)", + SubtitleLineMaximumLength = 40, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 41, + SubtitleMaximumCharactersPerSeconds = 25, + SubtitleOptimalCharactersPerSeconds = 18, + SubtitleMaximumDisplayMilliseconds = 5000, + SubtitleMinimumDisplayMilliseconds = 800, + SubtitleMaximumWordsPerMinute = 300, + CpsLineLengthStrategy = string.Empty, + MinimumMillisecondsBetweenLines = 240, + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.None + }); + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs b/src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs new file mode 100644 index 000000000..9c2fca481 --- /dev/null +++ b/src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class MultipleSearchAndReplaceGroup + { + public string Name { get; set; } + public bool Enabled { get; set; } + public List Rules { get; set; } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs b/src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs new file mode 100644 index 000000000..4bb8e8652 --- /dev/null +++ b/src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs @@ -0,0 +1,11 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class MultipleSearchAndReplaceSetting + { + public bool Enabled { get; set; } + public string FindWhat { get; set; } + public string ReplaceWith { get; set; } + public string SearchType { get; set; } + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/NetworkSettings.cs b/src/libse/Common/Settings/NetworkSettings.cs new file mode 100644 index 000000000..bdf8a75b5 --- /dev/null +++ b/src/libse/Common/Settings/NetworkSettings.cs @@ -0,0 +1,21 @@ +using System; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class NetworkSettings + { + public string UserName { get; set; } + public string WebApiUrl { get; set; } + public string SessionKey { get; set; } + public int PollIntervalSeconds { get; set; } + public string NewMessageSound { get; set; } + + public NetworkSettings() + { + UserName = string.Empty; + SessionKey = Guid.NewGuid().ToString(); + WebApiUrl = "https://www.nikse.dk/api/SeNet"; + PollIntervalSeconds = 5; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/ProxySettings.cs b/src/libse/Common/Settings/ProxySettings.cs new file mode 100644 index 000000000..da651fc7c --- /dev/null +++ b/src/libse/Common/Settings/ProxySettings.cs @@ -0,0 +1,24 @@ +using System; +using System.Text; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class ProxySettings + { + public string ProxyAddress { get; set; } + public string AuthType { get; set; } + public bool UseDefaultCredentials { get; set; } + public string UserName { get; set; } + public string Password { get; set; } + public string Domain { get; set; } + + public string DecodePassword() + { + return Encoding.UTF8.GetString(Convert.FromBase64String(Password)); + } + public void EncodePassword(string unencryptedPassword) + { + Password = Convert.ToBase64String(Encoding.UTF8.GetBytes(unencryptedPassword)); + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/RecentFileEntry.cs b/src/libse/Common/Settings/RecentFileEntry.cs new file mode 100644 index 000000000..59a5a7156 --- /dev/null +++ b/src/libse/Common/Settings/RecentFileEntry.cs @@ -0,0 +1,14 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class RecentFileEntry + { + public string FileName { get; set; } + public string OriginalFileName { get; set; } + public string VideoFileName { get; set; } + public int AudioTrack { get; set; } + public int FirstVisibleIndex { get; set; } + public int FirstSelectedIndex { get; set; } + public long VideoOffsetInMs { get; set; } + public bool VideoIsSmpte { get; set; } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/RecentFilesSettings.cs b/src/libse/Common/Settings/RecentFilesSettings.cs new file mode 100644 index 000000000..2ec0da5fd --- /dev/null +++ b/src/libse/Common/Settings/RecentFilesSettings.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Serialization; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class RecentFilesSettings + { + private const int MaxRecentFiles = 25; + + [XmlArrayItem("FileName")] + public List Files { get; set; } + + public RecentFilesSettings() + { + Files = new List(); + } + + public void Add(string fileName, int firstVisibleIndex, int firstSelectedIndex, string videoFileName, int audioTrack, string originalFileName, long videoOffset, bool isSmpte) + { + Files = Files.Where(p => !string.IsNullOrEmpty(p.FileName)).ToList(); + + if (string.IsNullOrEmpty(fileName) && !string.IsNullOrEmpty(originalFileName)) + { + fileName = originalFileName; + originalFileName = null; + } + + if (string.IsNullOrEmpty(fileName)) + { + Files.Insert(0, new RecentFileEntry { FileName = string.Empty }); + return; + } + + var existingEntry = GetRecentFile(fileName, originalFileName); + if (existingEntry == null) + { + Files.Insert(0, new RecentFileEntry { FileName = fileName ?? string.Empty, FirstVisibleIndex = -1, FirstSelectedIndex = -1, VideoFileName = videoFileName, AudioTrack = audioTrack, OriginalFileName = originalFileName }); + } + else + { + Files.Remove(existingEntry); + existingEntry.FirstSelectedIndex = firstSelectedIndex; + existingEntry.FirstVisibleIndex = firstVisibleIndex; + existingEntry.VideoFileName = videoFileName; + existingEntry.AudioTrack = audioTrack; + existingEntry.OriginalFileName = originalFileName; + existingEntry.VideoOffsetInMs = videoOffset; + existingEntry.VideoIsSmpte = isSmpte; + Files.Insert(0, existingEntry); + } + Files = Files.Take(MaxRecentFiles).ToList(); + } + + public void Add(string fileName, string videoFileName, int audioTrack, string originalFileName) + { + Files = Files.Where(p => !string.IsNullOrEmpty(p.FileName)).ToList(); + + var existingEntry = GetRecentFile(fileName, originalFileName); + if (existingEntry == null) + { + Files.Insert(0, new RecentFileEntry { FileName = fileName ?? string.Empty, FirstVisibleIndex = -1, FirstSelectedIndex = -1, VideoFileName = videoFileName, AudioTrack = audioTrack, OriginalFileName = originalFileName }); + } + else + { + Files.Remove(existingEntry); + Files.Insert(0, existingEntry); + } + Files = Files.Take(MaxRecentFiles).ToList(); + } + + private RecentFileEntry GetRecentFile(string fileName, string originalFileName) + { + RecentFileEntry existingEntry; + if (string.IsNullOrEmpty(originalFileName)) + { + existingEntry = Files.Find(p => !string.IsNullOrEmpty(p.FileName) && + string.IsNullOrEmpty(p.OriginalFileName) && + p.FileName.Equals(fileName, StringComparison.OrdinalIgnoreCase)); + } + else + { + existingEntry = Files.Find(p => !string.IsNullOrEmpty(p.FileName) && + !string.IsNullOrEmpty(p.OriginalFileName) && + p.FileName.Equals(fileName, StringComparison.OrdinalIgnoreCase) && + p.OriginalFileName.Equals(originalFileName, StringComparison.OrdinalIgnoreCase)); + } + return existingEntry; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs b/src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs new file mode 100644 index 000000000..5e613cc43 --- /dev/null +++ b/src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs @@ -0,0 +1,38 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class RemoveTextForHearingImpairedSettings + { + public bool RemoveTextBetweenBrackets { get; set; } + public bool RemoveTextBetweenParentheses { get; set; } + public bool RemoveTextBetweenCurlyBrackets { get; set; } + public bool RemoveTextBetweenQuestionMarks { get; set; } + public bool RemoveTextBetweenCustom { get; set; } + public string RemoveTextBetweenCustomBefore { get; set; } + public string RemoveTextBetweenCustomAfter { get; set; } + public bool RemoveTextBetweenOnlySeparateLines { get; set; } + public bool RemoveTextBeforeColon { get; set; } + public bool RemoveTextBeforeColonOnlyIfUppercase { get; set; } + public bool RemoveTextBeforeColonOnlyOnSeparateLine { get; set; } + public bool RemoveInterjections { get; set; } + public bool RemoveInterjectionsOnlyOnSeparateLine { get; set; } + public bool RemoveIfContains { get; set; } + public bool RemoveIfAllUppercase { get; set; } + public string RemoveIfContainsText { get; set; } + public bool RemoveIfOnlyMusicSymbols { get; set; } + + public RemoveTextForHearingImpairedSettings() + { + RemoveTextBetweenBrackets = true; + RemoveTextBetweenParentheses = true; + RemoveTextBetweenCurlyBrackets = true; + RemoveTextBetweenQuestionMarks = true; + RemoveTextBetweenCustom = false; + RemoveTextBetweenCustomBefore = "¶"; + RemoveTextBetweenCustomAfter = "¶"; + RemoveTextBeforeColon = true; + RemoveTextBeforeColonOnlyIfUppercase = true; + RemoveIfContainsText = "¶"; + RemoveIfOnlyMusicSymbols = true; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings.cs b/src/libse/Common/Settings/Settings.cs similarity index 76% rename from src/libse/Common/Settings.cs rename to src/libse/Common/Settings/Settings.cs index d6947b9d9..55a33b883 100644 --- a/src/libse/Common/Settings.cs +++ b/src/libse/Common/Settings/Settings.cs @@ -4,3238 +4,14 @@ using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.IO; -using System.Linq; using System.Text; using System.Xml; -using System.Xml.Serialization; -using Nikse.SubtitleEdit.Core.Common.TextLengthCalculator; namespace Nikse.SubtitleEdit.Core.Common { // The settings classes are built for easy xml-serialization (makes save/load code simple) // ...but the built-in serialization is too slow - so a custom (de-)serialization has been used! - public class RecentFileEntry - { - public string FileName { get; set; } - public string OriginalFileName { get; set; } - public string VideoFileName { get; set; } - public int AudioTrack { get; set; } - public int FirstVisibleIndex { get; set; } - public int FirstSelectedIndex { get; set; } - public long VideoOffsetInMs { get; set; } - public bool VideoIsSmpte { get; set; } - } - - public class RecentFilesSettings - { - private const int MaxRecentFiles = 25; - - [XmlArrayItem("FileName")] - public List Files { get; set; } - - public RecentFilesSettings() - { - Files = new List(); - } - - public void Add(string fileName, int firstVisibleIndex, int firstSelectedIndex, string videoFileName, int audioTrack, string originalFileName, long videoOffset, bool isSmpte) - { - Files = Files.Where(p => !string.IsNullOrEmpty(p.FileName)).ToList(); - - if (string.IsNullOrEmpty(fileName) && !string.IsNullOrEmpty(originalFileName)) - { - fileName = originalFileName; - originalFileName = null; - } - - if (string.IsNullOrEmpty(fileName)) - { - Files.Insert(0, new RecentFileEntry { FileName = string.Empty }); - return; - } - - var existingEntry = GetRecentFile(fileName, originalFileName); - if (existingEntry == null) - { - Files.Insert(0, new RecentFileEntry { FileName = fileName ?? string.Empty, FirstVisibleIndex = -1, FirstSelectedIndex = -1, VideoFileName = videoFileName, AudioTrack = audioTrack, OriginalFileName = originalFileName }); - } - else - { - Files.Remove(existingEntry); - existingEntry.FirstSelectedIndex = firstSelectedIndex; - existingEntry.FirstVisibleIndex = firstVisibleIndex; - existingEntry.VideoFileName = videoFileName; - existingEntry.AudioTrack = audioTrack; - existingEntry.OriginalFileName = originalFileName; - existingEntry.VideoOffsetInMs = videoOffset; - existingEntry.VideoIsSmpte = isSmpte; - Files.Insert(0, existingEntry); - } - Files = Files.Take(MaxRecentFiles).ToList(); - } - - public void Add(string fileName, string videoFileName, int audioTrack, string originalFileName) - { - Files = Files.Where(p => !string.IsNullOrEmpty(p.FileName)).ToList(); - - var existingEntry = GetRecentFile(fileName, originalFileName); - if (existingEntry == null) - { - Files.Insert(0, new RecentFileEntry { FileName = fileName ?? string.Empty, FirstVisibleIndex = -1, FirstSelectedIndex = -1, VideoFileName = videoFileName, AudioTrack = audioTrack, OriginalFileName = originalFileName }); - } - else - { - Files.Remove(existingEntry); - Files.Insert(0, existingEntry); - } - Files = Files.Take(MaxRecentFiles).ToList(); - } - - private RecentFileEntry GetRecentFile(string fileName, string originalFileName) - { - RecentFileEntry existingEntry; - if (string.IsNullOrEmpty(originalFileName)) - { - existingEntry = Files.Find(p => !string.IsNullOrEmpty(p.FileName) && - string.IsNullOrEmpty(p.OriginalFileName) && - p.FileName.Equals(fileName, StringComparison.OrdinalIgnoreCase)); - } - else - { - existingEntry = Files.Find(p => !string.IsNullOrEmpty(p.FileName) && - !string.IsNullOrEmpty(p.OriginalFileName) && - p.FileName.Equals(fileName, StringComparison.OrdinalIgnoreCase) && - p.OriginalFileName.Equals(originalFileName, StringComparison.OrdinalIgnoreCase)); - } - return existingEntry; - } - } - - public class ToolsSettings - { - public List AssaTagTemplates { get; set; } - public int StartSceneIndex { get; set; } - public int EndSceneIndex { get; set; } - public int VerifyPlaySeconds { get; set; } - public bool FixShortDisplayTimesAllowMoveStartTime { get; set; } - public bool RemoveEmptyLinesBetweenText { get; set; } - public string MusicSymbol { get; set; } - public string MusicSymbolReplace { get; set; } - public string UnicodeSymbolsToInsert { get; set; } - public bool SpellCheckAutoChangeNameCasing { get; set; } - public bool SpellCheckUseLargerFont { get; set; } - public bool SpellCheckAutoChangeNamesUseSuggestions { get; set; } - public string SpellCheckSearchEngine { get; set; } - public bool CheckOneLetterWords { get; set; } - public bool SpellCheckEnglishAllowInQuoteAsIng { get; set; } - public bool RememberUseAlwaysList { get; set; } - public bool LiveSpellCheck { get; set; } - public bool SpellCheckShowCompletedMessage { get; set; } - public bool OcrFixUseHardcodedRules { get; set; } - public bool OcrGoogleCloudVisionSeHandlesTextMerge { get; set; } - public int OcrBinaryImageCompareRgbThreshold { get; set; } - public int OcrTesseract4RgbThreshold { get; set; } - public string OcrAddLetterRow1 { get; set; } - public string OcrAddLetterRow2 { get; set; } - public string OcrTrainFonts { get; set; } - public string OcrTrainMergedLetters { get; set; } - public string OcrTrainSrtFile { get; set; } - public bool OcrUseWordSplitList { get; set; } - public bool OcrUseWordSplitListAvoidPropercase { get; set; } - public string BDOpenIn { get; set; } - public string MicrosoftBingApiId { get; set; } - public string MicrosoftTranslatorApiKey { get; set; } - public string MicrosoftTranslatorTokenEndpoint { get; set; } - public string MicrosoftTranslatorCategory { get; set; } - public string GoogleApiV2Key { get; set; } - public bool GoogleTranslateNoKeyWarningShow { get; set; } - public int GoogleApiV1ChunkSize { get; set; } - public string GoogleTranslateLastSourceLanguage { get; set; } - public string GoogleTranslateLastTargetLanguage { get; set; } - public string AutoTranslateLastName { get; set; } - public string AutoTranslateLastUrl { get; set; } - public string AutoTranslateNllbApiUrl { get; set; } - public string AutoTranslateNllbServeUrl { get; set; } - public string AutoTranslateNllbServeModel { get; set; } - public string AutoTranslateLibreUrl { get; set; } - public string AutoTranslateLibreApiKey { get; set; } - public string AutoTranslateMyMemoryApiKey { get; set; } - public string AutoTranslateSeamlessM4TUrl { get; set; } - public string AutoTranslateDeepLApiKey { get; set; } - public string AutoTranslateDeepLUrl { get; set; } - public string AutoTranslatePapagoApiKeyId { get; set; } - public string AutoTranslatePapagoApiKey { get; set; } - public string AutoTranslateDeepLFormality { get; set; } - public bool TranslateAllowSplit { get; set; } - public string TranslateLastService { get; set; } - public string TranslateMergeStrategy { get; set; } - public string TranslateViaCopyPasteSeparator { get; set; } - public int TranslateViaCopyPasteMaxSize { get; set; } - public bool TranslateViaCopyPasteAutoCopyToClipboard { get; set; } - public string ChatGptUrl { get; set; } - public string ChatGptPrompt { get; set; } - public string ChatGptApiKey { get; set; } - public string ChatGptModel { get; set; } - public string LmStudioApiUrl { get; set; } - public string LmStudioModel { get; set; } - public string LmStudioPrompt { get; set; } - public string OllamaApiUrl { get; set; } - public string OllamaModels { get; set; } - public string OllamaModel { get; set; } - public string OllamaPrompt { get; set; } - - public string AnthropicApiUrl { get; set; } - public string AnthropicPrompt { get; set; } - public string AnthropicApiKey { get; set; } - public string AnthropicApiModel { get; set; } - public int AutoTranslateDelaySeconds { get; set; } - public int AutoTranslateMaxBytes { get; set; } - public string AutoTranslateStrategy { get; set; } - public string GeminiProApiKey { get; set; } - public string TextToSpeechEngine { get; set; } - public string TextToSpeechLastVoice { get; set; } - public string TextToSpeechElevenLabsApiKey { get; set; } - public string TextToSpeechAzureApiKey { get; set; } - public string TextToSpeechAzureRegion { get; set; } - public bool TextToSpeechPreview { get; set; } - public bool TextToSpeechCustomAudio { get; set; } - public bool TextToSpeechCustomAudioStereo { get; set; } - public string TextToSpeechCustomAudioEncoding { get; set; } - public bool TextToSpeechAddToVideoFile { get; set; } - public bool ListViewSyntaxColorDurationSmall { get; set; } - public bool ListViewSyntaxColorDurationBig { get; set; } - public bool ListViewSyntaxColorOverlap { get; set; } - public bool ListViewSyntaxColorLongLines { get; set; } - public bool ListViewSyntaxColorWideLines { get; set; } - public bool ListViewSyntaxColorGap { get; set; } - public bool ListViewSyntaxMoreThanXLines { get; set; } - public Color ListViewSyntaxErrorColor { get; set; } - public Color ListViewUnfocusedSelectedColor { get; set; } - public Color Color1 { get; set; } - public Color Color2 { get; set; } - public Color Color3 { get; set; } - public Color Color4 { get; set; } - public Color Color5 { get; set; } - public Color Color6 { get; set; } - public Color Color7 { get; set; } - public Color Color8 { get; set; } - public bool ListViewShowColumnStartTime { get; set; } - public bool ListViewShowColumnEndTime { get; set; } - public bool ListViewShowColumnDuration { get; set; } - public bool ListViewShowColumnCharsPerSec { get; set; } - public bool ListViewShowColumnWordsPerMin { get; set; } - public bool ListViewShowColumnGap { get; set; } - public bool ListViewShowColumnActor { get; set; } - public bool ListViewShowColumnRegion { get; set; } - public bool ListViewMultipleReplaceShowColumnRuleInfo { get; set; } - public bool SplitAdvanced { get; set; } - public string SplitOutputFolder { get; set; } - public int SplitNumberOfParts { get; set; } - public string SplitVia { get; set; } - public bool JoinCorrectTimeCodes { get; set; } - public int JoinAddMs { get; set; } - public int SplitLongLinesMax { get; set; } - public string LastShowEarlierOrLaterSelection { get; set; } - public string NewEmptyTranslationText { get; set; } - public string BatchConvertOutputFolder { get; set; } - public bool BatchConvertOverwriteExisting { get; set; } - public bool BatchConvertSaveInSourceFolder { get; set; } - public bool BatchConvertRemoveFormatting { get; set; } - public bool BatchConvertRemoveFormattingAll { get; set; } - public bool BatchConvertRemoveFormattingItalic { get; set; } - public bool BatchConvertRemoveFormattingBold { get; set; } - public bool BatchConvertRemoveFormattingUnderline { get; set; } - public bool BatchConvertRemoveFormattingFontName { get; set; } - public bool BatchConvertRemoveFormattingColor { get; set; } - public bool BatchConvertRemoveFormattingAlignment { get; set; } - public bool BatchConvertRemoveStyle { get; set; } - public bool BatchConvertBridgeGaps { get; set; } - public bool BatchConvertFixCasing { get; set; } - public bool BatchConvertRemoveTextForHI { get; set; } - public bool BatchConvertConvertColorsToDialog { get; set; } - public bool BatchConvertBeautifyTimeCodes { get; set; } - public bool BatchConvertAutoTranslate { get; set; } - public bool BatchConvertFixCommonErrors { get; set; } - public bool BatchConvertMultipleReplace { get; set; } - public bool BatchConvertFixRtl { get; set; } - public string BatchConvertFixRtlMode { get; set; } - public bool BatchConvertSplitLongLines { get; set; } - public bool BatchConvertAutoBalance { get; set; } - public bool BatchConvertSetMinDisplayTimeBetweenSubtitles { get; set; } - public bool BatchConvertMergeShortLines { get; set; } - public bool BatchConvertRemoveLineBreaks { get; set; } - public bool BatchConvertMergeSameText { get; set; } - public bool BatchConvertMergeSameTimeCodes { get; set; } - public bool BatchConvertChangeFrameRate { get; set; } - public bool BatchConvertChangeSpeed { get; set; } - public bool BatchConvertAdjustDisplayDuration { get; set; } - public bool BatchConvertApplyDurationLimits { get; set; } - public bool BatchConvertDeleteLines { get; set; } - public bool BatchConvertAssaChangeRes { get; set; } - public bool BatchConvertSortBy { get; set; } - public string BatchConvertSortByChoice { get; set; } - public bool BatchConvertOffsetTimeCodes { get; set; } - public bool BatchConvertScanFolderIncludeVideo { get; set; } - public string BatchConvertLanguage { get; set; } - public string BatchConvertFormat { get; set; } - public string BatchConvertAssStyles { get; set; } - public string BatchConvertSsaStyles { get; set; } - public bool BatchConvertUseStyleFromSource { get; set; } - public string BatchConvertExportCustomTextTemplate { get; set; } - public bool BatchConvertTsOverrideXPosition { get; set; } - public bool BatchConvertTsOverrideYPosition { get; set; } - public int BatchConvertTsOverrideBottomMargin { get; set; } - public string BatchConvertTsOverrideHAlign { get; set; } - public int BatchConvertTsOverrideHMargin { get; set; } - public bool BatchConvertTsOverrideScreenSize { get; set; } - public int BatchConvertTsScreenWidth { get; set; } - public int BatchConvertTsScreenHeight { get; set; } - public string BatchConvertTsFileNameAppend { get; set; } - public bool BatchConvertTsOnlyTeletext { get; set; } - public string BatchConvertMkvLanguageCodeStyle { get; set; } - public string BatchConvertOcrEngine { get; set; } - public string BatchConvertOcrLanguage { get; set; } - public string WaveformBatchLastFolder { get; set; } - public string ModifySelectionText { get; set; } - public string ModifySelectionRule { get; set; } - public bool ModifySelectionCaseSensitive { get; set; } - public string ExportVobSubFontName { get; set; } - public int ExportVobSubFontSize { get; set; } - public string ExportVobSubVideoResolution { get; set; } - public string ExportVobSubLanguage { get; set; } - public bool ExportVobSubSimpleRendering { get; set; } - public bool ExportVobAntiAliasingWithTransparency { get; set; } - public string ExportBluRayFontName { get; set; } - public int ExportBluRayFontSize { get; set; } - public string ExportFcpFontName { get; set; } - public string ExportFontNameOther { get; set; } - public int ExportFcpFontSize { get; set; } - public string ExportFcpImageType { get; set; } - public string ExportFcpPalNtsc { get; set; } - public string ExportBdnXmlImageType { get; set; } - public int ExportLastFontSize { get; set; } - public int ExportLastLineHeight { get; set; } - public int ExportLastBorderWidth { get; set; } - public bool ExportLastFontBold { get; set; } - public string ExportBluRayVideoResolution { get; set; } - public string ExportFcpVideoResolution { get; set; } - public Color ExportFontColor { get; set; } - public Color ExportBorderColor { get; set; } - public Color ExportShadowColor { get; set; } - public int ExportBoxBorderSize { get; set; } - public string ExportBottomMarginUnit { get; set; } - public int ExportBottomMarginPercent { get; set; } - public int ExportBottomMarginPixels { get; set; } - public string ExportLeftRightMarginUnit { get; set; } - public int ExportLeftRightMarginPercent { get; set; } - public int ExportLeftRightMarginPixels { get; set; } - public int ExportHorizontalAlignment { get; set; } - public int ExportBluRayBottomMarginPercent { get; set; } - public int ExportBluRayBottomMarginPixels { get; set; } - public int ExportBluRayShadow { get; set; } - public bool ExportBluRayRemoveSmallGaps { get; set; } - public string ExportCdgBackgroundImage { get; set; } - public int ExportCdgMarginLeft { get; set; } - public int ExportCdgMarginBottom { get; set; } - public string ExportCdgFormat { get; set; } - public int Export3DType { get; set; } - public int Export3DDepth { get; set; } - public int ExportLastShadowTransparency { get; set; } - public double ExportLastFrameRate { get; set; } - public bool ExportFullFrame { get; set; } - public bool ExportFcpFullPathUrl { get; set; } - public string ExportPenLineJoin { get; set; } - public Color BinEditBackgroundColor { get; set; } - public Color BinEditImageBackgroundColor { get; set; } - public int BinEditTopMargin { get; set; } - public int BinEditBottomMargin { get; set; } - public int BinEditLeftMargin { get; set; } - public int BinEditRightMargin { get; set; } - public string BinEditStartPosition { get; set; } - public string BinEditStartSize { get; set; } - public bool BinEditShowColumnGap { get; set; } - public bool FixCommonErrorsFixOverlapAllowEqualEndStart { get; set; } - public bool FixCommonErrorsSkipStepOne { get; set; } - public string ImportTextSplitting { get; set; } - public string ImportTextSplittingLineMode { get; set; } - public string ImportTextLineBreak { get; set; } - public bool ImportTextMergeShortLines { get; set; } - public bool ImportTextRemoveEmptyLines { get; set; } - public bool ImportTextAutoSplitAtBlank { get; set; } - public bool ImportTextRemoveLinesNoLetters { get; set; } - public bool ImportTextGenerateTimeCodes { get; set; } - public bool ImportTextTakeTimeCodeFromFileName { get; set; } - public bool ImportTextAutoBreak { get; set; } - public bool ImportTextAutoBreakAtEnd { get; set; } - public decimal ImportTextGap { get; set; } - public decimal ImportTextAutoSplitNumberOfLines { get; set; } - public string ImportTextAutoBreakAtEndMarkerText { get; set; } - public bool ImportTextDurationAuto { get; set; } - public decimal ImportTextFixedDuration { get; set; } - public string GenerateTimeCodePatterns { get; set; } - public string MusicSymbolStyle { get; set; } - public int BridgeGapMilliseconds { get; set; } - public int BridgeGapMillisecondsMinGap { get; set; } - public string ExportCustomTemplates { get; set; } - public string ChangeCasingChoice { get; set; } - public bool ChangeCasingNormalFixNames { get; set; } - public bool ChangeCasingNormalOnlyUppercase { get; set; } - public bool UseNoLineBreakAfter { get; set; } - public string NoLineBreakAfterEnglish { get; set; } - public List FindHistory { get; set; } - public string ReplaceIn { get; set; } - public string ExportTextFormatText { get; set; } - public bool ExportTextRemoveStyling { get; set; } - public bool ExportTextShowLineNumbers { get; set; } - public bool ExportTextShowLineNumbersNewLine { get; set; } - public bool ExportTextShowTimeCodes { get; set; } - public bool ExportTextShowTimeCodesNewLine { get; set; } - public bool ExportTextNewLineAfterText { get; set; } - public bool ExportTextNewLineBetweenSubtitles { get; set; } - public string ExportTextTimeCodeFormat { get; set; } - public string ExportTextTimeCodeSeparator { get; set; } - public bool VideoOffsetKeepTimeCodes { get; set; } - public int MoveStartEndMs { get; set; } - public decimal AdjustDurationSeconds { get; set; } - public int AdjustDurationPercent { get; set; } - public string AdjustDurationLast { get; set; } - public bool AdjustDurationExtendOnly { get; set; } - public bool AdjustDurationExtendEnforceDurationLimits { get; set; } - public bool AdjustDurationExtendCheckShotChanges { get; set; } - public bool ChangeSpeedAllowOverlap { get; set; } - public bool AutoBreakCommaBreakEarly { get; set; } - public bool AutoBreakDashEarly { get; set; } - public bool AutoBreakLineEndingEarly { get; set; } - public bool AutoBreakUsePixelWidth { get; set; } - public bool AutoBreakPreferBottomHeavy { get; set; } - public double AutoBreakPreferBottomPercent { get; set; } - public bool ApplyMinimumDurationLimit { get; set; } - public bool ApplyMinimumDurationLimitCheckShotChanges { get; set; } - public bool ApplyMaximumDurationLimit { get; set; } - public int MergeShortLinesMaxGap { get; set; } - public int MergeShortLinesMaxChars { get; set; } - public bool MergeShortLinesOnlyContinuous { get; set; } - public int MergeTextWithSameTimeCodesMaxGap { get; set; } - public bool MergeTextWithSameTimeCodesMakeDialog { get; set; } - public bool MergeTextWithSameTimeCodesReBreakLines { get; set; } - public int MergeLinesWithSameTextMaxMs { get; set; } - public bool MergeLinesWithSameTextIncrement { get; set; } - public bool ConvertColorsToDialogRemoveColorTags { get; set; } - public bool ConvertColorsToDialogAddNewLines { get; set; } - public bool ConvertColorsToDialogReBreakLines { get; set; } - public string ColumnPasteColumn { get; set; } - public string ColumnPasteOverwriteMode { get; set; } - public string AssaAttachmentFontTextPreview { get; set; } - public string AssaSetPositionTarget { get; set; } - public string VisualSyncStartSize { get; set; } - public Color BlankVideoColor { get; set; } - public bool BlankVideoUseCheckeredImage { get; set; } - public int BlankVideoMinutes { get; set; } - public decimal BlankVideoFrameRate { get; set; } - public Color AssaProgressBarForeColor { get; set; } - public Color AssaProgressBarBackColor { get; set; } - public Color AssaProgressBarTextColor { get; set; } - public int AssaProgressBarHeight { get; set; } - public int AssaProgressBarSplitterWidth { get; set; } - public int AssaProgressBarSplitterHeight { get; set; } - public string AssaProgressBarFontName { get; set; } - public int AssaProgressBarFontSize { get; set; } - public bool AssaProgressBarTopAlign { get; set; } - public string AssaProgressBarTextAlign { get; set; } - - - public int AssaBgBoxPaddingLeft { get; set; } - public int AssaBgBoxPaddingRight { get; set; } - public int AssaBgBoxPaddingTop { get; set; } - public int AssaBgBoxPaddingBottom { get; set; } - public int AssaBgBoxDrawingMarginV { get; set; } - public int AssaBgBoxDrawingMarginH { get; set; } - public string AssaBgBoxDrawingAlignment { get; set; } - public Color AssaBgBoxColor { get; set; } - public Color AssaBgBoxOutlineColor { get; set; } - public Color AssaBgBoxShadowColor { get; set; } - public Color AssaBgBoxTransparentColor { get; set; } - public string AssaBgBoxStyle { get; set; } - public int AssaBgBoxStyleRadius { get; set; } - public int AssaBgBoxStyleCircleAdjustY { get; set; } - public int AssaBgBoxStyleSpikesStep { get; set; } - public int AssaBgBoxStyleSpikesHeight { get; set; } - public int AssaBgBoxStyleBubblesStep { get; set; } - public int AssaBgBoxStyleBubblesHeight { get; set; } - public int AssaBgBoxOutlineWidth { get; set; } - public int AssaBgBoxLayer { get; set; } - public string AssaBgBoxDrawing { get; set; } - public bool AssaBgBoxDrawingFileWatch { get; set; } - public bool AssaBgBoxDrawingOnly { get; set; } - - - public string GenVideoFontName { get; set; } - public bool GenVideoFontBold { get; set; } - public decimal GenVideoOutline { get; set; } - public int GenVideoFontSize { get; set; } - public string GenVideoEncoding { get; set; } - public string GenVideoPreset { get; set; } - public string GenVideoCrf { get; set; } - public string GenVideoTune { get; set; } - public string GenVideoAudioEncoding { get; set; } - public bool GenVideoAudioForceStereo { get; set; } - public string GenVideoAudioSampleRate { get; set; } - public bool GenVideoTargetFileSize { get; set; } - public float GenVideoFontSizePercentOfHeight { get; set; } - public bool GenVideoNonAssaBox { get; set; } - public Color GenVideoNonAssaBoxColor { get; set; } - public Color GenVideoNonAssaTextColor { get; set; } - public bool GenVideoNonAssaAlignRight { get; set; } - public bool GenVideoNonAssaFixRtlUnicode { get; set; } - public string GenVideoEmbedOutputExt { get; set; } - public string GenVideoEmbedOutputSuffix { get; set; } - public string GenVideoEmbedOutputReplace { get; set; } - public bool GenVideoDeleteInputVideoFile { get; set; } - public bool GenVideoUseOutputFolder { get; set; } - public string GenVideoOutputFolder { get; set; } - public string GenVideoOutputFileSuffix { get; set; } - - public bool VoskPostProcessing { get; set; } - public string VoskModel { get; set; } - public string WhisperChoice { get; set; } - public bool WhisperIgnoreVersion { get; set; } - - public bool WhisperDeleteTempFiles { get; set; } - public string WhisperModel { get; set; } - public string WhisperLanguageCode { get; set; } - public string WhisperLocation { get; set; } - public string WhisperCtranslate2Location { get; set; } - public string WhisperPurfviewFasterWhisperLocation { get; set; } - public string WhisperPurfviewFasterWhisperDefaultCmd { get; set; } - public string WhisperXLocation { get; set; } - public string WhisperStableTsLocation { get; set; } - public string WhisperCppModelLocation { get; set; } - public string WhisperExtraSettings { get; set; } - public string WhisperExtraSettingsHistory { get; set; } - public bool WhisperAutoAdjustTimings { get; set; } - public bool WhisperUseLineMaxChars { get; set; } - public bool WhisperPostProcessingAddPeriods { get; set; } - public bool WhisperPostProcessingMergeLines { get; set; } - public bool WhisperPostProcessingSplitLines { get; set; } - public bool WhisperPostProcessingFixCasing { get; set; } - public bool WhisperPostProcessingFixShortDuration { get; set; } - public int AudioToTextLineMaxChars { get; set; } - public int AudioToTextLineMaxCharsJp { get; set; } - public int AudioToTextLineMaxCharsCn { get; set; } - public int BreakLinesLongerThan { get; set; } - public int UnbreakLinesLongerThan { get; set; } - - public ToolsSettings() - { - AssaTagTemplates = new List(); - StartSceneIndex = 1; - EndSceneIndex = 1; - VerifyPlaySeconds = 2; - FixShortDisplayTimesAllowMoveStartTime = false; - RemoveEmptyLinesBetweenText = true; - MusicSymbol = "♪"; - MusicSymbolReplace = "♪,â™," + // ♪ + ♫ in UTF-8 opened as ANSI - ",," + // music symbols by subtitle creator - "#,*,¶"; // common music symbols - UnicodeSymbolsToInsert = "♪;♫;°;☺;☹;♥;©;☮;☯;Σ;∞;≡;⇒;π"; - SpellCheckAutoChangeNameCasing = false; - SpellCheckAutoChangeNamesUseSuggestions = false; - OcrFixUseHardcodedRules = true; - OcrGoogleCloudVisionSeHandlesTextMerge = true; - OcrBinaryImageCompareRgbThreshold = 200; - OcrTesseract4RgbThreshold = 200; - OcrAddLetterRow1 = "♪;á;é;í;ó;ö;ő;ú;ü;ű;ç;ñ;å;¿"; - OcrAddLetterRow2 = "♫;Á;É;Í;Ó;Ö;Ő;Ú;Ü;Ű;Ç;Ñ;Å;¡"; - OcrTrainFonts = "Arial;Calibri;Corbel;Futura Std Book;Futura Bis;Helvetica Neue;Lucida Console;Tahoma;Trebuchet MS;Verdana"; - OcrTrainMergedLetters = "ff ft fi fj fy fl rf rt rv rw ry rt rz ryt tt TV tw yt yw wy wf ryt xy"; - OcrUseWordSplitList = true; - OcrUseWordSplitListAvoidPropercase = true; - MicrosoftTranslatorTokenEndpoint = "https://api.cognitive.microsoft.com/sts/v1.0/issueToken"; - GoogleTranslateNoKeyWarningShow = true; - GoogleApiV1ChunkSize = 1500; - GoogleTranslateLastTargetLanguage = "en"; - AutoTranslateNllbServeUrl = "http://127.0.0.1:6060/"; - AutoTranslateNllbApiUrl = "http://localhost:7860/api/v2/"; - AutoTranslateLibreUrl = "http://localhost:5000/"; - AutoTranslateSeamlessM4TUrl = "http://localhost:5000/"; - AutoTranslateDeepLUrl = "https://api-free.deepl.com/"; - ChatGptUrl = "https://api.openai.com/v1/chat/completions"; - ChatGptPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments:"; - ChatGptModel = "gpt-4o"; - LmStudioPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments:"; - OllamaApiUrl = "http://localhost:11434/api/generate"; - OllamaModels = "llama3,llama2,mistral,dolphin-phi,phi,neural-chat,starling-lm,codellama,llama2-uncensored,llama2:13b,llama2:70b,orca-mini,vicuna,llava,gemma:2b,gemma:7b"; - OllamaModel = "llama3"; - OllamaPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments or notes:"; - AnthropicApiUrl = "https://api.anthropic.com/v1/messages"; - AnthropicPrompt = "Translate from {0} to {1}, keep sentences in {1} as they are, do not censor the translation, give only the output without comments:"; - AnthropicApiModel = "claude-3-5-sonnet-20240620"; - TextToSpeechAzureRegion = "westeurope"; - AutoTranslateMaxBytes = 2000; - TextToSpeechAddToVideoFile = true; - TranslateAllowSplit = true; - TranslateViaCopyPasteAutoCopyToClipboard = true; - TranslateViaCopyPasteMaxSize = 5000; - TranslateViaCopyPasteSeparator = "."; - CheckOneLetterWords = true; - SpellCheckEnglishAllowInQuoteAsIng = false; - SpellCheckShowCompletedMessage = true; - ListViewSyntaxColorDurationSmall = true; - ListViewSyntaxColorDurationBig = true; - ListViewSyntaxColorOverlap = true; - ListViewSyntaxColorLongLines = true; - ListViewSyntaxColorWideLines = false; - ListViewSyntaxMoreThanXLines = true; - ListViewSyntaxColorGap = true; - ListViewSyntaxErrorColor = Color.FromArgb(255, 180, 150); - ListViewUnfocusedSelectedColor = Color.LightBlue; - Color1 = Color.Yellow; - Color2 = Color.FromArgb(byte.MaxValue, 0, 0); - Color3 = Color.FromArgb(0, byte.MaxValue, 0); - Color4 = Color.Cyan; - Color5 = Color.Black; - Color6 = Color.White; - Color7 = Color.Orange; - Color8 = Color.Pink; - ListViewShowColumnStartTime = true; - ListViewShowColumnEndTime = true; - ListViewShowColumnDuration = true; - SplitAdvanced = false; - SplitNumberOfParts = 3; - SplitVia = "Lines"; - JoinCorrectTimeCodes = true; - SplitLongLinesMax = 90; - NewEmptyTranslationText = string.Empty; - BatchConvertLanguage = string.Empty; - BatchConvertTsOverrideBottomMargin = 5; // pct - BatchConvertTsScreenWidth = 1920; - BatchConvertTsScreenHeight = 1080; - BatchConvertOcrEngine = "Tesseract"; - BatchConvertOcrLanguage = "en"; - BatchConvertTsOverrideHAlign = "center"; // left center right - BatchConvertTsOverrideHMargin = 5; // pct - BatchConvertTsFileNameAppend = ".{two-letter-country-code}"; - BatchConvertMkvLanguageCodeStyle = "2"; - ModifySelectionRule = "Contains"; - ModifySelectionText = string.Empty; - ImportTextDurationAuto = true; - ImportTextGap = 84; - ImportTextFixedDuration = 2500; - GenerateTimeCodePatterns = "HH:mm:ss;yyyy-MM-dd;dddd dd MMMM yyyy
HH:mm:ss;dddd dd MMMM yyyy
hh:mm:ss tt;s"; - MusicSymbolStyle = "Double"; // 'Double' or 'Single' - ExportFontColor = Color.White; - ExportBorderColor = Color.FromArgb(255, 0, 0, 0); - ExportShadowColor = Color.FromArgb(255, 0, 0, 0); - ExportBoxBorderSize = 8; - ExportBottomMarginUnit = "%"; - ExportBottomMarginPercent = 5; - ExportBottomMarginPixels = 15; - ExportLeftRightMarginUnit = "%"; - ExportLeftRightMarginPercent = 5; - ExportLeftRightMarginPixels = 15; - ExportHorizontalAlignment = 1; // 1=center (0=left, 2=right) - ExportVobSubSimpleRendering = false; - ExportVobAntiAliasingWithTransparency = true; - ExportBluRayBottomMarginPercent = 5; - ExportBluRayBottomMarginPixels = 20; - ExportBluRayShadow = 1; - Export3DType = 0; - Export3DDepth = 0; - ExportCdgMarginLeft = 160; - ExportCdgMarginBottom = 67; - ExportLastShadowTransparency = 200; - ExportLastFrameRate = 24.0d; - ExportFullFrame = false; - ExportPenLineJoin = "Round"; - ExportFcpImageType = "Bmp"; - ExportFcpPalNtsc = "PAL"; - ExportLastBorderWidth = 4; - BinEditBackgroundColor = Color.Black; - BinEditImageBackgroundColor = Color.Blue; - BinEditTopMargin = 10; - BinEditBottomMargin = 10; - BinEditLeftMargin = 10; - BinEditRightMargin = 10; - BridgeGapMilliseconds = 100; - BridgeGapMillisecondsMinGap = 24; - ChangeCasingNormalFixNames = true; - ExportCustomTemplates = "SubRipÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]ÆÆsrtæMicroDVDÆÆ{{start}}{{end}}{text}\r\nÆffÆ||ÆÆsub"; - UseNoLineBreakAfter = false; - NoLineBreakAfterEnglish = " Mrs.; Ms.; Mr.; Dr.; a; an; the; my; my own; your; his; our; their; it's; is; are;'s; 're; would;'ll;'ve;'d; will; that; which; who; whom; whose; whichever; whoever; wherever; each; either; every; all; both; few; many; sevaral; all; any; most; been; been doing; none; some; my own; your own; his own; her own; our own; their own; I; she; he; as per; as regards; into; onto; than; where as; abaft; aboard; about; above; across; afore; after; against; along; alongside; amid; amidst; among; amongst; anenst; apropos; apud; around; as; aside; astride; at; athwart; atop; barring; before; behind; below; beneath; beside; besides; between; betwixt; beyond; but; by; circa; ca; concerning; despite; down; during; except; excluding; following; for; forenenst; from; given; in; including; inside; into; lest; like; minus; modulo; near; next; of; off; on; onto; opposite; out; outside; over; pace; past; per; plus; pro; qua; regarding; round; sans; save; since; than; through; thru; throughout; thruout; till; to; toward; towards; under; underneath; unlike; until; unto; up; upon; versus; vs; via; vice; with; within; without; considering; respecting; one; two; another; three; our; five; six; seven; eight; nine; ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen; seventeen; eighteen; nineteen; twenty; thirty; forty; fifty; sixty; seventy; eighty; ninety; hundred; thousand; million; billion; trillion; while; however; what; zero; little; enough; after; although; and; as; if; though; although; because; before; both; but; even; how; than; nor; or; only; unless; until; yet; was; were"; - FindHistory = new List(); - ExportTextFormatText = "None"; - ExportTextRemoveStyling = true; - ExportTextShowLineNumbersNewLine = true; - ExportTextShowTimeCodesNewLine = true; - ExportTextNewLineAfterText = true; - ExportTextNewLineBetweenSubtitles = true; - ImportTextLineBreak = "|"; - ImportTextAutoSplitNumberOfLines = 2; - ImportTextAutoSplitAtBlank = true; - ImportTextAutoBreakAtEndMarkerText = ".!?"; - ImportTextAutoBreakAtEnd = true; - MoveStartEndMs = 100; - AdjustDurationSeconds = 0.1m; - AdjustDurationPercent = 120; - AdjustDurationExtendOnly = true; - AdjustDurationExtendEnforceDurationLimits = true; - AdjustDurationExtendCheckShotChanges = true; - AutoBreakCommaBreakEarly = false; - AutoBreakDashEarly = true; - AutoBreakLineEndingEarly = false; - AutoBreakUsePixelWidth = true; - AutoBreakPreferBottomHeavy = true; - AutoBreakPreferBottomPercent = 5; - ApplyMinimumDurationLimit = true; - ApplyMinimumDurationLimitCheckShotChanges = true; - ApplyMaximumDurationLimit = true; - MergeShortLinesMaxGap = 250; - MergeShortLinesMaxChars = 55; - MergeShortLinesOnlyContinuous = true; - MergeTextWithSameTimeCodesMaxGap = 250; - MergeTextWithSameTimeCodesReBreakLines = false; - MergeLinesWithSameTextMaxMs = 250; - MergeLinesWithSameTextIncrement = true; - MergeTextWithSameTimeCodesMakeDialog = false; - ConvertColorsToDialogRemoveColorTags = true; - ConvertColorsToDialogAddNewLines = true; - ConvertColorsToDialogReBreakLines = false; - ColumnPasteColumn = "all"; - ColumnPasteOverwriteMode = "overwrite"; - AssaAttachmentFontTextPreview = - "Hello World!" + Environment.NewLine + - "こんにちは世界" + Environment.NewLine + - "你好世界!" + Environment.NewLine + - "1234567890"; - BlankVideoColor = Color.CadetBlue; - BlankVideoUseCheckeredImage = true; - BlankVideoMinutes = 2; - BlankVideoFrameRate = 23.976m; - AssaProgressBarForeColor = Color.FromArgb(200, 200, 0, 0); - AssaProgressBarBackColor = Color.FromArgb(150, 80, 80, 80); - AssaProgressBarTextColor = Color.White; - AssaProgressBarHeight = 40; - AssaProgressBarSplitterWidth = 2; - AssaProgressBarSplitterHeight = 40; - AssaProgressBarFontName = "Arial"; - AssaProgressBarFontSize = 30; - AssaProgressBarTextAlign = "left"; - - AssaBgBoxPaddingLeft = 10; - AssaBgBoxPaddingRight = 10; - AssaBgBoxPaddingTop = 6; - AssaBgBoxPaddingBottom = 6; - AssaBgBoxColor = Color.FromArgb(200, 0, 0, 0); - AssaBgBoxOutlineColor = Color.FromArgb(200, 80, 80, 80); - AssaBgBoxShadowColor = Color.FromArgb(100, 0, 0, 0); - AssaBgBoxTransparentColor = Color.Cyan; - AssaBgBoxStyle = "square"; - AssaBgBoxStyleRadius = 30; - AssaBgBoxStyleCircleAdjustY = 30; - AssaBgBoxStyleSpikesStep = 15; - AssaBgBoxStyleSpikesHeight = 30; - AssaBgBoxStyleBubblesStep = 75; - AssaBgBoxStyleBubblesHeight = 40; - AssaBgBoxOutlineWidth = 0; - AssaBgBoxLayer = -11893; - AssaBgBoxDrawingFileWatch = true; - - GenVideoEncoding = "libx264"; - GenVideoPreset = "medium"; - GenVideoCrf = "23"; - GenVideoTune = "film"; - GenVideoAudioEncoding = "copy"; - GenVideoAudioForceStereo = true; - GenVideoAudioSampleRate = "48000"; - GenVideoFontBold = true; - GenVideoOutline = 6; - GenVideoFontSizePercentOfHeight = 0.078f; - GenVideoNonAssaBox = true; - GenVideoNonAssaBoxColor = Color.FromArgb(150, 0, 0, 0); - GenVideoNonAssaTextColor = Color.White; - GenVideoEmbedOutputSuffix = "embed"; - GenVideoEmbedOutputReplace = "embed" + Environment.NewLine + "SoftSub" + Environment.NewLine + "SoftSubbed"; - GenVideoOutputFileSuffix = "_new"; - VoskPostProcessing = true; - WhisperChoice = Configuration.IsRunningOnWindows ? AudioToText.WhisperChoice.PurfviewFasterWhisper : AudioToText.WhisperChoice.OpenAi; - WhisperDeleteTempFiles = true; - WhisperPurfviewFasterWhisperDefaultCmd = "--standard"; - WhisperExtraSettings = ""; - WhisperLanguageCode = "en"; - WhisperAutoAdjustTimings = true; - WhisperPostProcessingAddPeriods = false; - WhisperPostProcessingMergeLines = true; - WhisperPostProcessingSplitLines = true; - WhisperPostProcessingFixCasing = false; - WhisperPostProcessingFixShortDuration = true; - AudioToTextLineMaxChars = 86; - AudioToTextLineMaxCharsJp = 32; - AudioToTextLineMaxCharsCn = 36; - } - } - - public class FcpExportSettings - { - public string FontName { get; set; } - public int FontSize { get; set; } - public string Alignment { get; set; } - public int Baseline { get; set; } - public Color Color { get; set; } - - public FcpExportSettings() - { - FontName = "Lucida Sans"; - FontSize = 36; - Alignment = "center"; - Baseline = 29; - Color = Color.WhiteSmoke; - } - } - - - public class WordListSettings - { - public string LastLanguage { get; set; } - public string NamesUrl { get; set; } - public bool UseOnlineNames { get; set; } - - public WordListSettings() - { - LastLanguage = "en-US"; - NamesUrl = "https://raw.githubusercontent.com/SubtitleEdit/subtitleedit/main/Dictionaries/names.xml"; - } - } - - public class SubtitleSettings - { - public List AssaStyleStorageCategories { get; set; } - public List AssaOverrideTagHistory { get; set; } - public bool AssaResolutionAutoNew { get; set; } - public bool AssaResolutionPromptChange { get; set; } - public bool AssaShowScaledBorderAndShadow { get; set; } - public bool AssaShowPlayDepth { get; set; } - public string DCinemaFontFile { get; set; } - public string DCinemaLoadFontResource { get; set; } - public int DCinemaFontSize { get; set; } - public int DCinemaBottomMargin { get; set; } - public double DCinemaZPosition { get; set; } - public int DCinemaFadeUpTime { get; set; } - public int DCinemaFadeDownTime { get; set; } - public bool DCinemaAutoGenerateSubtitleId { get; set; } - - public string CurrentDCinemaSubtitleId { get; set; } - public string CurrentDCinemaMovieTitle { get; set; } - public string CurrentDCinemaReelNumber { get; set; } - public string CurrentDCinemaIssueDate { get; set; } - public string CurrentDCinemaLanguage { get; set; } - public string CurrentDCinemaEditRate { get; set; } - public string CurrentDCinemaTimeCodeRate { get; set; } - public string CurrentDCinemaStartTime { get; set; } - public string CurrentDCinemaFontId { get; set; } - public string CurrentDCinemaFontUri { get; set; } - public Color CurrentDCinemaFontColor { get; set; } - public string CurrentDCinemaFontEffect { get; set; } - public Color CurrentDCinemaFontEffectColor { get; set; } - public int CurrentDCinemaFontSize { get; set; } - - public int CurrentCavena890LanguageIdLine1 { get; set; } - public int CurrentCavena890LanguageIdLine2 { get; set; } - public string CurrentCavena89Title { get; set; } - public string CurrentCavena890riginalTitle { get; set; } - public string CurrentCavena890Translator { get; set; } - public string CurrentCavena89Comment { get; set; } - public int CurrentCavena89LanguageId { get; set; } - public string Cavena890StartOfMessage { get; set; } - - public bool EbuStlTeletextUseBox { get; set; } - public bool EbuStlTeletextUseDoubleHeight { get; set; } - public int EbuStlMarginTop { get; set; } - public int EbuStlMarginBottom { get; set; } - public int EbuStlNewLineRows { get; set; } - public bool EbuStlRemoveEmptyLines { get; set; } - public int PacVerticalTop { get; set; } - public int PacVerticalCenter { get; set; } - public int PacVerticalBottom { get; set; } - - public string DvdStudioProHeader { get; set; } - - public string TmpegEncXmlFontName { get; set; } - public string TmpegEncXmlFontHeight { get; set; } - public string TmpegEncXmlPosition { get; set; } - - public bool CheetahCaptionAlwayWriteEndTime { get; set; } - - public bool SamiDisplayTwoClassesAsTwoSubtitles { get; set; } - public int SamiHtmlEncodeMode { get; set; } - - public string TimedText10TimeCodeFormat { get; set; } - public string TimedText10TimeCodeFormatSource { get; set; } - public bool TimedText10ShowStyleAndLanguage { get; set; } - public string TimedText10FileExtension { get; set; } - public string TimedTextItunesTopOrigin { get; set; } - public string TimedTextItunesTopExtent { get; set; } - public string TimedTextItunesBottomOrigin { get; set; } - public string TimedTextItunesBottomExtent { get; set; } - public string TimedTextItunesTimeCodeFormat { get; set; } - public string TimedTextItunesStyleAttribute { get; set; } - public string TimedTextImsc11TimeCodeFormat { get; set; } - public string TimedTextImsc11FileExtension { get; set; } - - - public int FcpFontSize { get; set; } - public string FcpFontName { get; set; } - - public string NuendoCharacterListFile { get; set; } - - public bool WebVttUseXTimestampMap { get; set; } - public bool WebVttUseMultipleXTimestampMap { get; set; } - public bool WebVttMergeLinesWithSameText { get; set; } - public long WebVttTimescale { get; set; } - public string WebVttCueAn1 { get; set; } - public string WebVttCueAn2 { get; set; } - public string WebVttCueAn3 { get; set; } - public string WebVttCueAn4 { get; set; } - public string WebVttCueAn5 { get; set; } - public string WebVttCueAn6 { get; set; } - public string WebVttCueAn7 { get; set; } - public string WebVttCueAn8 { get; set; } - public string WebVttCueAn9 { get; set; } - public string MPlayer2Extension { get; set; } - public bool TeletextItalicFix { get; set; } - public bool MccDebug { get; set; } - public bool BluRaySupSkipMerge { get; set; } - public bool BluRaySupForceMergeAll { get; set; } - - public SubtitleSettings() - { - AssaStyleStorageCategories = new List(); - AssaOverrideTagHistory = new List(); - AssaResolutionAutoNew = true; - AssaResolutionPromptChange = true; - AssaShowScaledBorderAndShadow = true; - AssaShowPlayDepth = true; - - DCinemaFontFile = "Arial.ttf"; - DCinemaLoadFontResource = "urn:uuid:3dec6dc0-39d0-498d-97d0-928d2eb78391"; - DCinemaFontSize = 42; - DCinemaBottomMargin = 8; - DCinemaZPosition = 0; - DCinemaFadeUpTime = 0; - DCinemaFadeDownTime = 0; - DCinemaAutoGenerateSubtitleId = true; - - EbuStlTeletextUseBox = true; - EbuStlTeletextUseDoubleHeight = true; - EbuStlMarginTop = 0; - EbuStlMarginBottom = 2; - EbuStlNewLineRows = 2; - - PacVerticalTop = 1; - PacVerticalCenter = 6; - PacVerticalBottom = 11; - - DvdStudioProHeader = @"$VertAlign = Bottom -$Bold = FALSE -$Underlined = FALSE -$Italic = FALSE -$XOffset = 0 -$YOffset = -5 -$TextContrast = 15 -$Outline1Contrast = 15 -$Outline2Contrast = 13 -$BackgroundContrast = 0 -$ForceDisplay = FALSE -$FadeIn = 0 -$FadeOut = 0 -$HorzAlign = Center -"; - - TmpegEncXmlFontName = "Tahoma"; - TmpegEncXmlFontHeight = "0.069"; - TmpegEncXmlPosition = "23"; - - SamiDisplayTwoClassesAsTwoSubtitles = true; - SamiHtmlEncodeMode = 0; - - TimedText10TimeCodeFormat = "Source"; - TimedText10ShowStyleAndLanguage = true; - TimedText10FileExtension = ".xml"; - - TimedTextItunesTopOrigin = "0% 0%"; - TimedTextItunesTopExtent = "100% 15%"; - TimedTextItunesBottomOrigin = "0% 85%"; - TimedTextItunesBottomExtent = "100% 15%"; - TimedTextItunesTimeCodeFormat = "Frames"; - TimedTextItunesStyleAttribute = "tts:fontStyle"; - TimedTextImsc11TimeCodeFormat = "hh:mm:ss.ms"; - TimedTextImsc11FileExtension = ".xml"; - - FcpFontSize = 18; - FcpFontName = "Lucida Grande"; - - Cavena890StartOfMessage = "10:00:00:00"; - - WebVttTimescale = 90000; - WebVttUseXTimestampMap = true; - WebVttUseMultipleXTimestampMap = true; - WebVttCueAn1 = "position:20%"; - WebVttCueAn2 = ""; - WebVttCueAn3 = "position:80%"; - WebVttCueAn4 = "position:20% line:50%"; - WebVttCueAn5 = "line:50%"; - WebVttCueAn6 = "position:80% line:50%"; - WebVttCueAn7 = "position:20% line:20%"; - WebVttCueAn8 = "line:20%"; - WebVttCueAn9 = "position:80% line:20%"; - - MPlayer2Extension = ".txt"; - - TeletextItalicFix = true; - } - - public void InitializeDCinameSettings(bool smpte) - { - if (smpte) - { - CurrentDCinemaSubtitleId = "urn:uuid:" + Guid.NewGuid(); - CurrentDCinemaLanguage = "en"; - CurrentDCinemaFontUri = DCinemaLoadFontResource; - CurrentDCinemaFontId = "theFontId"; - } - else - { - string hex = Guid.NewGuid().ToString().RemoveChar('-').ToLowerInvariant(); - hex = hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-"); - CurrentDCinemaSubtitleId = hex; - CurrentDCinemaLanguage = "English"; - CurrentDCinemaFontUri = DCinemaFontFile; - CurrentDCinemaFontId = "Arial"; - } - CurrentDCinemaIssueDate = DateTime.Now.ToString("s"); - CurrentDCinemaMovieTitle = "title"; - CurrentDCinemaReelNumber = "1"; - CurrentDCinemaFontColor = Color.White; - CurrentDCinemaFontEffect = "border"; - CurrentDCinemaFontEffectColor = Color.Black; - CurrentDCinemaFontSize = DCinemaFontSize; - CurrentCavena890LanguageIdLine1 = -1; - CurrentCavena890LanguageIdLine2 = -1; - } - } - - public class ProxySettings - { - public string ProxyAddress { get; set; } - public string AuthType { get; set; } - public bool UseDefaultCredentials { get; set; } - public string UserName { get; set; } - public string Password { get; set; } - public string Domain { get; set; } - - public string DecodePassword() - { - return Encoding.UTF8.GetString(Convert.FromBase64String(Password)); - } - public void EncodePassword(string unencryptedPassword) - { - Password = Convert.ToBase64String(Encoding.UTF8.GetBytes(unencryptedPassword)); - } - } - - public class FixCommonErrorsSettings - { - public string StartPosition { get; set; } - public string StartSize { get; set; } - public bool EmptyLinesTicked { get; set; } - public bool OverlappingDisplayTimeTicked { get; set; } - public bool TooShortDisplayTimeTicked { get; set; } - public bool TooLongDisplayTimeTicked { get; set; } - public bool TooShortGapTicked { get; set; } - public bool InvalidItalicTagsTicked { get; set; } - public bool BreakLongLinesTicked { get; set; } - public bool MergeShortLinesTicked { get; set; } - public bool MergeShortLinesAllTicked { get; set; } - public bool MergeShortLinesPixelWidthTicked { get; set; } - public bool UnneededSpacesTicked { get; set; } - public bool UnneededPeriodsTicked { get; set; } - public bool FixCommasTicked { get; set; } - public bool MissingSpacesTicked { get; set; } - public bool AddMissingQuotesTicked { get; set; } - public bool Fix3PlusLinesTicked { get; set; } - public bool FixHyphensTicked { get; set; } - public bool FixHyphensRemoveSingleLineTicked { get; set; } - public bool UppercaseIInsideLowercaseWordTicked { get; set; } - public bool DoubleApostropheToQuoteTicked { get; set; } - public bool AddPeriodAfterParagraphTicked { get; set; } - public bool StartWithUppercaseLetterAfterParagraphTicked { get; set; } - public bool StartWithUppercaseLetterAfterPeriodInsideParagraphTicked { get; set; } - public bool StartWithUppercaseLetterAfterColonTicked { get; set; } - public bool AloneLowercaseIToUppercaseIEnglishTicked { get; set; } - public bool FixOcrErrorsViaReplaceListTicked { get; set; } - public bool RemoveSpaceBetweenNumberTicked { get; set; } - public bool FixDialogsOnOneLineTicked { get; set; } - public bool RemoveDialogFirstLineInNonDialogs { get; set; } - public bool TurkishAnsiTicked { get; set; } - public bool DanishLetterITicked { get; set; } - public bool SpanishInvertedQuestionAndExclamationMarksTicked { get; set; } - public bool FixDoubleDashTicked { get; set; } - public bool FixDoubleGreaterThanTicked { get; set; } - public bool FixEllipsesStartTicked { get; set; } - public bool FixMissingOpenBracketTicked { get; set; } - public bool FixMusicNotationTicked { get; set; } - public bool FixContinuationStyleTicked { get; set; } - public bool FixUnnecessaryLeadingDotsTicked { get; set; } - public bool NormalizeStringsTicked { get; set; } - public string DefaultFixes { get; set; } - - - public FixCommonErrorsSettings() - { - SetDefaultFixes(); - } - - public void SaveUserDefaultFixes() - { - var sb = new StringBuilder(); - - if (EmptyLinesTicked) - { - sb.Append(nameof(EmptyLinesTicked) + ";"); - } - - if (OverlappingDisplayTimeTicked) - { - sb.Append(nameof(OverlappingDisplayTimeTicked) + ";"); - } - - if (TooShortDisplayTimeTicked) - { - sb.Append(nameof(TooShortDisplayTimeTicked) + ";"); - } - - if (TooLongDisplayTimeTicked) - { - sb.Append(nameof(TooLongDisplayTimeTicked) + ";"); - } - - if (TooShortGapTicked) - { - sb.Append(nameof(TooShortGapTicked) + ";"); - } - - if (InvalidItalicTagsTicked) - { - sb.Append(nameof(InvalidItalicTagsTicked) + ";"); - } - - if (BreakLongLinesTicked) - { - sb.Append(nameof(BreakLongLinesTicked) + ";"); - } - - if (MergeShortLinesTicked) - { - sb.Append(nameof(MergeShortLinesTicked) + ";"); - } - - if (MergeShortLinesAllTicked) - { - sb.Append(nameof(MergeShortLinesAllTicked) + ";"); - } - - if (MergeShortLinesPixelWidthTicked) - { - sb.Append(nameof(MergeShortLinesPixelWidthTicked) + ";"); - } - - if (UnneededSpacesTicked) - { - sb.Append(nameof(UnneededSpacesTicked) + ";"); - } - - if (UnneededPeriodsTicked) - { - sb.Append(nameof(UnneededPeriodsTicked) + ";"); - } - - if (FixCommasTicked) - { - sb.Append(nameof(FixCommasTicked) + ";"); - } - - if (MissingSpacesTicked) - { - sb.Append(nameof(MissingSpacesTicked) + ";"); - } - - if (AddMissingQuotesTicked) - { - sb.Append(nameof(AddMissingQuotesTicked) + ";"); - } - - if (Fix3PlusLinesTicked) - { - sb.Append(nameof(Fix3PlusLinesTicked) + ";"); - } - - if (FixHyphensTicked) - { - sb.Append(nameof(FixHyphensTicked) + ";"); - } - - if (FixHyphensRemoveSingleLineTicked) - { - sb.Append(nameof(FixHyphensRemoveSingleLineTicked) + ";"); - } - - if (UppercaseIInsideLowercaseWordTicked) - { - sb.Append(nameof(UppercaseIInsideLowercaseWordTicked) + ";"); - } - - if (DoubleApostropheToQuoteTicked) - { - sb.Append(nameof(DoubleApostropheToQuoteTicked) + ";"); - } - - if (AddPeriodAfterParagraphTicked) - { - sb.Append(nameof(AddPeriodAfterParagraphTicked) + ";"); - } - - if (StartWithUppercaseLetterAfterParagraphTicked) - { - sb.Append(nameof(StartWithUppercaseLetterAfterParagraphTicked) + ";"); - } - - if (StartWithUppercaseLetterAfterPeriodInsideParagraphTicked) - { - sb.Append(nameof(StartWithUppercaseLetterAfterPeriodInsideParagraphTicked) + ";"); - } - - if (StartWithUppercaseLetterAfterColonTicked) - { - sb.Append(nameof(StartWithUppercaseLetterAfterColonTicked) + ";"); - } - - if (AloneLowercaseIToUppercaseIEnglishTicked) - { - sb.Append(nameof(AloneLowercaseIToUppercaseIEnglishTicked) + ";"); - } - - if (FixOcrErrorsViaReplaceListTicked) - { - sb.Append(nameof(FixOcrErrorsViaReplaceListTicked) + ";"); - } - - if (RemoveSpaceBetweenNumberTicked) - { - sb.Append(nameof(RemoveSpaceBetweenNumberTicked) + ";"); - } - - if (FixDialogsOnOneLineTicked) - { - sb.Append(nameof(FixDialogsOnOneLineTicked) + ";"); - } - - if (RemoveDialogFirstLineInNonDialogs) - { - sb.Append(nameof(RemoveDialogFirstLineInNonDialogs) + ";"); - } - - if (TurkishAnsiTicked) - { - sb.Append(nameof(TurkishAnsiTicked) + ";"); - } - - if (DanishLetterITicked) - { - sb.Append(nameof(DanishLetterITicked) + ";"); - } - - if (SpanishInvertedQuestionAndExclamationMarksTicked) - { - sb.Append(nameof(SpanishInvertedQuestionAndExclamationMarksTicked) + ";"); - } - - if (FixDoubleDashTicked) - { - sb.Append(nameof(FixDoubleDashTicked) + ";"); - } - - if (FixEllipsesStartTicked) - { - sb.Append(nameof(FixEllipsesStartTicked) + ";"); - } - - if (FixMissingOpenBracketTicked) - { - sb.Append(nameof(FixMissingOpenBracketTicked) + ";"); - } - - if (FixMusicNotationTicked) - { - sb.Append(nameof(FixMusicNotationTicked) + ";"); - } - - if (FixContinuationStyleTicked) - { - sb.Append(nameof(FixContinuationStyleTicked) + ";"); - } - - if (FixUnnecessaryLeadingDotsTicked) - { - sb.Append(nameof(FixUnnecessaryLeadingDotsTicked) + ";"); - } - - if (NormalizeStringsTicked) - { - sb.Append(nameof(NormalizeStringsTicked) + ";"); - } - - DefaultFixes = sb.ToString().TrimEnd(';'); - } - - public void LoadUserDefaultFixes(string fixes) - { - var list = fixes.Split(';'); - EmptyLinesTicked = list.Contains(nameof(EmptyLinesTicked)); - OverlappingDisplayTimeTicked = list.Contains(nameof(OverlappingDisplayTimeTicked)); - TooShortDisplayTimeTicked = list.Contains(nameof(TooShortDisplayTimeTicked)); - TooLongDisplayTimeTicked = list.Contains(nameof(TooLongDisplayTimeTicked)); - TooShortGapTicked = list.Contains(nameof(TooShortGapTicked)); - InvalidItalicTagsTicked = list.Contains(nameof(InvalidItalicTagsTicked)); - BreakLongLinesTicked = list.Contains(nameof(BreakLongLinesTicked)); - MergeShortLinesTicked = list.Contains(nameof(MergeShortLinesTicked)); - MergeShortLinesAllTicked = list.Contains(nameof(MergeShortLinesAllTicked)); - MergeShortLinesPixelWidthTicked = list.Contains(nameof(MergeShortLinesPixelWidthTicked)); - UnneededSpacesTicked = list.Contains(nameof(UnneededSpacesTicked)); - UnneededPeriodsTicked = list.Contains(nameof(UnneededPeriodsTicked)); - FixCommasTicked = list.Contains(nameof(FixCommasTicked)); - MissingSpacesTicked = list.Contains(nameof(MissingSpacesTicked)); - AddMissingQuotesTicked = list.Contains(nameof(AddMissingQuotesTicked)); - Fix3PlusLinesTicked = list.Contains(nameof(Fix3PlusLinesTicked)); - FixHyphensTicked = list.Contains(nameof(FixHyphensTicked)); - FixHyphensRemoveSingleLineTicked = list.Contains(nameof(FixHyphensRemoveSingleLineTicked)); - UppercaseIInsideLowercaseWordTicked = list.Contains(nameof(UppercaseIInsideLowercaseWordTicked)); - DoubleApostropheToQuoteTicked = list.Contains(nameof(DoubleApostropheToQuoteTicked)); - AddPeriodAfterParagraphTicked = list.Contains(nameof(AddPeriodAfterParagraphTicked)); - StartWithUppercaseLetterAfterParagraphTicked = list.Contains(nameof(StartWithUppercaseLetterAfterParagraphTicked)); - StartWithUppercaseLetterAfterPeriodInsideParagraphTicked = list.Contains(nameof(StartWithUppercaseLetterAfterPeriodInsideParagraphTicked)); - StartWithUppercaseLetterAfterColonTicked = list.Contains(nameof(StartWithUppercaseLetterAfterColonTicked)); - AloneLowercaseIToUppercaseIEnglishTicked = list.Contains(nameof(AloneLowercaseIToUppercaseIEnglishTicked)); - FixOcrErrorsViaReplaceListTicked = list.Contains(nameof(FixOcrErrorsViaReplaceListTicked)); - RemoveSpaceBetweenNumberTicked = list.Contains(nameof(RemoveSpaceBetweenNumberTicked)); - FixDialogsOnOneLineTicked = list.Contains(nameof(FixDialogsOnOneLineTicked)); - RemoveDialogFirstLineInNonDialogs = list.Contains(nameof(RemoveDialogFirstLineInNonDialogs)); - TurkishAnsiTicked = list.Contains(nameof(TurkishAnsiTicked)); - DanishLetterITicked = list.Contains(nameof(DanishLetterITicked)); - SpanishInvertedQuestionAndExclamationMarksTicked = list.Contains(nameof(SpanishInvertedQuestionAndExclamationMarksTicked)); - FixDoubleDashTicked = list.Contains(nameof(FixDoubleDashTicked)); - FixEllipsesStartTicked = list.Contains(nameof(FixEllipsesStartTicked)); - FixMissingOpenBracketTicked = list.Contains(nameof(FixMissingOpenBracketTicked)); - FixMusicNotationTicked = list.Contains(nameof(FixMusicNotationTicked)); - FixContinuationStyleTicked = list.Contains(nameof(FixContinuationStyleTicked)); - FixUnnecessaryLeadingDotsTicked = list.Contains(nameof(FixUnnecessaryLeadingDotsTicked)); - NormalizeStringsTicked = list.Contains(nameof(NormalizeStringsTicked)); - } - - public void SetDefaultFixes() - { - LoadUserDefaultFixes(string.Empty); - EmptyLinesTicked = true; - OverlappingDisplayTimeTicked = true; - TooShortDisplayTimeTicked = true; - TooLongDisplayTimeTicked = true; - TooShortGapTicked = false; - InvalidItalicTagsTicked = true; - BreakLongLinesTicked = true; - MergeShortLinesTicked = true; - MergeShortLinesPixelWidthTicked = false; - UnneededPeriodsTicked = true; - FixCommasTicked = true; - UnneededSpacesTicked = true; - MissingSpacesTicked = true; - UppercaseIInsideLowercaseWordTicked = true; - DoubleApostropheToQuoteTicked = true; - AddPeriodAfterParagraphTicked = false; - StartWithUppercaseLetterAfterParagraphTicked = true; - StartWithUppercaseLetterAfterPeriodInsideParagraphTicked = false; - StartWithUppercaseLetterAfterColonTicked = false; - AloneLowercaseIToUppercaseIEnglishTicked = false; - TurkishAnsiTicked = false; - DanishLetterITicked = false; - FixDoubleDashTicked = true; - FixDoubleGreaterThanTicked = true; - FixEllipsesStartTicked = true; - FixMissingOpenBracketTicked = true; - FixMusicNotationTicked = true; - FixContinuationStyleTicked = false; - FixUnnecessaryLeadingDotsTicked = true; - NormalizeStringsTicked = false; - SaveUserDefaultFixes(); - } - } - - public class GeneralSettings - { - public List Profiles { get; set; } - public string CurrentProfile { get; set; } - public bool ShowToolbarNew { get; set; } - public bool ShowToolbarOpen { get; set; } - public bool ShowToolbarOpenVideo { get; set; } - public bool ShowToolbarSave { get; set; } - public bool ShowToolbarSaveAs { get; set; } - public bool ShowToolbarFind { get; set; } - public bool ShowToolbarReplace { get; set; } - public bool ShowToolbarFixCommonErrors { get; set; } - public bool ShowToolbarRemoveTextForHi { get; set; } - public bool ShowToolbarToggleSourceView { get; set; } - public bool ShowToolbarVisualSync { get; set; } - public bool ShowToolbarBurnIn { get; set; } - public bool ShowToolbarSpellCheck { get; set; } - public bool ShowToolbarNetflixGlyphCheck { get; set; } - public bool ShowToolbarBeautifyTimeCodes { get; set; } - public bool ShowToolbarSettings { get; set; } - public bool ShowToolbarHelp { get; set; } - - public int LayoutNumber { get; set; } - public string LayoutSizes { get; set; } - public bool ShowVideoPlayer { get; set; } - public bool ShowAudioVisualizer { get; set; } - public bool ShowWaveform { get; set; } - public bool ShowSpectrogram { get; set; } - public bool ShowFrameRate { get; set; } - public bool ShowVideoControls { get; set; } - public bool TextAndOrigianlTextBoxesSwitched { get; set; } - public double DefaultFrameRate { get; set; } - public double CurrentFrameRate { get; set; } - public string DefaultSubtitleFormat { get; set; } - public string DefaultSaveAsFormat { get; set; } - public string FavoriteSubtitleFormats { get; set; } - public string DefaultEncoding { get; set; } - public bool AutoConvertToUtf8 { get; set; } - public bool AutoGuessAnsiEncoding { get; set; } - public string TranslationAutoSuffixes { get; set; } - public string TranslationAutoSuffixDefault { get; set; } - public string SystemSubtitleFontNameOverride { get; set; } - public int SystemSubtitleFontSizeOverride { get; set; } - - public string SubtitleFontName { get; set; } - public int SubtitleTextBoxFontSize { get; set; } - public bool SubtitleTextBoxSyntaxColor { get; set; } - public Color SubtitleTextBoxHtmlColor { get; set; } - public Color SubtitleTextBoxAssColor { get; set; } - public int SubtitleListViewFontSize { get; set; } - public bool SubtitleTextBoxFontBold { get; set; } - public bool SubtitleListViewFontBold { get; set; } - public Color SubtitleFontColor { get; set; } - public Color SubtitleBackgroundColor { get; set; } - public string MeasureFontName { get; set; } - public int MeasureFontSize { get; set; } - public bool MeasureFontBold { get; set; } - public int SubtitleLineMaximumPixelWidth { get; set; } - public bool CenterSubtitleInTextBox { get; set; } - public bool ShowRecentFiles { get; set; } - public bool RememberSelectedLine { get; set; } - public bool StartLoadLastFile { get; set; } - public bool StartRememberPositionAndSize { get; set; } - public string StartPosition { get; set; } - public string StartSize { get; set; } - public bool StartInSourceView { get; set; } - public bool RemoveBlankLinesWhenOpening { get; set; } - public bool RemoveBadCharsWhenOpening { get; set; } - public int SubtitleLineMaximumLength { get; set; } - public int MaxNumberOfLines { get; set; } - public int MaxNumberOfLinesPlusAbort { get; set; } - public int MergeLinesShorterThan { get; set; } - public int SubtitleMinimumDisplayMilliseconds { get; set; } - public int SubtitleMaximumDisplayMilliseconds { get; set; } - public int MinimumMillisecondsBetweenLines { get; set; } - public int SetStartEndHumanDelay { get; set; } - public bool AutoWrapLineWhileTyping { get; set; } - public double SubtitleMaximumCharactersPerSeconds { get; set; } - public double SubtitleOptimalCharactersPerSeconds { get; set; } - public string CpsLineLengthStrategy { get; set; } - public double SubtitleMaximumWordsPerMinute { get; set; } - public DialogType DialogStyle { get; set; } - public ContinuationStyle ContinuationStyle { get; set; } - public int ContinuationPause { get; set; } - public string CustomContinuationStyleSuffix { get; set; } - public bool CustomContinuationStyleSuffixApplyIfComma { get; set; } - public bool CustomContinuationStyleSuffixAddSpace { get; set; } - public bool CustomContinuationStyleSuffixReplaceComma { get; set; } - public string CustomContinuationStylePrefix { get; set; } - public bool CustomContinuationStylePrefixAddSpace { get; set; } - public bool CustomContinuationStyleUseDifferentStyleGap { get; set; } - public string CustomContinuationStyleGapSuffix { get; set; } - public bool CustomContinuationStyleGapSuffixApplyIfComma { get; set; } - public bool CustomContinuationStyleGapSuffixAddSpace { get; set; } - public bool CustomContinuationStyleGapSuffixReplaceComma { get; set; } - public string CustomContinuationStyleGapPrefix { get; set; } - public bool CustomContinuationStyleGapPrefixAddSpace { get; set; } - public bool FixContinuationStyleUncheckInsertsAllCaps { get; set; } - public bool FixContinuationStyleUncheckInsertsItalic { get; set; } - public bool FixContinuationStyleUncheckInsertsLowercase { get; set; } - public bool FixContinuationStyleHideContinuationCandidatesWithoutName { get; set; } - public bool FixContinuationStyleIgnoreLyrics { get; set; } - public string SpellCheckLanguage { get; set; } - public string VideoPlayer { get; set; } - public int VideoPlayerDefaultVolume { get; set; } - public string VideoPlayerPreviewFontName { get; set; } - public int VideoPlayerPreviewFontSize { get; set; } - public bool VideoPlayerPreviewFontBold { get; set; } - public bool VideoPlayerShowStopButton { get; set; } - public bool VideoPlayerShowFullscreenButton { get; set; } - public bool VideoPlayerShowMuteButton { get; set; } - public string Language { get; set; } - public string ListViewLineSeparatorString { get; set; } - public int ListViewDoubleClickAction { get; set; } - public string SaveAsUseFileNameFrom { get; set; } - public string UppercaseLetters { get; set; } - public int DefaultAdjustMilliseconds { get; set; } - public bool AutoRepeatOn { get; set; } - public int AutoRepeatCount { get; set; } - public bool AutoContinueOn { get; set; } - public int AutoContinueDelay { get; set; } - public bool ReturnToStartAfterRepeat { get; set; } - public bool SyncListViewWithVideoWhilePlaying { get; set; } - public int AutoBackupSeconds { get; set; } - public int AutoBackupDeleteAfterMonths { get; set; } - public string SpellChecker { get; set; } - public bool AllowEditOfOriginalSubtitle { get; set; } - public bool PromptDeleteLines { get; set; } - public bool Undocked { get; set; } - public string UndockedVideoPosition { get; set; } - public bool UndockedVideoFullscreen { get; set; } - public string UndockedWaveformPosition { get; set; } - public string UndockedVideoControlsPosition { get; set; } - public bool WaveformCenter { get; set; } - public bool WaveformAutoGenWhenOpeningVideo { get; set; } - public int WaveformUpdateIntervalMs { get; set; } - public int SmallDelayMilliseconds { get; set; } - public int LargeDelayMilliseconds { get; set; } - public bool ShowOriginalAsPreviewIfAvailable { get; set; } - public int LastPacCodePage { get; set; } - public string OpenSubtitleExtraExtensions { get; set; } - public bool ListViewColumnsRememberSize { get; set; } - - public int ListViewNumberWidth { get; set; } - public int ListViewStartWidth { get; set; } - public int ListViewEndWidth { get; set; } - public int ListViewDurationWidth { get; set; } - public int ListViewCpsWidth { get; set; } - public int ListViewWpmWidth { get; set; } - public int ListViewGapWidth { get; set; } - public int ListViewActorWidth { get; set; } - public int ListViewRegionWidth { get; set; } - public int ListViewTextWidth { get; set; } - - public int ListViewNumberDisplayIndex { get; set; } = -1; - public int ListViewStartDisplayIndex { get; set; } = -1; - public int ListViewEndDisplayIndex { get; set; } = -1; - public int ListViewDurationDisplayIndex { get; set; } = -1; - public int ListViewCpsDisplayIndex { get; set; } = -1; - public int ListViewWpmDisplayIndex { get; set; } = -1; - public int ListViewGapDisplayIndex { get; set; } = -1; - public int ListViewActorDisplayIndex { get; set; } = -1; - public int ListViewRegionDisplayIndex { get; set; } = -1; - public int ListViewTextDisplayIndex { get; set; } = -1; - - public bool DirectShowDoubleLoad { get; set; } - public string VlcWaveTranscodeSettings { get; set; } - public string VlcLocation { get; set; } - public string VlcLocationRelative { get; set; } - public string MpvVideoOutputWindows { get; set; } - public string MpvVideoOutputLinux { get; set; } - public string MpvVideoVf { get; set; } - public string MpvVideoAf { get; set; } - public string MpvExtraOptions { get; set; } - public bool MpvLogging { get; set; } - public bool MpvHandlesPreviewText { get; set; } - public Color MpvPreviewTextPrimaryColor { get; set; } - public Color MpvPreviewTextOutlineColor { get; set; } - public Color MpvPreviewTextBackgroundColor { get; set; } - public decimal MpvPreviewTextOutlineWidth { get; set; } - public decimal MpvPreviewTextShadowWidth { get; set; } - public bool MpvPreviewTextOpaqueBox { get; set; } - public string MpvPreviewTextOpaqueBoxStyle { get; set; } - public string MpvPreviewTextAlignment { get; set; } - public int MpvPreviewTextMarginVertical { get; set; } - public string MpcHcLocation { get; set; } - public string MkvMergeLocation { get; set; } - public bool UseFFmpegForWaveExtraction { get; set; } - public bool FFmpegUseCenterChannelOnly { get; set; } - public string FFmpegLocation { get; set; } - public string FFmpegSceneThreshold { get; set; } - public bool UseTimeFormatHHMMSSFF { get; set; } - public int SplitBehavior { get; set; } - public bool SplitRemovesDashes { get; set; } - public int ClearStatusBarAfterSeconds { get; set; } - public string Company { get; set; } - public bool MoveVideo100Or500MsPlaySmallSample { get; set; } - public bool DisableVideoAutoLoading { get; set; } - public bool DisableShowingLoadErrors { get; set; } - public bool AllowVolumeBoost { get; set; } - public int NewEmptyDefaultMs { get; set; } - public bool NewEmptyUseAutoDuration { get; set; } - public bool RightToLeftMode { get; set; } - public string LastSaveAsFormat { get; set; } - public bool CheckForUpdates { get; set; } - public DateTime LastCheckForUpdates { get; set; } - public bool AutoSave { get; set; } - public string PreviewAssaText { get; set; } - public string TagsInToggleHiTags { get; set; } - public string TagsInToggleCustomTags { get; set; } - public bool ShowProgress { get; set; } - public bool ShowNegativeDurationInfoOnSave { get; set; } - public bool ShowFormatRequiresUtf8Warning { get; set; } - public long DefaultVideoOffsetInMs { get; set; } - public string DefaultVideoOffsetInMsList { get; set; } - public long CurrentVideoOffsetInMs { get; set; } - public bool CurrentVideoIsSmpte { get; set; } - public bool AutoSetVideoSmpteForTtml { get; set; } - public bool AutoSetVideoSmpteForTtmlPrompt { get; set; } - public string TitleBarAsterisk { get; set; } // Show asteriks "before" or "after" file name (any other value will hide asteriks) - public bool TitleBarFullFileName { get; set; } // Show full file name with path or just file name - public bool MeasurementConverterCloseOnInsert { get; set; } - public string MeasurementConverterCategories { get; set; } - public bool SubtitleTextBoxAutoVerticalScrollBars { get; set; } - public int SubtitleTextBoxMaxHeight { get; set; } - public bool AllowLetterShortcutsInTextBox { get; set; } - public Color DarkThemeForeColor { get; set; } - public Color DarkThemeBackColor { get; set; } - public Color DarkThemeSelectedBackgroundColor { get; set; } - public Color DarkThemeDisabledColor { get; set; } - public Color LastColorPickerColor { get; set; } - public Color LastColorPickerColor1 { get; set; } - public Color LastColorPickerColor2 { get; set; } - public Color LastColorPickerColor3 { get; set; } - public Color LastColorPickerColor4 { get; set; } - public Color LastColorPickerColor5 { get; set; } - public Color LastColorPickerColor6 { get; set; } - public Color LastColorPickerColor7 { get; set; } - public Color LastColorPickerDropper { get; set; } - public string ToolbarIconTheme { get; set; } - public bool UseDarkTheme { get; set; } - public bool DarkThemeShowListViewGridLines { get; set; } - public bool ShowBetaStuff { get; set; } - public bool DebugTranslationSync { get; set; } - public bool UseLegacyDownloader { get; set; } - public bool UseLegacyHtmlColor { get; set; } = true; - public string DefaultLanguages { get; set; } - - public GeneralSettings() - { - ShowToolbarNew = true; - ShowToolbarOpen = true; - ShowToolbarSave = true; - ShowToolbarSaveAs = false; - ShowToolbarFind = true; - ShowToolbarReplace = true; - ShowToolbarFixCommonErrors = false; - ShowToolbarVisualSync = true; - ShowToolbarSpellCheck = true; - ShowToolbarNetflixGlyphCheck = true; - ShowToolbarBeautifyTimeCodes = false; - ShowToolbarSettings = true; - ShowToolbarHelp = true; - ShowToolbarToggleSourceView = false; - ShowVideoPlayer = true; - ShowAudioVisualizer = true; - ShowWaveform = true; - ShowSpectrogram = true; - ShowFrameRate = false; - ShowVideoControls = true; - DefaultFrameRate = 23.976; - CurrentFrameRate = DefaultFrameRate; - SubtitleFontName = "Tahoma"; - SubtitleTextBoxFontSize = 12; - SubtitleListViewFontSize = 10; - SubtitleTextBoxSyntaxColor = false; - SubtitleTextBoxHtmlColor = Color.CornflowerBlue; - SubtitleTextBoxAssColor = Color.BlueViolet; - SubtitleTextBoxFontBold = true; - SubtitleFontColor = Color.Black; - MeasureFontName = "Arial"; - MeasureFontSize = 24; - MeasureFontBold = false; - SubtitleLineMaximumPixelWidth = 576; - SubtitleBackgroundColor = Color.White; - CenterSubtitleInTextBox = false; - DefaultSubtitleFormat = "SubRip"; - DefaultEncoding = TextEncoding.Utf8WithBom; - AutoConvertToUtf8 = false; - AutoGuessAnsiEncoding = true; - TranslationAutoSuffixes = ";.translation;_translation;.en;_en"; - TranslationAutoSuffixDefault = ""; - ShowRecentFiles = true; - RememberSelectedLine = true; - StartLoadLastFile = true; - StartRememberPositionAndSize = true; - SubtitleLineMaximumLength = 43; - MaxNumberOfLines = 2; - MaxNumberOfLinesPlusAbort = 1; - MergeLinesShorterThan = 33; - SubtitleMinimumDisplayMilliseconds = 1000; - SubtitleMaximumDisplayMilliseconds = 8 * 1000; - RemoveBadCharsWhenOpening = true; - MinimumMillisecondsBetweenLines = 24; - SetStartEndHumanDelay = 100; - AutoWrapLineWhileTyping = false; - SubtitleMaximumCharactersPerSeconds = 25.0; - SubtitleOptimalCharactersPerSeconds = 15.0; - SubtitleMaximumWordsPerMinute = 400; - DialogStyle = DialogType.DashBothLinesWithSpace; - ContinuationStyle = ContinuationStyle.None; - ContinuationPause = 300; - CustomContinuationStyleSuffix = ""; - CustomContinuationStyleSuffixApplyIfComma = false; - CustomContinuationStyleSuffixAddSpace = false; - CustomContinuationStyleSuffixReplaceComma = false; - CustomContinuationStylePrefix = ""; - CustomContinuationStylePrefixAddSpace = false; - CustomContinuationStyleUseDifferentStyleGap = true; - CustomContinuationStyleGapSuffix = "..."; - CustomContinuationStyleGapSuffixApplyIfComma = true; - CustomContinuationStyleGapSuffixAddSpace = false; - CustomContinuationStyleGapSuffixReplaceComma = true; - CustomContinuationStyleGapPrefix = "..."; - CustomContinuationStyleGapPrefixAddSpace = false; - FixContinuationStyleUncheckInsertsAllCaps = true; - FixContinuationStyleUncheckInsertsItalic = true; - FixContinuationStyleUncheckInsertsLowercase = true; - FixContinuationStyleHideContinuationCandidatesWithoutName = true; - FixContinuationStyleIgnoreLyrics = true; - SpellCheckLanguage = null; - VideoPlayer = string.Empty; - VideoPlayerDefaultVolume = 75; - VideoPlayerPreviewFontName = "Tahoma"; - VideoPlayerPreviewFontSize = 12; - VideoPlayerPreviewFontBold = true; - VideoPlayerShowStopButton = true; - VideoPlayerShowMuteButton = true; - VideoPlayerShowFullscreenButton = true; - ListViewLineSeparatorString = "
"; - ListViewDoubleClickAction = 1; - SaveAsUseFileNameFrom = "video"; - UppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWZYXÆØÃÅÄÖÉÈÁÂÀÇÊÍÓÔÕÚŁАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯĞİŞÜÙÁÌÑÎΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"; - DefaultAdjustMilliseconds = 1000; - AutoRepeatOn = true; - AutoRepeatCount = 2; - AutoContinueOn = false; - AutoContinueDelay = 2; - ReturnToStartAfterRepeat = false; - SyncListViewWithVideoWhilePlaying = false; - AutoBackupSeconds = 60 * 5; - AutoBackupDeleteAfterMonths = 3; - SpellChecker = "hunspell"; - AllowEditOfOriginalSubtitle = true; - PromptDeleteLines = true; - Undocked = false; - UndockedVideoPosition = "-32000;-32000"; - UndockedWaveformPosition = "-32000;-32000"; - UndockedVideoControlsPosition = "-32000;-32000"; - WaveformUpdateIntervalMs = 40; - SmallDelayMilliseconds = 500; - LargeDelayMilliseconds = 5000; - OpenSubtitleExtraExtensions = "*.mp4;*.m4v;*.mkv;*.ts"; // matroska/mp4/m4v files (can contain subtitles) - ListViewColumnsRememberSize = true; - DirectShowDoubleLoad = true; - VlcWaveTranscodeSettings = "acodec=s16l"; // "acodec=s16l,channels=1,ab=64,samplerate=8000"; - MpvVideoOutputWindows = string.Empty; // could also be e.g. "gpu" or "directshow" - MpvVideoOutputLinux = "x11"; // could also be e.g. "x11"; - MpvHandlesPreviewText = true; - MpvPreviewTextPrimaryColor = Color.White; - MpvPreviewTextOutlineColor = Color.Black; - MpvPreviewTextBackgroundColor = Color.Black; - MpvPreviewTextOutlineWidth = 1; - MpvPreviewTextShadowWidth = 1; - MpvPreviewTextOpaqueBox = false; - MpvPreviewTextOpaqueBoxStyle = "1"; - MpvPreviewTextAlignment = "2"; - MpvPreviewTextMarginVertical = 10; - FFmpegSceneThreshold = "0.4"; // threshold for generating shot changes - 0.2 is sensitive (more shot changes), 0.6 is less sensitive (fewer shot changes) - UseTimeFormatHHMMSSFF = false; - SplitBehavior = 1; // 0=take gap from left, 1=divide evenly, 2=take gap from right - SplitRemovesDashes = true; - ClearStatusBarAfterSeconds = 10; - MoveVideo100Or500MsPlaySmallSample = false; - DisableVideoAutoLoading = false; - NewEmptyUseAutoDuration = true; - RightToLeftMode = false; - LastSaveAsFormat = string.Empty; - SystemSubtitleFontNameOverride = string.Empty; - CheckForUpdates = true; - LastCheckForUpdates = DateTime.Now; - ShowProgress = false; - ShowNegativeDurationInfoOnSave = true; - ShowFormatRequiresUtf8Warning = true; - DefaultVideoOffsetInMs = 10 * 60 * 60 * 1000; - DefaultVideoOffsetInMsList = "36000000;3600000"; - DarkThemeForeColor = Color.FromArgb(155, 155, 155); - DarkThemeBackColor = Color.FromArgb(30, 30, 30); - DarkThemeSelectedBackgroundColor = Color.FromArgb(24, 52, 75); - DarkThemeDisabledColor = Color.FromArgb(120, 120, 120); - LastColorPickerColor = Color.Yellow; - LastColorPickerColor1 = Color.Red; - LastColorPickerColor2 = Color.Green; - LastColorPickerColor3 = Color.Blue; - LastColorPickerColor4 = Color.White; - LastColorPickerColor5 = Color.Black; - LastColorPickerColor6 = Color.Cyan; - LastColorPickerColor7 = Color.DarkOrange; - LastColorPickerDropper = Color.Transparent; - ToolbarIconTheme = "Auto"; - UseDarkTheme = false; - DarkThemeShowListViewGridLines = false; - AutoSetVideoSmpteForTtml = true; - AutoSetVideoSmpteForTtmlPrompt = true; - TitleBarAsterisk = "before"; - MeasurementConverterCloseOnInsert = true; - MeasurementConverterCategories = "Length;Kilometers;Meters"; - PreviewAssaText = "ABCDEFGHIJKL abcdefghijkl 123"; - TagsInToggleHiTags = "[;]"; - TagsInToggleCustomTags = "(Æ)"; - SubtitleTextBoxMaxHeight = 300; - ShowBetaStuff = false; - DebugTranslationSync = false; - NewEmptyDefaultMs = 2000; - DialogStyle = DialogType.DashBothLinesWithSpace; - ContinuationStyle = ContinuationStyle.None; - - if (Configuration.IsRunningOnLinux) - { - SubtitleFontName = Configuration.DefaultLinuxFontName; - VideoPlayerPreviewFontName = Configuration.DefaultLinuxFontName; - } - - Profiles = new List(); - CurrentProfile = "Default"; - Profiles.Add(new RulesProfile - { - Name = CurrentProfile, - SubtitleLineMaximumLength = SubtitleLineMaximumLength, - MaxNumberOfLines = MaxNumberOfLines, - MergeLinesShorterThan = MergeLinesShorterThan, - SubtitleMaximumCharactersPerSeconds = (decimal)SubtitleMaximumCharactersPerSeconds, - SubtitleOptimalCharactersPerSeconds = (decimal)SubtitleOptimalCharactersPerSeconds, - SubtitleMaximumDisplayMilliseconds = SubtitleMaximumDisplayMilliseconds, - SubtitleMinimumDisplayMilliseconds = SubtitleMinimumDisplayMilliseconds, - SubtitleMaximumWordsPerMinute = (decimal)SubtitleMaximumWordsPerMinute, - CpsLineLengthStrategy = CpsLineLengthStrategy, - MinimumMillisecondsBetweenLines = MinimumMillisecondsBetweenLines, - DialogStyle = DialogStyle, - ContinuationStyle = ContinuationStyle - }); - AddExtraProfiles(Profiles); - } - - internal static void AddExtraProfiles(List profiles) - { - profiles.Add(new RulesProfile - { - Name = "Netflix (English)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 20, - SubtitleOptimalCharactersPerSeconds = 15, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 833, - SubtitleMaximumWordsPerMinute = 240, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashBothLinesWithoutSpace, - ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis - }); - profiles.Add(new RulesProfile - { - Name = "Netflix (Other languages)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 17, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 833, - SubtitleMaximumWordsPerMinute = 204, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis - }); - profiles.Add(new RulesProfile - { - Name = "Netflix (Dutch)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 17, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 833, - SubtitleMaximumWordsPerMinute = 204, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashSecondLineWithoutSpace, - ContinuationStyle = ContinuationStyle.LeadingTrailingEllipsis - }); - profiles.Add(new RulesProfile - { - Name = "Netflix (Simplified Chinese)", - SubtitleLineMaximumLength = 16, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 17, - SubtitleMaximumCharactersPerSeconds = 9, - SubtitleOptimalCharactersPerSeconds = 9, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 833, - SubtitleMaximumWordsPerMinute = 100, - CpsLineLengthStrategy = "CalcAll", - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashBothLinesWithoutSpace, - ContinuationStyle = ContinuationStyle.LeadingTrailingEllipsis - }); - profiles.Add(new RulesProfile - { - Name = "Amazon Prime (English/Spanish/French)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 17, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 1000, - SubtitleMaximumWordsPerMinute = 204, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis, - }); - profiles.Add(new RulesProfile - { - Name = "Amazon Prime (Arabic)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 20, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 1000, - SubtitleMaximumWordsPerMinute = 240, - CpsLineLengthStrategy = typeof(CalcAll).Name, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis, - }); - profiles.Add(new RulesProfile - { - Name = "Amazon Prime (Danish)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 17, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 1000, - SubtitleMaximumWordsPerMinute = 204, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashBothLinesWithoutSpace, - ContinuationStyle = ContinuationStyle.NoneLeadingTrailingEllipsis, - }); - profiles.Add(new RulesProfile - { - Name = "Amazon Prime (Dutch)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 17, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 1000, - SubtitleMaximumWordsPerMinute = 204, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 83, // 2 frames for 23.976 fps videos - DialogStyle = DialogType.DashSecondLineWithoutSpace, - ContinuationStyle = ContinuationStyle.OnlyTrailingEllipsis, - }); - profiles.Add(new RulesProfile - { - Name = "TikTok/YouTube-shorts (9:16)", - SubtitleLineMaximumLength = 24, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 0, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5000, - SubtitleMinimumDisplayMilliseconds = 700, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 0, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "Arte (German/English)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 20, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 10000, - SubtitleMinimumDisplayMilliseconds = 1000, - SubtitleMaximumWordsPerMinute = 240, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 200, // 5 frames for 25 fps videos - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "Dutch professional subtitles (23.976/24 fps)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 15, - SubtitleOptimalCharactersPerSeconds = 11, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 1400, - SubtitleMaximumWordsPerMinute = 180, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 125, - DialogStyle = DialogType.DashSecondLineWithoutSpace, - ContinuationStyle = ContinuationStyle.OnlyTrailingDots - }); - profiles.Add(new RulesProfile - { - Name = "Dutch professional subtitles (25 fps)", - SubtitleLineMaximumLength = 42, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 43, - SubtitleMaximumCharactersPerSeconds = 15, - SubtitleOptimalCharactersPerSeconds = 11, - SubtitleMaximumDisplayMilliseconds = 7000, - SubtitleMinimumDisplayMilliseconds = 1400, - SubtitleMaximumWordsPerMinute = 180, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 120, - DialogStyle = DialogType.DashSecondLineWithoutSpace, - ContinuationStyle = ContinuationStyle.OnlyTrailingDots - }); - profiles.Add(new RulesProfile - { - Name = "Dutch fansubs (23.976/24 fps)", - SubtitleLineMaximumLength = 45, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 46, - SubtitleMaximumCharactersPerSeconds = 22.5m, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7007, - SubtitleMinimumDisplayMilliseconds = 1200, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 125, - DialogStyle = DialogType.DashSecondLineWithSpace, - ContinuationStyle = ContinuationStyle.OnlyTrailingDots - }); - profiles.Add(new RulesProfile - { - Name = "Dutch fansubs (25 fps)", - SubtitleLineMaximumLength = 45, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 46, - SubtitleMaximumCharactersPerSeconds = 22.5m, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7000, - SubtitleMinimumDisplayMilliseconds = 1200, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 120, - DialogStyle = DialogType.DashSecondLineWithSpace, - ContinuationStyle = ContinuationStyle.OnlyTrailingDots - }); - profiles.Add(new RulesProfile - { - Name = "Danish professional subtitles (23.976/24 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 15, - SubtitleOptimalCharactersPerSeconds = 10, - SubtitleMaximumDisplayMilliseconds = 8008, - SubtitleMinimumDisplayMilliseconds = 2002, - SubtitleMaximumWordsPerMinute = 180, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 125, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.LeadingTrailingDashDots - }); - profiles.Add(new RulesProfile - { - Name = "Danish professional subtitles (25 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 15, - SubtitleOptimalCharactersPerSeconds = 10, - SubtitleMaximumDisplayMilliseconds = 8000, - SubtitleMinimumDisplayMilliseconds = 2000, - SubtitleMaximumWordsPerMinute = 180, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 120, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.LeadingTrailingDashDots - }); - profiles.Add(new RulesProfile - { - Name = "SDI (Dutch)", - SubtitleLineMaximumLength = 37, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 38, - SubtitleMaximumCharactersPerSeconds = 18.75m, - SubtitleOptimalCharactersPerSeconds = 12, - SubtitleMaximumDisplayMilliseconds = 7000, - SubtitleMinimumDisplayMilliseconds = 1320, - SubtitleMaximumWordsPerMinute = 225, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 160, - DialogStyle = DialogType.DashSecondLineWithoutSpace, - ContinuationStyle = ContinuationStyle.OnlyTrailingDots - }); - profiles.Add(new RulesProfile - { - Name = "SW2 (French) (23.976/24 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5005, - SubtitleMinimumDisplayMilliseconds = 792, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 125, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "SW2 (French) (25 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5000, - SubtitleMinimumDisplayMilliseconds = 800, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 120, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "SW3 (French) (23.976/24 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5005, - SubtitleMinimumDisplayMilliseconds = 792, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 167, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "SW3 (French) (25 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5000, - SubtitleMinimumDisplayMilliseconds = 800, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 160, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "SW4 (French) (23.976/24 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5005, - SubtitleMinimumDisplayMilliseconds = 792, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 250, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - profiles.Add(new RulesProfile - { - Name = "SW4 (French) (25 fps)", - SubtitleLineMaximumLength = 40, - MaxNumberOfLines = 2, - MergeLinesShorterThan = 41, - SubtitleMaximumCharactersPerSeconds = 25, - SubtitleOptimalCharactersPerSeconds = 18, - SubtitleMaximumDisplayMilliseconds = 5000, - SubtitleMinimumDisplayMilliseconds = 800, - SubtitleMaximumWordsPerMinute = 300, - CpsLineLengthStrategy = string.Empty, - MinimumMillisecondsBetweenLines = 240, - DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.None - }); - } - } - - public class VideoControlsSettings - { - public string CustomSearchText1 { get; set; } - public string CustomSearchText2 { get; set; } - public string CustomSearchText3 { get; set; } - public string CustomSearchText4 { get; set; } - public string CustomSearchText5 { get; set; } - public string CustomSearchUrl1 { get; set; } - public string CustomSearchUrl2 { get; set; } - public string CustomSearchUrl3 { get; set; } - public string CustomSearchUrl4 { get; set; } - public string CustomSearchUrl5 { get; set; } - public string LastActiveTab { get; set; } - public bool WaveformDrawGrid { get; set; } - public bool WaveformDrawCps { get; set; } - public bool WaveformDrawWpm { get; set; } - public bool WaveformAllowOverlap { get; set; } - public bool WaveformFocusOnMouseEnter { get; set; } - public bool WaveformListViewFocusOnMouseEnter { get; set; } - public bool WaveformSetVideoPositionOnMoveStartEnd { get; set; } - public bool WaveformSingleClickSelect { get; set; } - public bool WaveformSnapToShotChanges { get; set; } - public int WaveformShotChangeStartTimeBeforeMs { get; set; } - public int WaveformShotChangeStartTimeAfterMs { get; set; } - public int WaveformShotChangeEndTimeBeforeMs { get; set; } - public int WaveformShotChangeEndTimeAfterMs { get; set; } - public int WaveformBorderHitMs { get; set; } - public Color WaveformGridColor { get; set; } - public Color WaveformColor { get; set; } - public Color WaveformSelectedColor { get; set; } - public Color WaveformBackgroundColor { get; set; } - public Color WaveformTextColor { get; set; } - public Color WaveformCursorColor { get; set; } - public Color WaveformChaptersColor { get; set; } - public int WaveformTextSize { get; set; } - public bool WaveformTextBold { get; set; } - public string WaveformDoubleClickOnNonParagraphAction { get; set; } - public string WaveformRightClickOnNonParagraphAction { get; set; } - public bool WaveformMouseWheelScrollUpIsForward { get; set; } - public bool WaveformLabelShowCodec { get; set; } - public bool GenerateSpectrogram { get; set; } - public string SpectrogramAppearance { get; set; } - public int WaveformMinimumSampleRate { get; set; } - public double WaveformSeeksSilenceDurationSeconds { get; set; } - public double WaveformSeeksSilenceMaxVolume { get; set; } - public bool WaveformUnwrapText { get; set; } - public bool WaveformHideWpmCpsLabels { get; set; } - - - public VideoControlsSettings() - { - CustomSearchText1 = "The Free Dictionary"; - CustomSearchUrl1 = "https://www.thefreedictionary.com/{0}"; - CustomSearchText2 = "Wikipedia"; - CustomSearchUrl2 = "https://en.wikipedia.org/wiki?search={0}"; - CustomSearchText3 = "DuckDuckGo"; - CustomSearchUrl3 = "https://duckduckgo.com/?q={0}"; - - LastActiveTab = "Translate"; - WaveformDrawGrid = true; - WaveformAllowOverlap = false; - WaveformBorderHitMs = 15; - WaveformGridColor = Color.FromArgb(255, 20, 20, 18); - WaveformColor = Color.FromArgb(255, 160, 240, 30); - WaveformSelectedColor = Color.FromArgb(255, 230, 0, 0); - WaveformBackgroundColor = Color.Black; - WaveformTextColor = Color.Gray; - WaveformCursorColor = Color.Turquoise; - WaveformChaptersColor = Color.FromArgb(255, 104, 33, 122); - WaveformTextSize = 9; - WaveformTextBold = true; - WaveformDoubleClickOnNonParagraphAction = "PlayPause"; - WaveformDoubleClickOnNonParagraphAction = string.Empty; - WaveformMouseWheelScrollUpIsForward = true; - WaveformLabelShowCodec = true; - SpectrogramAppearance = "OneColorGradient"; - WaveformMinimumSampleRate = 126; - WaveformSeeksSilenceDurationSeconds = 0.3; - WaveformSeeksSilenceMaxVolume = 0.1; - WaveformSnapToShotChanges = true; - } - } - - public class VobSubOcrSettings - { - public int XOrMorePixelsMakesSpace { get; set; } - public double AllowDifferenceInPercent { get; set; } - public double BlurayAllowDifferenceInPercent { get; set; } - public string LastImageCompareFolder { get; set; } - public int LastModiLanguageId { get; set; } - public string LastOcrMethod { get; set; } - public string TesseractLastLanguage { get; set; } - public bool UseTesseractFallback { get; set; } - public bool UseItalicsInTesseract { get; set; } - public int TesseractEngineMode { get; set; } - public bool UseMusicSymbolsInTesseract { get; set; } - public bool RightToLeft { get; set; } - public bool TopToBottom { get; set; } - public int DefaultMillisecondsForUnknownDurations { get; set; } - public bool FixOcrErrors { get; set; } - public bool PromptForUnknownWords { get; set; } - public bool GuessUnknownWords { get; set; } - public bool AutoBreakSubtitleIfMoreThanTwoLines { get; set; } - public double ItalicFactor { get; set; } - - public bool LineOcrDraw { get; set; } - public int LineOcrMinHeightSplit { get; set; } - public bool LineOcrAdvancedItalic { get; set; } - public string LineOcrLastLanguages { get; set; } - public string LineOcrLastSpellCheck { get; set; } - public int LineOcrLinesToAutoGuess { get; set; } - public int LineOcrMinLineHeight { get; set; } - public int LineOcrMaxLineHeight { get; set; } - public int LineOcrMaxErrorPixels { get; set; } - public string LastBinaryImageCompareDb { get; set; } - public string LastBinaryImageSpellCheck { get; set; } - public bool BinaryAutoDetectBestDb { get; set; } - public string LastTesseractSpellCheck { get; set; } - public bool CaptureTopAlign { get; set; } - public int UnfocusedAttentionBlinkCount { get; set; } - public int UnfocusedAttentionPlaySoundCount { get; set; } - public string CloudVisionApiKey { get; set; } - public string CloudVisionLanguage { get; set; } - public bool CloudVisionSendOriginalImages { get; set; } - - public VobSubOcrSettings() - { - XOrMorePixelsMakesSpace = 8; - AllowDifferenceInPercent = 1.0; - BlurayAllowDifferenceInPercent = 7.5; - LastImageCompareFolder = "English"; - LastModiLanguageId = 9; - LastOcrMethod = "Tesseract"; - UseItalicsInTesseract = true; - TesseractEngineMode = 3; // Default, based on what is available (T4 docs) - UseMusicSymbolsInTesseract = true; - UseTesseractFallback = true; - RightToLeft = false; - TopToBottom = true; - DefaultMillisecondsForUnknownDurations = 5000; - FixOcrErrors = true; - PromptForUnknownWords = true; - GuessUnknownWords = true; - AutoBreakSubtitleIfMoreThanTwoLines = true; - ItalicFactor = 0.2f; - LineOcrLinesToAutoGuess = 100; - LineOcrMaxErrorPixels = 45; - LastBinaryImageCompareDb = "Latin+Latin"; - BinaryAutoDetectBestDb = true; - CaptureTopAlign = false; - UnfocusedAttentionBlinkCount = 50; - UnfocusedAttentionPlaySoundCount = 1; - CloudVisionApiKey = string.Empty; - CloudVisionLanguage = "en"; - CloudVisionSendOriginalImages = false; - } - } - - public class MultipleSearchAndReplaceSetting - { - public bool Enabled { get; set; } - public string FindWhat { get; set; } - public string ReplaceWith { get; set; } - public string SearchType { get; set; } - public string Description { get; set; } - } - - public class MultipleSearchAndReplaceGroup - { - public string Name { get; set; } - public bool Enabled { get; set; } - public List Rules { get; set; } - } - - public class AssaStorageCategory - { - public string Name { get; set; } - public bool IsDefault { get; set; } - public List Styles { get; set; } - } - - public class NetworkSettings - { - public string UserName { get; set; } - public string WebApiUrl { get; set; } - public string SessionKey { get; set; } - public int PollIntervalSeconds { get; set; } - public string NewMessageSound { get; set; } - - public NetworkSettings() - { - UserName = string.Empty; - SessionKey = Guid.NewGuid().ToString(); - WebApiUrl = "https://www.nikse.dk/api/SeNet"; - PollIntervalSeconds = 5; - } - } - - public class Shortcuts - { - // General - public string GeneralMergeSelectedLines { get; set; } - public string GeneralMergeWithPrevious { get; set; } - public string GeneralMergeWithNext { get; set; } - public string GeneralMergeWithPreviousAndUnbreak { get; set; } - public string GeneralMergeWithNextAndUnbreak { get; set; } - public string GeneralMergeWithPreviousAndBreak { get; set; } - public string GeneralMergeWithNextAndBreak { get; set; } - public string GeneralMergeSelectedLinesAndAutoBreak { get; set; } - public string GeneralMergeSelectedLinesAndUnbreak { get; set; } - public string GeneralMergeSelectedLinesAndUnbreakCjk { get; set; } - public string GeneralMergeSelectedLinesOnlyFirstText { get; set; } - public string GeneralMergeSelectedLinesBilingual { get; set; } - public string GeneralMergeWithPreviousBilingual { get; set; } - public string GeneralMergeWithNextBilingual { get; set; } - public string GeneralMergeOriginalAndTranslation { get; set; } - public string GeneralToggleTranslationMode { get; set; } - public string GeneralSwitchOriginalAndTranslation { get; set; } - public string GeneralSwitchOriginalAndTranslationTextBoxes { get; set; } - public string GeneralLayoutChoose { get; set; } - public string GeneralLayoutChoose1 { get; set; } - public string GeneralLayoutChoose2 { get; set; } - public string GeneralLayoutChoose3 { get; set; } - public string GeneralLayoutChoose4 { get; set; } - public string GeneralLayoutChoose5 { get; set; } - public string GeneralLayoutChoose6 { get; set; } - public string GeneralLayoutChoose7 { get; set; } - public string GeneralLayoutChoose8 { get; set; } - public string GeneralLayoutChoose9 { get; set; } - public string GeneralLayoutChoose10 { get; set; } - public string GeneralLayoutChoose11 { get; set; } - public string GeneralLayoutChoose12 { get; set; } - public string GeneralPlayFirstSelected { get; set; } - public string GeneralGoToFirstSelectedLine { get; set; } - public string GeneralGoToNextEmptyLine { get; set; } - public string GeneralGoToNextSubtitle { get; set; } - public string GeneralGoToNextSubtitlePlayTranslate { get; set; } - public string GeneralGoToNextSubtitleCursorAtEnd { get; set; } - public string GeneralGoToPrevSubtitle { get; set; } - public string GeneralGoToPrevSubtitlePlayTranslate { get; set; } - public string GeneralGoToStartOfCurrentSubtitle { get; set; } - public string GeneralGoToEndOfCurrentSubtitle { get; set; } - public string GeneralGoToPreviousSubtitleAndFocusVideo { get; set; } - public string GeneralGoToNextSubtitleAndFocusVideo { get; set; } - public string GeneralGoToPreviousSubtitleAndFocusWaveform { get; set; } - public string GeneralGoToNextSubtitleAndFocusWaveform { get; set; } - public string GeneralGoToPrevSubtitleAndPlay { get; set; } - public string GeneralGoToNextSubtitleAndPlay { get; set; } - public string GeneralToggleBookmarks { get; set; } - public string GeneralToggleBookmarksWithText { get; set; } - public string GeneralEditBookmarks { get; set; } - public string GeneralClearBookmarks { get; set; } - public string GeneralGoToBookmark { get; set; } - public string GeneralGoToPreviousBookmark { get; set; } - public string GeneralGoToNextBookmark { get; set; } - public string GeneralChooseProfile { get; set; } - public string GeneralDuplicateLine { get; set; } - public string OpenDataFolder { get; set; } - public string OpenContainingFolder { get; set; } - public string GeneralToggleView { get; set; } - public string GeneralToggleMode { get; set; } - public string GeneralTogglePreviewOnVideo { get; set; } - public string GeneralRemoveBlankLines { get; set; } - public string GeneralApplyAssaOverrideTags { get; set; } - public string GeneralSetAssaPosition { get; set; } - public string GeneralSetAssaResolution { get; set; } - public string GeneralSetAssaBgBox { get; set; } - public string GeneralColorPicker { get; set; } - public string GeneralTakeAutoBackup { get; set; } - public string GeneralHelp { get; set; } - public string GeneralFocusTextBox { get; set; } - - // File - public string MainFileNew { get; set; } - public string MainFileOpen { get; set; } - public string MainFileOpenKeepVideo { get; set; } - public string MainFileSave { get; set; } - public string MainFileSaveOriginal { get; set; } - public string MainFileSaveOriginalAs { get; set; } - public string MainFileSaveAs { get; set; } - public string MainFileSaveAll { get; set; } - public string MainFileOpenOriginal { get; set; } - public string MainFileCloseOriginal { get; set; } - public string MainFileCloseTranslation { get; set; } - public string MainFileCompare { get; set; } - public string MainFileVerifyCompleteness { get; set; } - public string MainFileImportPlainText { get; set; } - public string MainFileImportBdSupForEdit { get; set; } - public string MainFileImportTimeCodes { get; set; } - public string MainFileExportEbu { get; set; } - public string MainFileExportPac { get; set; } - public string MainFileExportBdSup { get; set; } - public string MainFileExportEdlClip { get; set; } - public string MainFileExportPlainText { get; set; } - public string MainFileExit { get; set; } - - // Edit - public string MainEditUndo { get; set; } - public string MainEditRedo { get; set; } - public string MainEditFind { get; set; } - public string MainEditFindNext { get; set; } - public string MainEditReplace { get; set; } - public string MainEditMultipleReplace { get; set; } - public string MainEditGoToLineNumber { get; set; } - public string MainEditRightToLeft { get; set; } - public string MainEditFixRTLViaUnicodeChars { get; set; } - public string MainEditRemoveRTLUnicodeChars { get; set; } - public string MainEditReverseStartAndEndingForRTL { get; set; } - public string MainVideoToggleControls { get; set; } - public string MainEditToggleTranslationOriginalInPreviews { get; set; } - public string MainEditInverseSelection { get; set; } - public string MainEditModifySelection { get; set; } - - // Tools - public string MainToolsAdjustDuration { get; set; } - public string MainToolsAdjustDurationLimits { get; set; } - public string MainToolsFixCommonErrors { get; set; } - public string MainToolsFixCommonErrorsPreview { get; set; } - public string MainToolsMergeShortLines { get; set; } - public string MainToolsMergeDuplicateText { get; set; } - public string MainToolsMergeSameTimeCodes { get; set; } - public string MainToolsMakeEmptyFromCurrent { get; set; } - public string MainToolsSplitLongLines { get; set; } - public string MainToolsDurationsBridgeGap { get; set; } - public string MainToolsMinimumDisplayTimeBetweenParagraphs { get; set; } - - public string MainToolsRenumber { get; set; } - public string MainToolsRemoveTextForHI { get; set; } - public string MainToolsConvertColorsToDialog { get; set; } - public string MainToolsChangeCasing { get; set; } - public string MainToolsAutoDuration { get; set; } - public string MainToolsBatchConvert { get; set; } - public string MainToolsMeasurementConverter { get; set; } - public string MainToolsSplit { get; set; } - public string MainToolsAppend { get; set; } - public string MainToolsJoin { get; set; } - public string MainToolsStyleManager { get; set; } - - // Video - public string MainVideoOpen { get; set; } - public string MainVideoClose { get; set; } - public string MainVideoPause { get; set; } - public string MainVideoStop { get; set; } - public string MainVideoPlayFromJustBefore { get; set; } - public string MainVideoPlayFromBeginning { get; set; } - public string MainVideoPlayPauseToggle { get; set; } - public string MainVideoPlay150Speed { get; set; } - public string MainVideoPlay200Speed { get; set; } - public string MainVideoFocusSetVideoPosition { get; set; } - public string MainVideoToggleVideoControls { get; set; } - public string MainVideo1FrameLeft { get; set; } - public string MainVideo1FrameRight { get; set; } - public string MainVideo1FrameLeftWithPlay { get; set; } - public string MainVideo1FrameRightWithPlay { get; set; } - public string MainVideo100MsLeft { get; set; } - public string MainVideo100MsRight { get; set; } - public string MainVideo500MsLeft { get; set; } - public string MainVideo500MsRight { get; set; } - public string MainVideo1000MsLeft { get; set; } - public string MainVideo1000MsRight { get; set; } - public string MainVideo5000MsLeft { get; set; } - public string MainVideo5000MsRight { get; set; } - public string MainVideoXSMsLeft { get; set; } - public string MainVideoXSMsRight { get; set; } - public string MainVideoXLMsLeft { get; set; } - public string MainVideoXLMsRight { get; set; } - public string MainVideo3000MsLeft { get; set; } - public string MainVideo3000MsRight { get; set; } - public string MainVideoGoToStartCurrent { get; set; } - public string MainVideoToggleStartEndCurrent { get; set; } - public string MainVideoPlaySelectedLines { get; set; } - public string MainVideoLoopSelectedLines { get; set; } - public string MainVideoGoToPrevSubtitle { get; set; } - public string MainVideoGoToNextSubtitle { get; set; } - public string MainVideoGoToPrevTimeCode { get; set; } - public string MainVideoGoToNextTimeCode { get; set; } - public string MainVideoGoToPrevChapter { get; set; } - public string MainVideoGoToNextChapter { get; set; } - public string MainVideoSelectNextSubtitle { get; set; } - public string MainVideoFullscreen { get; set; } - public string MainVideoSlower { get; set; } - public string MainVideoFaster { get; set; } - public string MainVideoSpeedToggle { get; set; } - public string MainVideoReset { get; set; } - public string MainVideoToggleBrightness { get; set; } - public string MainVideoToggleContrast { get; set; } - public string MainVideoAudioToTextVosk { get; set; } - public string MainVideoAudioToTextWhisper { get; set; } - public string MainVideoAudioExtractAudioSelectedLines { get; set; } - public string MainVideoTextToSpeech { get; set; } - - // spell check - public string MainSpellCheck { get; set; } - public string MainSpellCheckFindDoubleWords { get; set; } - public string MainSpellCheckAddWordToNames { get; set; } - - // Sync - public string MainSynchronizationAdjustTimes { get; set; } - public string MainSynchronizationVisualSync { get; set; } - public string MainSynchronizationPointSync { get; set; } - public string MainSynchronizationPointSyncViaFile { get; set; } - public string MainSynchronizationChangeFrameRate { get; set; } - - // List view - public string MainListViewItalic { get; set; } - public string MainListViewBold { get; set; } - public string MainListViewUnderline { get; set; } - public string MainListViewBox { get; set; } - public string MainListViewToggleQuotes { get; set; } - public string MainListViewToggleHiTags { get; set; } - public string MainListViewToggleCustomTags { get; set; } - public string MainListViewSplit { get; set; } - public string MainListViewToggleDashes { get; set; } - public string MainListViewToggleMusicSymbols { get; set; } - public string MainListViewAlignment { get; set; } - public string MainListViewAlignmentN1 { get; set; } - public string MainListViewAlignmentN2 { get; set; } - public string MainListViewAlignmentN3 { get; set; } - public string MainListViewAlignmentN4 { get; set; } - public string MainListViewAlignmentN5 { get; set; } - public string MainListViewAlignmentN6 { get; set; } - public string MainListViewAlignmentN7 { get; set; } - public string MainListViewAlignmentN8 { get; set; } - public string MainListViewAlignmentN9 { get; set; } - public string MainListViewColor1 { get; set; } - public string MainListViewColor2 { get; set; } - public string MainListViewColor3 { get; set; } - public string MainListViewColor4 { get; set; } - public string MainListViewColor5 { get; set; } - public string MainListViewColor6 { get; set; } - public string MainListViewColor7 { get; set; } - public string MainListViewColor8 { get; set; } - public string MainListViewSetNewActor { get; set; } - public string MainListViewSetActor1 { get; set; } - public string MainListViewSetActor2 { get; set; } - public string MainListViewSetActor3 { get; set; } - public string MainListViewSetActor4 { get; set; } - public string MainListViewSetActor5 { get; set; } - public string MainListViewSetActor6 { get; set; } - public string MainListViewSetActor7 { get; set; } - public string MainListViewSetActor8 { get; set; } - public string MainListViewSetActor9 { get; set; } - public string MainListViewSetActor10 { get; set; } - public string MainListViewColorChoose { get; set; } - public string MainRemoveFormatting { get; set; } - public string MainListViewCopyText { get; set; } - public string MainListViewCopyPlainText { get; set; } - public string MainListViewCopyTextFromOriginalToCurrent { get; set; } - public string MainListViewAutoDuration { get; set; } - public string MainListViewColumnDeleteText { get; set; } - public string MainListViewColumnDeleteTextAndShiftUp { get; set; } - public string MainListViewColumnInsertText { get; set; } - public string MainListViewColumnPaste { get; set; } - public string MainListViewColumnTextUp { get; set; } - public string MainListViewColumnTextDown { get; set; } - public string MainListViewGoToNextError { get; set; } - public string MainListViewListErrors { get; set; } - public string MainListViewSortByNumber { get; set; } - public string MainListViewSortByStartTime { get; set; } - public string MainListViewSortByEndTime { get; set; } - public string MainListViewSortByDuration { get; set; } - public string MainListViewSortByGap { get; set; } - public string MainListViewSortByText { get; set; } - public string MainListViewSortBySingleLineMaxLen { get; set; } - public string MainListViewSortByTextTotalLength { get; set; } - public string MainListViewSortByCps { get; set; } - public string MainListViewSortByWpm { get; set; } - public string MainListViewSortByNumberOfLines { get; set; } - public string MainListViewSortByActor { get; set; } - public string MainListViewSortByStyle { get; set; } - public string MainListViewRemoveTimeCodes { get; set; } - public string MainTextBoxSplitAtCursor { get; set; } - public string MainTextBoxSplitAtCursorAndAutoBr { get; set; } - public string MainTextBoxSplitAtCursorAndVideoPos { get; set; } - public string MainTextBoxSplitSelectedLineBilingual { get; set; } - public string MainTextBoxMoveLastWordDown { get; set; } - public string MainTextBoxMoveFirstWordFromNextUp { get; set; } - public string MainTextBoxMoveLastWordDownCurrent { get; set; } - public string MainTextBoxMoveFirstWordUpCurrent { get; set; } - public string MainTextBoxMoveFromCursorToNextAndGoToNext { get; set; } - public string MainTextBoxSelectionToLower { get; set; } - public string MainTextBoxSelectionToUpper { get; set; } - public string MainTextBoxSelectionToggleCasing { get; set; } - public string MainTextBoxSelectionToRuby { get; set; } - public string MainTextBoxToggleAutoDuration { get; set; } - public string MainCreateInsertSubAtVideoPos { get; set; } - public string MainCreateInsertSubAtVideoPosMax { get; set; } - public string MainCreateInsertSubAtVideoPosNoTextBoxFocus { get; set; } - public string MainCreateSetStart { get; set; } - public string MainCreateSetEnd { get; set; } - public string MainAdjustVideoSetStartForAppropriateLine { get; set; } - public string MainAdjustVideoSetEndForAppropriateLine { get; set; } - public string MainAdjustSetEndAndPause { get; set; } - public string MainCreateSetEndAddNewAndGoToNew { get; set; } - public string MainCreateStartDownEndUp { get; set; } - public string MainAdjustSetStartAndOffsetTheRest { get; set; } - public string MainAdjustSetStartAndOffsetTheRest2 { get; set; } - public string MainAdjustSetStartAndOffsetTheWholeSubtitle { get; set; } - public string MainAdjustSetEndAndOffsetTheRest { get; set; } - public string MainAdjustSetEndAndOffsetTheRestAndGoToNext { get; set; } - public string MainAdjustSetStartAndGotoNext { get; set; } - public string MainAdjustSetEndAndGotoNext { get; set; } - public string MainAdjustViaEndAutoStart { get; set; } - public string MainAdjustViaEndAutoStartAndGoToNext { get; set; } - public string MainAdjustSetEndMinusGapAndStartNextHere { get; set; } - public string MainSetEndAndStartNextAfterGap { get; set; } - public string MainAdjustSetStartAutoDurationAndGoToNext { get; set; } - public string MainAdjustSetEndNextStartAndGoToNext { get; set; } - public string MainAdjustStartDownEndUpAndGoToNext { get; set; } - public string MainAdjustSetStartAndEndOfPrevious { get; set; } - public string MainAdjustSetStartAndEndOfPreviousAndGoToNext { get; set; } - public string MainAdjustSetStartKeepDuration { get; set; } - public string MainAdjustSelected100MsForward { get; set; } - public string MainAdjustSelected100MsBack { get; set; } - public string MainAdjustStartXMsBack { get; set; } - public string MainAdjustStartXMsForward { get; set; } - public string MainAdjustEndXMsBack { get; set; } - public string MainAdjustEndXMsForward { get; set; } - public string MoveStartOneFrameBack { get; set; } - public string MoveStartOneFrameForward { get; set; } - public string MoveEndOneFrameBack { get; set; } - public string MoveEndOneFrameForward { get; set; } - public string MoveStartOneFrameBackKeepGapPrev { get; set; } - public string MoveStartOneFrameForwardKeepGapPrev { get; set; } - public string MoveEndOneFrameBackKeepGapNext { get; set; } - public string MoveEndOneFrameForwardKeepGapNext { get; set; } - public string MainAdjustSnapStartToNextShotChange { get; set; } - public string MainAdjustSnapEndToPreviousShotChange { get; set; } - public string MainAdjustExtendToNextShotChange { get; set; } - public string MainAdjustExtendToPreviousShotChange { get; set; } - public string MainAdjustExtendToNextSubtitle { get; set; } - public string MainAdjustExtendToPreviousSubtitle { get; set; } - public string MainAdjustExtendToNextSubtitleMinusChainingGap { get; set; } - public string MainAdjustExtendToPreviousSubtitleMinusChainingGap { get; set; } - public string MainAdjustExtendCurrentSubtitle { get; set; } - public string MainAdjustExtendPreviousLineEndToCurrentStart { get; set; } - public string MainAdjustExtendNextLineStartToCurrentEnd { get; set; } - public string MainSetInCueToClosestShotChangeLeftGreenZone { get; set; } - public string MainSetInCueToClosestShotChangeRightGreenZone { get; set; } - public string MainSetOutCueToClosestShotChangeLeftGreenZone { get; set; } - public string MainSetOutCueToClosestShotChangeRightGreenZone { get; set; } - public string GeneralAutoCalcCurrentDuration { get; set; } - public string GeneralAutoCalcCurrentDurationByOptimalReadingSpeed { get; set; } - public string GeneralAutoCalcCurrentDurationByMinReadingSpeed { get; set; } - public string MainInsertAfter { get; set; } - public string MainTextBoxAutoBreak { get; set; } - public string MainTextBoxBreakAtPosition { get; set; } - public string MainTextBoxBreakAtPositionAndGoToNext { get; set; } - public string MainTextBoxRecord { get; set; } - public string MainTextBoxUnbreak { get; set; } - public string MainTextBoxUnbreakNoSpace { get; set; } - public string MainTextBoxAssaIntellisense { get; set; } - public string MainTextBoxAssaRemoveTag { get; set; } - public string MainWaveformInsertAtCurrentPosition { get; set; } - public string MainInsertBefore { get; set; } - public string MainMergeDialog { get; set; } - public string MainMergeDialogWithNext { get; set; } - public string MainMergeDialogWithPrevious { get; set; } - public string MainAutoBalanceSelectedLines { get; set; } - public string MainEvenlyDistributeSelectedLines { get; set; } - public string MainToggleFocus { get; set; } - public string MainToggleFocusWaveform { get; set; } - public string MainToggleFocusWaveformTextBox { get; set; } - public string WaveformAdd { get; set; } - public string WaveformVerticalZoom { get; set; } - public string WaveformVerticalZoomOut { get; set; } - public string WaveformZoomIn { get; set; } - public string WaveformZoomOut { get; set; } - public string WaveformSplit { get; set; } - public string WaveformPlaySelection { get; set; } - public string WaveformPlaySelectionEnd { get; set; } - public string WaveformSearchSilenceForward { get; set; } - public string WaveformSearchSilenceBack { get; set; } - public string WaveformAddTextHere { get; set; } - public string WaveformAddTextHereFromClipboard { get; set; } - public string WaveformSetParagraphAsSelection { get; set; } - public string WaveformGoToPreviousShotChange { get; set; } - public string WaveformGoToNextShotChange { get; set; } - public string WaveformToggleShotChange { get; set; } - public string WaveformListShotChanges { get; set; } - public string WaveformGuessStart { get; set; } - public string Waveform100MsLeft { get; set; } - public string Waveform100MsRight { get; set; } - public string Waveform1000MsLeft { get; set; } - public string Waveform1000MsRight { get; set; } - public string WaveformAudioToTextVosk { get; set; } - public string WaveformAudioToTextWhisper { get; set; } - public string MainCheckFixTimingViaShotChanges { get; set; } - public string MainTranslateGoogleIt { get; set; } - public string MainTranslateGoogleTranslateIt { get; set; } - public string MainTranslateAuto { get; set; } - public string MainTranslateAutoSelectedLines { get; set; } - public string MainTranslateCustomSearch1 { get; set; } - public string MainTranslateCustomSearch2 { get; set; } - public string MainTranslateCustomSearch3 { get; set; } - public string MainTranslateCustomSearch4 { get; set; } - public string MainTranslateCustomSearch5 { get; set; } - public List PluginShortcuts { get; set; } - - - public Shortcuts() - { - GeneralGoToFirstSelectedLine = "Control+L"; - GeneralMergeSelectedLines = "Control+Shift+M"; - GeneralToggleTranslationMode = "Control+Shift+O"; - GeneralMergeOriginalAndTranslation = "Control+Alt+Shift+M"; - GeneralGoToNextSubtitle = "Shift+Return"; - GeneralGoToNextSubtitlePlayTranslate = "Alt+Down"; - GeneralGoToPrevSubtitlePlayTranslate = "Alt+Up"; - GeneralToggleBookmarksWithText = "Control+Shift+B"; - OpenDataFolder = "Control+Alt+Shift+D"; - GeneralToggleView = "F2"; - GeneralHelp = "F1"; - MainFileNew = "Control+N"; - MainFileOpen = "Control+O"; - MainFileSave = "Control+S"; - MainFileSaveAs = "Control+Shift+S"; - MainEditUndo = "Control+Z"; - MainEditRedo = "Control+Y"; - MainEditFind = "Control+F"; - MainEditFindNext = "F3"; - MainEditReplace = "Control+H"; - MainEditMultipleReplace = "Control+Alt+M"; - MainEditGoToLineNumber = "Control+G"; - MainEditRightToLeft = "Control+Shift+Alt+R"; - MainEditInverseSelection = "Control+Shift+I"; - MainToolsFixCommonErrors = "Control+Shift+F"; - MainToolsFixCommonErrorsPreview = "Control+P"; - MainToolsRenumber = "Control+Shift+N"; - MainToolsRemoveTextForHI = "Control+Shift+H"; - MainToolsChangeCasing = "Control+Shift+C"; - MainVideoPlayFromJustBefore = "Shift+F10"; - MainVideoPlayPauseToggle = "Control+P"; - MainVideoPause = "Control+Alt+P"; - MainVideo500MsLeft = "Alt+Left"; - MainVideo500MsRight = "Alt+Right"; - MainVideoFullscreen = "Alt+Return"; - MainVideoReset = "Control+D0"; - MainSpellCheck = "Control+Shift+S"; - MainSpellCheckFindDoubleWords = "Control+Shift+D"; - MainSpellCheckAddWordToNames = "Control+Shift+L"; - MainSynchronizationAdjustTimes = "Control+Shift+A"; - MainSynchronizationVisualSync = "Control+Shift+V"; - MainSynchronizationPointSync = "Control+Shift+P"; - MainListViewItalic = "Control+I"; - MainTextBoxSplitAtCursor = "Control+Alt+V"; - MainTextBoxSelectionToLower = "Control+U"; - MainTextBoxSelectionToUpper = "Control+Shift+U"; - MainTextBoxSelectionToggleCasing = "Control+Shift+F3"; - MainCreateInsertSubAtVideoPos = "Shift+F9"; - MainVideoGoToStartCurrent = "Shift+F11"; - MainVideoToggleStartEndCurrent = "F4"; - MainVideoPlaySelectedLines = "F5"; - MainVideoGoToStartCurrent = "F6"; - MainVideo3000MsLeft = "F7"; - MainListViewGoToNextError = "F8"; - MainListViewListErrors = "Control+F8"; - MainCreateSetStart = "F11"; - MainCreateSetEnd = "F12"; - MainAdjustSetStartAndOffsetTheRest = "Control+Space"; - MainAdjustSetStartAndOffsetTheRest2 = "F9"; - MainAdjustSetEndAndGotoNext = "F10"; - MainInsertAfter = "Alt+Insert"; - MainWaveformInsertAtCurrentPosition = "Insert"; - MainInsertBefore = "Control+Shift+Insert"; - MainTextBoxAutoBreak = "Control+R"; - MainTranslateAuto = "Control+Shift+G"; - MainAdjustExtendToNextSubtitle = "Control+Shift+E"; - MainAdjustExtendToPreviousSubtitle = "Alt+Shift+E"; - MainAdjustExtendToNextSubtitleMinusChainingGap = "Control+Shift+W"; - MainAdjustExtendToPreviousSubtitleMinusChainingGap = "Alt+Shift+W"; - WaveformVerticalZoom = "Shift+Add"; - WaveformVerticalZoomOut = "Shift+Subtract"; - WaveformAddTextHere = "Return"; - Waveform100MsLeft = "Shift+Left"; - Waveform100MsRight = "Shift+Right"; - Waveform1000MsLeft = "Left"; - Waveform1000MsRight = "Right"; - MainCheckFixTimingViaShotChanges = "Control+Shift+D9"; - PluginShortcuts = new List(); - } - - public Shortcuts Clone() - { - var xws = new XmlWriterSettings { Indent = true }; - var sb = new StringBuilder(); - using (var textWriter = XmlWriter.Create(sb, xws)) - { - textWriter.WriteStartDocument(); - textWriter.WriteStartElement("Settings", string.Empty); - Settings.WriteShortcuts(this, textWriter); - textWriter.WriteEndElement(); - textWriter.WriteEndDocument(); - } - - var doc = new XmlDocument { PreserveWhitespace = true }; - doc.LoadXml(sb.ToString().Replace("encoding=\"utf-16\"", "encoding=\"utf-8\"")); - var shortcuts = new Shortcuts(); - Settings.ReadShortcuts(doc, shortcuts); - return shortcuts; - } - - public static void Save(string fileName, Shortcuts shortcuts) - { - var xws = new XmlWriterSettings { Indent = true, Encoding = Encoding.UTF8 }; - var sb = new StringBuilder(); - using (var textWriter = XmlWriter.Create(sb, xws)) - { - textWriter.WriteStartDocument(); - textWriter.WriteStartElement("Settings", string.Empty); - Settings.WriteShortcuts(shortcuts, textWriter); - textWriter.WriteEndElement(); - textWriter.WriteEndDocument(); - } - File.WriteAllText(fileName, sb.ToString().Replace("encoding=\"utf-16\"", "encoding=\"utf-8\""), Encoding.UTF8); - } - - public static Shortcuts Load(string fileName) - { - var doc = new XmlDocument { PreserveWhitespace = true }; - using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) - { - doc.Load(stream); - var shortcuts = new Shortcuts(); - Settings.ReadShortcuts(doc, shortcuts); - return shortcuts; - } - } - } - - public class RemoveTextForHearingImpairedSettings - { - public bool RemoveTextBetweenBrackets { get; set; } - public bool RemoveTextBetweenParentheses { get; set; } - public bool RemoveTextBetweenCurlyBrackets { get; set; } - public bool RemoveTextBetweenQuestionMarks { get; set; } - public bool RemoveTextBetweenCustom { get; set; } - public string RemoveTextBetweenCustomBefore { get; set; } - public string RemoveTextBetweenCustomAfter { get; set; } - public bool RemoveTextBetweenOnlySeparateLines { get; set; } - public bool RemoveTextBeforeColon { get; set; } - public bool RemoveTextBeforeColonOnlyIfUppercase { get; set; } - public bool RemoveTextBeforeColonOnlyOnSeparateLine { get; set; } - public bool RemoveInterjections { get; set; } - public bool RemoveInterjectionsOnlyOnSeparateLine { get; set; } - public bool RemoveIfContains { get; set; } - public bool RemoveIfAllUppercase { get; set; } - public string RemoveIfContainsText { get; set; } - public bool RemoveIfOnlyMusicSymbols { get; set; } - - public RemoveTextForHearingImpairedSettings() - { - RemoveTextBetweenBrackets = true; - RemoveTextBetweenParentheses = true; - RemoveTextBetweenCurlyBrackets = true; - RemoveTextBetweenQuestionMarks = true; - RemoveTextBetweenCustom = false; - RemoveTextBetweenCustomBefore = "¶"; - RemoveTextBetweenCustomAfter = "¶"; - RemoveTextBeforeColon = true; - RemoveTextBeforeColonOnlyIfUppercase = true; - RemoveIfContainsText = "¶"; - RemoveIfOnlyMusicSymbols = true; - } - } - - public class SubtitleBeaming - { - public string FontName { get; set; } - public int FontSize { get; set; } - public Color FontColor { get; set; } - public Color BorderColor { get; set; } - public int BorderWidth { get; set; } - - public SubtitleBeaming() - { - FontName = "Verdana"; - FontSize = 30; - FontColor = Color.White; - BorderColor = Color.DarkGray; - BorderWidth = 2; - } - } - - public class BeautifyTimeCodesSettings - { - public bool AlignTimeCodes { get; set; } - public bool ExtractExactTimeCodes { get; set; } - public bool SnapToShotChanges { get; set; } - public int OverlapThreshold { get; set; } - public BeautifyTimeCodesProfile Profile { get; set; } - - public BeautifyTimeCodesSettings() - { - AlignTimeCodes = true; - ExtractExactTimeCodes = false; - SnapToShotChanges = true; - OverlapThreshold = 1000; - Profile = new BeautifyTimeCodesProfile(); - } - - public class BeautifyTimeCodesProfile - { - // General - public int Gap { get; set; } - - // In cues - public int InCuesGap { get; set; } - public int InCuesLeftGreenZone { get; set; } - public int InCuesLeftRedZone { get; set; } - public int InCuesRightRedZone { get; set; } - public int InCuesRightGreenZone { get; set; } - - // Out cues - public int OutCuesGap { get; set; } - public int OutCuesLeftGreenZone { get; set; } - public int OutCuesLeftRedZone { get; set; } - public int OutCuesRightRedZone { get; set; } - public int OutCuesRightGreenZone { get; set; } - - // Connected subtitles - public int ConnectedSubtitlesInCueClosestLeftGap { get; set; } - public int ConnectedSubtitlesInCueClosestRightGap { get; set; } - public int ConnectedSubtitlesOutCueClosestLeftGap { get; set; } - public int ConnectedSubtitlesOutCueClosestRightGap { get; set; } - public int ConnectedSubtitlesLeftGreenZone { get; set; } - public int ConnectedSubtitlesLeftRedZone { get; set; } - public int ConnectedSubtitlesRightRedZone { get; set; } - public int ConnectedSubtitlesRightGreenZone { get; set; } - public int ConnectedSubtitlesTreatConnected { get; set; } - - // Chaining - public bool ChainingGeneralUseZones { get; set; } - public int ChainingGeneralMaxGap { get; set; } - public int ChainingGeneralLeftGreenZone { get; set; } - public int ChainingGeneralLeftRedZone { get; set; } - public ChainingShotChangeBehaviorEnum ChainingGeneralShotChangeBehavior { get; set; } - public bool ChainingInCueOnShotUseZones { get; set; } - public int ChainingInCueOnShotMaxGap { get; set; } - public int ChainingInCueOnShotLeftGreenZone { get; set; } - public int ChainingInCueOnShotLeftRedZone { get; set; } - public ChainingShotChangeBehaviorEnum ChainingInCueOnShotShotChangeBehavior { get; set; } - public bool ChainingInCueOnShotCheckGeneral { get; set; } - public bool ChainingOutCueOnShotUseZones { get; set; } - public int ChainingOutCueOnShotMaxGap { get; set; } - public int ChainingOutCueOnShotRightRedZone { get; set; } - public int ChainingOutCueOnShotRightGreenZone { get; set; } - public ChainingShotChangeBehaviorEnum ChainingOutCueOnShotShotChangeBehavior { get; set; } - public bool ChainingOutCueOnShotCheckGeneral { get; set; } - - public enum Preset : int - { - Default = 0, - Netflix = 1, - SDI = 2, - } - - public enum ChainingShotChangeBehaviorEnum : int - { - DontChain = 0, - ExtendCrossingShotChange = 1, - ExtendUntilShotChange = 2 - } - - public BeautifyTimeCodesProfile(Preset preset = Preset.Default) - { - switch (preset) - { - case Preset.Netflix: - Gap = 2; - - InCuesGap = 0; - InCuesLeftGreenZone = 12; - InCuesLeftRedZone = 7; - InCuesRightRedZone = 7; - InCuesRightGreenZone = 12; - - OutCuesGap = 2; - OutCuesLeftGreenZone = 12; - OutCuesLeftRedZone = 7; - OutCuesRightRedZone = 7; - OutCuesRightGreenZone = 12; - - ConnectedSubtitlesInCueClosestLeftGap = 2; - ConnectedSubtitlesInCueClosestRightGap = 0; - ConnectedSubtitlesOutCueClosestLeftGap = 2; - ConnectedSubtitlesOutCueClosestRightGap = 0; - ConnectedSubtitlesLeftGreenZone = 12; - ConnectedSubtitlesLeftRedZone = 7; - ConnectedSubtitlesRightRedZone = 7; - ConnectedSubtitlesRightGreenZone = 12; - ConnectedSubtitlesTreatConnected = 180; - - ChainingGeneralUseZones = false; - ChainingGeneralMaxGap = 500; - ChainingGeneralLeftGreenZone = 12; - ChainingGeneralLeftRedZone = 11; - ChainingGeneralShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; - ChainingInCueOnShotUseZones = false; - ChainingInCueOnShotMaxGap = 500; - ChainingInCueOnShotLeftGreenZone = 12; - ChainingInCueOnShotLeftRedZone = 11; - ChainingInCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; - ChainingInCueOnShotCheckGeneral = true; - ChainingOutCueOnShotUseZones = false; - ChainingOutCueOnShotMaxGap = 500; - ChainingOutCueOnShotRightRedZone = 11; - ChainingOutCueOnShotRightGreenZone = 12; - ChainingOutCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; - ChainingOutCueOnShotCheckGeneral = true; - break; - case Preset.SDI: - Gap = 4; - - InCuesGap = 2; - InCuesLeftGreenZone = 12; - InCuesLeftRedZone = 7; - InCuesRightRedZone = 7; - InCuesRightGreenZone = 12; - - OutCuesGap = 2; - OutCuesLeftGreenZone = 12; - OutCuesLeftRedZone = 7; - OutCuesRightRedZone = 7; - OutCuesRightGreenZone = 12; - - ConnectedSubtitlesInCueClosestLeftGap = 2; - ConnectedSubtitlesInCueClosestRightGap = 2; - ConnectedSubtitlesOutCueClosestLeftGap = 2; - ConnectedSubtitlesOutCueClosestRightGap = 2; - ConnectedSubtitlesLeftGreenZone = 12; - ConnectedSubtitlesLeftRedZone = 7; - ConnectedSubtitlesRightRedZone = 7; - ConnectedSubtitlesRightGreenZone = 12; - ConnectedSubtitlesTreatConnected = 240; - - ChainingGeneralUseZones = false; - ChainingGeneralMaxGap = 1000; - ChainingGeneralLeftGreenZone = 25; - ChainingGeneralLeftRedZone = 24; - ChainingGeneralShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendCrossingShotChange; - ChainingInCueOnShotUseZones = false; - ChainingInCueOnShotMaxGap = 1000; - ChainingInCueOnShotLeftGreenZone = 25; - ChainingInCueOnShotLeftRedZone = 24; - ChainingInCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendCrossingShotChange; - ChainingInCueOnShotCheckGeneral = true; - ChainingOutCueOnShotUseZones = true; - ChainingOutCueOnShotMaxGap = 500; - ChainingOutCueOnShotRightRedZone = 7; - ChainingOutCueOnShotRightGreenZone = 12; - ChainingOutCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendCrossingShotChange; - ChainingOutCueOnShotCheckGeneral = true; - break; - default: - Gap = 3; - - InCuesGap = 0; - InCuesLeftGreenZone = 3; - InCuesLeftRedZone = 3; - InCuesRightRedZone = 5; - InCuesRightGreenZone = 5; - - OutCuesGap = 0; - OutCuesLeftGreenZone = 10; - OutCuesLeftRedZone = 10; - OutCuesRightRedZone = 3; - OutCuesRightGreenZone = 12; - - ConnectedSubtitlesInCueClosestLeftGap = 3; - ConnectedSubtitlesInCueClosestRightGap = 0; - ConnectedSubtitlesOutCueClosestLeftGap = 0; - ConnectedSubtitlesOutCueClosestRightGap = 3; - ConnectedSubtitlesLeftGreenZone = 3; - ConnectedSubtitlesLeftRedZone = 3; - ConnectedSubtitlesRightRedZone = 3; - ConnectedSubtitlesRightGreenZone = 3; - ConnectedSubtitlesTreatConnected = 180; - - ChainingGeneralUseZones = false; - ChainingGeneralMaxGap = 1000; - ChainingGeneralLeftGreenZone = 25; - ChainingGeneralLeftRedZone = 24; - ChainingGeneralShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; - ChainingInCueOnShotUseZones = false; - ChainingInCueOnShotMaxGap = 1000; - ChainingInCueOnShotLeftGreenZone = 25; - ChainingInCueOnShotLeftRedZone = 24; - ChainingInCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; - ChainingInCueOnShotCheckGeneral = true; - ChainingOutCueOnShotUseZones = false; - ChainingOutCueOnShotMaxGap = 500; - ChainingOutCueOnShotRightRedZone = 11; - ChainingOutCueOnShotRightGreenZone = 12; - ChainingOutCueOnShotShotChangeBehavior = ChainingShotChangeBehaviorEnum.ExtendUntilShotChange; - ChainingOutCueOnShotCheckGeneral = true; - break; - } - } - } - } - - public class CompareSettings - { - public bool ShowOnlyDifferences { get; set; } - public bool OnlyLookForDifferenceInText { get; set; } - public bool IgnoreLineBreaks { get; set; } - public bool IgnoreWhitespace { get; set; } - public bool IgnoreFormatting { get; set; } - - public CompareSettings() - { - OnlyLookForDifferenceInText = true; - } - } - - public class VerifyCompletenessSettings - { - public ListSortEnum ListSort { get; set; } - - public enum ListSortEnum : int - { - Coverage = 0, - Time = 1, - } - - public VerifyCompletenessSettings() - { - ListSort = ListSortEnum.Coverage; - } - } public class Settings { diff --git a/src/libse/Common/Settings/Shortcuts.cs b/src/libse/Common/Settings/Shortcuts.cs new file mode 100644 index 000000000..15a493343 --- /dev/null +++ b/src/libse/Common/Settings/Shortcuts.cs @@ -0,0 +1,539 @@ +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class Shortcuts + { + // General + public string GeneralMergeSelectedLines { get; set; } + public string GeneralMergeWithPrevious { get; set; } + public string GeneralMergeWithNext { get; set; } + public string GeneralMergeWithPreviousAndUnbreak { get; set; } + public string GeneralMergeWithNextAndUnbreak { get; set; } + public string GeneralMergeWithPreviousAndBreak { get; set; } + public string GeneralMergeWithNextAndBreak { get; set; } + public string GeneralMergeSelectedLinesAndAutoBreak { get; set; } + public string GeneralMergeSelectedLinesAndUnbreak { get; set; } + public string GeneralMergeSelectedLinesAndUnbreakCjk { get; set; } + public string GeneralMergeSelectedLinesOnlyFirstText { get; set; } + public string GeneralMergeSelectedLinesBilingual { get; set; } + public string GeneralMergeWithPreviousBilingual { get; set; } + public string GeneralMergeWithNextBilingual { get; set; } + public string GeneralMergeOriginalAndTranslation { get; set; } + public string GeneralToggleTranslationMode { get; set; } + public string GeneralSwitchOriginalAndTranslation { get; set; } + public string GeneralSwitchOriginalAndTranslationTextBoxes { get; set; } + public string GeneralLayoutChoose { get; set; } + public string GeneralLayoutChoose1 { get; set; } + public string GeneralLayoutChoose2 { get; set; } + public string GeneralLayoutChoose3 { get; set; } + public string GeneralLayoutChoose4 { get; set; } + public string GeneralLayoutChoose5 { get; set; } + public string GeneralLayoutChoose6 { get; set; } + public string GeneralLayoutChoose7 { get; set; } + public string GeneralLayoutChoose8 { get; set; } + public string GeneralLayoutChoose9 { get; set; } + public string GeneralLayoutChoose10 { get; set; } + public string GeneralLayoutChoose11 { get; set; } + public string GeneralLayoutChoose12 { get; set; } + public string GeneralPlayFirstSelected { get; set; } + public string GeneralGoToFirstSelectedLine { get; set; } + public string GeneralGoToNextEmptyLine { get; set; } + public string GeneralGoToNextSubtitle { get; set; } + public string GeneralGoToNextSubtitlePlayTranslate { get; set; } + public string GeneralGoToNextSubtitleCursorAtEnd { get; set; } + public string GeneralGoToPrevSubtitle { get; set; } + public string GeneralGoToPrevSubtitlePlayTranslate { get; set; } + public string GeneralGoToStartOfCurrentSubtitle { get; set; } + public string GeneralGoToEndOfCurrentSubtitle { get; set; } + public string GeneralGoToPreviousSubtitleAndFocusVideo { get; set; } + public string GeneralGoToNextSubtitleAndFocusVideo { get; set; } + public string GeneralGoToPreviousSubtitleAndFocusWaveform { get; set; } + public string GeneralGoToNextSubtitleAndFocusWaveform { get; set; } + public string GeneralGoToPrevSubtitleAndPlay { get; set; } + public string GeneralGoToNextSubtitleAndPlay { get; set; } + public string GeneralToggleBookmarks { get; set; } + public string GeneralToggleBookmarksWithText { get; set; } + public string GeneralEditBookmarks { get; set; } + public string GeneralClearBookmarks { get; set; } + public string GeneralGoToBookmark { get; set; } + public string GeneralGoToPreviousBookmark { get; set; } + public string GeneralGoToNextBookmark { get; set; } + public string GeneralChooseProfile { get; set; } + public string GeneralDuplicateLine { get; set; } + public string OpenDataFolder { get; set; } + public string OpenContainingFolder { get; set; } + public string GeneralToggleView { get; set; } + public string GeneralToggleMode { get; set; } + public string GeneralTogglePreviewOnVideo { get; set; } + public string GeneralRemoveBlankLines { get; set; } + public string GeneralApplyAssaOverrideTags { get; set; } + public string GeneralSetAssaPosition { get; set; } + public string GeneralSetAssaResolution { get; set; } + public string GeneralSetAssaBgBox { get; set; } + public string GeneralColorPicker { get; set; } + public string GeneralTakeAutoBackup { get; set; } + public string GeneralHelp { get; set; } + public string GeneralFocusTextBox { get; set; } + + // File + public string MainFileNew { get; set; } + public string MainFileOpen { get; set; } + public string MainFileOpenKeepVideo { get; set; } + public string MainFileSave { get; set; } + public string MainFileSaveOriginal { get; set; } + public string MainFileSaveOriginalAs { get; set; } + public string MainFileSaveAs { get; set; } + public string MainFileSaveAll { get; set; } + public string MainFileOpenOriginal { get; set; } + public string MainFileCloseOriginal { get; set; } + public string MainFileCloseTranslation { get; set; } + public string MainFileCompare { get; set; } + public string MainFileVerifyCompleteness { get; set; } + public string MainFileImportPlainText { get; set; } + public string MainFileImportBdSupForEdit { get; set; } + public string MainFileImportTimeCodes { get; set; } + public string MainFileExportEbu { get; set; } + public string MainFileExportPac { get; set; } + public string MainFileExportBdSup { get; set; } + public string MainFileExportEdlClip { get; set; } + public string MainFileExportPlainText { get; set; } + public string MainFileExit { get; set; } + + // Edit + public string MainEditUndo { get; set; } + public string MainEditRedo { get; set; } + public string MainEditFind { get; set; } + public string MainEditFindNext { get; set; } + public string MainEditReplace { get; set; } + public string MainEditMultipleReplace { get; set; } + public string MainEditGoToLineNumber { get; set; } + public string MainEditRightToLeft { get; set; } + public string MainEditFixRTLViaUnicodeChars { get; set; } + public string MainEditRemoveRTLUnicodeChars { get; set; } + public string MainEditReverseStartAndEndingForRTL { get; set; } + public string MainVideoToggleControls { get; set; } + public string MainEditToggleTranslationOriginalInPreviews { get; set; } + public string MainEditInverseSelection { get; set; } + public string MainEditModifySelection { get; set; } + + // Tools + public string MainToolsAdjustDuration { get; set; } + public string MainToolsAdjustDurationLimits { get; set; } + public string MainToolsFixCommonErrors { get; set; } + public string MainToolsFixCommonErrorsPreview { get; set; } + public string MainToolsMergeShortLines { get; set; } + public string MainToolsMergeDuplicateText { get; set; } + public string MainToolsMergeSameTimeCodes { get; set; } + public string MainToolsMakeEmptyFromCurrent { get; set; } + public string MainToolsSplitLongLines { get; set; } + public string MainToolsDurationsBridgeGap { get; set; } + public string MainToolsMinimumDisplayTimeBetweenParagraphs { get; set; } + + public string MainToolsRenumber { get; set; } + public string MainToolsRemoveTextForHI { get; set; } + public string MainToolsConvertColorsToDialog { get; set; } + public string MainToolsChangeCasing { get; set; } + public string MainToolsAutoDuration { get; set; } + public string MainToolsBatchConvert { get; set; } + public string MainToolsMeasurementConverter { get; set; } + public string MainToolsSplit { get; set; } + public string MainToolsAppend { get; set; } + public string MainToolsJoin { get; set; } + public string MainToolsStyleManager { get; set; } + + // Video + public string MainVideoOpen { get; set; } + public string MainVideoClose { get; set; } + public string MainVideoPause { get; set; } + public string MainVideoStop { get; set; } + public string MainVideoPlayFromJustBefore { get; set; } + public string MainVideoPlayFromBeginning { get; set; } + public string MainVideoPlayPauseToggle { get; set; } + public string MainVideoPlay150Speed { get; set; } + public string MainVideoPlay200Speed { get; set; } + public string MainVideoFocusSetVideoPosition { get; set; } + public string MainVideoToggleVideoControls { get; set; } + public string MainVideo1FrameLeft { get; set; } + public string MainVideo1FrameRight { get; set; } + public string MainVideo1FrameLeftWithPlay { get; set; } + public string MainVideo1FrameRightWithPlay { get; set; } + public string MainVideo100MsLeft { get; set; } + public string MainVideo100MsRight { get; set; } + public string MainVideo500MsLeft { get; set; } + public string MainVideo500MsRight { get; set; } + public string MainVideo1000MsLeft { get; set; } + public string MainVideo1000MsRight { get; set; } + public string MainVideo5000MsLeft { get; set; } + public string MainVideo5000MsRight { get; set; } + public string MainVideoXSMsLeft { get; set; } + public string MainVideoXSMsRight { get; set; } + public string MainVideoXLMsLeft { get; set; } + public string MainVideoXLMsRight { get; set; } + public string MainVideo3000MsLeft { get; set; } + public string MainVideo3000MsRight { get; set; } + public string MainVideoGoToStartCurrent { get; set; } + public string MainVideoToggleStartEndCurrent { get; set; } + public string MainVideoPlaySelectedLines { get; set; } + public string MainVideoLoopSelectedLines { get; set; } + public string MainVideoGoToPrevSubtitle { get; set; } + public string MainVideoGoToNextSubtitle { get; set; } + public string MainVideoGoToPrevTimeCode { get; set; } + public string MainVideoGoToNextTimeCode { get; set; } + public string MainVideoGoToPrevChapter { get; set; } + public string MainVideoGoToNextChapter { get; set; } + public string MainVideoSelectNextSubtitle { get; set; } + public string MainVideoFullscreen { get; set; } + public string MainVideoSlower { get; set; } + public string MainVideoFaster { get; set; } + public string MainVideoSpeedToggle { get; set; } + public string MainVideoReset { get; set; } + public string MainVideoToggleBrightness { get; set; } + public string MainVideoToggleContrast { get; set; } + public string MainVideoAudioToTextVosk { get; set; } + public string MainVideoAudioToTextWhisper { get; set; } + public string MainVideoAudioExtractAudioSelectedLines { get; set; } + public string MainVideoTextToSpeech { get; set; } + + // spell check + public string MainSpellCheck { get; set; } + public string MainSpellCheckFindDoubleWords { get; set; } + public string MainSpellCheckAddWordToNames { get; set; } + + // Sync + public string MainSynchronizationAdjustTimes { get; set; } + public string MainSynchronizationVisualSync { get; set; } + public string MainSynchronizationPointSync { get; set; } + public string MainSynchronizationPointSyncViaFile { get; set; } + public string MainSynchronizationChangeFrameRate { get; set; } + + // List view + public string MainListViewItalic { get; set; } + public string MainListViewBold { get; set; } + public string MainListViewUnderline { get; set; } + public string MainListViewBox { get; set; } + public string MainListViewToggleQuotes { get; set; } + public string MainListViewToggleHiTags { get; set; } + public string MainListViewToggleCustomTags { get; set; } + public string MainListViewSplit { get; set; } + public string MainListViewToggleDashes { get; set; } + public string MainListViewToggleMusicSymbols { get; set; } + public string MainListViewAlignment { get; set; } + public string MainListViewAlignmentN1 { get; set; } + public string MainListViewAlignmentN2 { get; set; } + public string MainListViewAlignmentN3 { get; set; } + public string MainListViewAlignmentN4 { get; set; } + public string MainListViewAlignmentN5 { get; set; } + public string MainListViewAlignmentN6 { get; set; } + public string MainListViewAlignmentN7 { get; set; } + public string MainListViewAlignmentN8 { get; set; } + public string MainListViewAlignmentN9 { get; set; } + public string MainListViewColor1 { get; set; } + public string MainListViewColor2 { get; set; } + public string MainListViewColor3 { get; set; } + public string MainListViewColor4 { get; set; } + public string MainListViewColor5 { get; set; } + public string MainListViewColor6 { get; set; } + public string MainListViewColor7 { get; set; } + public string MainListViewColor8 { get; set; } + public string MainListViewSetNewActor { get; set; } + public string MainListViewSetActor1 { get; set; } + public string MainListViewSetActor2 { get; set; } + public string MainListViewSetActor3 { get; set; } + public string MainListViewSetActor4 { get; set; } + public string MainListViewSetActor5 { get; set; } + public string MainListViewSetActor6 { get; set; } + public string MainListViewSetActor7 { get; set; } + public string MainListViewSetActor8 { get; set; } + public string MainListViewSetActor9 { get; set; } + public string MainListViewSetActor10 { get; set; } + public string MainListViewColorChoose { get; set; } + public string MainRemoveFormatting { get; set; } + public string MainListViewCopyText { get; set; } + public string MainListViewCopyPlainText { get; set; } + public string MainListViewCopyTextFromOriginalToCurrent { get; set; } + public string MainListViewAutoDuration { get; set; } + public string MainListViewColumnDeleteText { get; set; } + public string MainListViewColumnDeleteTextAndShiftUp { get; set; } + public string MainListViewColumnInsertText { get; set; } + public string MainListViewColumnPaste { get; set; } + public string MainListViewColumnTextUp { get; set; } + public string MainListViewColumnTextDown { get; set; } + public string MainListViewGoToNextError { get; set; } + public string MainListViewListErrors { get; set; } + public string MainListViewSortByNumber { get; set; } + public string MainListViewSortByStartTime { get; set; } + public string MainListViewSortByEndTime { get; set; } + public string MainListViewSortByDuration { get; set; } + public string MainListViewSortByGap { get; set; } + public string MainListViewSortByText { get; set; } + public string MainListViewSortBySingleLineMaxLen { get; set; } + public string MainListViewSortByTextTotalLength { get; set; } + public string MainListViewSortByCps { get; set; } + public string MainListViewSortByWpm { get; set; } + public string MainListViewSortByNumberOfLines { get; set; } + public string MainListViewSortByActor { get; set; } + public string MainListViewSortByStyle { get; set; } + public string MainListViewRemoveTimeCodes { get; set; } + public string MainTextBoxSplitAtCursor { get; set; } + public string MainTextBoxSplitAtCursorAndAutoBr { get; set; } + public string MainTextBoxSplitAtCursorAndVideoPos { get; set; } + public string MainTextBoxSplitSelectedLineBilingual { get; set; } + public string MainTextBoxMoveLastWordDown { get; set; } + public string MainTextBoxMoveFirstWordFromNextUp { get; set; } + public string MainTextBoxMoveLastWordDownCurrent { get; set; } + public string MainTextBoxMoveFirstWordUpCurrent { get; set; } + public string MainTextBoxMoveFromCursorToNextAndGoToNext { get; set; } + public string MainTextBoxSelectionToLower { get; set; } + public string MainTextBoxSelectionToUpper { get; set; } + public string MainTextBoxSelectionToggleCasing { get; set; } + public string MainTextBoxSelectionToRuby { get; set; } + public string MainTextBoxToggleAutoDuration { get; set; } + public string MainCreateInsertSubAtVideoPos { get; set; } + public string MainCreateInsertSubAtVideoPosMax { get; set; } + public string MainCreateInsertSubAtVideoPosNoTextBoxFocus { get; set; } + public string MainCreateSetStart { get; set; } + public string MainCreateSetEnd { get; set; } + public string MainAdjustVideoSetStartForAppropriateLine { get; set; } + public string MainAdjustVideoSetEndForAppropriateLine { get; set; } + public string MainAdjustSetEndAndPause { get; set; } + public string MainCreateSetEndAddNewAndGoToNew { get; set; } + public string MainCreateStartDownEndUp { get; set; } + public string MainAdjustSetStartAndOffsetTheRest { get; set; } + public string MainAdjustSetStartAndOffsetTheRest2 { get; set; } + public string MainAdjustSetStartAndOffsetTheWholeSubtitle { get; set; } + public string MainAdjustSetEndAndOffsetTheRest { get; set; } + public string MainAdjustSetEndAndOffsetTheRestAndGoToNext { get; set; } + public string MainAdjustSetStartAndGotoNext { get; set; } + public string MainAdjustSetEndAndGotoNext { get; set; } + public string MainAdjustViaEndAutoStart { get; set; } + public string MainAdjustViaEndAutoStartAndGoToNext { get; set; } + public string MainAdjustSetEndMinusGapAndStartNextHere { get; set; } + public string MainSetEndAndStartNextAfterGap { get; set; } + public string MainAdjustSetStartAutoDurationAndGoToNext { get; set; } + public string MainAdjustSetEndNextStartAndGoToNext { get; set; } + public string MainAdjustStartDownEndUpAndGoToNext { get; set; } + public string MainAdjustSetStartAndEndOfPrevious { get; set; } + public string MainAdjustSetStartAndEndOfPreviousAndGoToNext { get; set; } + public string MainAdjustSetStartKeepDuration { get; set; } + public string MainAdjustSelected100MsForward { get; set; } + public string MainAdjustSelected100MsBack { get; set; } + public string MainAdjustStartXMsBack { get; set; } + public string MainAdjustStartXMsForward { get; set; } + public string MainAdjustEndXMsBack { get; set; } + public string MainAdjustEndXMsForward { get; set; } + public string MoveStartOneFrameBack { get; set; } + public string MoveStartOneFrameForward { get; set; } + public string MoveEndOneFrameBack { get; set; } + public string MoveEndOneFrameForward { get; set; } + public string MoveStartOneFrameBackKeepGapPrev { get; set; } + public string MoveStartOneFrameForwardKeepGapPrev { get; set; } + public string MoveEndOneFrameBackKeepGapNext { get; set; } + public string MoveEndOneFrameForwardKeepGapNext { get; set; } + public string MainAdjustSnapStartToNextShotChange { get; set; } + public string MainAdjustSnapEndToPreviousShotChange { get; set; } + public string MainAdjustExtendToNextShotChange { get; set; } + public string MainAdjustExtendToPreviousShotChange { get; set; } + public string MainAdjustExtendToNextSubtitle { get; set; } + public string MainAdjustExtendToPreviousSubtitle { get; set; } + public string MainAdjustExtendToNextSubtitleMinusChainingGap { get; set; } + public string MainAdjustExtendToPreviousSubtitleMinusChainingGap { get; set; } + public string MainAdjustExtendCurrentSubtitle { get; set; } + public string MainAdjustExtendPreviousLineEndToCurrentStart { get; set; } + public string MainAdjustExtendNextLineStartToCurrentEnd { get; set; } + public string MainSetInCueToClosestShotChangeLeftGreenZone { get; set; } + public string MainSetInCueToClosestShotChangeRightGreenZone { get; set; } + public string MainSetOutCueToClosestShotChangeLeftGreenZone { get; set; } + public string MainSetOutCueToClosestShotChangeRightGreenZone { get; set; } + public string GeneralAutoCalcCurrentDuration { get; set; } + public string GeneralAutoCalcCurrentDurationByOptimalReadingSpeed { get; set; } + public string GeneralAutoCalcCurrentDurationByMinReadingSpeed { get; set; } + public string MainInsertAfter { get; set; } + public string MainTextBoxAutoBreak { get; set; } + public string MainTextBoxBreakAtPosition { get; set; } + public string MainTextBoxBreakAtPositionAndGoToNext { get; set; } + public string MainTextBoxRecord { get; set; } + public string MainTextBoxUnbreak { get; set; } + public string MainTextBoxUnbreakNoSpace { get; set; } + public string MainTextBoxAssaIntellisense { get; set; } + public string MainTextBoxAssaRemoveTag { get; set; } + public string MainWaveformInsertAtCurrentPosition { get; set; } + public string MainInsertBefore { get; set; } + public string MainMergeDialog { get; set; } + public string MainMergeDialogWithNext { get; set; } + public string MainMergeDialogWithPrevious { get; set; } + public string MainAutoBalanceSelectedLines { get; set; } + public string MainEvenlyDistributeSelectedLines { get; set; } + public string MainToggleFocus { get; set; } + public string MainToggleFocusWaveform { get; set; } + public string MainToggleFocusWaveformTextBox { get; set; } + public string WaveformAdd { get; set; } + public string WaveformVerticalZoom { get; set; } + public string WaveformVerticalZoomOut { get; set; } + public string WaveformZoomIn { get; set; } + public string WaveformZoomOut { get; set; } + public string WaveformSplit { get; set; } + public string WaveformPlaySelection { get; set; } + public string WaveformPlaySelectionEnd { get; set; } + public string WaveformSearchSilenceForward { get; set; } + public string WaveformSearchSilenceBack { get; set; } + public string WaveformAddTextHere { get; set; } + public string WaveformAddTextHereFromClipboard { get; set; } + public string WaveformSetParagraphAsSelection { get; set; } + public string WaveformGoToPreviousShotChange { get; set; } + public string WaveformGoToNextShotChange { get; set; } + public string WaveformToggleShotChange { get; set; } + public string WaveformListShotChanges { get; set; } + public string WaveformGuessStart { get; set; } + public string Waveform100MsLeft { get; set; } + public string Waveform100MsRight { get; set; } + public string Waveform1000MsLeft { get; set; } + public string Waveform1000MsRight { get; set; } + public string WaveformAudioToTextVosk { get; set; } + public string WaveformAudioToTextWhisper { get; set; } + public string MainCheckFixTimingViaShotChanges { get; set; } + public string MainTranslateGoogleIt { get; set; } + public string MainTranslateGoogleTranslateIt { get; set; } + public string MainTranslateAuto { get; set; } + public string MainTranslateAutoSelectedLines { get; set; } + public string MainTranslateCustomSearch1 { get; set; } + public string MainTranslateCustomSearch2 { get; set; } + public string MainTranslateCustomSearch3 { get; set; } + public string MainTranslateCustomSearch4 { get; set; } + public string MainTranslateCustomSearch5 { get; set; } + public List PluginShortcuts { get; set; } + + + public Shortcuts() + { + GeneralGoToFirstSelectedLine = "Control+L"; + GeneralMergeSelectedLines = "Control+Shift+M"; + GeneralToggleTranslationMode = "Control+Shift+O"; + GeneralMergeOriginalAndTranslation = "Control+Alt+Shift+M"; + GeneralGoToNextSubtitle = "Shift+Return"; + GeneralGoToNextSubtitlePlayTranslate = "Alt+Down"; + GeneralGoToPrevSubtitlePlayTranslate = "Alt+Up"; + GeneralToggleBookmarksWithText = "Control+Shift+B"; + OpenDataFolder = "Control+Alt+Shift+D"; + GeneralToggleView = "F2"; + GeneralHelp = "F1"; + MainFileNew = "Control+N"; + MainFileOpen = "Control+O"; + MainFileSave = "Control+S"; + MainFileSaveAs = "Control+Shift+S"; + MainEditUndo = "Control+Z"; + MainEditRedo = "Control+Y"; + MainEditFind = "Control+F"; + MainEditFindNext = "F3"; + MainEditReplace = "Control+H"; + MainEditMultipleReplace = "Control+Alt+M"; + MainEditGoToLineNumber = "Control+G"; + MainEditRightToLeft = "Control+Shift+Alt+R"; + MainEditInverseSelection = "Control+Shift+I"; + MainToolsFixCommonErrors = "Control+Shift+F"; + MainToolsFixCommonErrorsPreview = "Control+P"; + MainToolsRenumber = "Control+Shift+N"; + MainToolsRemoveTextForHI = "Control+Shift+H"; + MainToolsChangeCasing = "Control+Shift+C"; + MainVideoPlayFromJustBefore = "Shift+F10"; + MainVideoPlayPauseToggle = "Control+P"; + MainVideoPause = "Control+Alt+P"; + MainVideo500MsLeft = "Alt+Left"; + MainVideo500MsRight = "Alt+Right"; + MainVideoFullscreen = "Alt+Return"; + MainVideoReset = "Control+D0"; + MainSpellCheck = "Control+Shift+S"; + MainSpellCheckFindDoubleWords = "Control+Shift+D"; + MainSpellCheckAddWordToNames = "Control+Shift+L"; + MainSynchronizationAdjustTimes = "Control+Shift+A"; + MainSynchronizationVisualSync = "Control+Shift+V"; + MainSynchronizationPointSync = "Control+Shift+P"; + MainListViewItalic = "Control+I"; + MainTextBoxSplitAtCursor = "Control+Alt+V"; + MainTextBoxSelectionToLower = "Control+U"; + MainTextBoxSelectionToUpper = "Control+Shift+U"; + MainTextBoxSelectionToggleCasing = "Control+Shift+F3"; + MainCreateInsertSubAtVideoPos = "Shift+F9"; + MainVideoGoToStartCurrent = "Shift+F11"; + MainVideoToggleStartEndCurrent = "F4"; + MainVideoPlaySelectedLines = "F5"; + MainVideoGoToStartCurrent = "F6"; + MainVideo3000MsLeft = "F7"; + MainListViewGoToNextError = "F8"; + MainListViewListErrors = "Control+F8"; + MainCreateSetStart = "F11"; + MainCreateSetEnd = "F12"; + MainAdjustSetStartAndOffsetTheRest = "Control+Space"; + MainAdjustSetStartAndOffsetTheRest2 = "F9"; + MainAdjustSetEndAndGotoNext = "F10"; + MainInsertAfter = "Alt+Insert"; + MainWaveformInsertAtCurrentPosition = "Insert"; + MainInsertBefore = "Control+Shift+Insert"; + MainTextBoxAutoBreak = "Control+R"; + MainTranslateAuto = "Control+Shift+G"; + MainAdjustExtendToNextSubtitle = "Control+Shift+E"; + MainAdjustExtendToPreviousSubtitle = "Alt+Shift+E"; + MainAdjustExtendToNextSubtitleMinusChainingGap = "Control+Shift+W"; + MainAdjustExtendToPreviousSubtitleMinusChainingGap = "Alt+Shift+W"; + WaveformVerticalZoom = "Shift+Add"; + WaveformVerticalZoomOut = "Shift+Subtract"; + WaveformAddTextHere = "Return"; + Waveform100MsLeft = "Shift+Left"; + Waveform100MsRight = "Shift+Right"; + Waveform1000MsLeft = "Left"; + Waveform1000MsRight = "Right"; + MainCheckFixTimingViaShotChanges = "Control+Shift+D9"; + PluginShortcuts = new List(); + } + + public Shortcuts Clone() + { + var xws = new XmlWriterSettings { Indent = true }; + var sb = new StringBuilder(); + using (var textWriter = XmlWriter.Create(sb, xws)) + { + textWriter.WriteStartDocument(); + textWriter.WriteStartElement("Settings", string.Empty); + Settings.WriteShortcuts(this, textWriter); + textWriter.WriteEndElement(); + textWriter.WriteEndDocument(); + } + + var doc = new XmlDocument { PreserveWhitespace = true }; + doc.LoadXml(sb.ToString().Replace("encoding=\"utf-16\"", "encoding=\"utf-8\"")); + var shortcuts = new Shortcuts(); + Settings.ReadShortcuts(doc, shortcuts); + return shortcuts; + } + + public static void Save(string fileName, Shortcuts shortcuts) + { + var xws = new XmlWriterSettings { Indent = true, Encoding = Encoding.UTF8 }; + var sb = new StringBuilder(); + using (var textWriter = XmlWriter.Create(sb, xws)) + { + textWriter.WriteStartDocument(); + textWriter.WriteStartElement("Settings", string.Empty); + Settings.WriteShortcuts(shortcuts, textWriter); + textWriter.WriteEndElement(); + textWriter.WriteEndDocument(); + } + File.WriteAllText(fileName, sb.ToString().Replace("encoding=\"utf-16\"", "encoding=\"utf-8\""), Encoding.UTF8); + } + + public static Shortcuts Load(string fileName) + { + var doc = new XmlDocument { PreserveWhitespace = true }; + using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + doc.Load(stream); + var shortcuts = new Shortcuts(); + Settings.ReadShortcuts(doc, shortcuts); + return shortcuts; + } + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/SubtitleBeaming.cs b/src/libse/Common/Settings/SubtitleBeaming.cs new file mode 100644 index 000000000..42bf3b036 --- /dev/null +++ b/src/libse/Common/Settings/SubtitleBeaming.cs @@ -0,0 +1,22 @@ +using System.Drawing; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class SubtitleBeaming + { + public string FontName { get; set; } + public int FontSize { get; set; } + public Color FontColor { get; set; } + public Color BorderColor { get; set; } + public int BorderWidth { get; set; } + + public SubtitleBeaming() + { + FontName = "Verdana"; + FontSize = 30; + FontColor = Color.White; + BorderColor = Color.DarkGray; + BorderWidth = 2; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/SubtitleSettings.cs b/src/libse/Common/Settings/SubtitleSettings.cs new file mode 100644 index 000000000..116973451 --- /dev/null +++ b/src/libse/Common/Settings/SubtitleSettings.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class SubtitleSettings + { + public List AssaStyleStorageCategories { get; set; } + public List AssaOverrideTagHistory { get; set; } + public bool AssaResolutionAutoNew { get; set; } + public bool AssaResolutionPromptChange { get; set; } + public bool AssaShowScaledBorderAndShadow { get; set; } + public bool AssaShowPlayDepth { get; set; } + public string DCinemaFontFile { get; set; } + public string DCinemaLoadFontResource { get; set; } + public int DCinemaFontSize { get; set; } + public int DCinemaBottomMargin { get; set; } + public double DCinemaZPosition { get; set; } + public int DCinemaFadeUpTime { get; set; } + public int DCinemaFadeDownTime { get; set; } + public bool DCinemaAutoGenerateSubtitleId { get; set; } + + public string CurrentDCinemaSubtitleId { get; set; } + public string CurrentDCinemaMovieTitle { get; set; } + public string CurrentDCinemaReelNumber { get; set; } + public string CurrentDCinemaIssueDate { get; set; } + public string CurrentDCinemaLanguage { get; set; } + public string CurrentDCinemaEditRate { get; set; } + public string CurrentDCinemaTimeCodeRate { get; set; } + public string CurrentDCinemaStartTime { get; set; } + public string CurrentDCinemaFontId { get; set; } + public string CurrentDCinemaFontUri { get; set; } + public Color CurrentDCinemaFontColor { get; set; } + public string CurrentDCinemaFontEffect { get; set; } + public Color CurrentDCinemaFontEffectColor { get; set; } + public int CurrentDCinemaFontSize { get; set; } + + public int CurrentCavena890LanguageIdLine1 { get; set; } + public int CurrentCavena890LanguageIdLine2 { get; set; } + public string CurrentCavena89Title { get; set; } + public string CurrentCavena890riginalTitle { get; set; } + public string CurrentCavena890Translator { get; set; } + public string CurrentCavena89Comment { get; set; } + public int CurrentCavena89LanguageId { get; set; } + public string Cavena890StartOfMessage { get; set; } + + public bool EbuStlTeletextUseBox { get; set; } + public bool EbuStlTeletextUseDoubleHeight { get; set; } + public int EbuStlMarginTop { get; set; } + public int EbuStlMarginBottom { get; set; } + public int EbuStlNewLineRows { get; set; } + public bool EbuStlRemoveEmptyLines { get; set; } + public int PacVerticalTop { get; set; } + public int PacVerticalCenter { get; set; } + public int PacVerticalBottom { get; set; } + + public string DvdStudioProHeader { get; set; } + + public string TmpegEncXmlFontName { get; set; } + public string TmpegEncXmlFontHeight { get; set; } + public string TmpegEncXmlPosition { get; set; } + + public bool CheetahCaptionAlwayWriteEndTime { get; set; } + + public bool SamiDisplayTwoClassesAsTwoSubtitles { get; set; } + public int SamiHtmlEncodeMode { get; set; } + + public string TimedText10TimeCodeFormat { get; set; } + public string TimedText10TimeCodeFormatSource { get; set; } + public bool TimedText10ShowStyleAndLanguage { get; set; } + public string TimedText10FileExtension { get; set; } + public string TimedTextItunesTopOrigin { get; set; } + public string TimedTextItunesTopExtent { get; set; } + public string TimedTextItunesBottomOrigin { get; set; } + public string TimedTextItunesBottomExtent { get; set; } + public string TimedTextItunesTimeCodeFormat { get; set; } + public string TimedTextItunesStyleAttribute { get; set; } + public string TimedTextImsc11TimeCodeFormat { get; set; } + public string TimedTextImsc11FileExtension { get; set; } + + + public int FcpFontSize { get; set; } + public string FcpFontName { get; set; } + + public string NuendoCharacterListFile { get; set; } + + public bool WebVttUseXTimestampMap { get; set; } + public bool WebVttUseMultipleXTimestampMap { get; set; } + public bool WebVttMergeLinesWithSameText { get; set; } + public long WebVttTimescale { get; set; } + public string WebVttCueAn1 { get; set; } + public string WebVttCueAn2 { get; set; } + public string WebVttCueAn3 { get; set; } + public string WebVttCueAn4 { get; set; } + public string WebVttCueAn5 { get; set; } + public string WebVttCueAn6 { get; set; } + public string WebVttCueAn7 { get; set; } + public string WebVttCueAn8 { get; set; } + public string WebVttCueAn9 { get; set; } + public string MPlayer2Extension { get; set; } + public bool TeletextItalicFix { get; set; } + public bool MccDebug { get; set; } + public bool BluRaySupSkipMerge { get; set; } + public bool BluRaySupForceMergeAll { get; set; } + + public SubtitleSettings() + { + AssaStyleStorageCategories = new List(); + AssaOverrideTagHistory = new List(); + AssaResolutionAutoNew = true; + AssaResolutionPromptChange = true; + AssaShowScaledBorderAndShadow = true; + AssaShowPlayDepth = true; + + DCinemaFontFile = "Arial.ttf"; + DCinemaLoadFontResource = "urn:uuid:3dec6dc0-39d0-498d-97d0-928d2eb78391"; + DCinemaFontSize = 42; + DCinemaBottomMargin = 8; + DCinemaZPosition = 0; + DCinemaFadeUpTime = 0; + DCinemaFadeDownTime = 0; + DCinemaAutoGenerateSubtitleId = true; + + EbuStlTeletextUseBox = true; + EbuStlTeletextUseDoubleHeight = true; + EbuStlMarginTop = 0; + EbuStlMarginBottom = 2; + EbuStlNewLineRows = 2; + + PacVerticalTop = 1; + PacVerticalCenter = 6; + PacVerticalBottom = 11; + + DvdStudioProHeader = @"$VertAlign = Bottom +$Bold = FALSE +$Underlined = FALSE +$Italic = FALSE +$XOffset = 0 +$YOffset = -5 +$TextContrast = 15 +$Outline1Contrast = 15 +$Outline2Contrast = 13 +$BackgroundContrast = 0 +$ForceDisplay = FALSE +$FadeIn = 0 +$FadeOut = 0 +$HorzAlign = Center +"; + + TmpegEncXmlFontName = "Tahoma"; + TmpegEncXmlFontHeight = "0.069"; + TmpegEncXmlPosition = "23"; + + SamiDisplayTwoClassesAsTwoSubtitles = true; + SamiHtmlEncodeMode = 0; + + TimedText10TimeCodeFormat = "Source"; + TimedText10ShowStyleAndLanguage = true; + TimedText10FileExtension = ".xml"; + + TimedTextItunesTopOrigin = "0% 0%"; + TimedTextItunesTopExtent = "100% 15%"; + TimedTextItunesBottomOrigin = "0% 85%"; + TimedTextItunesBottomExtent = "100% 15%"; + TimedTextItunesTimeCodeFormat = "Frames"; + TimedTextItunesStyleAttribute = "tts:fontStyle"; + TimedTextImsc11TimeCodeFormat = "hh:mm:ss.ms"; + TimedTextImsc11FileExtension = ".xml"; + + FcpFontSize = 18; + FcpFontName = "Lucida Grande"; + + Cavena890StartOfMessage = "10:00:00:00"; + + WebVttTimescale = 90000; + WebVttUseXTimestampMap = true; + WebVttUseMultipleXTimestampMap = true; + WebVttCueAn1 = "position:20%"; + WebVttCueAn2 = ""; + WebVttCueAn3 = "position:80%"; + WebVttCueAn4 = "position:20% line:50%"; + WebVttCueAn5 = "line:50%"; + WebVttCueAn6 = "position:80% line:50%"; + WebVttCueAn7 = "position:20% line:20%"; + WebVttCueAn8 = "line:20%"; + WebVttCueAn9 = "position:80% line:20%"; + + MPlayer2Extension = ".txt"; + + TeletextItalicFix = true; + } + + public void InitializeDCinameSettings(bool smpte) + { + if (smpte) + { + CurrentDCinemaSubtitleId = "urn:uuid:" + Guid.NewGuid(); + CurrentDCinemaLanguage = "en"; + CurrentDCinemaFontUri = DCinemaLoadFontResource; + CurrentDCinemaFontId = "theFontId"; + } + else + { + string hex = Guid.NewGuid().ToString().RemoveChar('-').ToLowerInvariant(); + hex = hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-"); + CurrentDCinemaSubtitleId = hex; + CurrentDCinemaLanguage = "English"; + CurrentDCinemaFontUri = DCinemaFontFile; + CurrentDCinemaFontId = "Arial"; + } + CurrentDCinemaIssueDate = DateTime.Now.ToString("s"); + CurrentDCinemaMovieTitle = "title"; + CurrentDCinemaReelNumber = "1"; + CurrentDCinemaFontColor = Color.White; + CurrentDCinemaFontEffect = "border"; + CurrentDCinemaFontEffectColor = Color.Black; + CurrentDCinemaFontSize = DCinemaFontSize; + CurrentCavena890LanguageIdLine1 = -1; + CurrentCavena890LanguageIdLine2 = -1; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/ToolsSettings.cs b/src/libse/Common/Settings/ToolsSettings.cs new file mode 100644 index 000000000..b153562fa --- /dev/null +++ b/src/libse/Common/Settings/ToolsSettings.cs @@ -0,0 +1,669 @@ +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class ToolsSettings + { + public List AssaTagTemplates { get; set; } + public int StartSceneIndex { get; set; } + public int EndSceneIndex { get; set; } + public int VerifyPlaySeconds { get; set; } + public bool FixShortDisplayTimesAllowMoveStartTime { get; set; } + public bool RemoveEmptyLinesBetweenText { get; set; } + public string MusicSymbol { get; set; } + public string MusicSymbolReplace { get; set; } + public string UnicodeSymbolsToInsert { get; set; } + public bool SpellCheckAutoChangeNameCasing { get; set; } + public bool SpellCheckUseLargerFont { get; set; } + public bool SpellCheckAutoChangeNamesUseSuggestions { get; set; } + public string SpellCheckSearchEngine { get; set; } + public bool CheckOneLetterWords { get; set; } + public bool SpellCheckEnglishAllowInQuoteAsIng { get; set; } + public bool RememberUseAlwaysList { get; set; } + public bool LiveSpellCheck { get; set; } + public bool SpellCheckShowCompletedMessage { get; set; } + public bool OcrFixUseHardcodedRules { get; set; } + public bool OcrGoogleCloudVisionSeHandlesTextMerge { get; set; } + public int OcrBinaryImageCompareRgbThreshold { get; set; } + public int OcrTesseract4RgbThreshold { get; set; } + public string OcrAddLetterRow1 { get; set; } + public string OcrAddLetterRow2 { get; set; } + public string OcrTrainFonts { get; set; } + public string OcrTrainMergedLetters { get; set; } + public string OcrTrainSrtFile { get; set; } + public bool OcrUseWordSplitList { get; set; } + public bool OcrUseWordSplitListAvoidPropercase { get; set; } + public string BDOpenIn { get; set; } + public string MicrosoftBingApiId { get; set; } + public string MicrosoftTranslatorApiKey { get; set; } + public string MicrosoftTranslatorTokenEndpoint { get; set; } + public string MicrosoftTranslatorCategory { get; set; } + public string GoogleApiV2Key { get; set; } + public bool GoogleTranslateNoKeyWarningShow { get; set; } + public int GoogleApiV1ChunkSize { get; set; } + public string GoogleTranslateLastSourceLanguage { get; set; } + public string GoogleTranslateLastTargetLanguage { get; set; } + public string AutoTranslateLastName { get; set; } + public string AutoTranslateLastUrl { get; set; } + public string AutoTranslateNllbApiUrl { get; set; } + public string AutoTranslateNllbServeUrl { get; set; } + public string AutoTranslateNllbServeModel { get; set; } + public string AutoTranslateLibreUrl { get; set; } + public string AutoTranslateLibreApiKey { get; set; } + public string AutoTranslateMyMemoryApiKey { get; set; } + public string AutoTranslateSeamlessM4TUrl { get; set; } + public string AutoTranslateDeepLApiKey { get; set; } + public string AutoTranslateDeepLUrl { get; set; } + public string AutoTranslatePapagoApiKeyId { get; set; } + public string AutoTranslatePapagoApiKey { get; set; } + public string AutoTranslateDeepLFormality { get; set; } + public bool TranslateAllowSplit { get; set; } + public string TranslateLastService { get; set; } + public string TranslateMergeStrategy { get; set; } + public string TranslateViaCopyPasteSeparator { get; set; } + public int TranslateViaCopyPasteMaxSize { get; set; } + public bool TranslateViaCopyPasteAutoCopyToClipboard { get; set; } + public string ChatGptUrl { get; set; } + public string ChatGptPrompt { get; set; } + public string ChatGptApiKey { get; set; } + public string ChatGptModel { get; set; } + public string LmStudioApiUrl { get; set; } + public string LmStudioModel { get; set; } + public string LmStudioPrompt { get; set; } + public string OllamaApiUrl { get; set; } + public string OllamaModels { get; set; } + public string OllamaModel { get; set; } + public string OllamaPrompt { get; set; } + + public string AnthropicApiUrl { get; set; } + public string AnthropicPrompt { get; set; } + public string AnthropicApiKey { get; set; } + public string AnthropicApiModel { get; set; } + public int AutoTranslateDelaySeconds { get; set; } + public int AutoTranslateMaxBytes { get; set; } + public string AutoTranslateStrategy { get; set; } + public string GeminiProApiKey { get; set; } + public string TextToSpeechEngine { get; set; } + public string TextToSpeechLastVoice { get; set; } + public string TextToSpeechElevenLabsApiKey { get; set; } + public string TextToSpeechAzureApiKey { get; set; } + public string TextToSpeechAzureRegion { get; set; } + public bool TextToSpeechPreview { get; set; } + public bool TextToSpeechCustomAudio { get; set; } + public bool TextToSpeechCustomAudioStereo { get; set; } + public string TextToSpeechCustomAudioEncoding { get; set; } + public bool TextToSpeechAddToVideoFile { get; set; } + public bool ListViewSyntaxColorDurationSmall { get; set; } + public bool ListViewSyntaxColorDurationBig { get; set; } + public bool ListViewSyntaxColorOverlap { get; set; } + public bool ListViewSyntaxColorLongLines { get; set; } + public bool ListViewSyntaxColorWideLines { get; set; } + public bool ListViewSyntaxColorGap { get; set; } + public bool ListViewSyntaxMoreThanXLines { get; set; } + public Color ListViewSyntaxErrorColor { get; set; } + public Color ListViewUnfocusedSelectedColor { get; set; } + public Color Color1 { get; set; } + public Color Color2 { get; set; } + public Color Color3 { get; set; } + public Color Color4 { get; set; } + public Color Color5 { get; set; } + public Color Color6 { get; set; } + public Color Color7 { get; set; } + public Color Color8 { get; set; } + public bool ListViewShowColumnStartTime { get; set; } + public bool ListViewShowColumnEndTime { get; set; } + public bool ListViewShowColumnDuration { get; set; } + public bool ListViewShowColumnCharsPerSec { get; set; } + public bool ListViewShowColumnWordsPerMin { get; set; } + public bool ListViewShowColumnGap { get; set; } + public bool ListViewShowColumnActor { get; set; } + public bool ListViewShowColumnRegion { get; set; } + public bool ListViewMultipleReplaceShowColumnRuleInfo { get; set; } + public bool SplitAdvanced { get; set; } + public string SplitOutputFolder { get; set; } + public int SplitNumberOfParts { get; set; } + public string SplitVia { get; set; } + public bool JoinCorrectTimeCodes { get; set; } + public int JoinAddMs { get; set; } + public int SplitLongLinesMax { get; set; } + public string LastShowEarlierOrLaterSelection { get; set; } + public string NewEmptyTranslationText { get; set; } + public string BatchConvertOutputFolder { get; set; } + public bool BatchConvertOverwriteExisting { get; set; } + public bool BatchConvertSaveInSourceFolder { get; set; } + public bool BatchConvertRemoveFormatting { get; set; } + public bool BatchConvertRemoveFormattingAll { get; set; } + public bool BatchConvertRemoveFormattingItalic { get; set; } + public bool BatchConvertRemoveFormattingBold { get; set; } + public bool BatchConvertRemoveFormattingUnderline { get; set; } + public bool BatchConvertRemoveFormattingFontName { get; set; } + public bool BatchConvertRemoveFormattingColor { get; set; } + public bool BatchConvertRemoveFormattingAlignment { get; set; } + public bool BatchConvertRemoveStyle { get; set; } + public bool BatchConvertBridgeGaps { get; set; } + public bool BatchConvertFixCasing { get; set; } + public bool BatchConvertRemoveTextForHI { get; set; } + public bool BatchConvertConvertColorsToDialog { get; set; } + public bool BatchConvertBeautifyTimeCodes { get; set; } + public bool BatchConvertAutoTranslate { get; set; } + public bool BatchConvertFixCommonErrors { get; set; } + public bool BatchConvertMultipleReplace { get; set; } + public bool BatchConvertFixRtl { get; set; } + public string BatchConvertFixRtlMode { get; set; } + public bool BatchConvertSplitLongLines { get; set; } + public bool BatchConvertAutoBalance { get; set; } + public bool BatchConvertSetMinDisplayTimeBetweenSubtitles { get; set; } + public bool BatchConvertMergeShortLines { get; set; } + public bool BatchConvertRemoveLineBreaks { get; set; } + public bool BatchConvertMergeSameText { get; set; } + public bool BatchConvertMergeSameTimeCodes { get; set; } + public bool BatchConvertChangeFrameRate { get; set; } + public bool BatchConvertChangeSpeed { get; set; } + public bool BatchConvertAdjustDisplayDuration { get; set; } + public bool BatchConvertApplyDurationLimits { get; set; } + public bool BatchConvertDeleteLines { get; set; } + public bool BatchConvertAssaChangeRes { get; set; } + public bool BatchConvertSortBy { get; set; } + public string BatchConvertSortByChoice { get; set; } + public bool BatchConvertOffsetTimeCodes { get; set; } + public bool BatchConvertScanFolderIncludeVideo { get; set; } + public string BatchConvertLanguage { get; set; } + public string BatchConvertFormat { get; set; } + public string BatchConvertAssStyles { get; set; } + public string BatchConvertSsaStyles { get; set; } + public bool BatchConvertUseStyleFromSource { get; set; } + public string BatchConvertExportCustomTextTemplate { get; set; } + public bool BatchConvertTsOverrideXPosition { get; set; } + public bool BatchConvertTsOverrideYPosition { get; set; } + public int BatchConvertTsOverrideBottomMargin { get; set; } + public string BatchConvertTsOverrideHAlign { get; set; } + public int BatchConvertTsOverrideHMargin { get; set; } + public bool BatchConvertTsOverrideScreenSize { get; set; } + public int BatchConvertTsScreenWidth { get; set; } + public int BatchConvertTsScreenHeight { get; set; } + public string BatchConvertTsFileNameAppend { get; set; } + public bool BatchConvertTsOnlyTeletext { get; set; } + public string BatchConvertMkvLanguageCodeStyle { get; set; } + public string BatchConvertOcrEngine { get; set; } + public string BatchConvertOcrLanguage { get; set; } + public string WaveformBatchLastFolder { get; set; } + public string ModifySelectionText { get; set; } + public string ModifySelectionRule { get; set; } + public bool ModifySelectionCaseSensitive { get; set; } + public string ExportVobSubFontName { get; set; } + public int ExportVobSubFontSize { get; set; } + public string ExportVobSubVideoResolution { get; set; } + public string ExportVobSubLanguage { get; set; } + public bool ExportVobSubSimpleRendering { get; set; } + public bool ExportVobAntiAliasingWithTransparency { get; set; } + public string ExportBluRayFontName { get; set; } + public int ExportBluRayFontSize { get; set; } + public string ExportFcpFontName { get; set; } + public string ExportFontNameOther { get; set; } + public int ExportFcpFontSize { get; set; } + public string ExportFcpImageType { get; set; } + public string ExportFcpPalNtsc { get; set; } + public string ExportBdnXmlImageType { get; set; } + public int ExportLastFontSize { get; set; } + public int ExportLastLineHeight { get; set; } + public int ExportLastBorderWidth { get; set; } + public bool ExportLastFontBold { get; set; } + public string ExportBluRayVideoResolution { get; set; } + public string ExportFcpVideoResolution { get; set; } + public Color ExportFontColor { get; set; } + public Color ExportBorderColor { get; set; } + public Color ExportShadowColor { get; set; } + public int ExportBoxBorderSize { get; set; } + public string ExportBottomMarginUnit { get; set; } + public int ExportBottomMarginPercent { get; set; } + public int ExportBottomMarginPixels { get; set; } + public string ExportLeftRightMarginUnit { get; set; } + public int ExportLeftRightMarginPercent { get; set; } + public int ExportLeftRightMarginPixels { get; set; } + public int ExportHorizontalAlignment { get; set; } + public int ExportBluRayBottomMarginPercent { get; set; } + public int ExportBluRayBottomMarginPixels { get; set; } + public int ExportBluRayShadow { get; set; } + public bool ExportBluRayRemoveSmallGaps { get; set; } + public string ExportCdgBackgroundImage { get; set; } + public int ExportCdgMarginLeft { get; set; } + public int ExportCdgMarginBottom { get; set; } + public string ExportCdgFormat { get; set; } + public int Export3DType { get; set; } + public int Export3DDepth { get; set; } + public int ExportLastShadowTransparency { get; set; } + public double ExportLastFrameRate { get; set; } + public bool ExportFullFrame { get; set; } + public bool ExportFcpFullPathUrl { get; set; } + public string ExportPenLineJoin { get; set; } + public Color BinEditBackgroundColor { get; set; } + public Color BinEditImageBackgroundColor { get; set; } + public int BinEditTopMargin { get; set; } + public int BinEditBottomMargin { get; set; } + public int BinEditLeftMargin { get; set; } + public int BinEditRightMargin { get; set; } + public string BinEditStartPosition { get; set; } + public string BinEditStartSize { get; set; } + public bool BinEditShowColumnGap { get; set; } + public bool FixCommonErrorsFixOverlapAllowEqualEndStart { get; set; } + public bool FixCommonErrorsSkipStepOne { get; set; } + public string ImportTextSplitting { get; set; } + public string ImportTextSplittingLineMode { get; set; } + public string ImportTextLineBreak { get; set; } + public bool ImportTextMergeShortLines { get; set; } + public bool ImportTextRemoveEmptyLines { get; set; } + public bool ImportTextAutoSplitAtBlank { get; set; } + public bool ImportTextRemoveLinesNoLetters { get; set; } + public bool ImportTextGenerateTimeCodes { get; set; } + public bool ImportTextTakeTimeCodeFromFileName { get; set; } + public bool ImportTextAutoBreak { get; set; } + public bool ImportTextAutoBreakAtEnd { get; set; } + public decimal ImportTextGap { get; set; } + public decimal ImportTextAutoSplitNumberOfLines { get; set; } + public string ImportTextAutoBreakAtEndMarkerText { get; set; } + public bool ImportTextDurationAuto { get; set; } + public decimal ImportTextFixedDuration { get; set; } + public string GenerateTimeCodePatterns { get; set; } + public string MusicSymbolStyle { get; set; } + public int BridgeGapMilliseconds { get; set; } + public int BridgeGapMillisecondsMinGap { get; set; } + public string ExportCustomTemplates { get; set; } + public string ChangeCasingChoice { get; set; } + public bool ChangeCasingNormalFixNames { get; set; } + public bool ChangeCasingNormalOnlyUppercase { get; set; } + public bool UseNoLineBreakAfter { get; set; } + public string NoLineBreakAfterEnglish { get; set; } + public List FindHistory { get; set; } + public string ReplaceIn { get; set; } + public string ExportTextFormatText { get; set; } + public bool ExportTextRemoveStyling { get; set; } + public bool ExportTextShowLineNumbers { get; set; } + public bool ExportTextShowLineNumbersNewLine { get; set; } + public bool ExportTextShowTimeCodes { get; set; } + public bool ExportTextShowTimeCodesNewLine { get; set; } + public bool ExportTextNewLineAfterText { get; set; } + public bool ExportTextNewLineBetweenSubtitles { get; set; } + public string ExportTextTimeCodeFormat { get; set; } + public string ExportTextTimeCodeSeparator { get; set; } + public bool VideoOffsetKeepTimeCodes { get; set; } + public int MoveStartEndMs { get; set; } + public decimal AdjustDurationSeconds { get; set; } + public int AdjustDurationPercent { get; set; } + public string AdjustDurationLast { get; set; } + public bool AdjustDurationExtendOnly { get; set; } + public bool AdjustDurationExtendEnforceDurationLimits { get; set; } + public bool AdjustDurationExtendCheckShotChanges { get; set; } + public bool ChangeSpeedAllowOverlap { get; set; } + public bool AutoBreakCommaBreakEarly { get; set; } + public bool AutoBreakDashEarly { get; set; } + public bool AutoBreakLineEndingEarly { get; set; } + public bool AutoBreakUsePixelWidth { get; set; } + public bool AutoBreakPreferBottomHeavy { get; set; } + public double AutoBreakPreferBottomPercent { get; set; } + public bool ApplyMinimumDurationLimit { get; set; } + public bool ApplyMinimumDurationLimitCheckShotChanges { get; set; } + public bool ApplyMaximumDurationLimit { get; set; } + public int MergeShortLinesMaxGap { get; set; } + public int MergeShortLinesMaxChars { get; set; } + public bool MergeShortLinesOnlyContinuous { get; set; } + public int MergeTextWithSameTimeCodesMaxGap { get; set; } + public bool MergeTextWithSameTimeCodesMakeDialog { get; set; } + public bool MergeTextWithSameTimeCodesReBreakLines { get; set; } + public int MergeLinesWithSameTextMaxMs { get; set; } + public bool MergeLinesWithSameTextIncrement { get; set; } + public bool ConvertColorsToDialogRemoveColorTags { get; set; } + public bool ConvertColorsToDialogAddNewLines { get; set; } + public bool ConvertColorsToDialogReBreakLines { get; set; } + public string ColumnPasteColumn { get; set; } + public string ColumnPasteOverwriteMode { get; set; } + public string AssaAttachmentFontTextPreview { get; set; } + public string AssaSetPositionTarget { get; set; } + public string VisualSyncStartSize { get; set; } + public Color BlankVideoColor { get; set; } + public bool BlankVideoUseCheckeredImage { get; set; } + public int BlankVideoMinutes { get; set; } + public decimal BlankVideoFrameRate { get; set; } + public Color AssaProgressBarForeColor { get; set; } + public Color AssaProgressBarBackColor { get; set; } + public Color AssaProgressBarTextColor { get; set; } + public int AssaProgressBarHeight { get; set; } + public int AssaProgressBarSplitterWidth { get; set; } + public int AssaProgressBarSplitterHeight { get; set; } + public string AssaProgressBarFontName { get; set; } + public int AssaProgressBarFontSize { get; set; } + public bool AssaProgressBarTopAlign { get; set; } + public string AssaProgressBarTextAlign { get; set; } + + + public int AssaBgBoxPaddingLeft { get; set; } + public int AssaBgBoxPaddingRight { get; set; } + public int AssaBgBoxPaddingTop { get; set; } + public int AssaBgBoxPaddingBottom { get; set; } + public int AssaBgBoxDrawingMarginV { get; set; } + public int AssaBgBoxDrawingMarginH { get; set; } + public string AssaBgBoxDrawingAlignment { get; set; } + public Color AssaBgBoxColor { get; set; } + public Color AssaBgBoxOutlineColor { get; set; } + public Color AssaBgBoxShadowColor { get; set; } + public Color AssaBgBoxTransparentColor { get; set; } + public string AssaBgBoxStyle { get; set; } + public int AssaBgBoxStyleRadius { get; set; } + public int AssaBgBoxStyleCircleAdjustY { get; set; } + public int AssaBgBoxStyleSpikesStep { get; set; } + public int AssaBgBoxStyleSpikesHeight { get; set; } + public int AssaBgBoxStyleBubblesStep { get; set; } + public int AssaBgBoxStyleBubblesHeight { get; set; } + public int AssaBgBoxOutlineWidth { get; set; } + public int AssaBgBoxLayer { get; set; } + public string AssaBgBoxDrawing { get; set; } + public bool AssaBgBoxDrawingFileWatch { get; set; } + public bool AssaBgBoxDrawingOnly { get; set; } + + + public string GenVideoFontName { get; set; } + public bool GenVideoFontBold { get; set; } + public decimal GenVideoOutline { get; set; } + public int GenVideoFontSize { get; set; } + public string GenVideoEncoding { get; set; } + public string GenVideoPreset { get; set; } + public string GenVideoCrf { get; set; } + public string GenVideoTune { get; set; } + public string GenVideoAudioEncoding { get; set; } + public bool GenVideoAudioForceStereo { get; set; } + public string GenVideoAudioSampleRate { get; set; } + public bool GenVideoTargetFileSize { get; set; } + public float GenVideoFontSizePercentOfHeight { get; set; } + public bool GenVideoNonAssaBox { get; set; } + public Color GenVideoNonAssaBoxColor { get; set; } + public Color GenVideoNonAssaTextColor { get; set; } + public bool GenVideoNonAssaAlignRight { get; set; } + public bool GenVideoNonAssaFixRtlUnicode { get; set; } + public string GenVideoEmbedOutputExt { get; set; } + public string GenVideoEmbedOutputSuffix { get; set; } + public string GenVideoEmbedOutputReplace { get; set; } + public bool GenVideoDeleteInputVideoFile { get; set; } + public bool GenVideoUseOutputFolder { get; set; } + public string GenVideoOutputFolder { get; set; } + public string GenVideoOutputFileSuffix { get; set; } + + public bool VoskPostProcessing { get; set; } + public string VoskModel { get; set; } + public string WhisperChoice { get; set; } + public bool WhisperIgnoreVersion { get; set; } + + public bool WhisperDeleteTempFiles { get; set; } + public string WhisperModel { get; set; } + public string WhisperLanguageCode { get; set; } + public string WhisperLocation { get; set; } + public string WhisperCtranslate2Location { get; set; } + public string WhisperPurfviewFasterWhisperLocation { get; set; } + public string WhisperPurfviewFasterWhisperDefaultCmd { get; set; } + public string WhisperXLocation { get; set; } + public string WhisperStableTsLocation { get; set; } + public string WhisperCppModelLocation { get; set; } + public string WhisperExtraSettings { get; set; } + public string WhisperExtraSettingsHistory { get; set; } + public bool WhisperAutoAdjustTimings { get; set; } + public bool WhisperUseLineMaxChars { get; set; } + public bool WhisperPostProcessingAddPeriods { get; set; } + public bool WhisperPostProcessingMergeLines { get; set; } + public bool WhisperPostProcessingSplitLines { get; set; } + public bool WhisperPostProcessingFixCasing { get; set; } + public bool WhisperPostProcessingFixShortDuration { get; set; } + public int AudioToTextLineMaxChars { get; set; } + public int AudioToTextLineMaxCharsJp { get; set; } + public int AudioToTextLineMaxCharsCn { get; set; } + public int BreakLinesLongerThan { get; set; } + public int UnbreakLinesLongerThan { get; set; } + + public ToolsSettings() + { + AssaTagTemplates = new List(); + StartSceneIndex = 1; + EndSceneIndex = 1; + VerifyPlaySeconds = 2; + FixShortDisplayTimesAllowMoveStartTime = false; + RemoveEmptyLinesBetweenText = true; + MusicSymbol = "♪"; + MusicSymbolReplace = "♪,â™," + // ♪ + ♫ in UTF-8 opened as ANSI + ",," + // music symbols by subtitle creator + "#,*,¶"; // common music symbols + UnicodeSymbolsToInsert = "♪;♫;°;☺;☹;♥;©;☮;☯;Σ;∞;≡;⇒;π"; + SpellCheckAutoChangeNameCasing = false; + SpellCheckAutoChangeNamesUseSuggestions = false; + OcrFixUseHardcodedRules = true; + OcrGoogleCloudVisionSeHandlesTextMerge = true; + OcrBinaryImageCompareRgbThreshold = 200; + OcrTesseract4RgbThreshold = 200; + OcrAddLetterRow1 = "♪;á;é;í;ó;ö;ő;ú;ü;ű;ç;ñ;å;¿"; + OcrAddLetterRow2 = "♫;Á;É;Í;Ó;Ö;Ő;Ú;Ü;Ű;Ç;Ñ;Å;¡"; + OcrTrainFonts = "Arial;Calibri;Corbel;Futura Std Book;Futura Bis;Helvetica Neue;Lucida Console;Tahoma;Trebuchet MS;Verdana"; + OcrTrainMergedLetters = "ff ft fi fj fy fl rf rt rv rw ry rt rz ryt tt TV tw yt yw wy wf ryt xy"; + OcrUseWordSplitList = true; + OcrUseWordSplitListAvoidPropercase = true; + MicrosoftTranslatorTokenEndpoint = "https://api.cognitive.microsoft.com/sts/v1.0/issueToken"; + GoogleTranslateNoKeyWarningShow = true; + GoogleApiV1ChunkSize = 1500; + GoogleTranslateLastTargetLanguage = "en"; + AutoTranslateNllbServeUrl = "http://127.0.0.1:6060/"; + AutoTranslateNllbApiUrl = "http://localhost:7860/api/v2/"; + AutoTranslateLibreUrl = "http://localhost:5000/"; + AutoTranslateSeamlessM4TUrl = "http://localhost:5000/"; + AutoTranslateDeepLUrl = "https://api-free.deepl.com/"; + ChatGptUrl = "https://api.openai.com/v1/chat/completions"; + ChatGptPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments:"; + ChatGptModel = "gpt-4o"; + LmStudioPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments:"; + OllamaApiUrl = "http://localhost:11434/api/generate"; + OllamaModels = "llama3,llama2,mistral,dolphin-phi,phi,neural-chat,starling-lm,codellama,llama2-uncensored,llama2:13b,llama2:70b,orca-mini,vicuna,llava,gemma:2b,gemma:7b"; + OllamaModel = "llama3"; + OllamaPrompt = "Translate from {0} to {1}, keep punctuation as input, do not censor the translation, give only the output without comments or notes:"; + AnthropicApiUrl = "https://api.anthropic.com/v1/messages"; + AnthropicPrompt = "Translate from {0} to {1}, keep sentences in {1} as they are, do not censor the translation, give only the output without comments:"; + AnthropicApiModel = "claude-3-5-sonnet-20240620"; + TextToSpeechAzureRegion = "westeurope"; + AutoTranslateMaxBytes = 2000; + TextToSpeechAddToVideoFile = true; + TranslateAllowSplit = true; + TranslateViaCopyPasteAutoCopyToClipboard = true; + TranslateViaCopyPasteMaxSize = 5000; + TranslateViaCopyPasteSeparator = "."; + CheckOneLetterWords = true; + SpellCheckEnglishAllowInQuoteAsIng = false; + SpellCheckShowCompletedMessage = true; + ListViewSyntaxColorDurationSmall = true; + ListViewSyntaxColorDurationBig = true; + ListViewSyntaxColorOverlap = true; + ListViewSyntaxColorLongLines = true; + ListViewSyntaxColorWideLines = false; + ListViewSyntaxMoreThanXLines = true; + ListViewSyntaxColorGap = true; + ListViewSyntaxErrorColor = Color.FromArgb(255, 180, 150); + ListViewUnfocusedSelectedColor = Color.LightBlue; + Color1 = Color.Yellow; + Color2 = Color.FromArgb(byte.MaxValue, 0, 0); + Color3 = Color.FromArgb(0, byte.MaxValue, 0); + Color4 = Color.Cyan; + Color5 = Color.Black; + Color6 = Color.White; + Color7 = Color.Orange; + Color8 = Color.Pink; + ListViewShowColumnStartTime = true; + ListViewShowColumnEndTime = true; + ListViewShowColumnDuration = true; + SplitAdvanced = false; + SplitNumberOfParts = 3; + SplitVia = "Lines"; + JoinCorrectTimeCodes = true; + SplitLongLinesMax = 90; + NewEmptyTranslationText = string.Empty; + BatchConvertLanguage = string.Empty; + BatchConvertTsOverrideBottomMargin = 5; // pct + BatchConvertTsScreenWidth = 1920; + BatchConvertTsScreenHeight = 1080; + BatchConvertOcrEngine = "Tesseract"; + BatchConvertOcrLanguage = "en"; + BatchConvertTsOverrideHAlign = "center"; // left center right + BatchConvertTsOverrideHMargin = 5; // pct + BatchConvertTsFileNameAppend = ".{two-letter-country-code}"; + BatchConvertMkvLanguageCodeStyle = "2"; + ModifySelectionRule = "Contains"; + ModifySelectionText = string.Empty; + ImportTextDurationAuto = true; + ImportTextGap = 84; + ImportTextFixedDuration = 2500; + GenerateTimeCodePatterns = "HH:mm:ss;yyyy-MM-dd;dddd dd MMMM yyyy
HH:mm:ss;dddd dd MMMM yyyy
hh:mm:ss tt;s"; + MusicSymbolStyle = "Double"; // 'Double' or 'Single' + ExportFontColor = Color.White; + ExportBorderColor = Color.FromArgb(255, 0, 0, 0); + ExportShadowColor = Color.FromArgb(255, 0, 0, 0); + ExportBoxBorderSize = 8; + ExportBottomMarginUnit = "%"; + ExportBottomMarginPercent = 5; + ExportBottomMarginPixels = 15; + ExportLeftRightMarginUnit = "%"; + ExportLeftRightMarginPercent = 5; + ExportLeftRightMarginPixels = 15; + ExportHorizontalAlignment = 1; // 1=center (0=left, 2=right) + ExportVobSubSimpleRendering = false; + ExportVobAntiAliasingWithTransparency = true; + ExportBluRayBottomMarginPercent = 5; + ExportBluRayBottomMarginPixels = 20; + ExportBluRayShadow = 1; + Export3DType = 0; + Export3DDepth = 0; + ExportCdgMarginLeft = 160; + ExportCdgMarginBottom = 67; + ExportLastShadowTransparency = 200; + ExportLastFrameRate = 24.0d; + ExportFullFrame = false; + ExportPenLineJoin = "Round"; + ExportFcpImageType = "Bmp"; + ExportFcpPalNtsc = "PAL"; + ExportLastBorderWidth = 4; + BinEditBackgroundColor = Color.Black; + BinEditImageBackgroundColor = Color.Blue; + BinEditTopMargin = 10; + BinEditBottomMargin = 10; + BinEditLeftMargin = 10; + BinEditRightMargin = 10; + BridgeGapMilliseconds = 100; + BridgeGapMillisecondsMinGap = 24; + ChangeCasingNormalFixNames = true; + ExportCustomTemplates = "SubRipÆÆ{number}\r\n{start} --> {end}\r\n{text}\r\n\r\nÆhh:mm:ss,zzzÆ[Do not modify]ÆÆsrtæMicroDVDÆÆ{{start}}{{end}}{text}\r\nÆffÆ||ÆÆsub"; + UseNoLineBreakAfter = false; + NoLineBreakAfterEnglish = " Mrs.; Ms.; Mr.; Dr.; a; an; the; my; my own; your; his; our; their; it's; is; are;'s; 're; would;'ll;'ve;'d; will; that; which; who; whom; whose; whichever; whoever; wherever; each; either; every; all; both; few; many; sevaral; all; any; most; been; been doing; none; some; my own; your own; his own; her own; our own; their own; I; she; he; as per; as regards; into; onto; than; where as; abaft; aboard; about; above; across; afore; after; against; along; alongside; amid; amidst; among; amongst; anenst; apropos; apud; around; as; aside; astride; at; athwart; atop; barring; before; behind; below; beneath; beside; besides; between; betwixt; beyond; but; by; circa; ca; concerning; despite; down; during; except; excluding; following; for; forenenst; from; given; in; including; inside; into; lest; like; minus; modulo; near; next; of; off; on; onto; opposite; out; outside; over; pace; past; per; plus; pro; qua; regarding; round; sans; save; since; than; through; thru; throughout; thruout; till; to; toward; towards; under; underneath; unlike; until; unto; up; upon; versus; vs; via; vice; with; within; without; considering; respecting; one; two; another; three; our; five; six; seven; eight; nine; ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen; seventeen; eighteen; nineteen; twenty; thirty; forty; fifty; sixty; seventy; eighty; ninety; hundred; thousand; million; billion; trillion; while; however; what; zero; little; enough; after; although; and; as; if; though; although; because; before; both; but; even; how; than; nor; or; only; unless; until; yet; was; were"; + FindHistory = new List(); + ExportTextFormatText = "None"; + ExportTextRemoveStyling = true; + ExportTextShowLineNumbersNewLine = true; + ExportTextShowTimeCodesNewLine = true; + ExportTextNewLineAfterText = true; + ExportTextNewLineBetweenSubtitles = true; + ImportTextLineBreak = "|"; + ImportTextAutoSplitNumberOfLines = 2; + ImportTextAutoSplitAtBlank = true; + ImportTextAutoBreakAtEndMarkerText = ".!?"; + ImportTextAutoBreakAtEnd = true; + MoveStartEndMs = 100; + AdjustDurationSeconds = 0.1m; + AdjustDurationPercent = 120; + AdjustDurationExtendOnly = true; + AdjustDurationExtendEnforceDurationLimits = true; + AdjustDurationExtendCheckShotChanges = true; + AutoBreakCommaBreakEarly = false; + AutoBreakDashEarly = true; + AutoBreakLineEndingEarly = false; + AutoBreakUsePixelWidth = true; + AutoBreakPreferBottomHeavy = true; + AutoBreakPreferBottomPercent = 5; + ApplyMinimumDurationLimit = true; + ApplyMinimumDurationLimitCheckShotChanges = true; + ApplyMaximumDurationLimit = true; + MergeShortLinesMaxGap = 250; + MergeShortLinesMaxChars = 55; + MergeShortLinesOnlyContinuous = true; + MergeTextWithSameTimeCodesMaxGap = 250; + MergeTextWithSameTimeCodesReBreakLines = false; + MergeLinesWithSameTextMaxMs = 250; + MergeLinesWithSameTextIncrement = true; + MergeTextWithSameTimeCodesMakeDialog = false; + ConvertColorsToDialogRemoveColorTags = true; + ConvertColorsToDialogAddNewLines = true; + ConvertColorsToDialogReBreakLines = false; + ColumnPasteColumn = "all"; + ColumnPasteOverwriteMode = "overwrite"; + AssaAttachmentFontTextPreview = + "Hello World!" + Environment.NewLine + + "こんにちは世界" + Environment.NewLine + + "你好世界!" + Environment.NewLine + + "1234567890"; + BlankVideoColor = Color.CadetBlue; + BlankVideoUseCheckeredImage = true; + BlankVideoMinutes = 2; + BlankVideoFrameRate = 23.976m; + AssaProgressBarForeColor = Color.FromArgb(200, 200, 0, 0); + AssaProgressBarBackColor = Color.FromArgb(150, 80, 80, 80); + AssaProgressBarTextColor = Color.White; + AssaProgressBarHeight = 40; + AssaProgressBarSplitterWidth = 2; + AssaProgressBarSplitterHeight = 40; + AssaProgressBarFontName = "Arial"; + AssaProgressBarFontSize = 30; + AssaProgressBarTextAlign = "left"; + + AssaBgBoxPaddingLeft = 10; + AssaBgBoxPaddingRight = 10; + AssaBgBoxPaddingTop = 6; + AssaBgBoxPaddingBottom = 6; + AssaBgBoxColor = Color.FromArgb(200, 0, 0, 0); + AssaBgBoxOutlineColor = Color.FromArgb(200, 80, 80, 80); + AssaBgBoxShadowColor = Color.FromArgb(100, 0, 0, 0); + AssaBgBoxTransparentColor = Color.Cyan; + AssaBgBoxStyle = "square"; + AssaBgBoxStyleRadius = 30; + AssaBgBoxStyleCircleAdjustY = 30; + AssaBgBoxStyleSpikesStep = 15; + AssaBgBoxStyleSpikesHeight = 30; + AssaBgBoxStyleBubblesStep = 75; + AssaBgBoxStyleBubblesHeight = 40; + AssaBgBoxOutlineWidth = 0; + AssaBgBoxLayer = -11893; + AssaBgBoxDrawingFileWatch = true; + + GenVideoEncoding = "libx264"; + GenVideoPreset = "medium"; + GenVideoCrf = "23"; + GenVideoTune = "film"; + GenVideoAudioEncoding = "copy"; + GenVideoAudioForceStereo = true; + GenVideoAudioSampleRate = "48000"; + GenVideoFontBold = true; + GenVideoOutline = 6; + GenVideoFontSizePercentOfHeight = 0.078f; + GenVideoNonAssaBox = true; + GenVideoNonAssaBoxColor = Color.FromArgb(150, 0, 0, 0); + GenVideoNonAssaTextColor = Color.White; + GenVideoEmbedOutputSuffix = "embed"; + GenVideoEmbedOutputReplace = "embed" + Environment.NewLine + "SoftSub" + Environment.NewLine + "SoftSubbed"; + GenVideoOutputFileSuffix = "_new"; + VoskPostProcessing = true; + WhisperChoice = Configuration.IsRunningOnWindows ? AudioToText.WhisperChoice.PurfviewFasterWhisper : AudioToText.WhisperChoice.OpenAi; + WhisperDeleteTempFiles = true; + WhisperPurfviewFasterWhisperDefaultCmd = "--standard"; + WhisperExtraSettings = ""; + WhisperLanguageCode = "en"; + WhisperAutoAdjustTimings = true; + WhisperPostProcessingAddPeriods = false; + WhisperPostProcessingMergeLines = true; + WhisperPostProcessingSplitLines = true; + WhisperPostProcessingFixCasing = false; + WhisperPostProcessingFixShortDuration = true; + AudioToTextLineMaxChars = 86; + AudioToTextLineMaxCharsJp = 32; + AudioToTextLineMaxCharsCn = 36; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/VerifyCompletenessSettings.cs b/src/libse/Common/Settings/VerifyCompletenessSettings.cs new file mode 100644 index 000000000..45ddc3021 --- /dev/null +++ b/src/libse/Common/Settings/VerifyCompletenessSettings.cs @@ -0,0 +1,18 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class VerifyCompletenessSettings + { + public ListSortEnum ListSort { get; set; } + + public enum ListSortEnum : int + { + Coverage = 0, + Time = 1, + } + + public VerifyCompletenessSettings() + { + ListSort = ListSortEnum.Coverage; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/VideoControlsSettings.cs b/src/libse/Common/Settings/VideoControlsSettings.cs new file mode 100644 index 000000000..8e9815b43 --- /dev/null +++ b/src/libse/Common/Settings/VideoControlsSettings.cs @@ -0,0 +1,87 @@ +using System.Drawing; + +namespace Nikse.SubtitleEdit.Core.Common +{ + public class VideoControlsSettings + { + public string CustomSearchText1 { get; set; } + public string CustomSearchText2 { get; set; } + public string CustomSearchText3 { get; set; } + public string CustomSearchText4 { get; set; } + public string CustomSearchText5 { get; set; } + public string CustomSearchUrl1 { get; set; } + public string CustomSearchUrl2 { get; set; } + public string CustomSearchUrl3 { get; set; } + public string CustomSearchUrl4 { get; set; } + public string CustomSearchUrl5 { get; set; } + public string LastActiveTab { get; set; } + public bool WaveformDrawGrid { get; set; } + public bool WaveformDrawCps { get; set; } + public bool WaveformDrawWpm { get; set; } + public bool WaveformAllowOverlap { get; set; } + public bool WaveformFocusOnMouseEnter { get; set; } + public bool WaveformListViewFocusOnMouseEnter { get; set; } + public bool WaveformSetVideoPositionOnMoveStartEnd { get; set; } + public bool WaveformSingleClickSelect { get; set; } + public bool WaveformSnapToShotChanges { get; set; } + public int WaveformShotChangeStartTimeBeforeMs { get; set; } + public int WaveformShotChangeStartTimeAfterMs { get; set; } + public int WaveformShotChangeEndTimeBeforeMs { get; set; } + public int WaveformShotChangeEndTimeAfterMs { get; set; } + public int WaveformBorderHitMs { get; set; } + public Color WaveformGridColor { get; set; } + public Color WaveformColor { get; set; } + public Color WaveformSelectedColor { get; set; } + public Color WaveformBackgroundColor { get; set; } + public Color WaveformTextColor { get; set; } + public Color WaveformCursorColor { get; set; } + public Color WaveformChaptersColor { get; set; } + public int WaveformTextSize { get; set; } + public bool WaveformTextBold { get; set; } + public string WaveformDoubleClickOnNonParagraphAction { get; set; } + public string WaveformRightClickOnNonParagraphAction { get; set; } + public bool WaveformMouseWheelScrollUpIsForward { get; set; } + public bool WaveformLabelShowCodec { get; set; } + public bool GenerateSpectrogram { get; set; } + public string SpectrogramAppearance { get; set; } + public int WaveformMinimumSampleRate { get; set; } + public double WaveformSeeksSilenceDurationSeconds { get; set; } + public double WaveformSeeksSilenceMaxVolume { get; set; } + public bool WaveformUnwrapText { get; set; } + public bool WaveformHideWpmCpsLabels { get; set; } + + + public VideoControlsSettings() + { + CustomSearchText1 = "The Free Dictionary"; + CustomSearchUrl1 = "https://www.thefreedictionary.com/{0}"; + CustomSearchText2 = "Wikipedia"; + CustomSearchUrl2 = "https://en.wikipedia.org/wiki?search={0}"; + CustomSearchText3 = "DuckDuckGo"; + CustomSearchUrl3 = "https://duckduckgo.com/?q={0}"; + + LastActiveTab = "Translate"; + WaveformDrawGrid = true; + WaveformAllowOverlap = false; + WaveformBorderHitMs = 15; + WaveformGridColor = Color.FromArgb(255, 20, 20, 18); + WaveformColor = Color.FromArgb(255, 160, 240, 30); + WaveformSelectedColor = Color.FromArgb(255, 230, 0, 0); + WaveformBackgroundColor = Color.Black; + WaveformTextColor = Color.Gray; + WaveformCursorColor = Color.Turquoise; + WaveformChaptersColor = Color.FromArgb(255, 104, 33, 122); + WaveformTextSize = 9; + WaveformTextBold = true; + WaveformDoubleClickOnNonParagraphAction = "PlayPause"; + WaveformDoubleClickOnNonParagraphAction = string.Empty; + WaveformMouseWheelScrollUpIsForward = true; + WaveformLabelShowCodec = true; + SpectrogramAppearance = "OneColorGradient"; + WaveformMinimumSampleRate = 126; + WaveformSeeksSilenceDurationSeconds = 0.3; + WaveformSeeksSilenceMaxVolume = 0.1; + WaveformSnapToShotChanges = true; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/VobSubOcrSettings.cs b/src/libse/Common/Settings/VobSubOcrSettings.cs new file mode 100644 index 000000000..36a9ab327 --- /dev/null +++ b/src/libse/Common/Settings/VobSubOcrSettings.cs @@ -0,0 +1,77 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class VobSubOcrSettings + { + public int XOrMorePixelsMakesSpace { get; set; } + public double AllowDifferenceInPercent { get; set; } + public double BlurayAllowDifferenceInPercent { get; set; } + public string LastImageCompareFolder { get; set; } + public int LastModiLanguageId { get; set; } + public string LastOcrMethod { get; set; } + public string TesseractLastLanguage { get; set; } + public bool UseTesseractFallback { get; set; } + public bool UseItalicsInTesseract { get; set; } + public int TesseractEngineMode { get; set; } + public bool UseMusicSymbolsInTesseract { get; set; } + public bool RightToLeft { get; set; } + public bool TopToBottom { get; set; } + public int DefaultMillisecondsForUnknownDurations { get; set; } + public bool FixOcrErrors { get; set; } + public bool PromptForUnknownWords { get; set; } + public bool GuessUnknownWords { get; set; } + public bool AutoBreakSubtitleIfMoreThanTwoLines { get; set; } + public double ItalicFactor { get; set; } + + public bool LineOcrDraw { get; set; } + public int LineOcrMinHeightSplit { get; set; } + public bool LineOcrAdvancedItalic { get; set; } + public string LineOcrLastLanguages { get; set; } + public string LineOcrLastSpellCheck { get; set; } + public int LineOcrLinesToAutoGuess { get; set; } + public int LineOcrMinLineHeight { get; set; } + public int LineOcrMaxLineHeight { get; set; } + public int LineOcrMaxErrorPixels { get; set; } + public string LastBinaryImageCompareDb { get; set; } + public string LastBinaryImageSpellCheck { get; set; } + public bool BinaryAutoDetectBestDb { get; set; } + public string LastTesseractSpellCheck { get; set; } + public bool CaptureTopAlign { get; set; } + public int UnfocusedAttentionBlinkCount { get; set; } + public int UnfocusedAttentionPlaySoundCount { get; set; } + public string CloudVisionApiKey { get; set; } + public string CloudVisionLanguage { get; set; } + public bool CloudVisionSendOriginalImages { get; set; } + + public VobSubOcrSettings() + { + XOrMorePixelsMakesSpace = 8; + AllowDifferenceInPercent = 1.0; + BlurayAllowDifferenceInPercent = 7.5; + LastImageCompareFolder = "English"; + LastModiLanguageId = 9; + LastOcrMethod = "Tesseract"; + UseItalicsInTesseract = true; + TesseractEngineMode = 3; // Default, based on what is available (T4 docs) + UseMusicSymbolsInTesseract = true; + UseTesseractFallback = true; + RightToLeft = false; + TopToBottom = true; + DefaultMillisecondsForUnknownDurations = 5000; + FixOcrErrors = true; + PromptForUnknownWords = true; + GuessUnknownWords = true; + AutoBreakSubtitleIfMoreThanTwoLines = true; + ItalicFactor = 0.2f; + LineOcrLinesToAutoGuess = 100; + LineOcrMaxErrorPixels = 45; + LastBinaryImageCompareDb = "Latin+Latin"; + BinaryAutoDetectBestDb = true; + CaptureTopAlign = false; + UnfocusedAttentionBlinkCount = 50; + UnfocusedAttentionPlaySoundCount = 1; + CloudVisionApiKey = string.Empty; + CloudVisionLanguage = "en"; + CloudVisionSendOriginalImages = false; + } + } +} \ No newline at end of file diff --git a/src/libse/Common/Settings/WordListSettings.cs b/src/libse/Common/Settings/WordListSettings.cs new file mode 100644 index 000000000..f028a7aa7 --- /dev/null +++ b/src/libse/Common/Settings/WordListSettings.cs @@ -0,0 +1,15 @@ +namespace Nikse.SubtitleEdit.Core.Common +{ + public class WordListSettings + { + public string LastLanguage { get; set; } + public string NamesUrl { get; set; } + public bool UseOnlineNames { get; set; } + + public WordListSettings() + { + LastLanguage = "en-US"; + NamesUrl = "https://raw.githubusercontent.com/SubtitleEdit/subtitleedit/main/Dictionaries/names.xml"; + } + } +} \ No newline at end of file From 772dc8416bc5f9858a6b1584145962f98e3f7b1e Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Fri, 21 Jun 2024 09:10:47 +0100 Subject: [PATCH 29/42] Refactor settings namespace in .NET project The main change in this commit is relocating several settings related classes from `Nikse.SubtitleEdit.Core.Common` to a new namespace `Nikse.SubtitleEdit.Core.Settings`. This improves the project organization by grouping all settings-related functionality and data together, making it easier to find and maintain. This refactoring required updates across numerous files to import the new namespace. Signed-off-by: Ivandro Jao --- src/libse/AutoTranslate/AnthropicTranslate.cs | 1 + src/libse/AutoTranslate/ChatGptTranslate.cs | 1 + src/libse/AutoTranslate/LmStudioTranslate.cs | 1 + src/libse/AutoTranslate/OllamaTranslate.cs | 1 + src/libse/Common/Configuration.cs | 6 +++--- src/libse/Forms/TimeCodesBeautifier.cs | 1 + src/libse/Http/DownloaderFactory.cs | 1 + src/libse/{Common => }/Settings/AssaStorageCategory.cs | 3 ++- .../{Common => }/Settings/BeautifyTimeCodesSettings.cs | 2 +- src/libse/{Common => }/Settings/CompareSettings.cs | 2 +- src/libse/{Common => }/Settings/FcpExportSettings.cs | 2 +- src/libse/{Common => }/Settings/FixCommonErrorsSettings.cs | 2 +- src/libse/{Common => }/Settings/GeneralSettings.cs | 3 ++- .../{Common => }/Settings/MultipleSearchAndReplaceGroup.cs | 2 +- .../Settings/MultipleSearchAndReplaceSetting.cs | 2 +- src/libse/{Common => }/Settings/NetworkSettings.cs | 2 +- src/libse/{Common => }/Settings/ProxySettings.cs | 2 +- src/libse/{Common => }/Settings/RecentFileEntry.cs | 2 +- src/libse/{Common => }/Settings/RecentFilesSettings.cs | 2 +- .../Settings/RemoveTextForHearingImpairedSettings.cs | 2 +- src/libse/{Common => }/Settings/Settings.cs | 7 ++++--- src/libse/{Common => }/Settings/Shortcuts.cs | 3 ++- src/libse/{Common => }/Settings/SubtitleBeaming.cs | 2 +- src/libse/{Common => }/Settings/SubtitleSettings.cs | 3 ++- src/libse/{Common => }/Settings/ToolsSettings.cs | 3 ++- .../{Common => }/Settings/VerifyCompletenessSettings.cs | 2 +- src/libse/{Common => }/Settings/VideoControlsSettings.cs | 2 +- src/libse/{Common => }/Settings/VobSubOcrSettings.cs | 2 +- src/libse/{Common => }/Settings/WordListSettings.cs | 2 +- src/ui/Controls/SubtitleListView.cs | 1 + src/ui/Controls/VideoPlayerContainer.cs | 1 + src/ui/Forms/Assa/AssaProgressBar.cs | 1 + src/ui/Forms/Assa/AssaStyles.cs | 1 + src/ui/Forms/Assa/ReplaceStyleWith.cs | 1 + .../Assa/SubStationAlphaStylesCategoriesImportExport.cs | 1 + .../Forms/Assa/SubStationAlphaStylesCategoriesManager.cs | 1 + src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfile.cs | 1 + .../BeautifyTimeCodes/BeautifyTimeCodesProfileSimple.cs | 1 + src/ui/Forms/DCinema/DCinemaPropertiesInterop.cs | 1 + src/ui/Forms/DCinema/DCinemaPropertiesSmpte.cs | 1 + src/ui/Forms/ExportPngXml.cs | 3 ++- src/ui/Forms/Main.cs | 1 + src/ui/Forms/MultipleReplace.cs | 1 + src/ui/Forms/MultipleReplaceExportImport.cs | 1 + src/ui/Forms/Ocr/VobSubOcr.cs | 1 + src/ui/Forms/Options/Settings.cs | 5 +++-- src/ui/Forms/Options/SettingsProfile.cs | 1 + src/ui/Forms/ProfileChoose.cs | 1 + src/ui/Forms/RestoreAutoBackup.cs | 1 + src/ui/Forms/Translate/AutoTranslateSettings.cs | 1 + src/ui/Forms/Translate/MergeAndSplitHelper.cs | 1 + src/ui/Forms/VerifyCompleteness.cs | 2 +- src/ui/Logic/UiUtil.cs | 1 + 53 files changed, 66 insertions(+), 31 deletions(-) rename src/libse/{Common => }/Settings/AssaStorageCategory.cs (73%) rename src/libse/{Common => }/Settings/BeautifyTimeCodesSettings.cs (99%) rename src/libse/{Common => }/Settings/CompareSettings.cs (90%) rename src/libse/{Common => }/Settings/FcpExportSettings.cs (92%) rename src/libse/{Common => }/Settings/FixCommonErrorsSettings.cs (99%) rename src/libse/{Common => }/Settings/GeneralSettings.cs (99%) rename src/libse/{Common => }/Settings/MultipleSearchAndReplaceGroup.cs (85%) rename src/libse/{Common => }/Settings/MultipleSearchAndReplaceSetting.cs (87%) rename src/libse/{Common => }/Settings/NetworkSettings.cs (92%) rename src/libse/{Common => }/Settings/ProxySettings.cs (94%) rename src/libse/{Common => }/Settings/RecentFileEntry.cs (91%) rename src/libse/{Common => }/Settings/RecentFilesSettings.cs (98%) rename src/libse/{Common => }/Settings/RemoveTextForHearingImpairedSettings.cs (97%) rename src/libse/{Common => }/Settings/Settings.cs (99%) rename src/libse/{Common => }/Settings/Shortcuts.cs (99%) rename src/libse/{Common => }/Settings/SubtitleBeaming.cs (92%) rename src/libse/{Common => }/Settings/SubtitleSettings.cs (99%) rename src/libse/{Common => }/Settings/ToolsSettings.cs (99%) rename src/libse/{Common => }/Settings/VerifyCompletenessSettings.cs (88%) rename src/libse/{Common => }/Settings/VideoControlsSettings.cs (98%) rename src/libse/{Common => }/Settings/VobSubOcrSettings.cs (98%) rename src/libse/{Common => }/Settings/WordListSettings.cs (90%) diff --git a/src/libse/AutoTranslate/AnthropicTranslate.cs b/src/libse/AutoTranslate/AnthropicTranslate.cs index 77b122735..c5e6cc8fd 100644 --- a/src/libse/AutoTranslate/AnthropicTranslate.cs +++ b/src/libse/AutoTranslate/AnthropicTranslate.cs @@ -8,6 +8,7 @@ using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Core.AutoTranslate { diff --git a/src/libse/AutoTranslate/ChatGptTranslate.cs b/src/libse/AutoTranslate/ChatGptTranslate.cs index 0dfa46db2..7050b8c63 100644 --- a/src/libse/AutoTranslate/ChatGptTranslate.cs +++ b/src/libse/AutoTranslate/ChatGptTranslate.cs @@ -9,6 +9,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Core.AutoTranslate { diff --git a/src/libse/AutoTranslate/LmStudioTranslate.cs b/src/libse/AutoTranslate/LmStudioTranslate.cs index ee15573c3..3ca09a98c 100644 --- a/src/libse/AutoTranslate/LmStudioTranslate.cs +++ b/src/libse/AutoTranslate/LmStudioTranslate.cs @@ -8,6 +8,7 @@ using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Core.AutoTranslate { diff --git a/src/libse/AutoTranslate/OllamaTranslate.cs b/src/libse/AutoTranslate/OllamaTranslate.cs index 8411ce3c6..f70fa3d0d 100644 --- a/src/libse/AutoTranslate/OllamaTranslate.cs +++ b/src/libse/AutoTranslate/OllamaTranslate.cs @@ -8,6 +8,7 @@ using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Core.AutoTranslate { diff --git a/src/libse/Common/Configuration.cs b/src/libse/Common/Configuration.cs index 489932fa6..346ce6269 100644 --- a/src/libse/Common/Configuration.cs +++ b/src/libse/Common/Configuration.cs @@ -13,7 +13,7 @@ namespace Nikse.SubtitleEdit.Core.Common { private static readonly Lazy Instance = new Lazy(() => new Configuration()); - private readonly Lazy _settings; + private readonly Lazy _settings; private readonly IEnumerable _encodings; public static readonly string BaseDirectory = GetBaseDirectory(); @@ -59,7 +59,7 @@ namespace Nikse.SubtitleEdit.Core.Common private Configuration() { _encodings = GetAvailableEncodings(); - _settings = new Lazy(Settings.GetSettings); + _settings = new Lazy(Core.Settings.Settings.GetSettings); } private const int PlatformWindows = 1; @@ -113,7 +113,7 @@ namespace Nikse.SubtitleEdit.Core.Common : PlatformWindows; } - public static Settings Settings => Instance.Value._settings.Value; + public static Settings.Settings Settings => Instance.Value._settings.Value; public static IEnumerable AvailableEncodings => Instance.Value._encodings; diff --git a/src/libse/Forms/TimeCodesBeautifier.cs b/src/libse/Forms/TimeCodesBeautifier.cs index e44e5dda1..8eb8d03de 100644 --- a/src/libse/Forms/TimeCodesBeautifier.cs +++ b/src/libse/Forms/TimeCodesBeautifier.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Settings; using Nikse.SubtitleEdit.Core.SubtitleFormats; namespace Nikse.SubtitleEdit.Core.Forms diff --git a/src/libse/Http/DownloaderFactory.cs b/src/libse/Http/DownloaderFactory.cs index 72114248c..707abf747 100644 --- a/src/libse/Http/DownloaderFactory.cs +++ b/src/libse/Http/DownloaderFactory.cs @@ -2,6 +2,7 @@ using System.Net; using System.Net.Http; using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Core.Http { diff --git a/src/libse/Common/Settings/AssaStorageCategory.cs b/src/libse/Settings/AssaStorageCategory.cs similarity index 73% rename from src/libse/Common/Settings/AssaStorageCategory.cs rename to src/libse/Settings/AssaStorageCategory.cs index 1b4ea681f..b0703b64f 100644 --- a/src/libse/Common/Settings/AssaStorageCategory.cs +++ b/src/libse/Settings/AssaStorageCategory.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; +using Nikse.SubtitleEdit.Core.Common; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class AssaStorageCategory { diff --git a/src/libse/Common/Settings/BeautifyTimeCodesSettings.cs b/src/libse/Settings/BeautifyTimeCodesSettings.cs similarity index 99% rename from src/libse/Common/Settings/BeautifyTimeCodesSettings.cs rename to src/libse/Settings/BeautifyTimeCodesSettings.cs index cb0e2d651..432e91d46 100644 --- a/src/libse/Common/Settings/BeautifyTimeCodesSettings.cs +++ b/src/libse/Settings/BeautifyTimeCodesSettings.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class BeautifyTimeCodesSettings { diff --git a/src/libse/Common/Settings/CompareSettings.cs b/src/libse/Settings/CompareSettings.cs similarity index 90% rename from src/libse/Common/Settings/CompareSettings.cs rename to src/libse/Settings/CompareSettings.cs index ac68f050f..0c4ccf727 100644 --- a/src/libse/Common/Settings/CompareSettings.cs +++ b/src/libse/Settings/CompareSettings.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class CompareSettings { diff --git a/src/libse/Common/Settings/FcpExportSettings.cs b/src/libse/Settings/FcpExportSettings.cs similarity index 92% rename from src/libse/Common/Settings/FcpExportSettings.cs rename to src/libse/Settings/FcpExportSettings.cs index d2fbbc485..126f0ba36 100644 --- a/src/libse/Common/Settings/FcpExportSettings.cs +++ b/src/libse/Settings/FcpExportSettings.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class FcpExportSettings { diff --git a/src/libse/Common/Settings/FixCommonErrorsSettings.cs b/src/libse/Settings/FixCommonErrorsSettings.cs similarity index 99% rename from src/libse/Common/Settings/FixCommonErrorsSettings.cs rename to src/libse/Settings/FixCommonErrorsSettings.cs index 17633cd8a..5451ac601 100644 --- a/src/libse/Common/Settings/FixCommonErrorsSettings.cs +++ b/src/libse/Settings/FixCommonErrorsSettings.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Text; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class FixCommonErrorsSettings { diff --git a/src/libse/Common/Settings/GeneralSettings.cs b/src/libse/Settings/GeneralSettings.cs similarity index 99% rename from src/libse/Common/Settings/GeneralSettings.cs rename to src/libse/Settings/GeneralSettings.cs index cdad4897e..f4633b99e 100644 --- a/src/libse/Common/Settings/GeneralSettings.cs +++ b/src/libse/Settings/GeneralSettings.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Drawing; +using Nikse.SubtitleEdit.Core.Common; using Nikse.SubtitleEdit.Core.Common.TextLengthCalculator; using Nikse.SubtitleEdit.Core.Enums; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class GeneralSettings { diff --git a/src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs b/src/libse/Settings/MultipleSearchAndReplaceGroup.cs similarity index 85% rename from src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs rename to src/libse/Settings/MultipleSearchAndReplaceGroup.cs index 9c2fca481..4447b66c5 100644 --- a/src/libse/Common/Settings/MultipleSearchAndReplaceGroup.cs +++ b/src/libse/Settings/MultipleSearchAndReplaceGroup.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class MultipleSearchAndReplaceGroup { diff --git a/src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs b/src/libse/Settings/MultipleSearchAndReplaceSetting.cs similarity index 87% rename from src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs rename to src/libse/Settings/MultipleSearchAndReplaceSetting.cs index 4bb8e8652..36177891a 100644 --- a/src/libse/Common/Settings/MultipleSearchAndReplaceSetting.cs +++ b/src/libse/Settings/MultipleSearchAndReplaceSetting.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class MultipleSearchAndReplaceSetting { diff --git a/src/libse/Common/Settings/NetworkSettings.cs b/src/libse/Settings/NetworkSettings.cs similarity index 92% rename from src/libse/Common/Settings/NetworkSettings.cs rename to src/libse/Settings/NetworkSettings.cs index bdf8a75b5..1199579ca 100644 --- a/src/libse/Common/Settings/NetworkSettings.cs +++ b/src/libse/Settings/NetworkSettings.cs @@ -1,6 +1,6 @@ using System; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class NetworkSettings { diff --git a/src/libse/Common/Settings/ProxySettings.cs b/src/libse/Settings/ProxySettings.cs similarity index 94% rename from src/libse/Common/Settings/ProxySettings.cs rename to src/libse/Settings/ProxySettings.cs index da651fc7c..1ff59f735 100644 --- a/src/libse/Common/Settings/ProxySettings.cs +++ b/src/libse/Settings/ProxySettings.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class ProxySettings { diff --git a/src/libse/Common/Settings/RecentFileEntry.cs b/src/libse/Settings/RecentFileEntry.cs similarity index 91% rename from src/libse/Common/Settings/RecentFileEntry.cs rename to src/libse/Settings/RecentFileEntry.cs index 59a5a7156..a10fff400 100644 --- a/src/libse/Common/Settings/RecentFileEntry.cs +++ b/src/libse/Settings/RecentFileEntry.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class RecentFileEntry { diff --git a/src/libse/Common/Settings/RecentFilesSettings.cs b/src/libse/Settings/RecentFilesSettings.cs similarity index 98% rename from src/libse/Common/Settings/RecentFilesSettings.cs rename to src/libse/Settings/RecentFilesSettings.cs index 2ec0da5fd..55f77dc20 100644 --- a/src/libse/Common/Settings/RecentFilesSettings.cs +++ b/src/libse/Settings/RecentFilesSettings.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Xml.Serialization; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class RecentFilesSettings { diff --git a/src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs b/src/libse/Settings/RemoveTextForHearingImpairedSettings.cs similarity index 97% rename from src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs rename to src/libse/Settings/RemoveTextForHearingImpairedSettings.cs index 5e613cc43..03fe9a04e 100644 --- a/src/libse/Common/Settings/RemoveTextForHearingImpairedSettings.cs +++ b/src/libse/Settings/RemoveTextForHearingImpairedSettings.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class RemoveTextForHearingImpairedSettings { diff --git a/src/libse/Common/Settings/Settings.cs b/src/libse/Settings/Settings.cs similarity index 99% rename from src/libse/Common/Settings/Settings.cs rename to src/libse/Settings/Settings.cs index 55a33b883..a256051ac 100644 --- a/src/libse/Common/Settings/Settings.cs +++ b/src/libse/Settings/Settings.cs @@ -1,13 +1,14 @@ -using Nikse.SubtitleEdit.Core.Enums; -using System; +using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.IO; using System.Text; using System.Xml; +using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Enums; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { // The settings classes are built for easy xml-serialization (makes save/load code simple) // ...but the built-in serialization is too slow - so a custom (de-)serialization has been used! diff --git a/src/libse/Common/Settings/Shortcuts.cs b/src/libse/Settings/Shortcuts.cs similarity index 99% rename from src/libse/Common/Settings/Shortcuts.cs rename to src/libse/Settings/Shortcuts.cs index 15a493343..da18519f9 100644 --- a/src/libse/Common/Settings/Shortcuts.cs +++ b/src/libse/Settings/Shortcuts.cs @@ -2,8 +2,9 @@ using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; +using Nikse.SubtitleEdit.Core.Common; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class Shortcuts { diff --git a/src/libse/Common/Settings/SubtitleBeaming.cs b/src/libse/Settings/SubtitleBeaming.cs similarity index 92% rename from src/libse/Common/Settings/SubtitleBeaming.cs rename to src/libse/Settings/SubtitleBeaming.cs index 42bf3b036..35d62e4db 100644 --- a/src/libse/Common/Settings/SubtitleBeaming.cs +++ b/src/libse/Settings/SubtitleBeaming.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class SubtitleBeaming { diff --git a/src/libse/Common/Settings/SubtitleSettings.cs b/src/libse/Settings/SubtitleSettings.cs similarity index 99% rename from src/libse/Common/Settings/SubtitleSettings.cs rename to src/libse/Settings/SubtitleSettings.cs index 116973451..c2f8eb1e8 100644 --- a/src/libse/Common/Settings/SubtitleSettings.cs +++ b/src/libse/Settings/SubtitleSettings.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using System.Drawing; +using Nikse.SubtitleEdit.Core.Common; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class SubtitleSettings { diff --git a/src/libse/Common/Settings/ToolsSettings.cs b/src/libse/Settings/ToolsSettings.cs similarity index 99% rename from src/libse/Common/Settings/ToolsSettings.cs rename to src/libse/Settings/ToolsSettings.cs index b153562fa..eb4053d2b 100644 --- a/src/libse/Common/Settings/ToolsSettings.cs +++ b/src/libse/Settings/ToolsSettings.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using System.Drawing; +using Nikse.SubtitleEdit.Core.Common; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class ToolsSettings { diff --git a/src/libse/Common/Settings/VerifyCompletenessSettings.cs b/src/libse/Settings/VerifyCompletenessSettings.cs similarity index 88% rename from src/libse/Common/Settings/VerifyCompletenessSettings.cs rename to src/libse/Settings/VerifyCompletenessSettings.cs index 45ddc3021..1d95208f2 100644 --- a/src/libse/Common/Settings/VerifyCompletenessSettings.cs +++ b/src/libse/Settings/VerifyCompletenessSettings.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class VerifyCompletenessSettings { diff --git a/src/libse/Common/Settings/VideoControlsSettings.cs b/src/libse/Settings/VideoControlsSettings.cs similarity index 98% rename from src/libse/Common/Settings/VideoControlsSettings.cs rename to src/libse/Settings/VideoControlsSettings.cs index 8e9815b43..06e882acc 100644 --- a/src/libse/Common/Settings/VideoControlsSettings.cs +++ b/src/libse/Settings/VideoControlsSettings.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class VideoControlsSettings { diff --git a/src/libse/Common/Settings/VobSubOcrSettings.cs b/src/libse/Settings/VobSubOcrSettings.cs similarity index 98% rename from src/libse/Common/Settings/VobSubOcrSettings.cs rename to src/libse/Settings/VobSubOcrSettings.cs index 36a9ab327..6c0a6f0e3 100644 --- a/src/libse/Common/Settings/VobSubOcrSettings.cs +++ b/src/libse/Settings/VobSubOcrSettings.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class VobSubOcrSettings { diff --git a/src/libse/Common/Settings/WordListSettings.cs b/src/libse/Settings/WordListSettings.cs similarity index 90% rename from src/libse/Common/Settings/WordListSettings.cs rename to src/libse/Settings/WordListSettings.cs index f028a7aa7..6684fd414 100644 --- a/src/libse/Common/Settings/WordListSettings.cs +++ b/src/libse/Settings/WordListSettings.cs @@ -1,4 +1,4 @@ -namespace Nikse.SubtitleEdit.Core.Common +namespace Nikse.SubtitleEdit.Core.Settings { public class WordListSettings { diff --git a/src/ui/Controls/SubtitleListView.cs b/src/ui/Controls/SubtitleListView.cs index 2facd79f7..afc6b1944 100644 --- a/src/ui/Controls/SubtitleListView.cs +++ b/src/ui/Controls/SubtitleListView.cs @@ -6,6 +6,7 @@ using System.Drawing; using System.Drawing.Text; using System.Globalization; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Controls { diff --git a/src/ui/Controls/VideoPlayerContainer.cs b/src/ui/Controls/VideoPlayerContainer.cs index 95432f5b9..760e14670 100644 --- a/src/ui/Controls/VideoPlayerContainer.cs +++ b/src/ui/Controls/VideoPlayerContainer.cs @@ -8,6 +8,7 @@ using System.Drawing; using System.IO; using System.Text; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Controls { diff --git a/src/ui/Forms/Assa/AssaProgressBar.cs b/src/ui/Forms/Assa/AssaProgressBar.cs index a5381d017..205abcc61 100644 --- a/src/ui/Forms/Assa/AssaProgressBar.cs +++ b/src/ui/Forms/Assa/AssaProgressBar.cs @@ -11,6 +11,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms.Assa { diff --git a/src/ui/Forms/Assa/AssaStyles.cs b/src/ui/Forms/Assa/AssaStyles.cs index 363f36bc7..4eebec84b 100644 --- a/src/ui/Forms/Assa/AssaStyles.cs +++ b/src/ui/Forms/Assa/AssaStyles.cs @@ -13,6 +13,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; namespace Nikse.SubtitleEdit.Forms.Assa diff --git a/src/ui/Forms/Assa/ReplaceStyleWith.cs b/src/ui/Forms/Assa/ReplaceStyleWith.cs index 1987e5562..7c27a71ad 100644 --- a/src/ui/Forms/Assa/ReplaceStyleWith.cs +++ b/src/ui/Forms/Assa/ReplaceStyleWith.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms.Assa { diff --git a/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesImportExport.cs b/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesImportExport.cs index 2f8664d93..d38eab9fe 100644 --- a/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesImportExport.cs +++ b/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesImportExport.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Windows.Forms; using System.Xml; using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Settings; using Nikse.SubtitleEdit.Logic; namespace Nikse.SubtitleEdit.Forms.Assa diff --git a/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesManager.cs b/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesManager.cs index 963754249..48119b9bb 100644 --- a/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesManager.cs +++ b/src/ui/Forms/Assa/SubStationAlphaStylesCategoriesManager.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Windows.Forms; using System.Xml; using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Settings; using Nikse.SubtitleEdit.Logic; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; diff --git a/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfile.cs b/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfile.cs index 3a0958ea4..9d5adfb69 100644 --- a/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfile.cs +++ b/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfile.cs @@ -2,6 +2,7 @@ using System.Drawing; using System.Windows.Forms; using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Settings; using Nikse.SubtitleEdit.Logic; namespace Nikse.SubtitleEdit.Forms.BeautifyTimeCodes diff --git a/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfileSimple.cs b/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfileSimple.cs index 95ec25c96..98b8dbdb8 100644 --- a/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfileSimple.cs +++ b/src/ui/Forms/BeautifyTimeCodes/BeautifyTimeCodesProfileSimple.cs @@ -4,6 +4,7 @@ using Nikse.SubtitleEdit.Core.SubtitleFormats; using Nikse.SubtitleEdit.Logic; using System; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms.BeautifyTimeCodes { diff --git a/src/ui/Forms/DCinema/DCinemaPropertiesInterop.cs b/src/ui/Forms/DCinema/DCinemaPropertiesInterop.cs index bf876dbed..4a6af3aaa 100644 --- a/src/ui/Forms/DCinema/DCinemaPropertiesInterop.cs +++ b/src/ui/Forms/DCinema/DCinemaPropertiesInterop.cs @@ -5,6 +5,7 @@ using System; using System.Globalization; using System.Windows.Forms; using System.Xml.Linq; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms.DCinema { diff --git a/src/ui/Forms/DCinema/DCinemaPropertiesSmpte.cs b/src/ui/Forms/DCinema/DCinemaPropertiesSmpte.cs index 735d47fde..02a4d1c6e 100644 --- a/src/ui/Forms/DCinema/DCinemaPropertiesSmpte.cs +++ b/src/ui/Forms/DCinema/DCinemaPropertiesSmpte.cs @@ -5,6 +5,7 @@ using System; using System.Globalization; using System.Windows.Forms; using Nikse.SubtitleEdit.Core.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms.DCinema { diff --git a/src/ui/Forms/ExportPngXml.cs b/src/ui/Forms/ExportPngXml.cs index 3834684de..35f88a47b 100644 --- a/src/ui/Forms/ExportPngXml.cs +++ b/src/ui/Forms/ExportPngXml.cs @@ -22,6 +22,7 @@ using System.Text.RegularExpressions; using System.Threading; using System.Windows.Forms; using System.Xml; +using Nikse.SubtitleEdit.Core.Settings; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; namespace Nikse.SubtitleEdit.Forms @@ -5861,7 +5862,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine + } } - private void SubtitleListView1InitializeLanguage(LanguageStructure.General general, Core.Common.Settings settings) + private void SubtitleListView1InitializeLanguage(LanguageStructure.General general, Settings settings) { var columnIndexNumber = 0; var columnIndexStart = 1; diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index e6d9da106..99336986e 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -47,6 +47,7 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; using Nikse.SubtitleEdit.Forms.Tts; using CheckForUpdatesHelper = Nikse.SubtitleEdit.Logic.CheckForUpdatesHelper; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; diff --git a/src/ui/Forms/MultipleReplace.cs b/src/ui/Forms/MultipleReplace.cs index a7ab11a9e..cd64ca38d 100644 --- a/src/ui/Forms/MultipleReplace.cs +++ b/src/ui/Forms/MultipleReplace.cs @@ -9,6 +9,7 @@ using System.Text.RegularExpressions; using System.Windows.Forms; using System.Xml; using Nikse.SubtitleEdit.Controls.Adapters; +using Nikse.SubtitleEdit.Core.Settings; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; namespace Nikse.SubtitleEdit.Forms diff --git a/src/ui/Forms/MultipleReplaceExportImport.cs b/src/ui/Forms/MultipleReplaceExportImport.cs index 2afd07218..7f221d3e8 100644 --- a/src/ui/Forms/MultipleReplaceExportImport.cs +++ b/src/ui/Forms/MultipleReplaceExportImport.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Xml; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/ui/Forms/Ocr/VobSubOcr.cs b/src/ui/Forms/Ocr/VobSubOcr.cs index 4427632f7..0cf4d2f1e 100644 --- a/src/ui/Forms/Ocr/VobSubOcr.cs +++ b/src/ui/Forms/Ocr/VobSubOcr.cs @@ -28,6 +28,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using System.Xml; +using Nikse.SubtitleEdit.Core.Settings; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; using Timer = System.Windows.Forms.Timer; diff --git a/src/ui/Forms/Options/Settings.cs b/src/ui/Forms/Options/Settings.cs index 4f33b1386..b01b99898 100644 --- a/src/ui/Forms/Options/Settings.cs +++ b/src/ui/Forms/Options/Settings.cs @@ -16,6 +16,7 @@ using System.Linq; using System.Reflection; using System.Text; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; namespace Nikse.SubtitleEdit.Forms.Options @@ -131,7 +132,7 @@ namespace Nikse.SubtitleEdit.Forms.Options Init(); _loading = false; - _oldSettings = Core.Common.Settings.CustomSerialize(Configuration.Settings); + _oldSettings = Core.Settings.Settings.CustomSerialize(Configuration.Settings); } public void Init() @@ -2455,7 +2456,7 @@ namespace Nikse.SubtitleEdit.Forms.Options } } - if (_oldSettings == Core.Common.Settings.CustomSerialize(Configuration.Settings)) + if (_oldSettings == Core.Settings.Settings.CustomSerialize(Configuration.Settings)) { DialogResult = DialogResult.Cancel; return; diff --git a/src/ui/Forms/Options/SettingsProfile.cs b/src/ui/Forms/Options/SettingsProfile.cs index d61efaf78..fceb8490c 100644 --- a/src/ui/Forms/Options/SettingsProfile.cs +++ b/src/ui/Forms/Options/SettingsProfile.cs @@ -8,6 +8,7 @@ using System.Globalization; using System.Linq; using System.Text; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; namespace Nikse.SubtitleEdit.Forms.Options diff --git a/src/ui/Forms/ProfileChoose.cs b/src/ui/Forms/ProfileChoose.cs index d05b936a0..3ff1f06fd 100644 --- a/src/ui/Forms/ProfileChoose.cs +++ b/src/ui/Forms/ProfileChoose.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/ui/Forms/RestoreAutoBackup.cs b/src/ui/Forms/RestoreAutoBackup.cs index f79f02f05..188d0e6e2 100644 --- a/src/ui/Forms/RestoreAutoBackup.cs +++ b/src/ui/Forms/RestoreAutoBackup.cs @@ -9,6 +9,7 @@ using System.Windows.Forms; using Nikse.SubtitleEdit.Core.SubtitleFormats; using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox; using System.Threading; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/ui/Forms/Translate/AutoTranslateSettings.cs b/src/ui/Forms/Translate/AutoTranslateSettings.cs index 2543d9389..630e19e70 100644 --- a/src/ui/Forms/Translate/AutoTranslateSettings.cs +++ b/src/ui/Forms/Translate/AutoTranslateSettings.cs @@ -2,6 +2,7 @@ using System.Windows.Forms; using Nikse.SubtitleEdit.Core.AutoTranslate; using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.Settings; using Nikse.SubtitleEdit.Logic; namespace Nikse.SubtitleEdit.Forms.Translate diff --git a/src/ui/Forms/Translate/MergeAndSplitHelper.cs b/src/ui/Forms/Translate/MergeAndSplitHelper.cs index a0153adb5..b19faeb6a 100644 --- a/src/ui/Forms/Translate/MergeAndSplitHelper.cs +++ b/src/ui/Forms/Translate/MergeAndSplitHelper.cs @@ -8,6 +8,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Forms.Translate { diff --git a/src/ui/Forms/VerifyCompleteness.cs b/src/ui/Forms/VerifyCompleteness.cs index 9ebd97028..e65a31237 100644 --- a/src/ui/Forms/VerifyCompleteness.cs +++ b/src/ui/Forms/VerifyCompleteness.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms; -using static Nikse.SubtitleEdit.Core.Common.VerifyCompletenessSettings; +using static Nikse.SubtitleEdit.Core.Settings.VerifyCompletenessSettings; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/ui/Logic/UiUtil.cs b/src/ui/Logic/UiUtil.cs index 7f978693c..18be2a3ea 100644 --- a/src/ui/Logic/UiUtil.cs +++ b/src/ui/Logic/UiUtil.cs @@ -14,6 +14,7 @@ using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; +using Nikse.SubtitleEdit.Core.Settings; namespace Nikse.SubtitleEdit.Logic { From 761493d24c0f493ca13526b8cec2b4f3dd9bedc7 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Fri, 21 Jun 2024 19:44:23 +0100 Subject: [PATCH 30/42] Implement IDisposable pattern on HttpClient usage The HttpClient instances are now wrapped in a using statement to properly dispose them after use. This practice prevents potential memory leaks and ensures that system resources are returned back to the system once the HttpClient instances are no longer needed, improving the system's overall efficiency and performance. Signed-off-by: Ivandro Jao --- src/ui/Forms/Tts/TextToSpeech.cs | 538 ++++++++++++++++--------------- 1 file changed, 276 insertions(+), 262 deletions(-) diff --git a/src/ui/Forms/Tts/TextToSpeech.cs b/src/ui/Forms/Tts/TextToSpeech.cs index 83de73571..6303cab27 100644 --- a/src/ui/Forms/Tts/TextToSpeech.cs +++ b/src/ui/Forms/Tts/TextToSpeech.cs @@ -933,126 +933,130 @@ namespace Nikse.SubtitleEdit.Forms.Tts private bool GenerateParagraphAudioCoqui(Subtitle subtitle, bool showProgressBar, string overrideFileName) { - var httpClient = new HttpClient(); - httpClient.BaseAddress = new Uri(nikseComboBoxVoice.Text.StartsWith("http", StringComparison.OrdinalIgnoreCase) ? nikseComboBoxVoice.Text : "http://localhost:5002/api/tts"); - - progressBar1.Value = 0; - progressBar1.Maximum = subtitle.Paragraphs.Count; - progressBar1.Visible = showProgressBar; - - for (var index = 0; index < subtitle.Paragraphs.Count; index++) + using (var httpClient = new HttpClient()) { - if (showProgressBar) + httpClient.BaseAddress = new Uri(nikseComboBoxVoice.Text.StartsWith("http", StringComparison.OrdinalIgnoreCase) ? nikseComboBoxVoice.Text : "http://localhost:5002/api/tts"); + + progressBar1.Value = 0; + progressBar1.Maximum = subtitle.Paragraphs.Count; + progressBar1.Visible = showProgressBar; + + for (var index = 0; index < subtitle.Paragraphs.Count; index++) { - progressBar1.Value = index + 1; - labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); + if (showProgressBar) + { + progressBar1.Value = index + 1; + labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); + } + + var p = subtitle.Paragraphs[index]; + if (string.IsNullOrWhiteSpace(p.Text)) + { + continue; + } + + var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".wav" : overrideFileName); + + var text = Utilities.UnbreakLine(p.Text); + var result = httpClient.GetAsync("?text=" + Utilities.UrlEncode(text)).Result; + var bytes = result.Content.ReadAsByteArrayAsync().Result; + + if (!result.IsSuccessStatusCode) + { + SeLogger.Error($"coqui TTS failed calling API as base address {httpClient.BaseAddress} : Status code={result.StatusCode}"); + } + + File.WriteAllBytes(outputFileName, bytes); + + progressBar1.Refresh(); + labelProgress.Refresh(); + Application.DoEvents(); } - var p = subtitle.Paragraphs[index]; - if (string.IsNullOrWhiteSpace(p.Text)) - { - continue; - } + progressBar1.Visible = false; + labelProgress.Text = string.Empty; - var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".wav" : overrideFileName); - - var text = Utilities.UnbreakLine(p.Text); - var result = httpClient.GetAsync("?text=" + Utilities.UrlEncode(text)).Result; - var bytes = result.Content.ReadAsByteArrayAsync().Result; - - if (!result.IsSuccessStatusCode) - { - SeLogger.Error($"coqui TTS failed calling API as base address {httpClient.BaseAddress} : Status code={result.StatusCode}"); - } - - File.WriteAllBytes(outputFileName, bytes); - - progressBar1.Refresh(); - labelProgress.Refresh(); - Application.DoEvents(); + return true; } - - progressBar1.Visible = false; - labelProgress.Text = string.Empty; - - return true; } private bool GenerateParagraphAudioAllTalk(Subtitle subtitle, bool showProgressBar, string overrideFileName) { - var httpClient = new HttpClient(); - httpClient.BaseAddress = new Uri("http://127.0.0.1:7851"); - - progressBar1.Value = 0; - progressBar1.Maximum = subtitle.Paragraphs.Count; - progressBar1.Visible = showProgressBar; - - for (var index = 0; index < subtitle.Paragraphs.Count; index++) + using (var httpClient = new HttpClient()) { - if (showProgressBar) - { - progressBar1.Value = index + 1; - labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); - } + httpClient.BaseAddress = new Uri("http://127.0.0.1:7851"); - var voice = nikseComboBoxVoice.Text; - var p = subtitle.Paragraphs[index]; - if (string.IsNullOrWhiteSpace(p.Text)) - { - continue; - } + progressBar1.Value = 0; + progressBar1.Maximum = subtitle.Paragraphs.Count; + progressBar1.Visible = showProgressBar; - if (_actorAndVoices.Count > 0 && !string.IsNullOrEmpty(p.Actor)) + for (var index = 0; index < subtitle.Paragraphs.Count; index++) { - var f = _actorAndVoices.FirstOrDefault(x => x.Actor == p.Actor); - if (f != null && !string.IsNullOrEmpty(f.Voice)) + if (showProgressBar) { - voice = f.Voice; + progressBar1.Value = index + 1; + labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); + } + + var voice = nikseComboBoxVoice.Text; + var p = subtitle.Paragraphs[index]; + if (string.IsNullOrWhiteSpace(p.Text)) + { + continue; + } + + if (_actorAndVoices.Count > 0 && !string.IsNullOrEmpty(p.Actor)) + { + var f = _actorAndVoices.FirstOrDefault(x => x.Actor == p.Actor); + if (f != null && !string.IsNullOrEmpty(f.Voice)) + { + voice = f.Voice; + } + } + + var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".wav" : overrideFileName); + + var multipartContent = new MultipartFormDataContent(); + var text = Utilities.UnbreakLine(p.Text); + multipartContent.Add(new StringContent(Json.EncodeJsonText(text)), "text_input"); + multipartContent.Add(new StringContent("standard"), "text_filtering"); + multipartContent.Add(new StringContent(voice), "character_voice_gen"); + multipartContent.Add(new StringContent("false"), "narrator_enabled"); + multipartContent.Add(new StringContent(voice), "narrator_voice_gen"); + multipartContent.Add(new StringContent("character"), "text_not_inside"); + multipartContent.Add(new StringContent(nikseComboBoxRegion.Text), "language"); + multipartContent.Add(new StringContent("output"), "output_file_name"); + multipartContent.Add(new StringContent("false"), "output_file_timestamp"); + multipartContent.Add(new StringContent("false"), "autoplay"); + multipartContent.Add(new StringContent("1.0"), "autoplay_volume"); + var result = httpClient.PostAsync("/api/tts-generate", multipartContent).Result; + var bytes = result.Content.ReadAsByteArrayAsync().Result; + var resultJson = Encoding.UTF8.GetString(bytes); + + if (!result.IsSuccessStatusCode) + { + SeLogger.Error($"All Talk TTS failed calling API as base address {httpClient.BaseAddress} : Status code={result.StatusCode}" + Environment.NewLine + resultJson); + } + + var jsonParser = new SeJsonParser(); + var allTalkOutput = jsonParser.GetFirstObject(resultJson, "output_file_path"); + File.Copy(allTalkOutput, outputFileName); + SafeFileDelete(allTalkOutput); + progressBar1.Refresh(); + labelProgress.Refresh(); + Application.DoEvents(); + + if (_abort) + { + return false; } } - var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".wav" : overrideFileName); + progressBar1.Visible = false; + labelProgress.Text = string.Empty; - var multipartContent = new MultipartFormDataContent(); - var text = Utilities.UnbreakLine(p.Text); - multipartContent.Add(new StringContent(Json.EncodeJsonText(text)), "text_input"); - multipartContent.Add(new StringContent("standard"), "text_filtering"); - multipartContent.Add(new StringContent(voice), "character_voice_gen"); - multipartContent.Add(new StringContent("false"), "narrator_enabled"); - multipartContent.Add(new StringContent(voice), "narrator_voice_gen"); - multipartContent.Add(new StringContent("character"), "text_not_inside"); - multipartContent.Add(new StringContent(nikseComboBoxRegion.Text), "language"); - multipartContent.Add(new StringContent("output"), "output_file_name"); - multipartContent.Add(new StringContent("false"), "output_file_timestamp"); - multipartContent.Add(new StringContent("false"), "autoplay"); - multipartContent.Add(new StringContent("1.0"), "autoplay_volume"); - var result = httpClient.PostAsync("/api/tts-generate", multipartContent).Result; - var bytes = result.Content.ReadAsByteArrayAsync().Result; - var resultJson = Encoding.UTF8.GetString(bytes); - - if (!result.IsSuccessStatusCode) - { - SeLogger.Error($"All Talk TTS failed calling API as base address {httpClient.BaseAddress} : Status code={result.StatusCode}" + Environment.NewLine + resultJson); - } - - var jsonParser = new SeJsonParser(); - var allTalkOutput = jsonParser.GetFirstObject(resultJson, "output_file_path"); - File.Copy(allTalkOutput, outputFileName); - SafeFileDelete(allTalkOutput); - progressBar1.Refresh(); - labelProgress.Refresh(); - Application.DoEvents(); - - if (_abort) - { - return false; - } + return true; } - - progressBar1.Visible = false; - labelProgress.Text = string.Empty; - - return true; } private bool GenerateParagraphAudioElevenLabs(Subtitle subtitle, bool showProgressBar, string overrideFileName) @@ -1064,72 +1068,74 @@ namespace Nikse.SubtitleEdit.Forms.Tts return false; } - var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "audio/mpeg"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("xi-api-key", nikseTextBoxApiKey.Text.Trim()); - - progressBar1.Value = 0; - progressBar1.Maximum = subtitle.Paragraphs.Count; - progressBar1.Visible = showProgressBar; - - var voices = _elevenLabVoices; - var v = nikseComboBoxVoice.Text; - - for (var index = 0; index < subtitle.Paragraphs.Count; index++) + using (var httpClient = new HttpClient()) { - if (showProgressBar) - { - progressBar1.Value = index + 1; - labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); - } + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "audio/mpeg"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("xi-api-key", nikseTextBoxApiKey.Text.Trim()); - var p = subtitle.Paragraphs[index]; - if (string.IsNullOrWhiteSpace(p.Text)) - { - continue; - } + progressBar1.Value = 0; + progressBar1.Maximum = subtitle.Paragraphs.Count; + progressBar1.Visible = showProgressBar; - var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".mp3" : overrideFileName.Replace(".wav", ".mp3")); + var voices = _elevenLabVoices; + var v = nikseComboBoxVoice.Text; - if (_actorAndVoices.Count > 0 && !string.IsNullOrEmpty(p.Actor)) + for (var index = 0; index < subtitle.Paragraphs.Count; index++) { - var f = _actorAndVoices.FirstOrDefault(x => x.Actor == p.Actor); - if (f != null && !string.IsNullOrEmpty(f.Voice)) + if (showProgressBar) { - v = f.Voice; + progressBar1.Value = index + 1; + labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); } + + var p = subtitle.Paragraphs[index]; + if (string.IsNullOrWhiteSpace(p.Text)) + { + continue; + } + + var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".mp3" : overrideFileName.Replace(".wav", ".mp3")); + + if (_actorAndVoices.Count > 0 && !string.IsNullOrEmpty(p.Actor)) + { + var f = _actorAndVoices.FirstOrDefault(x => x.Actor == p.Actor); + if (f != null && !string.IsNullOrEmpty(f.Voice)) + { + v = f.Voice; + } + } + + var voice = voices.First(x => x.ToString() == v); + + var url = "https://api.elevenlabs.io/v1/text-to-speech/" + voice.Model; + var text = Utilities.UnbreakLine(p.Text); + var data = "{ \"text\": \"" + Json.EncodeJsonText(text) + "\", \"model_id\": \"eleven_multilingual_v2\", \"voice_settings\": { \"stability\": 0.8, \"similarity_boost\": 1.0 } }"; + var content = new StringContent(data, Encoding.UTF8); + content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json"); + var result = httpClient.PostAsync(url, content, CancellationToken.None).Result; + var bytes = result.Content.ReadAsByteArrayAsync().Result; + + if (!result.IsSuccessStatusCode) + { + var error = Encoding.UTF8.GetString(bytes).Trim(); + SeLogger.Error($"ElevenLabs TTS failed calling API as base address {httpClient.BaseAddress} : Status code={result.StatusCode} {error}" + Environment.NewLine + "Data=" + data); + MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "With: " + data + Environment.NewLine + Environment.NewLine + "Error: " + error); + return false; + } + + File.WriteAllBytes(outputFileName, bytes); + + progressBar1.Refresh(); + labelProgress.Refresh(); + Application.DoEvents(); } - var voice = voices.First(x => x.ToString() == v); + progressBar1.Visible = false; + labelProgress.Text = string.Empty; - var url = "https://api.elevenlabs.io/v1/text-to-speech/" + voice.Model; - var text = Utilities.UnbreakLine(p.Text); - var data = "{ \"text\": \"" + Json.EncodeJsonText(text) + "\", \"model_id\": \"eleven_multilingual_v2\", \"voice_settings\": { \"stability\": 0.8, \"similarity_boost\": 1.0 } }"; - var content = new StringContent(data, Encoding.UTF8); - content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json"); - var result = httpClient.PostAsync(url, content, CancellationToken.None).Result; - var bytes = result.Content.ReadAsByteArrayAsync().Result; - - if (!result.IsSuccessStatusCode) - { - var error = Encoding.UTF8.GetString(bytes).Trim(); - SeLogger.Error($"ElevenLabs TTS failed calling API as base address {httpClient.BaseAddress} : Status code={result.StatusCode} {error}" + Environment.NewLine + "Data=" + data); - MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "With: " + data + Environment.NewLine + Environment.NewLine + "Error: " + error); - return false; - } - - File.WriteAllBytes(outputFileName, bytes); - - progressBar1.Refresh(); - labelProgress.Refresh(); - Application.DoEvents(); + return true; } - - progressBar1.Visible = false; - labelProgress.Text = string.Empty; - - return true; } private List GetAzureVoices(bool useCache) @@ -1233,73 +1239,75 @@ namespace Nikse.SubtitleEdit.Forms.Tts return false; } - var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "ssml+xml"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "audio/mpeg"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Microsoft-OutputFormat", "audio-16khz-32kbitrate-mono-mp3"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "SubtitleEdit"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Ocp-Apim-Subscription-Key", nikseTextBoxApiKey.Text.Trim()); - - progressBar1.Value = 0; - progressBar1.Maximum = subtitle.Paragraphs.Count; - progressBar1.Visible = showProgressBar; - - var voices = _azureVoices; - var v = nikseComboBoxVoice.Text; - - for (var index = 0; index < subtitle.Paragraphs.Count; index++) + using (var httpClient = new HttpClient()) { - if (showProgressBar) - { - progressBar1.Value = index + 1; - labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); - } + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "ssml+xml"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "audio/mpeg"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Microsoft-OutputFormat", "audio-16khz-32kbitrate-mono-mp3"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "SubtitleEdit"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Ocp-Apim-Subscription-Key", nikseTextBoxApiKey.Text.Trim()); - var p = subtitle.Paragraphs[index]; - if (string.IsNullOrWhiteSpace(p.Text)) - { - continue; - } + progressBar1.Value = 0; + progressBar1.Maximum = subtitle.Paragraphs.Count; + progressBar1.Visible = showProgressBar; - var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".mp3" : overrideFileName.Replace(".wav", ".mp3")); + var voices = _azureVoices; + var v = nikseComboBoxVoice.Text; - if (_actorAndVoices.Count > 0 && !string.IsNullOrEmpty(p.Actor)) + for (var index = 0; index < subtitle.Paragraphs.Count; index++) { - var f = _actorAndVoices.FirstOrDefault(x => x.Actor == p.Actor); - if (f != null && !string.IsNullOrEmpty(f.Voice)) + if (showProgressBar) { - v = f.Voice; + progressBar1.Value = index + 1; + labelProgress.Text = string.Format(LanguageSettings.Current.TextToSpeech.GeneratingSpeechFromTextXOfY, index + 1, subtitle.Paragraphs.Count); } + + var p = subtitle.Paragraphs[index]; + if (string.IsNullOrWhiteSpace(p.Text)) + { + continue; + } + + var outputFileName = Path.Combine(_waveFolder, string.IsNullOrEmpty(overrideFileName) ? index + ".mp3" : overrideFileName.Replace(".wav", ".mp3")); + + if (_actorAndVoices.Count > 0 && !string.IsNullOrEmpty(p.Actor)) + { + var f = _actorAndVoices.FirstOrDefault(x => x.Actor == p.Actor); + if (f != null && !string.IsNullOrEmpty(f.Voice)) + { + v = f.Voice; + } + } + + var voice = voices.First(x => x.ToString() == v); + + var url = $"https://{nikseComboBoxRegion.Text.Trim()}.tts.speech.microsoft.com/cognitiveservices/v1"; + var text = Utilities.UnbreakLine(p.Text); + var data = $"{System.Net.WebUtility.HtmlEncode(text)}"; + var content = new StringContent(data, Encoding.UTF8); + var result = httpClient.PostAsync(url, content, CancellationToken.None).Result; + var bytes = result.Content.ReadAsByteArrayAsync().Result; + + if (!result.IsSuccessStatusCode) + { + var error = Encoding.UTF8.GetString(bytes).Trim(); + SeLogger.Error($"Azure TTS failed calling API on address {url} : Status code={result.StatusCode} {error}" + Environment.NewLine + "Data=" + data); + MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "With: " + data + Environment.NewLine + Environment.NewLine + "Error: " + error + result); + return false; + } + + File.WriteAllBytes(outputFileName, bytes); + + progressBar1.Refresh(); + labelProgress.Refresh(); + Application.DoEvents(); } - var voice = voices.First(x => x.ToString() == v); + progressBar1.Visible = false; + labelProgress.Text = string.Empty; - var url = $"https://{nikseComboBoxRegion.Text.Trim()}.tts.speech.microsoft.com/cognitiveservices/v1"; - var text = Utilities.UnbreakLine(p.Text); - var data = $"{System.Net.WebUtility.HtmlEncode(text)}"; - var content = new StringContent(data, Encoding.UTF8); - var result = httpClient.PostAsync(url, content, CancellationToken.None).Result; - var bytes = result.Content.ReadAsByteArrayAsync().Result; - - if (!result.IsSuccessStatusCode) - { - var error = Encoding.UTF8.GetString(bytes).Trim(); - SeLogger.Error($"Azure TTS failed calling API on address {url} : Status code={result.StatusCode} {error}" + Environment.NewLine + "Data=" + data); - MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "With: " + data + Environment.NewLine + Environment.NewLine + "Error: " + error + result); - return false; - } - - File.WriteAllBytes(outputFileName, bytes); - - progressBar1.Refresh(); - labelProgress.Refresh(); - Application.DoEvents(); + return true; } - - progressBar1.Visible = false; - labelProgress.Text = string.Empty; - - return true; } private void buttonOK_Click(object sender, EventArgs e) @@ -1806,22 +1814,24 @@ namespace Nikse.SubtitleEdit.Forms.Tts if (!useCache) { - var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); - var url = "https://huggingface.co/rhasspy/piper-voices/resolve/main/voices.json?download=true"; - var res = httpClient.GetAsync(new Uri(url), CancellationToken.None).Result; - var bytes = res.Content.ReadAsByteArrayAsync().Result; - - if (!res.IsSuccessStatusCode) + using (var httpClient = new HttpClient()) { - var error = Encoding.UTF8.GetString(bytes).Trim(); - SeLogger.Error($"Failed getting voices form Piper via url \"{url}\" : Status code={res.StatusCode} {error}"); - MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "Got error: " + error + " " + result); - return result; - } + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); + var url = "https://huggingface.co/rhasspy/piper-voices/resolve/main/voices.json?download=true"; + var res = httpClient.GetAsync(new Uri(url), CancellationToken.None).Result; + var bytes = res.Content.ReadAsByteArrayAsync().Result; - File.WriteAllBytes(jsonFileName, bytes); + if (!res.IsSuccessStatusCode) + { + var error = Encoding.UTF8.GetString(bytes).Trim(); + SeLogger.Error($"Failed getting voices form Piper via url \"{url}\" : Status code={res.StatusCode} {error}"); + MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "Got error: " + error + " " + result); + return result; + } + + File.WriteAllBytes(jsonFileName, bytes); + } } if (File.Exists(jsonFileName)) @@ -1903,29 +1913,31 @@ namespace Nikse.SubtitleEdit.Forms.Tts if (!useCache) { - var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); - - if (!string.IsNullOrWhiteSpace(nikseTextBoxApiKey.Text)) + using (var httpClient = new HttpClient()) { - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("xi-api-key", nikseTextBoxApiKey.Text.Trim()); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); + + if (!string.IsNullOrWhiteSpace(nikseTextBoxApiKey.Text)) + { + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("xi-api-key", nikseTextBoxApiKey.Text.Trim()); + } + + var url = "https://api.elevenlabs.io/v1/voices"; + var res = httpClient.GetAsync(new Uri(url), CancellationToken.None).Result; + var bytes = res.Content.ReadAsByteArrayAsync().Result; + + if (!res.IsSuccessStatusCode) + { + Cursor = Cursors.Default; + var error = Encoding.UTF8.GetString(bytes).Trim(); + SeLogger.Error($"Failed getting voices form ElevenLabs via url \"{url}\" : Status code={res.StatusCode} {error}"); + MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "Got error: " + error); + return new List(); + } + + File.WriteAllBytes(jsonFileName, bytes); } - - var url = "https://api.elevenlabs.io/v1/voices"; - var res = httpClient.GetAsync(new Uri(url), CancellationToken.None).Result; - var bytes = res.Content.ReadAsByteArrayAsync().Result; - - if (!res.IsSuccessStatusCode) - { - Cursor = Cursors.Default; - var error = Encoding.UTF8.GetString(bytes).Trim(); - SeLogger.Error($"Failed getting voices form ElevenLabs via url \"{url}\" : Status code={res.StatusCode} {error}"); - MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "Got error: " + error); - return new List(); - } - - File.WriteAllBytes(jsonFileName, bytes); } if (File.Exists(jsonFileName)) @@ -1991,24 +2003,26 @@ namespace Nikse.SubtitleEdit.Forms.Tts if (!useCache) { - var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); - - var url = "http://127.0.0.1:7851/api/voices"; - var res = httpClient.GetAsync(new Uri(url), CancellationToken.None).Result; - var bytes = res.Content.ReadAsByteArrayAsync().Result; - - if (!res.IsSuccessStatusCode) + using(var httpClient = new HttpClient()) { - Cursor = Cursors.Default; - var error = Encoding.UTF8.GetString(bytes).Trim(); - SeLogger.Error($"Failed getting voices form AllTalk via url \"{url}\" : Status code={res.StatusCode} {error}"); - MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "Got error: " + error); - return new List(); - } + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); - File.WriteAllBytes(jsonFileName, bytes); + var url = "http://127.0.0.1:7851/api/voices"; + var res = httpClient.GetAsync(new Uri(url), CancellationToken.None).Result; + var bytes = res.Content.ReadAsByteArrayAsync().Result; + + if (!res.IsSuccessStatusCode) + { + Cursor = Cursors.Default; + var error = Encoding.UTF8.GetString(bytes).Trim(); + SeLogger.Error($"Failed getting voices form AllTalk via url \"{url}\" : Status code={res.StatusCode} {error}"); + MessageBox.Show(this, "Calling url: " + url + Environment.NewLine + "Got error: " + error); + return new List(); + } + + File.WriteAllBytes(jsonFileName, bytes); + } } if (File.Exists(jsonFileName)) From de7622463706abc07742e1a338df6654ac7b4931 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 22 Jun 2024 09:13:39 +0200 Subject: [PATCH 31/42] Use new output path - thx GrampaWildWilly :) Fix #8555 --- build.bat | 34 ++++++++++++------------- build_beta.bat | 36 +++++++++++++-------------- installer/Subtitle_Edit_Installer.iss | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/build.bat b/build.bat index e5035dab5..1bac5e528 100644 --- a/build.bat +++ b/build.bat @@ -180,7 +180,7 @@ EXIT /B TITLE Creating ZIP archive with 7-Zip... ECHO. ECHO Creating ZIP archive with 7-Zip... -PUSHD "src\ui\bin\Release" +PUSHD "src\ui\bin\Release\net48" IF EXIST "temp_zip" RD /S /Q "temp_zip" IF NOT EXIST "temp_zip" MD "temp_zip" IF NOT EXIST "temp_zip\Languages" MD "temp_zip\Languages" @@ -198,9 +198,9 @@ IF NOT EXIST "temp_zip\Icons\Black" MD "temp_zip\Icons\Black" IF NOT EXIST "temp_zip\Icons\Black\VideoPlayer" MD "temp_zip\Icons\Black\VideoPlayer" ECHO. -COPY /Y /V "..\..\..\..\LICENSE.txt" "temp_zip\" -COPY /Y /V "..\..\..\..\Changelog.txt" "temp_zip\" -COPY /Y /V "..\..\..\..\preview.mkv" "temp_zip\" +COPY /Y /V "..\..\..\..\..\LICENSE.txt" "temp_zip\" +COPY /Y /V "..\..\..\..\..\Changelog.txt" "temp_zip\" +COPY /Y /V "..\..\..\..\..\preview.mkv" "temp_zip\" COPY /Y /V "Hunspellx86.dll" "temp_zip\" COPY /Y /V "Hunspellx64.dll" "temp_zip\" COPY /Y /V "libse.dll" "temp_zip\" @@ -209,7 +209,7 @@ COPY /Y /V "NHunspell.dll" "temp_zip\" COPY /Y /V "UtfUnknown.dll" "temp_zip\" COPY /Y /V "Vosk.dll" "temp_zip\" COPY /Y /V "NCalc.dll" "temp_zip\" -COPY /Y /V "..\..\DLLs\Interop.QuartzTypeLib.dll" "temp_zip\" +COPY /Y /V "..\..\..\DLLs\Interop.QuartzTypeLib.dll" "temp_zip\" COPY /Y /V "System.Net.Http.Extensions.dll" "temp_zip\" COPY /Y /V "Newtonsoft.Json.dll" "temp_zip\" COPY /Y /V "System.Net.Http.Primitives.dll" "temp_zip\" @@ -218,18 +218,18 @@ COPY /Y /V "NAudio.WinMM.dll" "temp_zip\" COPY /Y /V "Microsoft.Win32.Registry.dll" "temp_zip\" COPY /Y /V "SubtitleEdit.exe" "temp_zip\" COPY /Y /V "Languages\*.xml" "temp_zip\Languages\" -COPY /Y /V "..\..\..\..\Dictionaries\*.*" "temp_zip\Dictionaries\" -COPY /Y /V "..\..\..\..\Ocr\*.*" "temp_zip\Ocr\" -XCOPY /Y /V "..\..\..\..\Tesseract302\*.*" "temp_zip\Tesseract302\" /S -COPY /Y /V "..\..\..\..\Icons\*.ico" "temp_zip\Icons\" -COPY /Y /V "..\..\..\..\Icons\DefaultTheme\*.png" "temp_zip\Icons\DefaultTheme" -COPY /Y /V "..\..\..\..\Icons\DefaultTheme\VideoPlayer\*.png" "temp_zip\Icons\DefaultTheme\VideoPlayer" -COPY /Y /V "..\..\..\..\Icons\DarkTheme\*.png" "temp_zip\Icons\DarkTheme" -COPY /Y /V "..\..\..\..\Icons\DarkTheme\VideoPlayer\*.png" "temp_zip\Icons\DarkTheme\VideoPlayer" -COPY /Y /V "..\..\..\..\Icons\Legacy\*.png" "temp_zip\Icons\Legacy" -COPY /Y /V "..\..\..\..\Icons\Legacy\VideoPlayer\*.png" "temp_zip\Icons\Legacy\VideoPlayer" -COPY /Y /V "..\..\..\..\Icons\Black\*.png" "temp_zip\Icons\Black" -COPY /Y /V "..\..\..\..\Icons\Black\VideoPlayer\*.png" "temp_zip\Icons\Black\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Dictionaries\*.*" "temp_zip\Dictionaries\" +COPY /Y /V "..\..\..\..\..\Ocr\*.*" "temp_zip\Ocr\" +XCOPY /Y /V "..\..\..\..\..\Tesseract302\*.*" "temp_zip\Tesseract302\" /S +COPY /Y /V "..\..\..\..\..\Icons\*.ico" "temp_zip\Icons\" +COPY /Y /V "..\..\..\..\..\Icons\DefaultTheme\*.png" "temp_zip\Icons\DefaultTheme" +COPY /Y /V "..\..\..\..\..\Icons\DefaultTheme\VideoPlayer\*.png" "temp_zip\Icons\DefaultTheme\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Icons\DarkTheme\*.png" "temp_zip\Icons\DarkTheme" +COPY /Y /V "..\..\..\..\..\Icons\DarkTheme\VideoPlayer\*.png" "temp_zip\Icons\DarkTheme\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Icons\Legacy\*.png" "temp_zip\Icons\Legacy" +COPY /Y /V "..\..\..\..\..\Icons\Legacy\VideoPlayer\*.png" "temp_zip\Icons\Legacy\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Icons\Black\*.png" "temp_zip\Icons\Black" +COPY /Y /V "..\..\..\..\..\Icons\Black\VideoPlayer\*.png" "temp_zip\Icons\Black\VideoPlayer" PUSHD "temp_zip" START "" /B /WAIT "%SEVENZIP%" a -tzip -mx=9 "SubtitleEdit-%VERSION%.zip" * >NUL diff --git a/build_beta.bat b/build_beta.bat index 261b2a552..2511f3fb5 100644 --- a/build_beta.bat +++ b/build_beta.bat @@ -154,7 +154,7 @@ EXIT /B TITLE Creating ZIP archive with 7-Zip... ECHO. ECHO Creating ZIP archive with 7-Zip... -PUSHD "src\ui\bin\Release" +PUSHD "src\ui\bin\Release\net48" IF EXIST "temp_zip" RD /S /Q "temp_zip" IF NOT EXIST "temp_zip" MD "temp_zip" IF NOT EXIST "temp_zip\Languages" MD "temp_zip\Languages" @@ -172,9 +172,9 @@ IF NOT EXIST "temp_zip\Icons\Black" MD "temp_zip\Icons\Black" IF NOT EXIST "temp_zip\Icons\Black\VideoPlayer" MD "temp_zip\Icons\Black\VideoPlayer" ECHO. -COPY /Y /V "..\..\..\..\LICENSE.txt" "temp_zip\" -COPY /Y /V "..\..\..\..\Changelog.txt" "temp_zip\" -COPY /Y /V "..\..\..\..\preview.mkv" "temp_zip\" +COPY /Y /V "..\..\..\..\..\LICENSE.txt" "temp_zip\" +COPY /Y /V "..\..\..\..\..\Changelog.txt" "temp_zip\" +COPY /Y /V "..\..\..\..\..\preview.mkv" "temp_zip\" COPY /Y /V "Hunspellx86.dll" "temp_zip\" COPY /Y /V "Hunspellx64.dll" "temp_zip\" COPY /Y /V "libse.dll" "temp_zip\" @@ -183,7 +183,7 @@ COPY /Y /V "NHunspell.dll" "temp_zip\" COPY /Y /V "UtfUnknown.dll" "temp_zip\" COPY /Y /V "Vosk.dll" "temp_zip\" COPY /Y /V "NCalc.dll" "temp_zip\" -COPY /Y /V "..\..\DLLs\Interop.QuartzTypeLib.dll" "temp_zip\" +COPY /Y /V "..\..\..\DLLs\Interop.QuartzTypeLib.dll" "temp_zip\" COPY /Y /V "System.Net.Http.Extensions.dll" "temp_zip\" COPY /Y /V "Newtonsoft.Json.dll" "temp_zip\" COPY /Y /V "System.Net.Http.Primitives.dll" "temp_zip\" @@ -192,18 +192,18 @@ COPY /Y /V "NAudio.WinMM.dll" "temp_zip\" COPY /Y /V "Microsoft.Win32.Registry.dll" "temp_zip\" COPY /Y /V "SubtitleEdit.exe" "temp_zip\" COPY /Y /V "Languages\*.xml" "temp_zip\Languages\" -COPY /Y /V "..\..\..\..\Dictionaries\*.*" "temp_zip\Dictionaries\" -COPY /Y /V "..\..\..\..\Ocr\*.*" "temp_zip\Ocr\" -XCOPY /Y /V "..\..\..\..\Tesseract302\*.*" "temp_zip\Tesseract302\" /S -COPY /Y /V "..\..\..\..\Icons\*.ico" "temp_zip\Icons\" -COPY /Y /V "..\..\..\..\Icons\DefaultTheme\*.png" "temp_zip\Icons\DefaultTheme" -COPY /Y /V "..\..\..\..\Icons\DefaultTheme\VideoPlayer\*.png" "temp_zip\Icons\DefaultTheme\VideoPlayer" -COPY /Y /V "..\..\..\..\Icons\DarkTheme\*.png" "temp_zip\Icons\DarkTheme" -COPY /Y /V "..\..\..\..\Icons\DarkTheme\VideoPlayer\*.png" "temp_zip\Icons\DarkTheme\VideoPlayer" -COPY /Y /V "..\..\..\..\Icons\Legacy\*.png" "temp_zip\Icons\Legacy" -COPY /Y /V "..\..\..\..\Icons\Legacy\VideoPlayer\*.png" "temp_zip\Icons\Legacy\VideoPlayer" -COPY /Y /V "..\..\..\..\Icons\Black\*.png" "temp_zip\Icons\Black" -COPY /Y /V "..\..\..\..\Icons\Black\VideoPlayer\*.png" "temp_zip\Icons\Black\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Dictionaries\*.*" "temp_zip\Dictionaries\" +COPY /Y /V "..\..\..\..\..\Ocr\*.*" "temp_zip\Ocr\" +XCOPY /Y /V "..\..\..\..\..\Tesseract302\*.*" "temp_zip\Tesseract302\" /S +COPY /Y /V "..\..\..\..\..\Icons\*.ico" "temp_zip\Icons\" +COPY /Y /V "..\..\..\..\..\Icons\DefaultTheme\*.png" "temp_zip\Icons\DefaultTheme" +COPY /Y /V "..\..\..\..\..\Icons\DefaultTheme\VideoPlayer\*.png" "temp_zip\Icons\DefaultTheme\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Icons\DarkTheme\*.png" "temp_zip\Icons\DarkTheme" +COPY /Y /V "..\..\..\..\..\Icons\DarkTheme\VideoPlayer\*.png" "temp_zip\Icons\DarkTheme\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Icons\Legacy\*.png" "temp_zip\Icons\Legacy" +COPY /Y /V "..\..\..\..\..\Icons\Legacy\VideoPlayer\*.png" "temp_zip\Icons\Legacy\VideoPlayer" +COPY /Y /V "..\..\..\..\..\Icons\Black\*.png" "temp_zip\Icons\Black" +COPY /Y /V "..\..\..\..\..\Icons\Black\VideoPlayer\*.png" "temp_zip\Icons\Black\VideoPlayer" PUSHD "temp_zip" START "" /B /WAIT "%SEVENZIP%" a -tzip -mx=9 "SubtitleEditBeta.zip" * >NUL @@ -211,7 +211,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO EndWithError ECHO. ECHO ZIP archive created successfully! -MOVE /Y "SubtitleEditBeta.zip" "..\..\..\..\..\SubtitleEditBeta" >NUL +MOVE /Y "SubtitleEditBeta.zip" "..\..\..\..\..\..\SubtitleEditBeta" >NUL POPD IF EXIST "temp_zip" RD /S /Q "temp_zip" POPD diff --git a/installer/Subtitle_Edit_Installer.iss b/installer/Subtitle_Edit_Installer.iss index 595fa6b79..92bdf8271 100644 --- a/installer/Subtitle_Edit_Installer.iss +++ b/installer/Subtitle_Edit_Installer.iss @@ -43,7 +43,7 @@ #define VerBuild #define VerRevision -#define bindir "..\src\ui\bin\Release" +#define bindir "..\src\ui\bin\Release\net48" #ifnexist bindir + "\SubtitleEdit.exe" #error Compile Subtitle Edit first From 6711897f3a9f9e07a9d25bdc048fb09824822c8b Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 22 Jun 2024 22:36:03 +0200 Subject: [PATCH 32/42] Add gen transparent video with subs - thx JeditPro :) Work on #8534 --- ...eTransparentVideoWithSubtitles.Designer.cs | 899 ++++++++++++++++++ .../GenerateTransparentVideoWithSubtitles.cs | 616 ++++++++++++ ...GenerateTransparentVideoWithSubtitles.resx | 132 +++ src/ui/Forms/Main.cs | 12 +- src/ui/Logic/VideoPreviewGenerator.cs | 31 + 5 files changed, 1685 insertions(+), 5 deletions(-) create mode 100644 src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs create mode 100644 src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs create mode 100644 src/ui/Forms/GenerateTransparentVideoWithSubtitles.resx diff --git a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs new file mode 100644 index 000000000..b7684444b --- /dev/null +++ b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs @@ -0,0 +1,899 @@ +namespace Nikse.SubtitleEdit.Forms +{ + sealed partial class GenerateTransparentVideoWithSubtitles + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.removeSubtitleFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pickSubtitleFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.addFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripBatch = new System.Windows.Forms.ContextMenuStrip(this.components); + this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.numericUpDownFontSize = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.labelFontSize = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.labelPass = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.labelProgress = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.labelPleaseWait = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.textBoxLog = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.bAspectRatio916180270ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aAspectRatio916270480ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.bAspectRatio916360540ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aAspectRatio916540960ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.youTubeShortsTikTok10801920ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.pAL720x576ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.p848x480ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.x720ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.p1280x720ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.x1080ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.p1920x1080ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.dCI2KFlat1998x1080ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.dCI2KScope2048x858ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.k2048x1080ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.uHD3840x2160ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.x2160ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.useSourceResolutionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripRes = new System.Windows.Forms.ContextMenuStrip(this.components); + this.nikseLabelOutline = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.numericUpDownOutline = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.checkBoxFontBold = new System.Windows.Forms.CheckBox(); + this.panelForeColor = new System.Windows.Forms.Panel(); + this.panelOutlineColor = new System.Windows.Forms.Panel(); + this.buttonOutlineColor = new System.Windows.Forms.Button(); + this.groupBoxSettings = new System.Windows.Forms.GroupBox(); + this.buttonForeColor = new System.Windows.Forms.Button(); + this.checkBoxBox = new System.Windows.Forms.CheckBox(); + this.checkBoxAlignRight = new System.Windows.Forms.CheckBox(); + this.labelInfo = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.checkBoxRightToLeft = new System.Windows.Forms.CheckBox(); + this.comboBoxSubtitleFont = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.labelSubtitleFont = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.groupBoxVideo = new System.Windows.Forms.GroupBox(); + this.labelFrameRate = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.comboBoxFrameRate = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.buttonVideoChooseStandardRes = new System.Windows.Forms.Button(); + this.labelResolution = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.numericUpDownWidth = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.numericUpDownHeight = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.labelX = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.buttonCancel = new System.Windows.Forms.Button(); + this.promptParameterBeforeGenerateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripGenerate = new System.Windows.Forms.ContextMenuStrip(this.components); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.buttonGenerate = new System.Windows.Forms.Button(); + this.contextMenuStripBatch.SuspendLayout(); + this.contextMenuStripRes.SuspendLayout(); + this.groupBoxSettings.SuspendLayout(); + this.groupBoxVideo.SuspendLayout(); + this.contextMenuStripGenerate.SuspendLayout(); + this.SuspendLayout(); + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(178, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(175, 6); + // + // removeSubtitleFileToolStripMenuItem + // + this.removeSubtitleFileToolStripMenuItem.Name = "removeSubtitleFileToolStripMenuItem"; + this.removeSubtitleFileToolStripMenuItem.Size = new System.Drawing.Size(178, 22); + this.removeSubtitleFileToolStripMenuItem.Text = "Remove subtitle file"; + // + // pickSubtitleFileToolStripMenuItem + // + this.pickSubtitleFileToolStripMenuItem.Name = "pickSubtitleFileToolStripMenuItem"; + this.pickSubtitleFileToolStripMenuItem.Size = new System.Drawing.Size(178, 22); + this.pickSubtitleFileToolStripMenuItem.Text = "Pick subtitle file..."; + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(175, 6); + // + // addFilesToolStripMenuItem + // + this.addFilesToolStripMenuItem.Name = "addFilesToolStripMenuItem"; + this.addFilesToolStripMenuItem.Size = new System.Drawing.Size(178, 22); + this.addFilesToolStripMenuItem.Text = "Add video files..."; + // + // contextMenuStripBatch + // + this.contextMenuStripBatch.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.addFilesToolStripMenuItem, + this.toolStripSeparator2, + this.pickSubtitleFileToolStripMenuItem, + this.removeSubtitleFileToolStripMenuItem, + this.toolStripSeparator1, + this.deleteToolStripMenuItem, + this.clearToolStripMenuItem}); + this.contextMenuStripBatch.Name = "contextMenuStripBatch"; + this.contextMenuStripBatch.Size = new System.Drawing.Size(179, 126); + // + // clearToolStripMenuItem + // + this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; + this.clearToolStripMenuItem.Size = new System.Drawing.Size(178, 22); + this.clearToolStripMenuItem.Text = "Clear"; + // + // numericUpDownFontSize + // + this.numericUpDownFontSize.BackColor = System.Drawing.SystemColors.Window; + this.numericUpDownFontSize.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.numericUpDownFontSize.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.numericUpDownFontSize.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.numericUpDownFontSize.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.numericUpDownFontSize.ButtonForeColorDown = System.Drawing.Color.Orange; + this.numericUpDownFontSize.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.numericUpDownFontSize.DecimalPlaces = 0; + this.numericUpDownFontSize.Increment = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownFontSize.Location = new System.Drawing.Point(120, 25); + this.numericUpDownFontSize.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownFontSize.Minimum = new decimal(new int[] { + 3, + 0, + 0, + 0}); + this.numericUpDownFontSize.Name = "numericUpDownFontSize"; + this.numericUpDownFontSize.Size = new System.Drawing.Size(54, 20); + this.numericUpDownFontSize.TabIndex = 10; + this.numericUpDownFontSize.TabStop = false; + this.numericUpDownFontSize.ThousandsSeparator = false; + this.numericUpDownFontSize.Value = new decimal(new int[] { + 50, + 0, + 0, + 0}); + // + // labelFontSize + // + this.labelFontSize.AutoSize = true; + this.labelFontSize.Location = new System.Drawing.Point(19, 27); + this.labelFontSize.Name = "labelFontSize"; + this.labelFontSize.Size = new System.Drawing.Size(49, 13); + this.labelFontSize.TabIndex = 0; + this.labelFontSize.Text = "Font size"; + // + // labelPass + // + this.labelPass.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.labelPass.AutoSize = true; + this.labelPass.Location = new System.Drawing.Point(279, 295); + this.labelPass.Name = "labelPass"; + this.labelPass.Size = new System.Drawing.Size(51, 13); + this.labelPass.TabIndex = 149; + this.labelPass.Text = "Pass one"; + // + // labelProgress + // + this.labelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelProgress.AutoSize = true; + this.labelProgress.Location = new System.Drawing.Point(12, 325); + this.labelProgress.Name = "labelProgress"; + this.labelProgress.Size = new System.Drawing.Size(88, 13); + this.labelProgress.TabIndex = 147; + this.labelProgress.Text = "Remaining time..."; + // + // labelPleaseWait + // + this.labelPleaseWait.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelPleaseWait.AutoSize = true; + this.labelPleaseWait.Location = new System.Drawing.Point(12, 295); + this.labelPleaseWait.Name = "labelPleaseWait"; + this.labelPleaseWait.Size = new System.Drawing.Size(70, 13); + this.labelPleaseWait.TabIndex = 146; + this.labelPleaseWait.Text = "Please wait..."; + // + // textBoxLog + // + this.textBoxLog.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.textBoxLog.Location = new System.Drawing.Point(32, 7); + this.textBoxLog.Multiline = true; + this.textBoxLog.Name = "textBoxLog"; + this.textBoxLog.ReadOnly = true; + this.textBoxLog.Size = new System.Drawing.Size(188, 26); + this.textBoxLog.TabIndex = 148; + // + // bAspectRatio916180270ToolStripMenuItem + // + this.bAspectRatio916180270ToolStripMenuItem.Name = "bAspectRatio916180270ToolStripMenuItem"; + this.bAspectRatio916180270ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.bAspectRatio916180270ToolStripMenuItem.Text = "1/4 B - Aspect Ratio 9∶16 - (180x270)"; + this.bAspectRatio916180270ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // aAspectRatio916270480ToolStripMenuItem + // + this.aAspectRatio916270480ToolStripMenuItem.Name = "aAspectRatio916270480ToolStripMenuItem"; + this.aAspectRatio916270480ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.aAspectRatio916270480ToolStripMenuItem.Text = "1/4 A - Aspect Ratio 9∶16 - (270x480)"; + this.aAspectRatio916270480ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // bAspectRatio916360540ToolStripMenuItem + // + this.bAspectRatio916360540ToolStripMenuItem.Name = "bAspectRatio916360540ToolStripMenuItem"; + this.bAspectRatio916360540ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.bAspectRatio916360540ToolStripMenuItem.Text = "1/2 B - Aspect Ratio 9∶16 - (360x540)"; + this.bAspectRatio916360540ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // aAspectRatio916540960ToolStripMenuItem + // + this.aAspectRatio916540960ToolStripMenuItem.Name = "aAspectRatio916540960ToolStripMenuItem"; + this.aAspectRatio916540960ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.aAspectRatio916540960ToolStripMenuItem.Text = "1/2 A - Aspect Ratio 9∶16 - (540x960)"; + this.aAspectRatio916540960ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem + // + this.youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem.Name = "youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem"; + this.youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem.Text = "YouTube shorts/TikTok - Aspect Ratio 9∶16 - (720x1280)"; + this.youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // youTubeShortsTikTok10801920ToolStripMenuItem + // + this.youTubeShortsTikTok10801920ToolStripMenuItem.Name = "youTubeShortsTikTok10801920ToolStripMenuItem"; + this.youTubeShortsTikTok10801920ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.youTubeShortsTikTok10801920ToolStripMenuItem.Text = "YouTube shorts/TikTok - Aspect Ratio 9∶16 - (1080x1920)"; + this.youTubeShortsTikTok10801920ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(364, 6); + // + // pAL720x576ToolStripMenuItem + // + this.pAL720x576ToolStripMenuItem.Name = "pAL720x576ToolStripMenuItem"; + this.pAL720x576ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.pAL720x576ToolStripMenuItem.Text = "360p - Aspect Ratio 16∶9 - (640x360)"; + this.pAL720x576ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // p848x480ToolStripMenuItem + // + this.p848x480ToolStripMenuItem.Name = "p848x480ToolStripMenuItem"; + this.p848x480ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.p848x480ToolStripMenuItem.Text = "VGA - Aspect Ratio 4:3 - (640x480)"; + this.p848x480ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // x720ToolStripMenuItem + // + this.x720ToolStripMenuItem.Name = "x720ToolStripMenuItem"; + this.x720ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.x720ToolStripMenuItem.Text = "SD NTSC - Aspect Ratio 3:2 - (720x480)"; + this.x720ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // p1280x720ToolStripMenuItem + // + this.p1280x720ToolStripMenuItem.Name = "p1280x720ToolStripMenuItem"; + this.p1280x720ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.p1280x720ToolStripMenuItem.Text = "SD PAL - Aspect Ratio 4:3 - (720x576)"; + this.p1280x720ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // x1080ToolStripMenuItem + // + this.x1080ToolStripMenuItem.Name = "x1080ToolStripMenuItem"; + this.x1080ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.x1080ToolStripMenuItem.Text = "540p - Aspect Ratio 16∶9 - (960x540)"; + this.x1080ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // p1920x1080ToolStripMenuItem + // + this.p1920x1080ToolStripMenuItem.Name = "p1920x1080ToolStripMenuItem"; + this.p1920x1080ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.p1920x1080ToolStripMenuItem.Text = "HD 720p - Aspect Ratio 16∶9 - (1280x720)"; + this.p1920x1080ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // dCI2KFlat1998x1080ToolStripMenuItem + // + this.dCI2KFlat1998x1080ToolStripMenuItem.Name = "dCI2KFlat1998x1080ToolStripMenuItem"; + this.dCI2KFlat1998x1080ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.dCI2KFlat1998x1080ToolStripMenuItem.Text = "Full HD 1080p - Aspect Ratio 16∶9 - (1920x1080)"; + this.dCI2KFlat1998x1080ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // dCI2KScope2048x858ToolStripMenuItem + // + this.dCI2KScope2048x858ToolStripMenuItem.Name = "dCI2KScope2048x858ToolStripMenuItem"; + this.dCI2KScope2048x858ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.dCI2KScope2048x858ToolStripMenuItem.Text = "2K DCI - Aspect Ratio 16∶9 - (2048x1080)"; + this.dCI2KScope2048x858ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // k2048x1080ToolStripMenuItem + // + this.k2048x1080ToolStripMenuItem.Name = "k2048x1080ToolStripMenuItem"; + this.k2048x1080ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.k2048x1080ToolStripMenuItem.Text = "2K WQHD - Aspect Ratio 16∶9 - (2560x1440)"; + this.k2048x1080ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // uHD3840x2160ToolStripMenuItem + // + this.uHD3840x2160ToolStripMenuItem.Name = "uHD3840x2160ToolStripMenuItem"; + this.uHD3840x2160ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.uHD3840x2160ToolStripMenuItem.Text = "4K UHD - Aspect Ratio 16∶9 - (3840x2160)"; + this.uHD3840x2160ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // x2160ToolStripMenuItem + // + this.x2160ToolStripMenuItem.Name = "x2160ToolStripMenuItem"; + this.x2160ToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.x2160ToolStripMenuItem.Text = "4K DCI - Aspect Ratio 16∶9 - (4096x2160)"; + this.x2160ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(364, 6); + // + // useSourceResolutionToolStripMenuItem + // + this.useSourceResolutionToolStripMenuItem.Name = "useSourceResolutionToolStripMenuItem"; + this.useSourceResolutionToolStripMenuItem.Size = new System.Drawing.Size(367, 22); + this.useSourceResolutionToolStripMenuItem.Text = "Use source resolution"; + // + // contextMenuStripRes + // + this.contextMenuStripRes.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.useSourceResolutionToolStripMenuItem, + this.toolStripSeparator3, + this.x2160ToolStripMenuItem, + this.uHD3840x2160ToolStripMenuItem, + this.k2048x1080ToolStripMenuItem, + this.dCI2KScope2048x858ToolStripMenuItem, + this.dCI2KFlat1998x1080ToolStripMenuItem, + this.p1920x1080ToolStripMenuItem, + this.x1080ToolStripMenuItem, + this.p1280x720ToolStripMenuItem, + this.x720ToolStripMenuItem, + this.p848x480ToolStripMenuItem, + this.pAL720x576ToolStripMenuItem, + this.toolStripSeparator4, + this.youTubeShortsTikTok10801920ToolStripMenuItem, + this.youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem, + this.aAspectRatio916540960ToolStripMenuItem, + this.bAspectRatio916360540ToolStripMenuItem, + this.aAspectRatio916270480ToolStripMenuItem, + this.bAspectRatio916180270ToolStripMenuItem}); + this.contextMenuStripRes.Name = "contextMenuStripRes"; + this.contextMenuStripRes.Size = new System.Drawing.Size(368, 412); + // + // nikseLabelOutline + // + this.nikseLabelOutline.AutoSize = true; + this.nikseLabelOutline.Location = new System.Drawing.Point(19, 58); + this.nikseLabelOutline.Name = "nikseLabelOutline"; + this.nikseLabelOutline.Size = new System.Drawing.Size(40, 13); + this.nikseLabelOutline.TabIndex = 151; + this.nikseLabelOutline.Text = "Outline"; + // + // numericUpDownOutline + // + this.numericUpDownOutline.BackColor = System.Drawing.SystemColors.Window; + this.numericUpDownOutline.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.numericUpDownOutline.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.numericUpDownOutline.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.numericUpDownOutline.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.numericUpDownOutline.ButtonForeColorDown = System.Drawing.Color.Orange; + this.numericUpDownOutline.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.numericUpDownOutline.DecimalPlaces = 1; + this.numericUpDownOutline.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.numericUpDownOutline.Location = new System.Drawing.Point(119, 54); + this.numericUpDownOutline.Maximum = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numericUpDownOutline.Minimum = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.numericUpDownOutline.Name = "numericUpDownOutline"; + this.numericUpDownOutline.Size = new System.Drawing.Size(54, 23); + this.numericUpDownOutline.TabIndex = 40; + this.numericUpDownOutline.TabStop = false; + this.numericUpDownOutline.ThousandsSeparator = false; + this.numericUpDownOutline.Value = new decimal(new int[] { + 0, + 0, + 0, + 0}); + // + // checkBoxFontBold + // + this.checkBoxFontBold.AutoSize = true; + this.checkBoxFontBold.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.checkBoxFontBold.Location = new System.Drawing.Point(187, 31); + this.checkBoxFontBold.Name = "checkBoxFontBold"; + this.checkBoxFontBold.Size = new System.Drawing.Size(51, 17); + this.checkBoxFontBold.TabIndex = 20; + this.checkBoxFontBold.Text = "Bold"; + this.checkBoxFontBold.UseVisualStyleBackColor = true; + // + // panelForeColor + // + this.panelForeColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelForeColor.Location = new System.Drawing.Point(369, 28); + this.panelForeColor.Name = "panelForeColor"; + this.panelForeColor.Size = new System.Drawing.Size(21, 21); + this.panelForeColor.TabIndex = 6; + // + // panelOutlineColor + // + this.panelOutlineColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelOutlineColor.Location = new System.Drawing.Point(369, 56); + this.panelOutlineColor.Name = "panelOutlineColor"; + this.panelOutlineColor.Size = new System.Drawing.Size(21, 20); + this.panelOutlineColor.TabIndex = 4; + // + // buttonOutlineColor + // + this.buttonOutlineColor.Location = new System.Drawing.Point(274, 54); + this.buttonOutlineColor.Name = "buttonOutlineColor"; + this.buttonOutlineColor.Size = new System.Drawing.Size(89, 23); + this.buttonOutlineColor.TabIndex = 60; + this.buttonOutlineColor.Text = "Color"; + this.buttonOutlineColor.UseVisualStyleBackColor = true; + // + // groupBoxSettings + // + this.groupBoxSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxSettings.Controls.Add(this.nikseLabelOutline); + this.groupBoxSettings.Controls.Add(this.numericUpDownOutline); + this.groupBoxSettings.Controls.Add(this.checkBoxFontBold); + this.groupBoxSettings.Controls.Add(this.panelForeColor); + this.groupBoxSettings.Controls.Add(this.buttonForeColor); + this.groupBoxSettings.Controls.Add(this.panelOutlineColor); + this.groupBoxSettings.Controls.Add(this.buttonOutlineColor); + this.groupBoxSettings.Controls.Add(this.checkBoxBox); + this.groupBoxSettings.Controls.Add(this.checkBoxAlignRight); + this.groupBoxSettings.Controls.Add(this.labelInfo); + this.groupBoxSettings.Controls.Add(this.checkBoxRightToLeft); + this.groupBoxSettings.Controls.Add(this.comboBoxSubtitleFont); + this.groupBoxSettings.Controls.Add(this.labelSubtitleFont); + this.groupBoxSettings.Controls.Add(this.groupBoxVideo); + this.groupBoxSettings.Controls.Add(this.numericUpDownFontSize); + this.groupBoxSettings.Controls.Add(this.labelFontSize); + this.groupBoxSettings.Location = new System.Drawing.Point(12, 6); + this.groupBoxSettings.Name = "groupBoxSettings"; + this.groupBoxSettings.Size = new System.Drawing.Size(576, 260); + this.groupBoxSettings.TabIndex = 144; + this.groupBoxSettings.TabStop = false; + this.groupBoxSettings.Text = "Settings"; + // + // buttonForeColor + // + this.buttonForeColor.Location = new System.Drawing.Point(274, 25); + this.buttonForeColor.Name = "buttonForeColor"; + this.buttonForeColor.Size = new System.Drawing.Size(89, 23); + this.buttonForeColor.TabIndex = 30; + this.buttonForeColor.Text = "Color"; + this.buttonForeColor.UseVisualStyleBackColor = true; + // + // checkBoxBox + // + this.checkBoxBox.AutoSize = true; + this.checkBoxBox.Location = new System.Drawing.Point(187, 60); + this.checkBoxBox.Name = "checkBoxBox"; + this.checkBoxBox.Size = new System.Drawing.Size(44, 17); + this.checkBoxBox.TabIndex = 50; + this.checkBoxBox.Text = "Box"; + this.checkBoxBox.UseVisualStyleBackColor = true; + // + // checkBoxAlignRight + // + this.checkBoxAlignRight.AutoSize = true; + this.checkBoxAlignRight.Location = new System.Drawing.Point(218, 114); + this.checkBoxAlignRight.Name = "checkBoxAlignRight"; + this.checkBoxAlignRight.Size = new System.Drawing.Size(72, 17); + this.checkBoxAlignRight.TabIndex = 76; + this.checkBoxAlignRight.Text = "Align right"; + this.checkBoxAlignRight.UseVisualStyleBackColor = true; + // + // labelInfo + // + this.labelInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelInfo.AutoSize = true; + this.labelInfo.Location = new System.Drawing.Point(5, 239); + this.labelInfo.Name = "labelInfo"; + this.labelInfo.Size = new System.Drawing.Size(25, 13); + this.labelInfo.TabIndex = 1; + this.labelInfo.Text = "Info"; + // + // checkBoxRightToLeft + // + this.checkBoxRightToLeft.AutoSize = true; + this.checkBoxRightToLeft.Location = new System.Drawing.Point(120, 114); + this.checkBoxRightToLeft.Name = "checkBoxRightToLeft"; + this.checkBoxRightToLeft.Size = new System.Drawing.Size(80, 17); + this.checkBoxRightToLeft.TabIndex = 75; + this.checkBoxRightToLeft.Text = "Right to left"; + this.checkBoxRightToLeft.UseVisualStyleBackColor = true; + // + // comboBoxSubtitleFont + // + this.comboBoxSubtitleFont.BackColor = System.Drawing.SystemColors.Window; + this.comboBoxSubtitleFont.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.comboBoxSubtitleFont.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.comboBoxSubtitleFont.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.comboBoxSubtitleFont.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.comboBoxSubtitleFont.ButtonForeColorDown = System.Drawing.Color.Orange; + this.comboBoxSubtitleFont.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.comboBoxSubtitleFont.DropDownHeight = 400; + this.comboBoxSubtitleFont.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxSubtitleFont.DropDownWidth = 250; + this.comboBoxSubtitleFont.FormattingEnabled = true; + this.comboBoxSubtitleFont.Location = new System.Drawing.Point(120, 87); + this.comboBoxSubtitleFont.MaxLength = 32767; + this.comboBoxSubtitleFont.Name = "comboBoxSubtitleFont"; + this.comboBoxSubtitleFont.SelectedIndex = -1; + this.comboBoxSubtitleFont.SelectedItem = null; + this.comboBoxSubtitleFont.SelectedText = ""; + this.comboBoxSubtitleFont.Size = new System.Drawing.Size(250, 21); + this.comboBoxSubtitleFont.TabIndex = 70; + this.comboBoxSubtitleFont.UsePopupWindow = false; + // + // labelSubtitleFont + // + this.labelSubtitleFont.AutoSize = true; + this.labelSubtitleFont.Location = new System.Drawing.Point(19, 90); + this.labelSubtitleFont.Name = "labelSubtitleFont"; + this.labelSubtitleFont.Size = new System.Drawing.Size(63, 13); + this.labelSubtitleFont.TabIndex = 7; + this.labelSubtitleFont.Text = "Subtitle font"; + // + // groupBoxVideo + // + this.groupBoxVideo.Controls.Add(this.labelFrameRate); + this.groupBoxVideo.Controls.Add(this.comboBoxFrameRate); + this.groupBoxVideo.Controls.Add(this.buttonVideoChooseStandardRes); + this.groupBoxVideo.Controls.Add(this.labelResolution); + this.groupBoxVideo.Controls.Add(this.numericUpDownWidth); + this.groupBoxVideo.Controls.Add(this.numericUpDownHeight); + this.groupBoxVideo.Controls.Add(this.labelX); + this.groupBoxVideo.Location = new System.Drawing.Point(6, 141); + this.groupBoxVideo.Name = "groupBoxVideo"; + this.groupBoxVideo.Size = new System.Drawing.Size(530, 89); + this.groupBoxVideo.TabIndex = 70; + this.groupBoxVideo.TabStop = false; + this.groupBoxVideo.Text = "Video"; + // + // labelFrameRate + // + this.labelFrameRate.AutoSize = true; + this.labelFrameRate.Location = new System.Drawing.Point(13, 54); + this.labelFrameRate.Name = "labelFrameRate"; + this.labelFrameRate.Size = new System.Drawing.Size(57, 13); + this.labelFrameRate.TabIndex = 32; + this.labelFrameRate.Text = "Frame rate"; + // + // comboBoxFrameRate + // + this.comboBoxFrameRate.BackColor = System.Drawing.SystemColors.Window; + this.comboBoxFrameRate.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.comboBoxFrameRate.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.comboBoxFrameRate.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.comboBoxFrameRate.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.comboBoxFrameRate.ButtonForeColorDown = System.Drawing.Color.Orange; + this.comboBoxFrameRate.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.comboBoxFrameRate.DropDownHeight = 400; + this.comboBoxFrameRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; + this.comboBoxFrameRate.DropDownWidth = 200; + this.comboBoxFrameRate.FormattingEnabled = true; + this.comboBoxFrameRate.Location = new System.Drawing.Point(96, 46); + this.comboBoxFrameRate.MaxLength = 32767; + this.comboBoxFrameRate.Name = "comboBoxFrameRate"; + this.comboBoxFrameRate.SelectedIndex = -1; + this.comboBoxFrameRate.SelectedItem = null; + this.comboBoxFrameRate.SelectedText = ""; + this.comboBoxFrameRate.Size = new System.Drawing.Size(74, 23); + this.comboBoxFrameRate.TabIndex = 33; + this.comboBoxFrameRate.TabStop = false; + this.comboBoxFrameRate.UsePopupWindow = false; + // + // buttonVideoChooseStandardRes + // + this.buttonVideoChooseStandardRes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.buttonVideoChooseStandardRes.Location = new System.Drawing.Point(257, 17); + this.buttonVideoChooseStandardRes.Name = "buttonVideoChooseStandardRes"; + this.buttonVideoChooseStandardRes.Size = new System.Drawing.Size(41, 23); + this.buttonVideoChooseStandardRes.TabIndex = 3; + this.buttonVideoChooseStandardRes.Text = "..."; + this.buttonVideoChooseStandardRes.UseVisualStyleBackColor = true; + this.buttonVideoChooseStandardRes.Click += new System.EventHandler(this.buttonVideoChooseStandardRes_Click); + // + // labelResolution + // + this.labelResolution.AutoSize = true; + this.labelResolution.Location = new System.Drawing.Point(10, 19); + this.labelResolution.Name = "labelResolution"; + this.labelResolution.Size = new System.Drawing.Size(57, 13); + this.labelResolution.TabIndex = 0; + this.labelResolution.Text = "Resolution"; + // + // numericUpDownWidth + // + this.numericUpDownWidth.BackColor = System.Drawing.SystemColors.Window; + this.numericUpDownWidth.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.numericUpDownWidth.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.numericUpDownWidth.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.numericUpDownWidth.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.numericUpDownWidth.ButtonForeColorDown = System.Drawing.Color.Orange; + this.numericUpDownWidth.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.numericUpDownWidth.DecimalPlaces = 0; + this.numericUpDownWidth.Increment = new decimal(new int[] { + 2, + 0, + 0, + 0}); + this.numericUpDownWidth.Location = new System.Drawing.Point(96, 17); + this.numericUpDownWidth.Maximum = new decimal(new int[] { + 50000, + 0, + 0, + 0}); + this.numericUpDownWidth.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownWidth.Name = "numericUpDownWidth"; + this.numericUpDownWidth.Size = new System.Drawing.Size(64, 23); + this.numericUpDownWidth.TabIndex = 1; + this.numericUpDownWidth.TabStop = false; + this.numericUpDownWidth.ThousandsSeparator = false; + this.numericUpDownWidth.Value = new decimal(new int[] { + 1280, + 0, + 0, + 0}); + // + // numericUpDownHeight + // + this.numericUpDownHeight.BackColor = System.Drawing.SystemColors.Window; + this.numericUpDownHeight.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.numericUpDownHeight.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.numericUpDownHeight.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.numericUpDownHeight.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.numericUpDownHeight.ButtonForeColorDown = System.Drawing.Color.Orange; + this.numericUpDownHeight.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.numericUpDownHeight.DecimalPlaces = 0; + this.numericUpDownHeight.Increment = new decimal(new int[] { + 2, + 0, + 0, + 0}); + this.numericUpDownHeight.Location = new System.Drawing.Point(184, 17); + this.numericUpDownHeight.Maximum = new decimal(new int[] { + 50000, + 0, + 0, + 0}); + this.numericUpDownHeight.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownHeight.Name = "numericUpDownHeight"; + this.numericUpDownHeight.Size = new System.Drawing.Size(64, 23); + this.numericUpDownHeight.TabIndex = 2; + this.numericUpDownHeight.TabStop = false; + this.numericUpDownHeight.ThousandsSeparator = false; + this.numericUpDownHeight.Value = new decimal(new int[] { + 720, + 0, + 0, + 0}); + // + // labelX + // + this.labelX.AutoSize = true; + this.labelX.Location = new System.Drawing.Point(166, 19); + this.labelX.Name = "labelX"; + this.labelX.Size = new System.Drawing.Size(12, 13); + this.labelX.TabIndex = 31; + this.labelX.Text = "x"; + // + // timer1 + // + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonCancel.Location = new System.Drawing.Point(463, 311); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(125, 23); + this.buttonCancel.TabIndex = 154; + this.buttonCancel.Text = "C&ancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // promptParameterBeforeGenerateToolStripMenuItem + // + this.promptParameterBeforeGenerateToolStripMenuItem.Name = "promptParameterBeforeGenerateToolStripMenuItem"; + this.promptParameterBeforeGenerateToolStripMenuItem.Size = new System.Drawing.Size(289, 22); + this.promptParameterBeforeGenerateToolStripMenuItem.Text = "Prompt FFmpeg parameter and generate"; + this.promptParameterBeforeGenerateToolStripMenuItem.Click += new System.EventHandler(this.promptParameterBeforeGenerateToolStripMenuItem_Click); + // + // contextMenuStripGenerate + // + this.contextMenuStripGenerate.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.promptParameterBeforeGenerateToolStripMenuItem}); + this.contextMenuStripGenerate.Name = "contextMenuStripGenerate"; + this.contextMenuStripGenerate.Size = new System.Drawing.Size(290, 26); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(12, 311); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(318, 11); + this.progressBar1.TabIndex = 145; + this.progressBar1.Visible = false; + // + // buttonGenerate + // + this.buttonGenerate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonGenerate.ContextMenuStrip = this.contextMenuStripGenerate; + this.buttonGenerate.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonGenerate.Location = new System.Drawing.Point(336, 311); + this.buttonGenerate.Name = "buttonGenerate"; + this.buttonGenerate.Size = new System.Drawing.Size(121, 23); + this.buttonGenerate.TabIndex = 153; + this.buttonGenerate.Text = "Generate"; + this.buttonGenerate.UseVisualStyleBackColor = true; + this.buttonGenerate.Click += new System.EventHandler(this.buttonGenerate_Click); + // + // GenerateTransparentVideoWithSubtitles + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(600, 345); + this.Controls.Add(this.labelPass); + this.Controls.Add(this.labelProgress); + this.Controls.Add(this.labelPleaseWait); + this.Controls.Add(this.textBoxLog); + this.Controls.Add(this.groupBoxSettings); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.buttonGenerate); + this.KeyPreview = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "GenerateTransparentVideoWithSubtitles"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "GenerateTransparentVideoWithSubtitles"; + this.contextMenuStripBatch.ResumeLayout(false); + this.contextMenuStripRes.ResumeLayout(false); + this.groupBoxSettings.ResumeLayout(false); + this.groupBoxSettings.PerformLayout(); + this.groupBoxVideo.ResumeLayout(false); + this.groupBoxVideo.PerformLayout(); + this.contextMenuStripGenerate.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem removeSubtitleFileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pickSubtitleFileToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem addFilesToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStripBatch; + private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; + private Controls.NikseUpDown numericUpDownFontSize; + private Controls.NikseLabel labelFontSize; + private Controls.NikseLabel labelPass; + private Controls.NikseLabel labelProgress; + private Controls.NikseLabel labelPleaseWait; + private Controls.NikseTextBox textBoxLog; + private System.Windows.Forms.ToolStripMenuItem bAspectRatio916180270ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aAspectRatio916270480ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem bAspectRatio916360540ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aAspectRatio916540960ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem youTubeShortsTikTokAspectRatio9167201280ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem youTubeShortsTikTok10801920ToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem pAL720x576ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem p848x480ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem x720ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem p1280x720ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem x1080ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem p1920x1080ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem dCI2KFlat1998x1080ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem dCI2KScope2048x858ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem k2048x1080ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem uHD3840x2160ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem x2160ToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripMenuItem useSourceResolutionToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStripRes; + private Controls.NikseLabel nikseLabelOutline; + private Controls.NikseUpDown numericUpDownOutline; + private System.Windows.Forms.CheckBox checkBoxFontBold; + private System.Windows.Forms.Panel panelForeColor; + private System.Windows.Forms.Panel panelOutlineColor; + private System.Windows.Forms.Button buttonOutlineColor; + private System.Windows.Forms.GroupBox groupBoxSettings; + private System.Windows.Forms.Button buttonForeColor; + private System.Windows.Forms.CheckBox checkBoxBox; + private System.Windows.Forms.CheckBox checkBoxAlignRight; + private Controls.NikseLabel labelInfo; + private System.Windows.Forms.CheckBox checkBoxRightToLeft; + private Controls.NikseComboBox comboBoxSubtitleFont; + private Controls.NikseLabel labelSubtitleFont; + private System.Windows.Forms.GroupBox groupBoxVideo; + private System.Windows.Forms.Button buttonVideoChooseStandardRes; + private Controls.NikseLabel labelResolution; + private Controls.NikseUpDown numericUpDownWidth; + private Controls.NikseUpDown numericUpDownHeight; + private Controls.NikseLabel labelX; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.ToolStripMenuItem promptParameterBeforeGenerateToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStripGenerate; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Button buttonGenerate; + private Controls.NikseLabel labelFrameRate; + private Controls.NikseComboBox comboBoxFrameRate; + } +} \ No newline at end of file diff --git a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs new file mode 100644 index 000000000..97c859c9b --- /dev/null +++ b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs @@ -0,0 +1,616 @@ +using Nikse.SubtitleEdit.Core.Common; +using Nikse.SubtitleEdit.Core.SubtitleFormats; +using Nikse.SubtitleEdit.Logic; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Windows.Forms; + +namespace Nikse.SubtitleEdit.Forms +{ + public sealed partial class GenerateTransparentVideoWithSubtitles : Form + { + private bool _abort; + private readonly Subtitle _assaSubtitle; + private readonly VideoInfo _videoInfo; + private static readonly Regex FrameFinderRegex = new Regex(@"[Ff]rame=\s*\d+", RegexOptions.Compiled); + private long _processedFrames; + private long _startTicks; + private long _totalFrames; + private StringBuilder _log; + private readonly bool _isAssa; + private bool _promptFFmpegParameters; + public string VideoFileName { get; private set; } + public long MillisecondsEncoding { get; private set; } + + + public GenerateTransparentVideoWithSubtitles(Subtitle subtitle, SubtitleFormat format, VideoInfo videoInfo) + { + UiUtil.PreInitialize(this); + InitializeComponent(); + textBoxLog.ScrollBars = ScrollBars.Both; + UiUtil.FixFonts(this); + + _videoInfo = videoInfo; + _assaSubtitle = new Subtitle(subtitle); + + if (format.GetType() == typeof(NetflixImsc11Japanese) && _videoInfo != null) + { + _assaSubtitle = new Subtitle(); + var raw = NetflixImsc11JapaneseToAss.Convert(subtitle, _videoInfo.Width, _videoInfo.Height); + new AdvancedSubStationAlpha().LoadSubtitle(_assaSubtitle, raw.SplitToLines(), null); + } + + Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.Title; + buttonGenerate.Text = LanguageSettings.Current.Watermark.Generate; + labelPleaseWait.Text = LanguageSettings.Current.General.PleaseWait; + labelResolution.Text = LanguageSettings.Current.SubStationAlphaProperties.Resolution; + labelFontSize.Text = LanguageSettings.Current.ExportPngXml.FontSize; + nikseLabelOutline.Text = LanguageSettings.Current.SubStationAlphaStyles.Outline; + checkBoxFontBold.Text = LanguageSettings.Current.General.Bold; + numericUpDownOutline.Text = LanguageSettings.Current.SubStationAlphaStyles.Outline; + labelSubtitleFont.Text = LanguageSettings.Current.ExportPngXml.FontFamily; + buttonOutlineColor.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.OutputSettings; + buttonCancel.Text = LanguageSettings.Current.General.Cancel; + checkBoxRightToLeft.Text = LanguageSettings.Current.Settings.FixRTLViaUnicodeChars; + checkBoxAlignRight.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.AlignRight; + checkBoxBox.Text = LanguageSettings.Current.SubStationAlphaStyles.OpaqueBox; + deleteToolStripMenuItem.Text = LanguageSettings.Current.DvdSubRip.Remove; + clearToolStripMenuItem.Text = LanguageSettings.Current.DvdSubRip.Clear; + addFilesToolStripMenuItem.Text = LanguageSettings.Current.DvdSubRip.Add; + useSourceResolutionToolStripMenuItem.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.UseSourceResolution; + labelFrameRate.Text = LanguageSettings.Current.General.FrameRate; + + progressBar1.Visible = false; + labelPleaseWait.Visible = false; + labelProgress.Text = string.Empty; + labelPass.Text = string.Empty; + groupBoxSettings.Text = LanguageSettings.Current.Settings.Title; + groupBoxVideo.Text = LanguageSettings.Current.Main.Menu.Video.Title; + promptParameterBeforeGenerateToolStripMenuItem.Text = LanguageSettings.Current.GenerateBlankVideo.GenerateWithFfmpegParametersPrompt; + + checkBoxBox.Checked = Configuration.Settings.Tools.GenVideoNonAssaBox; + checkBoxAlignRight.Checked = Configuration.Settings.Tools.GenVideoNonAssaAlignRight; + checkBoxRightToLeft.Checked = Configuration.Settings.Tools.GenVideoNonAssaAlignRight; + + if (_videoInfo != null) + { + numericUpDownWidth.Value = _videoInfo.Width; + numericUpDownHeight.Value = _videoInfo.Height; + } + + var left = Math.Max(Math.Max(labelResolution.Left + labelResolution.Width, labelFontSize.Left + labelFontSize.Width), labelSubtitleFont.Left + labelSubtitleFont.Width) + 5; + numericUpDownFontSize.Left = left; + comboBoxSubtitleFont.Left = left; + numericUpDownOutline.Left = left; + numericUpDownWidth.Left = left; + comboBoxFrameRate.Left = left; + labelX.Left = numericUpDownWidth.Left + numericUpDownWidth.Width + 3; + numericUpDownHeight.Left = labelX.Left + labelX.Width + 3; + buttonVideoChooseStandardRes.Left = numericUpDownHeight.Left + numericUpDownHeight.Width + 9; + labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOff; + + checkBoxFontBold.Left = numericUpDownFontSize.Right + 12; + checkBoxBox.Left = numericUpDownOutline.Right + 12; + + checkBoxRightToLeft.Left = left; + checkBoxAlignRight.Left = checkBoxRightToLeft.Right + 12; + buttonOutlineColor.Left = checkBoxBox.Right + 2; + buttonOutlineColor.Text = LanguageSettings.Current.AssaSetBackgroundBox.BoxColor; + panelOutlineColor.Left = buttonOutlineColor.Right + 3; + buttonForeColor.Left = buttonOutlineColor.Left; + panelForeColor.Left = panelOutlineColor.Left; + buttonForeColor.Text = LanguageSettings.Current.Settings.WaveformTextColor; + + _isAssa = format.GetType() == typeof(AdvancedSubStationAlpha); + + checkBoxFontBold.Checked = Configuration.Settings.Tools.GenVideoFontBold; + numericUpDownOutline.Value = Configuration.Settings.Tools.GenVideoOutline; + + var initialFont = Configuration.Settings.Tools.GenVideoFontName; + if (string.IsNullOrEmpty(initialFont)) + { + initialFont = Configuration.Settings.Tools.ExportBluRayFontName; + } + labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn; + if (string.IsNullOrEmpty(initialFont)) + { + initialFont = UiUtil.GetDefaultFont().Name; + } + + foreach (var x in FontHelper.GetRegularOrBoldCapableFontFamilies()) + { + comboBoxSubtitleFont.Items.Add(x.Name); + if (x.Name.Equals(initialFont, StringComparison.OrdinalIgnoreCase)) + { + comboBoxSubtitleFont.SelectedIndex = comboBoxSubtitleFont.Items.Count - 1; + } + } + if (comboBoxSubtitleFont.SelectedIndex < 0 && comboBoxSubtitleFont.Items.Count > 0) + { + comboBoxSubtitleFont.SelectedIndex = 0; + } + + if (Configuration.Settings.Tools.GenVideoFontSize >= numericUpDownFontSize.Minimum && + Configuration.Settings.Tools.GenVideoFontSize >= numericUpDownFontSize.Minimum) + { + numericUpDownFontSize.Value = Configuration.Settings.Tools.GenVideoFontSize; + } + + checkBoxRightToLeft.Checked = Configuration.Settings.General.RightToLeftMode && LanguageAutoDetect.CouldBeRightToLeftLanguage(_assaSubtitle); + textBoxLog.Visible = false; + + UiUtil.FixLargeFonts(this, buttonGenerate); + UiUtil.FixFonts(this, 2000); + + comboBoxFrameRate.Items.Clear(); + comboBoxFrameRate.Items.Add("23.976"); + comboBoxFrameRate.Items.Add("24"); + comboBoxFrameRate.Items.Add("25"); + comboBoxFrameRate.Items.Add("29.97"); + comboBoxFrameRate.Items.Add("30"); + comboBoxFrameRate.Items.Add("50"); + comboBoxFrameRate.Items.Add("59.94"); + comboBoxFrameRate.Items.Add("60"); + comboBoxFrameRate.SelectedIndex = 2; + + FontEnableOrDisable(_isAssa); + } + + private void FontEnableOrDisable(bool assa) + { + var enabled = !assa; + + numericUpDownFontSize.Enabled = enabled; + numericUpDownFontSize.Enabled = enabled; + labelFontSize.Enabled = enabled; + nikseLabelOutline.Enabled = enabled; + labelSubtitleFont.Enabled = enabled; + comboBoxSubtitleFont.Enabled = enabled; + checkBoxAlignRight.Enabled = enabled; + checkBoxBox.Enabled = enabled; + checkBoxFontBold.Enabled = enabled; + numericUpDownOutline.Enabled = enabled; + buttonForeColor.Enabled = enabled; + buttonOutlineColor.Enabled = enabled; + panelOutlineColor.Enabled = enabled; + panelForeColor.Enabled = enabled; + + if (assa) + { + labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn; + } + else + { + labelInfo.Text = string.Empty; + } + } + + private void FixRightToLeft(Subtitle subtitle) + { + if (!checkBoxRightToLeft.Checked) + { + return; + } + + for (var index = 0; index < subtitle.Paragraphs.Count; index++) + { + var paragraph = subtitle.Paragraphs[index]; + if (LanguageAutoDetect.ContainsRightToLeftLetter(paragraph.Text)) + { + paragraph.Text = Utilities.FixRtlViaUnicodeChars(paragraph.Text); + } + } + } + + private void SetStyleForNonAssa(Subtitle sub) + { + sub.Header = AdvancedSubStationAlpha.DefaultHeader; + var style = AdvancedSubStationAlpha.GetSsaStyle("Default", sub.Header); + style.FontSize = numericUpDownFontSize.Value; + style.Bold = checkBoxFontBold.Checked; + style.FontName = comboBoxSubtitleFont.Text; + style.Background = panelOutlineColor.BackColor; + style.Primary = panelForeColor.BackColor; + style.OutlineWidth = numericUpDownOutline.Value; + style.ShadowWidth = style.OutlineWidth * 0.5m; + + if (checkBoxAlignRight.Checked) + { + style.Alignment = "3"; + } + + if (checkBoxBox.Checked) + { + style.BorderStyle = "4"; // box - multi line + style.ShadowWidth = 0; + style.OutlineWidth = numericUpDownOutline.Value; + } + else + { + style.Outline = panelOutlineColor.BackColor; + } + + sub.Header = AdvancedSubStationAlpha.GetHeaderAndStylesFromAdvancedSubStationAlpha(sub.Header, new List { style }); + sub.Header = AdvancedSubStationAlpha.AddTagToHeader("PlayResX", "PlayResX: " + ((int)numericUpDownWidth.Value).ToString(CultureInfo.InvariantCulture), "[Script Info]", sub.Header); + sub.Header = AdvancedSubStationAlpha.AddTagToHeader("PlayResY", "PlayResY: " + ((int)numericUpDownHeight.Value).ToString(CultureInfo.InvariantCulture), "[Script Info]", sub.Header); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + } + + private void buttonGenerate_Click(object sender, EventArgs e) + { + CalculateTotalFrames(); + + labelProgress.Text = string.Empty; + labelProgress.ForeColor = UiUtil.ForeColor; + + _log = new StringBuilder(); + buttonGenerate.Enabled = false; + var oldFontSizeEnabled = numericUpDownFontSize.Enabled; + numericUpDownFontSize.Enabled = false; + + Stopwatch stopWatch; + using (var saveDialog = new SaveFileDialog + { + FileName = SuggestNewVideoFileName(), + Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm|mov|*.mov", + AddExtension = true, + InitialDirectory = string.IsNullOrEmpty(_assaSubtitle.FileName) ? string.Empty : Path.GetDirectoryName(_assaSubtitle.FileName), + }) + { + if (saveDialog.ShowDialog(this) != DialogResult.OK) + { + buttonGenerate.Enabled = true; + numericUpDownFontSize.Enabled = true; + return; + } + + VideoFileName = saveDialog.FileName; + } + + stopWatch = Stopwatch.StartNew(); + if (!ConvertVideo(oldFontSizeEnabled, _assaSubtitle)) + { + buttonGenerate.Enabled = true; + numericUpDownFontSize.Enabled = true; + progressBar1.Visible = false; + labelPleaseWait.Visible = false; + timer1.Stop(); + MillisecondsEncoding = stopWatch.ElapsedMilliseconds; + labelProgress.Text = string.Empty; + groupBoxSettings.Enabled = true; + + if (!_abort && _log.ToString().Length > 10) + { + var title = "Error occurred during encoding"; + if (_log.ToString().Contains("Cannot load nvcuda.dll")) + { + title = "Error: Cannot load nvcuda.dll"; + } + else if (_log.ToString().Contains("amfrt64.dll")) + { + title = "Error: Cannot load amfrt64.dll"; + } + else if (_log.ToString().Contains("The minimum required Nvidia driver for nvenc is")) + { + title = "Nvidia driver needs updating"; + } + + MessageBox.Show($"Encoding with ffmpeg failed: {Environment.NewLine}{_log}", title, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + return; + } + + progressBar1.Visible = false; + labelPleaseWait.Visible = false; + timer1.Stop(); + MillisecondsEncoding = stopWatch.ElapsedMilliseconds; + labelProgress.Text = string.Empty; + groupBoxSettings.Enabled = true; + + if (_abort) + { + DialogResult = DialogResult.Cancel; + buttonGenerate.Enabled = true; + numericUpDownFontSize.Enabled = true; + return; + } + + if (!File.Exists(VideoFileName) || new FileInfo(VideoFileName).Length == 0) + { + SeLogger.Error(Environment.NewLine + "Generate video failed: " + Environment.NewLine + _log); + MessageBox.Show("Generate embedded video failed" + Environment.NewLine + + "For more info see the error log: " + SeLogger.ErrorFile); + buttonGenerate.Enabled = true; + numericUpDownFontSize.Enabled = oldFontSizeEnabled; + return; + } + + var encodingTime = new TimeCode(MillisecondsEncoding).ToString(); + using (var f = new ExportPngXmlDialogOpenFolder(string.Format(LanguageSettings.Current.GenerateVideoWithBurnedInSubs.XGeneratedWithBurnedInSubsInX, Path.GetFileName(VideoFileName), encodingTime), Path.GetDirectoryName(VideoFileName), VideoFileName)) + { + f.ShowDialog(this); + } + + buttonGenerate.Enabled = true; + numericUpDownFontSize.Enabled = true; + } + + private void CalculateTotalFrames() + { + var seconds = _assaSubtitle.Paragraphs.Max(p => p.EndTime.TotalSeconds); + var frameRate = double.Parse(comboBoxFrameRate.Text, CultureInfo.InvariantCulture); + _totalFrames = (long)Math.Round(seconds * frameRate, MidpointRounding.AwayFromZero) + 1; + } + + private static string GetAssaFileName(string inputVideoFileName) + { + var path = string.IsNullOrEmpty(inputVideoFileName) ? string.Empty : Path.GetDirectoryName(inputVideoFileName); + for (var i = 0; i < int.MaxValue; i++) + { + var guidLetters = Guid.NewGuid().ToString().RemoveChar('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-'); + var fileName = Path.Combine(path, $"{guidLetters}.ass"); + if (!File.Exists(fileName)) + { + return fileName; + } + } + + return Path.Combine(path, "qwerty12.ass"); + } + + private string SuggestNewVideoFileName() + { + var fileName = Path.GetFileNameWithoutExtension(_assaSubtitle.FileName); + + fileName += ".transparent-subs"; + + if (numericUpDownWidth.Value > 0 && numericUpDownHeight.Value > 0) + { + fileName += $".{numericUpDownWidth.Value}x{numericUpDownHeight.Value}"; + } + + return fileName.Replace(".", "_") + ".mp4"; + } + + private bool ConvertVideo(bool oldFontSizeEnabled, Subtitle subtitle) + { + if (File.Exists(VideoFileName)) + { + try + { + File.Delete(VideoFileName); + } + catch + { + MessageBox.Show($"Cannot overwrite video file {VideoFileName} - probably in use!"); + buttonGenerate.Enabled = true; + numericUpDownFontSize.Enabled = oldFontSizeEnabled; + return false; + } + } + + _log = new StringBuilder(); + + if (_videoInfo != null) + { + _log.AppendLine("Video info width: " + _videoInfo.Width); + _log.AppendLine("Video info width: " + _videoInfo.Height); + _log.AppendLine("Video info total frames: " + _videoInfo.TotalFrames); + _log.AppendLine("Video info total seconds: " + _videoInfo.TotalSeconds); + } + + if (!_isAssa) + { + SetStyleForNonAssa(subtitle); + } + + FixRightToLeft(subtitle); + + var format = new AdvancedSubStationAlpha(); + var assaTempFileName = GetAssaFileName(_assaSubtitle.FileName); + + if (Configuration.Settings.General.CurrentVideoIsSmpte && comboBoxFrameRate.Text.Contains(".", StringComparison.Ordinal)) + { + foreach (var assaP in subtitle.Paragraphs) + { + assaP.StartTime.TotalMilliseconds *= 1.001; + assaP.EndTime.TotalMilliseconds *= 1.001; + } + } + + FileUtil.WriteAllText(assaTempFileName, format.ToText(subtitle, null), new TextEncoding(Encoding.UTF8, "UTF8")); + + groupBoxSettings.Enabled = false; + labelPleaseWait.Visible = true; + labelPleaseWait.Text = LanguageSettings.Current.General.PleaseWait; + + if (_totalFrames > 0) + { + progressBar1.Visible = true; + } + + var result = RunOnePassEncoding(assaTempFileName); + + try + { + File.Delete(assaTempFileName); + } + catch + { + // ignore + } + + return result; + } + + private bool CheckForPromptParameters(Process process, string title) + { + if (!_promptFFmpegParameters) + { + return true; + } + + using (var form = new GenerateVideoFFmpegPrompt(title, process.StartInfo.Arguments)) + { + if (form.ShowDialog(this) != DialogResult.OK) + { + return false; + } + + _log.AppendLine("ffmpeg arguments custom: " + process.StartInfo.Arguments); + process.StartInfo.Arguments = form.Parameters; + } + + return true; + } + + private Process GetFfmpegProcess(string outputVideoFileName, string assaTempFileName) + { + return VideoPreviewGenerator.GenerateTransparentVideoFile( + assaTempFileName, + outputVideoFileName, + (int)numericUpDownWidth.Value, + (int)numericUpDownHeight.Value, + comboBoxFrameRate.Text, + OutputHandler); + } + + private void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine) + { + if (string.IsNullOrWhiteSpace(outLine.Data)) + { + return; + } + + _log?.AppendLine(outLine.Data); + + var match = FrameFinderRegex.Match(outLine.Data); + if (!match.Success) + { + return; + } + + var arr = match.Value.Split('='); + if (arr.Length != 2) + { + return; + } + + if (long.TryParse(arr[1].Trim(), out var f)) + { + _processedFrames = f; + } + } + + private bool RunOnePassEncoding(string assaTempFileName) + { + var process = GetFfmpegProcess(VideoFileName, assaTempFileName); + _log.AppendLine("ffmpeg arguments: " + process.StartInfo.Arguments); + + if (!CheckForPromptParameters(process, Text)) + { + _abort = true; + return false; + } + + process.Start(); + process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + _startTicks = DateTime.UtcNow.Ticks; + timer1.Start(); + + while (!process.HasExited) + { + Application.DoEvents(); + WindowsHelper.PreventStandBy(); + System.Threading.Thread.Sleep(100); + if (_abort) + { + process.Kill(); + return false; + } + + var v = (int)_processedFrames; + SetProgress(v); + } + + if (_abort) + { + return false; + } + + if (process.ExitCode != 0) + { + _log.AppendLine("ffmpeg exit code: " + process.ExitCode); + return false; + } + + return true; + } + + private void SetProgress(int v) + { + if (_totalFrames == 0) + { + progressBar1.Value = progressBar1.Maximum; + } + + var pct = Math.Min(progressBar1.Maximum, (int)Math.Round(v * 100.0 / _totalFrames, MidpointRounding.AwayFromZero)); + if (pct >= progressBar1.Minimum && pct <= progressBar1.Maximum && _totalFrames > 0) + { + progressBar1.Value = pct; + } + } + + private void timer1_Tick(object sender, EventArgs e) + { + if (_processedFrames <= 0) + { + return; + } + + var durationMs = (DateTime.UtcNow.Ticks - _startTicks) / 10_000; + var msPerFrame = (float)durationMs / _processedFrames; + var estimatedTotalMs = msPerFrame * _totalFrames; + var estimatedLeft = ProgressHelper.ToProgressTime(estimatedTotalMs - durationMs); + labelProgress.Text = estimatedLeft; + } + + private void promptParameterBeforeGenerateToolStripMenuItem_Click(object sender, EventArgs e) + { + _promptFFmpegParameters = true; + buttonGenerate_Click(null, null); + } + + private void ResolutionPickClick(object sender, EventArgs e) + { + labelX.Left = numericUpDownWidth.Left + numericUpDownWidth.Width + 3; + numericUpDownWidth.Visible = true; + labelX.Text = "x"; + numericUpDownHeight.Visible = true; + + var text = (sender as ToolStripMenuItem).Text; + var match = new Regex("\\d+x\\d+").Match(text); + var parts = match.Value.Split('x'); + numericUpDownWidth.Value = int.Parse(parts[0]); + numericUpDownHeight.Value = int.Parse(parts[1]); + } + + private void buttonVideoChooseStandardRes_Click(object sender, EventArgs e) + { + var coordinates = buttonVideoChooseStandardRes.PointToClient(Cursor.Position); + contextMenuStripRes.Show(buttonVideoChooseStandardRes, coordinates); + } + } +} diff --git a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.resx b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.resx new file mode 100644 index 000000000..7d8aa3df9 --- /dev/null +++ b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6, 10 + + + 185, 10 + + + 352, 10 + + + 440, 10 + + \ No newline at end of file diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index e6d9da106..62941ad46 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -36901,13 +36901,15 @@ namespace Nikse.SubtitleEdit.Forms private void generaeTransparentVideoWithSubtitleToolStripMenuItem_Click(object sender, EventArgs e) { - using (var saveDialog = new SaveFileDialog + if (!IsSubtitleLoaded) { - FileName = string.Empty, - Filter = "mkv|*.mkv|mp4|*.mp4|mov|*.mov" - }) + DisplaySubtitleNotLoadedMessage(); + return; + } + + using (var form = new GenerateTransparentVideoWithSubtitles(_subtitle, GetCurrentSubtitleFormat(), _videoInfo)) { - if (saveDialog.ShowDialog(this) != DialogResult.OK) + if (form.ShowDialog(this) != DialogResult.OK) { return; } diff --git a/src/ui/Logic/VideoPreviewGenerator.cs b/src/ui/Logic/VideoPreviewGenerator.cs index 28338011e..206179911 100644 --- a/src/ui/Logic/VideoPreviewGenerator.cs +++ b/src/ui/Logic/VideoPreviewGenerator.cs @@ -682,5 +682,36 @@ namespace Nikse.SubtitleEdit.Logic return processMakeVideo; } + + public static Process GenerateTransparentVideoFile(string assaSubtitleFileName, string outputVideoFileName, int width, int height, string frameRate, DataReceivedEventHandler dataReceivedHandler) + { + if (width % 2 == 1) + { + width++; + } + + if (height % 2 == 1) + { + height++; + } + + outputVideoFileName = $"\"{outputVideoFileName}\""; + + var processMakeVideo = new Process + { + StartInfo = + { + FileName = GetFfmpegLocation(), + Arguments = $" -y -f lavfi -i \"color=c=black@0.0:s={width}x{height}:r={frameRate}:d=00\\\\:00\\\\:30,format=rgba,subtitles=f={Path.GetFileName(assaSubtitleFileName)}:alpha=1\" -c:v png {outputVideoFileName}".TrimStart(), + UseShellExecute = false, + CreateNoWindow = true, + WorkingDirectory = Path.GetDirectoryName(assaSubtitleFileName) ?? string.Empty, + } + }; + + processMakeVideo.StartInfo.Arguments = processMakeVideo.StartInfo.Arguments.Trim(); + SetupDataReceiveHandler(dataReceivedHandler, processMakeVideo); + return processMakeVideo; + } } } From d7af38dda068738b726cdf4876710c11df933d1d Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 08:36:46 +0200 Subject: [PATCH 33/42] Work on #8534 --- src/libse/Settings/Settings.cs | 7 + src/libse/Settings/ToolsSettings.cs | 1 + ...eTransparentVideoWithSubtitles.Designer.cs | 594 +++++++++--------- .../GenerateTransparentVideoWithSubtitles.cs | 90 ++- src/ui/Forms/Main.Designer.cs | 70 +-- src/ui/Forms/Main.cs | 1 + src/ui/Forms/Main.resx | 9 +- src/ui/Logic/Language.cs | 1 + src/ui/Logic/LanguageStructure.cs | 1 + 9 files changed, 398 insertions(+), 376 deletions(-) diff --git a/src/libse/Settings/Settings.cs b/src/libse/Settings/Settings.cs index a256051ac..15d74bd63 100644 --- a/src/libse/Settings/Settings.cs +++ b/src/libse/Settings/Settings.cs @@ -4000,6 +4000,12 @@ namespace Nikse.SubtitleEdit.Core.Settings settings.Tools.GenVideoNonAssaBox = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture); } + subNode = node.SelectSingleNode("GenTransparentVideoNonAssaBox"); + if (subNode != null) + { + settings.Tools.GenTransparentVideoNonAssaBox = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture); + } + subNode = node.SelectSingleNode("GenVideoNonAssaBoxColor"); if (subNode != null) { @@ -9169,6 +9175,7 @@ namespace Nikse.SubtitleEdit.Core.Settings textWriter.WriteElementString("GenVideoTargetFileSize", settings.Tools.GenVideoTargetFileSize.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("GenVideoFontSizePercentOfHeight", settings.Tools.GenVideoFontSizePercentOfHeight.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("GenVideoNonAssaBox", settings.Tools.GenVideoNonAssaBox.ToString(CultureInfo.InvariantCulture)); + textWriter.WriteElementString("GenTransparentVideoNonAssaBox", settings.Tools.GenTransparentVideoNonAssaBox.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("GenVideoNonAssaBoxColor", ToHtml(settings.Tools.GenVideoNonAssaBoxColor)); textWriter.WriteElementString("GenVideoNonAssaTextColor", ToHtml(settings.Tools.GenVideoNonAssaTextColor)); textWriter.WriteElementString("GenVideoNonAssaAlignRight", settings.Tools.GenVideoNonAssaAlignRight.ToString(CultureInfo.InvariantCulture)); diff --git a/src/libse/Settings/ToolsSettings.cs b/src/libse/Settings/ToolsSettings.cs index eb4053d2b..fb64bfe62 100644 --- a/src/libse/Settings/ToolsSettings.cs +++ b/src/libse/Settings/ToolsSettings.cs @@ -377,6 +377,7 @@ namespace Nikse.SubtitleEdit.Core.Settings public bool GenVideoTargetFileSize { get; set; } public float GenVideoFontSizePercentOfHeight { get; set; } public bool GenVideoNonAssaBox { get; set; } + public bool GenTransparentVideoNonAssaBox { get; set; } public Color GenVideoNonAssaBoxColor { get; set; } public Color GenVideoNonAssaTextColor { get; set; } public bool GenVideoNonAssaAlignRight { get; set; } diff --git a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs index b7684444b..85c5025b8 100644 --- a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs +++ b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.Designer.cs @@ -37,12 +37,6 @@ this.addFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripBatch = new System.Windows.Forms.ContextMenuStrip(this.components); this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.numericUpDownFontSize = new Nikse.SubtitleEdit.Controls.NikseUpDown(); - this.labelFontSize = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.labelPass = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.labelProgress = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.labelPleaseWait = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.textBoxLog = new Nikse.SubtitleEdit.Controls.NikseTextBox(); this.bAspectRatio916180270ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aAspectRatio916270480ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.bAspectRatio916360540ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -61,11 +55,7 @@ this.k2048x1080ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.uHD3840x2160ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.x2160ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.useSourceResolutionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripRes = new System.Windows.Forms.ContextMenuStrip(this.components); - this.nikseLabelOutline = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.numericUpDownOutline = new Nikse.SubtitleEdit.Controls.NikseUpDown(); this.checkBoxFontBold = new System.Windows.Forms.CheckBox(); this.panelForeColor = new System.Windows.Forms.Panel(); this.panelOutlineColor = new System.Windows.Forms.Panel(); @@ -74,24 +64,32 @@ this.buttonForeColor = new System.Windows.Forms.Button(); this.checkBoxBox = new System.Windows.Forms.CheckBox(); this.checkBoxAlignRight = new System.Windows.Forms.CheckBox(); - this.labelInfo = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.checkBoxRightToLeft = new System.Windows.Forms.CheckBox(); - this.comboBoxSubtitleFont = new Nikse.SubtitleEdit.Controls.NikseComboBox(); - this.labelSubtitleFont = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.groupBoxVideo = new System.Windows.Forms.GroupBox(); - this.labelFrameRate = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.comboBoxFrameRate = new Nikse.SubtitleEdit.Controls.NikseComboBox(); this.buttonVideoChooseStandardRes = new System.Windows.Forms.Button(); - this.labelResolution = new Nikse.SubtitleEdit.Controls.NikseLabel(); - this.numericUpDownWidth = new Nikse.SubtitleEdit.Controls.NikseUpDown(); - this.numericUpDownHeight = new Nikse.SubtitleEdit.Controls.NikseUpDown(); - this.labelX = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.buttonCancel = new System.Windows.Forms.Button(); this.promptParameterBeforeGenerateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripGenerate = new System.Windows.Forms.ContextMenuStrip(this.components); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.buttonGenerate = new System.Windows.Forms.Button(); + this.labelPass = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.labelProgress = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.labelPleaseWait = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.textBoxLog = new Nikse.SubtitleEdit.Controls.NikseTextBox(); + this.nikseLabelOutline = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.numericUpDownOutline = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.labelInfo = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.comboBoxSubtitleFont = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.labelSubtitleFont = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.labelFrameRate = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.comboBoxFrameRate = new Nikse.SubtitleEdit.Controls.NikseComboBox(); + this.labelResolution = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.numericUpDownWidth = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.numericUpDownHeight = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.labelX = new Nikse.SubtitleEdit.Controls.NikseLabel(); + this.numericUpDownFontSize = new Nikse.SubtitleEdit.Controls.NikseUpDown(); + this.labelFontSize = new Nikse.SubtitleEdit.Controls.NikseLabel(); this.contextMenuStripBatch.SuspendLayout(); this.contextMenuStripRes.SuspendLayout(); this.groupBoxSettings.SuspendLayout(); @@ -152,92 +150,6 @@ this.clearToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.clearToolStripMenuItem.Text = "Clear"; // - // numericUpDownFontSize - // - this.numericUpDownFontSize.BackColor = System.Drawing.SystemColors.Window; - this.numericUpDownFontSize.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); - this.numericUpDownFontSize.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); - this.numericUpDownFontSize.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); - this.numericUpDownFontSize.ButtonForeColor = System.Drawing.SystemColors.ControlText; - this.numericUpDownFontSize.ButtonForeColorDown = System.Drawing.Color.Orange; - this.numericUpDownFontSize.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.numericUpDownFontSize.DecimalPlaces = 0; - this.numericUpDownFontSize.Increment = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.numericUpDownFontSize.Location = new System.Drawing.Point(120, 25); - this.numericUpDownFontSize.Maximum = new decimal(new int[] { - 1000, - 0, - 0, - 0}); - this.numericUpDownFontSize.Minimum = new decimal(new int[] { - 3, - 0, - 0, - 0}); - this.numericUpDownFontSize.Name = "numericUpDownFontSize"; - this.numericUpDownFontSize.Size = new System.Drawing.Size(54, 20); - this.numericUpDownFontSize.TabIndex = 10; - this.numericUpDownFontSize.TabStop = false; - this.numericUpDownFontSize.ThousandsSeparator = false; - this.numericUpDownFontSize.Value = new decimal(new int[] { - 50, - 0, - 0, - 0}); - // - // labelFontSize - // - this.labelFontSize.AutoSize = true; - this.labelFontSize.Location = new System.Drawing.Point(19, 27); - this.labelFontSize.Name = "labelFontSize"; - this.labelFontSize.Size = new System.Drawing.Size(49, 13); - this.labelFontSize.TabIndex = 0; - this.labelFontSize.Text = "Font size"; - // - // labelPass - // - this.labelPass.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.labelPass.AutoSize = true; - this.labelPass.Location = new System.Drawing.Point(279, 295); - this.labelPass.Name = "labelPass"; - this.labelPass.Size = new System.Drawing.Size(51, 13); - this.labelPass.TabIndex = 149; - this.labelPass.Text = "Pass one"; - // - // labelProgress - // - this.labelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.labelProgress.AutoSize = true; - this.labelProgress.Location = new System.Drawing.Point(12, 325); - this.labelProgress.Name = "labelProgress"; - this.labelProgress.Size = new System.Drawing.Size(88, 13); - this.labelProgress.TabIndex = 147; - this.labelProgress.Text = "Remaining time..."; - // - // labelPleaseWait - // - this.labelPleaseWait.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.labelPleaseWait.AutoSize = true; - this.labelPleaseWait.Location = new System.Drawing.Point(12, 295); - this.labelPleaseWait.Name = "labelPleaseWait"; - this.labelPleaseWait.Size = new System.Drawing.Size(70, 13); - this.labelPleaseWait.TabIndex = 146; - this.labelPleaseWait.Text = "Please wait..."; - // - // textBoxLog - // - this.textBoxLog.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); - this.textBoxLog.Location = new System.Drawing.Point(32, 7); - this.textBoxLog.Multiline = true; - this.textBoxLog.Name = "textBoxLog"; - this.textBoxLog.ReadOnly = true; - this.textBoxLog.Size = new System.Drawing.Size(188, 26); - this.textBoxLog.TabIndex = 148; - // // bAspectRatio916180270ToolStripMenuItem // this.bAspectRatio916180270ToolStripMenuItem.Name = "bAspectRatio916180270ToolStripMenuItem"; @@ -362,22 +274,9 @@ this.x2160ToolStripMenuItem.Text = "4K DCI - Aspect Ratio 16∶9 - (4096x2160)"; this.x2160ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick); // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(364, 6); - // - // useSourceResolutionToolStripMenuItem - // - this.useSourceResolutionToolStripMenuItem.Name = "useSourceResolutionToolStripMenuItem"; - this.useSourceResolutionToolStripMenuItem.Size = new System.Drawing.Size(367, 22); - this.useSourceResolutionToolStripMenuItem.Text = "Use source resolution"; - // // contextMenuStripRes // this.contextMenuStripRes.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.useSourceResolutionToolStripMenuItem, - this.toolStripSeparator3, this.x2160ToolStripMenuItem, this.uHD3840x2160ToolStripMenuItem, this.k2048x1080ToolStripMenuItem, @@ -397,7 +296,237 @@ this.aAspectRatio916270480ToolStripMenuItem, this.bAspectRatio916180270ToolStripMenuItem}); this.contextMenuStripRes.Name = "contextMenuStripRes"; - this.contextMenuStripRes.Size = new System.Drawing.Size(368, 412); + this.contextMenuStripRes.Size = new System.Drawing.Size(368, 406); + // + // checkBoxFontBold + // + this.checkBoxFontBold.AutoSize = true; + this.checkBoxFontBold.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.checkBoxFontBold.Location = new System.Drawing.Point(187, 31); + this.checkBoxFontBold.Name = "checkBoxFontBold"; + this.checkBoxFontBold.Size = new System.Drawing.Size(51, 17); + this.checkBoxFontBold.TabIndex = 20; + this.checkBoxFontBold.Text = "Bold"; + this.checkBoxFontBold.UseVisualStyleBackColor = true; + // + // panelForeColor + // + this.panelForeColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelForeColor.Location = new System.Drawing.Point(369, 28); + this.panelForeColor.Name = "panelForeColor"; + this.panelForeColor.Size = new System.Drawing.Size(21, 21); + this.panelForeColor.TabIndex = 6; + this.panelForeColor.Click += new System.EventHandler(this.panelForeColor_Click); + // + // panelOutlineColor + // + this.panelOutlineColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelOutlineColor.Location = new System.Drawing.Point(369, 56); + this.panelOutlineColor.Name = "panelOutlineColor"; + this.panelOutlineColor.Size = new System.Drawing.Size(21, 20); + this.panelOutlineColor.TabIndex = 4; + this.panelOutlineColor.Click += new System.EventHandler(this.panelOutlineColor_Click); + // + // buttonOutlineColor + // + this.buttonOutlineColor.Location = new System.Drawing.Point(274, 54); + this.buttonOutlineColor.Name = "buttonOutlineColor"; + this.buttonOutlineColor.Size = new System.Drawing.Size(89, 23); + this.buttonOutlineColor.TabIndex = 60; + this.buttonOutlineColor.Text = "Color"; + this.buttonOutlineColor.UseVisualStyleBackColor = true; + this.buttonOutlineColor.Click += new System.EventHandler(this.buttonOutlineColor_Click); + // + // groupBoxSettings + // + this.groupBoxSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxSettings.Controls.Add(this.nikseLabelOutline); + this.groupBoxSettings.Controls.Add(this.numericUpDownOutline); + this.groupBoxSettings.Controls.Add(this.checkBoxFontBold); + this.groupBoxSettings.Controls.Add(this.panelForeColor); + this.groupBoxSettings.Controls.Add(this.buttonForeColor); + this.groupBoxSettings.Controls.Add(this.panelOutlineColor); + this.groupBoxSettings.Controls.Add(this.buttonOutlineColor); + this.groupBoxSettings.Controls.Add(this.checkBoxBox); + this.groupBoxSettings.Controls.Add(this.checkBoxAlignRight); + this.groupBoxSettings.Controls.Add(this.labelInfo); + this.groupBoxSettings.Controls.Add(this.checkBoxRightToLeft); + this.groupBoxSettings.Controls.Add(this.comboBoxSubtitleFont); + this.groupBoxSettings.Controls.Add(this.labelSubtitleFont); + this.groupBoxSettings.Controls.Add(this.groupBoxVideo); + this.groupBoxSettings.Controls.Add(this.numericUpDownFontSize); + this.groupBoxSettings.Controls.Add(this.labelFontSize); + this.groupBoxSettings.Location = new System.Drawing.Point(12, 6); + this.groupBoxSettings.Name = "groupBoxSettings"; + this.groupBoxSettings.Size = new System.Drawing.Size(576, 260); + this.groupBoxSettings.TabIndex = 144; + this.groupBoxSettings.TabStop = false; + this.groupBoxSettings.Text = "Settings"; + // + // buttonForeColor + // + this.buttonForeColor.Location = new System.Drawing.Point(274, 25); + this.buttonForeColor.Name = "buttonForeColor"; + this.buttonForeColor.Size = new System.Drawing.Size(89, 23); + this.buttonForeColor.TabIndex = 30; + this.buttonForeColor.Text = "Color"; + this.buttonForeColor.UseVisualStyleBackColor = true; + this.buttonForeColor.Click += new System.EventHandler(this.buttonForeColor_Click); + // + // checkBoxBox + // + this.checkBoxBox.AutoSize = true; + this.checkBoxBox.Location = new System.Drawing.Point(187, 60); + this.checkBoxBox.Name = "checkBoxBox"; + this.checkBoxBox.Size = new System.Drawing.Size(44, 17); + this.checkBoxBox.TabIndex = 50; + this.checkBoxBox.Text = "Box"; + this.checkBoxBox.UseVisualStyleBackColor = true; + // + // checkBoxAlignRight + // + this.checkBoxAlignRight.AutoSize = true; + this.checkBoxAlignRight.Location = new System.Drawing.Point(218, 114); + this.checkBoxAlignRight.Name = "checkBoxAlignRight"; + this.checkBoxAlignRight.Size = new System.Drawing.Size(72, 17); + this.checkBoxAlignRight.TabIndex = 76; + this.checkBoxAlignRight.Text = "Align right"; + this.checkBoxAlignRight.UseVisualStyleBackColor = true; + // + // checkBoxRightToLeft + // + this.checkBoxRightToLeft.AutoSize = true; + this.checkBoxRightToLeft.Location = new System.Drawing.Point(120, 114); + this.checkBoxRightToLeft.Name = "checkBoxRightToLeft"; + this.checkBoxRightToLeft.Size = new System.Drawing.Size(80, 17); + this.checkBoxRightToLeft.TabIndex = 75; + this.checkBoxRightToLeft.Text = "Right to left"; + this.checkBoxRightToLeft.UseVisualStyleBackColor = true; + // + // groupBoxVideo + // + this.groupBoxVideo.Controls.Add(this.labelFrameRate); + this.groupBoxVideo.Controls.Add(this.comboBoxFrameRate); + this.groupBoxVideo.Controls.Add(this.buttonVideoChooseStandardRes); + this.groupBoxVideo.Controls.Add(this.labelResolution); + this.groupBoxVideo.Controls.Add(this.numericUpDownWidth); + this.groupBoxVideo.Controls.Add(this.numericUpDownHeight); + this.groupBoxVideo.Controls.Add(this.labelX); + this.groupBoxVideo.Location = new System.Drawing.Point(6, 141); + this.groupBoxVideo.Name = "groupBoxVideo"; + this.groupBoxVideo.Size = new System.Drawing.Size(530, 89); + this.groupBoxVideo.TabIndex = 70; + this.groupBoxVideo.TabStop = false; + this.groupBoxVideo.Text = "Video"; + // + // buttonVideoChooseStandardRes + // + this.buttonVideoChooseStandardRes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.buttonVideoChooseStandardRes.Location = new System.Drawing.Point(257, 17); + this.buttonVideoChooseStandardRes.Name = "buttonVideoChooseStandardRes"; + this.buttonVideoChooseStandardRes.Size = new System.Drawing.Size(41, 23); + this.buttonVideoChooseStandardRes.TabIndex = 3; + this.buttonVideoChooseStandardRes.Text = "..."; + this.buttonVideoChooseStandardRes.UseVisualStyleBackColor = true; + this.buttonVideoChooseStandardRes.Click += new System.EventHandler(this.buttonVideoChooseStandardRes_Click); + // + // timer1 + // + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonCancel.Location = new System.Drawing.Point(463, 311); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(125, 23); + this.buttonCancel.TabIndex = 154; + this.buttonCancel.Text = "C&ancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // promptParameterBeforeGenerateToolStripMenuItem + // + this.promptParameterBeforeGenerateToolStripMenuItem.Name = "promptParameterBeforeGenerateToolStripMenuItem"; + this.promptParameterBeforeGenerateToolStripMenuItem.Size = new System.Drawing.Size(289, 22); + this.promptParameterBeforeGenerateToolStripMenuItem.Text = "Prompt FFmpeg parameter and generate"; + this.promptParameterBeforeGenerateToolStripMenuItem.Click += new System.EventHandler(this.promptParameterBeforeGenerateToolStripMenuItem_Click); + // + // contextMenuStripGenerate + // + this.contextMenuStripGenerate.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.promptParameterBeforeGenerateToolStripMenuItem}); + this.contextMenuStripGenerate.Name = "contextMenuStripGenerate"; + this.contextMenuStripGenerate.Size = new System.Drawing.Size(290, 26); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(12, 311); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(318, 11); + this.progressBar1.TabIndex = 145; + this.progressBar1.Visible = false; + // + // buttonGenerate + // + this.buttonGenerate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonGenerate.ContextMenuStrip = this.contextMenuStripGenerate; + this.buttonGenerate.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonGenerate.Location = new System.Drawing.Point(336, 311); + this.buttonGenerate.Name = "buttonGenerate"; + this.buttonGenerate.Size = new System.Drawing.Size(121, 23); + this.buttonGenerate.TabIndex = 153; + this.buttonGenerate.Text = "Generate"; + this.buttonGenerate.UseVisualStyleBackColor = true; + this.buttonGenerate.Click += new System.EventHandler(this.buttonGenerate_Click); + // + // labelPass + // + this.labelPass.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.labelPass.AutoSize = true; + this.labelPass.Location = new System.Drawing.Point(279, 295); + this.labelPass.Name = "labelPass"; + this.labelPass.Size = new System.Drawing.Size(51, 13); + this.labelPass.TabIndex = 149; + this.labelPass.Text = "Pass one"; + // + // labelProgress + // + this.labelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelProgress.AutoSize = true; + this.labelProgress.Location = new System.Drawing.Point(12, 325); + this.labelProgress.Name = "labelProgress"; + this.labelProgress.Size = new System.Drawing.Size(88, 13); + this.labelProgress.TabIndex = 147; + this.labelProgress.Text = "Remaining time..."; + // + // labelPleaseWait + // + this.labelPleaseWait.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelPleaseWait.AutoSize = true; + this.labelPleaseWait.Location = new System.Drawing.Point(12, 295); + this.labelPleaseWait.Name = "labelPleaseWait"; + this.labelPleaseWait.Size = new System.Drawing.Size(70, 13); + this.labelPleaseWait.TabIndex = 146; + this.labelPleaseWait.Text = "Please wait..."; + // + // textBoxLog + // + this.textBoxLog.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.textBoxLog.Location = new System.Drawing.Point(32, 7); + this.textBoxLog.Multiline = true; + this.textBoxLog.Name = "textBoxLog"; + this.textBoxLog.ReadOnly = true; + this.textBoxLog.Size = new System.Drawing.Size(188, 26); + this.textBoxLog.TabIndex = 148; // // nikseLabelOutline // @@ -445,99 +574,6 @@ 0, 0}); // - // checkBoxFontBold - // - this.checkBoxFontBold.AutoSize = true; - this.checkBoxFontBold.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.checkBoxFontBold.Location = new System.Drawing.Point(187, 31); - this.checkBoxFontBold.Name = "checkBoxFontBold"; - this.checkBoxFontBold.Size = new System.Drawing.Size(51, 17); - this.checkBoxFontBold.TabIndex = 20; - this.checkBoxFontBold.Text = "Bold"; - this.checkBoxFontBold.UseVisualStyleBackColor = true; - // - // panelForeColor - // - this.panelForeColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelForeColor.Location = new System.Drawing.Point(369, 28); - this.panelForeColor.Name = "panelForeColor"; - this.panelForeColor.Size = new System.Drawing.Size(21, 21); - this.panelForeColor.TabIndex = 6; - // - // panelOutlineColor - // - this.panelOutlineColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelOutlineColor.Location = new System.Drawing.Point(369, 56); - this.panelOutlineColor.Name = "panelOutlineColor"; - this.panelOutlineColor.Size = new System.Drawing.Size(21, 20); - this.panelOutlineColor.TabIndex = 4; - // - // buttonOutlineColor - // - this.buttonOutlineColor.Location = new System.Drawing.Point(274, 54); - this.buttonOutlineColor.Name = "buttonOutlineColor"; - this.buttonOutlineColor.Size = new System.Drawing.Size(89, 23); - this.buttonOutlineColor.TabIndex = 60; - this.buttonOutlineColor.Text = "Color"; - this.buttonOutlineColor.UseVisualStyleBackColor = true; - // - // groupBoxSettings - // - this.groupBoxSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxSettings.Controls.Add(this.nikseLabelOutline); - this.groupBoxSettings.Controls.Add(this.numericUpDownOutline); - this.groupBoxSettings.Controls.Add(this.checkBoxFontBold); - this.groupBoxSettings.Controls.Add(this.panelForeColor); - this.groupBoxSettings.Controls.Add(this.buttonForeColor); - this.groupBoxSettings.Controls.Add(this.panelOutlineColor); - this.groupBoxSettings.Controls.Add(this.buttonOutlineColor); - this.groupBoxSettings.Controls.Add(this.checkBoxBox); - this.groupBoxSettings.Controls.Add(this.checkBoxAlignRight); - this.groupBoxSettings.Controls.Add(this.labelInfo); - this.groupBoxSettings.Controls.Add(this.checkBoxRightToLeft); - this.groupBoxSettings.Controls.Add(this.comboBoxSubtitleFont); - this.groupBoxSettings.Controls.Add(this.labelSubtitleFont); - this.groupBoxSettings.Controls.Add(this.groupBoxVideo); - this.groupBoxSettings.Controls.Add(this.numericUpDownFontSize); - this.groupBoxSettings.Controls.Add(this.labelFontSize); - this.groupBoxSettings.Location = new System.Drawing.Point(12, 6); - this.groupBoxSettings.Name = "groupBoxSettings"; - this.groupBoxSettings.Size = new System.Drawing.Size(576, 260); - this.groupBoxSettings.TabIndex = 144; - this.groupBoxSettings.TabStop = false; - this.groupBoxSettings.Text = "Settings"; - // - // buttonForeColor - // - this.buttonForeColor.Location = new System.Drawing.Point(274, 25); - this.buttonForeColor.Name = "buttonForeColor"; - this.buttonForeColor.Size = new System.Drawing.Size(89, 23); - this.buttonForeColor.TabIndex = 30; - this.buttonForeColor.Text = "Color"; - this.buttonForeColor.UseVisualStyleBackColor = true; - // - // checkBoxBox - // - this.checkBoxBox.AutoSize = true; - this.checkBoxBox.Location = new System.Drawing.Point(187, 60); - this.checkBoxBox.Name = "checkBoxBox"; - this.checkBoxBox.Size = new System.Drawing.Size(44, 17); - this.checkBoxBox.TabIndex = 50; - this.checkBoxBox.Text = "Box"; - this.checkBoxBox.UseVisualStyleBackColor = true; - // - // checkBoxAlignRight - // - this.checkBoxAlignRight.AutoSize = true; - this.checkBoxAlignRight.Location = new System.Drawing.Point(218, 114); - this.checkBoxAlignRight.Name = "checkBoxAlignRight"; - this.checkBoxAlignRight.Size = new System.Drawing.Size(72, 17); - this.checkBoxAlignRight.TabIndex = 76; - this.checkBoxAlignRight.Text = "Align right"; - this.checkBoxAlignRight.UseVisualStyleBackColor = true; - // // labelInfo // this.labelInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -548,16 +584,6 @@ this.labelInfo.TabIndex = 1; this.labelInfo.Text = "Info"; // - // checkBoxRightToLeft - // - this.checkBoxRightToLeft.AutoSize = true; - this.checkBoxRightToLeft.Location = new System.Drawing.Point(120, 114); - this.checkBoxRightToLeft.Name = "checkBoxRightToLeft"; - this.checkBoxRightToLeft.Size = new System.Drawing.Size(80, 17); - this.checkBoxRightToLeft.TabIndex = 75; - this.checkBoxRightToLeft.Text = "Right to left"; - this.checkBoxRightToLeft.UseVisualStyleBackColor = true; - // // comboBoxSubtitleFont // this.comboBoxSubtitleFont.BackColor = System.Drawing.SystemColors.Window; @@ -590,22 +616,6 @@ this.labelSubtitleFont.TabIndex = 7; this.labelSubtitleFont.Text = "Subtitle font"; // - // groupBoxVideo - // - this.groupBoxVideo.Controls.Add(this.labelFrameRate); - this.groupBoxVideo.Controls.Add(this.comboBoxFrameRate); - this.groupBoxVideo.Controls.Add(this.buttonVideoChooseStandardRes); - this.groupBoxVideo.Controls.Add(this.labelResolution); - this.groupBoxVideo.Controls.Add(this.numericUpDownWidth); - this.groupBoxVideo.Controls.Add(this.numericUpDownHeight); - this.groupBoxVideo.Controls.Add(this.labelX); - this.groupBoxVideo.Location = new System.Drawing.Point(6, 141); - this.groupBoxVideo.Name = "groupBoxVideo"; - this.groupBoxVideo.Size = new System.Drawing.Size(530, 89); - this.groupBoxVideo.TabIndex = 70; - this.groupBoxVideo.TabStop = false; - this.groupBoxVideo.Text = "Video"; - // // labelFrameRate // this.labelFrameRate.AutoSize = true; @@ -639,18 +649,6 @@ this.comboBoxFrameRate.TabStop = false; this.comboBoxFrameRate.UsePopupWindow = false; // - // buttonVideoChooseStandardRes - // - this.buttonVideoChooseStandardRes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.buttonVideoChooseStandardRes.Location = new System.Drawing.Point(257, 17); - this.buttonVideoChooseStandardRes.Name = "buttonVideoChooseStandardRes"; - this.buttonVideoChooseStandardRes.Size = new System.Drawing.Size(41, 23); - this.buttonVideoChooseStandardRes.TabIndex = 3; - this.buttonVideoChooseStandardRes.Text = "..."; - this.buttonVideoChooseStandardRes.UseVisualStyleBackColor = true; - this.buttonVideoChooseStandardRes.Click += new System.EventHandler(this.buttonVideoChooseStandardRes_Click); - // // labelResolution // this.labelResolution.AutoSize = true; @@ -743,60 +741,51 @@ this.labelX.TabIndex = 31; this.labelX.Text = "x"; // - // timer1 + // numericUpDownFontSize // - this.timer1.Interval = 1000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + this.numericUpDownFontSize.BackColor = System.Drawing.SystemColors.Window; + this.numericUpDownFontSize.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); + this.numericUpDownFontSize.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this.numericUpDownFontSize.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120))))); + this.numericUpDownFontSize.ButtonForeColor = System.Drawing.SystemColors.ControlText; + this.numericUpDownFontSize.ButtonForeColorDown = System.Drawing.Color.Orange; + this.numericUpDownFontSize.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215))))); + this.numericUpDownFontSize.DecimalPlaces = 0; + this.numericUpDownFontSize.Increment = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownFontSize.Location = new System.Drawing.Point(120, 25); + this.numericUpDownFontSize.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownFontSize.Minimum = new decimal(new int[] { + 3, + 0, + 0, + 0}); + this.numericUpDownFontSize.Name = "numericUpDownFontSize"; + this.numericUpDownFontSize.Size = new System.Drawing.Size(54, 20); + this.numericUpDownFontSize.TabIndex = 10; + this.numericUpDownFontSize.TabStop = false; + this.numericUpDownFontSize.ThousandsSeparator = false; + this.numericUpDownFontSize.Value = new decimal(new int[] { + 50, + 0, + 0, + 0}); // - // buttonCancel + // labelFontSize // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonCancel.Location = new System.Drawing.Point(463, 311); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(125, 23); - this.buttonCancel.TabIndex = 154; - this.buttonCancel.Text = "C&ancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); - // - // promptParameterBeforeGenerateToolStripMenuItem - // - this.promptParameterBeforeGenerateToolStripMenuItem.Name = "promptParameterBeforeGenerateToolStripMenuItem"; - this.promptParameterBeforeGenerateToolStripMenuItem.Size = new System.Drawing.Size(289, 22); - this.promptParameterBeforeGenerateToolStripMenuItem.Text = "Prompt FFmpeg parameter and generate"; - this.promptParameterBeforeGenerateToolStripMenuItem.Click += new System.EventHandler(this.promptParameterBeforeGenerateToolStripMenuItem_Click); - // - // contextMenuStripGenerate - // - this.contextMenuStripGenerate.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.promptParameterBeforeGenerateToolStripMenuItem}); - this.contextMenuStripGenerate.Name = "contextMenuStripGenerate"; - this.contextMenuStripGenerate.Size = new System.Drawing.Size(290, 26); - // - // progressBar1 - // - this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.progressBar1.Location = new System.Drawing.Point(12, 311); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(318, 11); - this.progressBar1.TabIndex = 145; - this.progressBar1.Visible = false; - // - // buttonGenerate - // - this.buttonGenerate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonGenerate.ContextMenuStrip = this.contextMenuStripGenerate; - this.buttonGenerate.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonGenerate.Location = new System.Drawing.Point(336, 311); - this.buttonGenerate.Name = "buttonGenerate"; - this.buttonGenerate.Size = new System.Drawing.Size(121, 23); - this.buttonGenerate.TabIndex = 153; - this.buttonGenerate.Text = "Generate"; - this.buttonGenerate.UseVisualStyleBackColor = true; - this.buttonGenerate.Click += new System.EventHandler(this.buttonGenerate_Click); + this.labelFontSize.AutoSize = true; + this.labelFontSize.Location = new System.Drawing.Point(19, 27); + this.labelFontSize.Name = "labelFontSize"; + this.labelFontSize.Size = new System.Drawing.Size(49, 13); + this.labelFontSize.TabIndex = 0; + this.labelFontSize.Text = "Font size"; // // GenerateTransparentVideoWithSubtitles // @@ -818,6 +807,7 @@ this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "GenerateTransparentVideoWithSubtitles"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GenerateTransparentVideoWithSubtitles_FormClosing); this.contextMenuStripBatch.ResumeLayout(false); this.contextMenuStripRes.ResumeLayout(false); this.groupBoxSettings.ResumeLayout(false); @@ -864,8 +854,6 @@ private System.Windows.Forms.ToolStripMenuItem k2048x1080ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem uHD3840x2160ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem x2160ToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripMenuItem useSourceResolutionToolStripMenuItem; private System.Windows.Forms.ContextMenuStrip contextMenuStripRes; private Controls.NikseLabel nikseLabelOutline; private Controls.NikseUpDown numericUpDownOutline; diff --git a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs index 97c859c9b..33f40ed44 100644 --- a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs +++ b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs @@ -28,7 +28,6 @@ namespace Nikse.SubtitleEdit.Forms public string VideoFileName { get; private set; } public long MillisecondsEncoding { get; private set; } - public GenerateTransparentVideoWithSubtitles(Subtitle subtitle, SubtitleFormat format, VideoInfo videoInfo) { UiUtil.PreInitialize(this); @@ -46,7 +45,7 @@ namespace Nikse.SubtitleEdit.Forms new AdvancedSubStationAlpha().LoadSubtitle(_assaSubtitle, raw.SplitToLines(), null); } - Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.Title; + Text = LanguageSettings.Current.Main.Menu.Video.GenerateTransparentVideoWithSubs.Trim('.'); buttonGenerate.Text = LanguageSettings.Current.Watermark.Generate; labelPleaseWait.Text = LanguageSettings.Current.General.PleaseWait; labelResolution.Text = LanguageSettings.Current.SubStationAlphaProperties.Resolution; @@ -74,7 +73,7 @@ namespace Nikse.SubtitleEdit.Forms groupBoxVideo.Text = LanguageSettings.Current.Main.Menu.Video.Title; promptParameterBeforeGenerateToolStripMenuItem.Text = LanguageSettings.Current.GenerateBlankVideo.GenerateWithFfmpegParametersPrompt; - checkBoxBox.Checked = Configuration.Settings.Tools.GenVideoNonAssaBox; + checkBoxBox.Checked = Configuration.Settings.Tools.GenTransparentVideoNonAssaBox; checkBoxAlignRight.Checked = Configuration.Settings.Tools.GenVideoNonAssaAlignRight; checkBoxRightToLeft.Checked = Configuration.Settings.Tools.GenVideoNonAssaAlignRight; @@ -160,6 +159,9 @@ namespace Nikse.SubtitleEdit.Forms comboBoxFrameRate.SelectedIndex = 2; FontEnableOrDisable(_isAssa); + + panelOutlineColor.BackColor = Configuration.Settings.Tools.GenVideoNonAssaBoxColor; + panelForeColor.BackColor = Configuration.Settings.Tools.GenVideoNonAssaTextColor; } private void FontEnableOrDisable(bool assa) @@ -181,14 +183,7 @@ namespace Nikse.SubtitleEdit.Forms panelOutlineColor.Enabled = enabled; panelForeColor.Enabled = enabled; - if (assa) - { - labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn; - } - else - { - labelInfo.Text = string.Empty; - } + labelInfo.Text = assa ? LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn : string.Empty; } private void FixRightToLeft(Subtitle subtitle) @@ -258,14 +253,13 @@ namespace Nikse.SubtitleEdit.Forms var oldFontSizeEnabled = numericUpDownFontSize.Enabled; numericUpDownFontSize.Enabled = false; - Stopwatch stopWatch; using (var saveDialog = new SaveFileDialog - { - FileName = SuggestNewVideoFileName(), - Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm|mov|*.mov", - AddExtension = true, - InitialDirectory = string.IsNullOrEmpty(_assaSubtitle.FileName) ? string.Empty : Path.GetDirectoryName(_assaSubtitle.FileName), - }) + { + FileName = SuggestNewVideoFileName(), + Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm|mov|*.mov", + AddExtension = true, + InitialDirectory = string.IsNullOrEmpty(_assaSubtitle.FileName) ? string.Empty : Path.GetDirectoryName(_assaSubtitle.FileName), + }) { if (saveDialog.ShowDialog(this) != DialogResult.OK) { @@ -277,7 +271,7 @@ namespace Nikse.SubtitleEdit.Forms VideoFileName = saveDialog.FileName; } - stopWatch = Stopwatch.StartNew(); + var stopWatch = Stopwatch.StartNew(); if (!ConvertVideo(oldFontSizeEnabled, _assaSubtitle)) { buttonGenerate.Enabled = true; @@ -292,19 +286,6 @@ namespace Nikse.SubtitleEdit.Forms if (!_abort && _log.ToString().Length > 10) { var title = "Error occurred during encoding"; - if (_log.ToString().Contains("Cannot load nvcuda.dll")) - { - title = "Error: Cannot load nvcuda.dll"; - } - else if (_log.ToString().Contains("amfrt64.dll")) - { - title = "Error: Cannot load amfrt64.dll"; - } - else if (_log.ToString().Contains("The minimum required Nvidia driver for nvenc is")) - { - title = "Nvidia driver needs updating"; - } - MessageBox.Show($"Encoding with ffmpeg failed: {Environment.NewLine}{_log}", title, MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -612,5 +593,50 @@ namespace Nikse.SubtitleEdit.Forms var coordinates = buttonVideoChooseStandardRes.PointToClient(Cursor.Position); contextMenuStripRes.Show(buttonVideoChooseStandardRes, coordinates); } + + private void buttonForeColor_Click(object sender, EventArgs e) + { + using (var colorChooser = new ColorChooser { Color = panelForeColor.BackColor }) + { + if (colorChooser.ShowDialog() == DialogResult.OK) + { + panelForeColor.BackColor = colorChooser.Color; + } + } + } + + private void buttonOutlineColor_Click(object sender, EventArgs e) + { + using (var colorChooser = new ColorChooser { Color = panelOutlineColor.BackColor }) + { + if (colorChooser.ShowDialog() == DialogResult.OK) + { + panelOutlineColor.BackColor = colorChooser.Color; + } + } + } + + private void panelForeColor_Click(object sender, EventArgs e) + { + buttonForeColor_Click(null, null); + } + + private void panelOutlineColor_Click(object sender, EventArgs e) + { + buttonOutlineColor_Click(null, null); + } + + private void GenerateTransparentVideoWithSubtitles_FormClosing(object sender, FormClosingEventArgs e) + { + Configuration.Settings.Tools.GenVideoFontName = comboBoxSubtitleFont.Text; + Configuration.Settings.Tools.GenVideoFontBold = checkBoxFontBold.Checked; + Configuration.Settings.Tools.GenVideoOutline = (int)numericUpDownOutline.Value; + Configuration.Settings.Tools.GenVideoFontSize = (int)numericUpDownFontSize.Value; + Configuration.Settings.Tools.GenTransparentVideoNonAssaBox = checkBoxBox.Checked; + Configuration.Settings.Tools.GenVideoNonAssaAlignRight = checkBoxAlignRight.Checked; + Configuration.Settings.Tools.GenVideoNonAssaFixRtlUnicode = checkBoxRightToLeft.Checked; + Configuration.Settings.Tools.GenVideoNonAssaBoxColor = panelOutlineColor.BackColor; + Configuration.Settings.Tools.GenVideoNonAssaTextColor = panelForeColor.BackColor; + } } } diff --git a/src/ui/Forms/Main.Designer.cs b/src/ui/Forms/Main.Designer.cs index 7dc4d95c4..3511fec93 100644 --- a/src/ui/Forms/Main.Designer.cs +++ b/src/ui/Forms/Main.Designer.cs @@ -41,9 +41,9 @@ namespace Nikse.SubtitleEdit.Forms { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); - Nikse.SubtitleEdit.Core.Common.TimeCode timeCode7 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); - Nikse.SubtitleEdit.Core.Common.TimeCode timeCode8 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); - Nikse.SubtitleEdit.Core.Common.TimeCode timeCode9 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); + Nikse.SubtitleEdit.Core.Common.TimeCode timeCode1 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); + Nikse.SubtitleEdit.Core.Common.TimeCode timeCode2 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); + Nikse.SubtitleEdit.Core.Common.TimeCode timeCode3 = new Nikse.SubtitleEdit.Core.Common.TimeCode(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.labelStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripSelected = new System.Windows.Forms.ToolStripStatusLabel(); @@ -245,6 +245,7 @@ namespace Nikse.SubtitleEdit.Forms this.generateBlankVideoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.generateVideoWithSoftcodedSubtitlesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.generateVideoWithHardcodedSubtitleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.generaeTransparentVideoWithSubtitleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.audioToTextWhisperTolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.videoaudioToTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.textToSpeechAndAddToVideoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -586,7 +587,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.generaeTransparentVideoWithSubtitleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -2420,6 +2420,13 @@ namespace Nikse.SubtitleEdit.Forms this.generateVideoWithHardcodedSubtitleToolStripMenuItem.Text = "Generate video with hardcoded subtitle..."; this.generateVideoWithHardcodedSubtitleToolStripMenuItem.Click += new System.EventHandler(this.GenerateVideoWithHardcodedSubtitleToolStripMenuItemClick); // + // generaeTransparentVideoWithSubtitleToolStripMenuItem + // + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Name = "generaeTransparentVideoWithSubtitleToolStripMenuItem"; + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Size = new System.Drawing.Size(295, 22); + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Text = "Generae transparent video with subtitle"; + this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Click += new System.EventHandler(this.generaeTransparentVideoWithSubtitleToolStripMenuItem_Click); + // // audioToTextWhisperTolStripMenuItem // this.audioToTextWhisperTolStripMenuItem.Name = "audioToTextWhisperTolStripMenuItem"; @@ -3916,14 +3923,14 @@ namespace Nikse.SubtitleEdit.Forms this.timeUpDownVideoPosition.Size = new System.Drawing.Size(113, 23); this.timeUpDownVideoPosition.TabIndex = 12; this.timeUpDownVideoPosition.TabStop = false; - timeCode7.Hours = 0; - timeCode7.Milliseconds = 0; - timeCode7.Minutes = 0; - timeCode7.Seconds = 0; - timeCode7.TimeSpan = System.TimeSpan.Parse("00:00:00"); - timeCode7.TotalMilliseconds = 0D; - timeCode7.TotalSeconds = 0D; - this.timeUpDownVideoPosition.TimeCode = timeCode7; + timeCode1.Hours = 0; + timeCode1.Milliseconds = 0; + timeCode1.Minutes = 0; + timeCode1.Seconds = 0; + timeCode1.TimeSpan = System.TimeSpan.Parse("00:00:00"); + timeCode1.TotalMilliseconds = 0D; + timeCode1.TotalSeconds = 0D; + this.timeUpDownVideoPosition.TimeCode = timeCode1; this.timeUpDownVideoPosition.UseVideoOffset = false; // // buttonGotoSub @@ -4196,14 +4203,14 @@ namespace Nikse.SubtitleEdit.Forms this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(113, 23); this.timeUpDownVideoPositionAdjust.TabIndex = 13; this.timeUpDownVideoPositionAdjust.TabStop = false; - timeCode8.Hours = 0; - timeCode8.Milliseconds = 0; - timeCode8.Minutes = 0; - timeCode8.Seconds = 0; - timeCode8.TimeSpan = System.TimeSpan.Parse("00:00:00"); - timeCode8.TotalMilliseconds = 0D; - timeCode8.TotalSeconds = 0D; - this.timeUpDownVideoPositionAdjust.TimeCode = timeCode8; + timeCode2.Hours = 0; + timeCode2.Milliseconds = 0; + timeCode2.Minutes = 0; + timeCode2.Seconds = 0; + timeCode2.TimeSpan = System.TimeSpan.Parse("00:00:00"); + timeCode2.TotalMilliseconds = 0D; + timeCode2.TotalSeconds = 0D; + this.timeUpDownVideoPositionAdjust.TimeCode = timeCode2; this.timeUpDownVideoPositionAdjust.UseVideoOffset = false; // // buttonAdjustSetEndTime @@ -5560,14 +5567,14 @@ namespace Nikse.SubtitleEdit.Forms this.timeUpDownStartTime.Size = new System.Drawing.Size(113, 23); this.timeUpDownStartTime.TabIndex = 0; this.timeUpDownStartTime.TabStop = false; - timeCode9.Hours = 0; - timeCode9.Milliseconds = 0; - timeCode9.Minutes = 0; - timeCode9.Seconds = 0; - timeCode9.TimeSpan = System.TimeSpan.Parse("00:00:00"); - timeCode9.TotalMilliseconds = 0D; - timeCode9.TotalSeconds = 0D; - this.timeUpDownStartTime.TimeCode = timeCode9; + timeCode3.Hours = 0; + timeCode3.Milliseconds = 0; + timeCode3.Minutes = 0; + timeCode3.Seconds = 0; + timeCode3.TimeSpan = System.TimeSpan.Parse("00:00:00"); + timeCode3.TotalMilliseconds = 0D; + timeCode3.TotalSeconds = 0D; + this.timeUpDownStartTime.TimeCode = timeCode3; this.timeUpDownStartTime.UseVideoOffset = false; // // numericUpDownDuration @@ -5921,13 +5928,6 @@ namespace Nikse.SubtitleEdit.Forms this.toolStripMenuItemShowVideoControls.Text = "Show video controls"; this.toolStripMenuItemShowVideoControls.Click += new System.EventHandler(this.ToolStripMenuItemShowVideoControlsClick); // - // generaeTransparentVideoWithSubtitleToolStripMenuItem - // - this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Name = "generaeTransparentVideoWithSubtitleToolStripMenuItem"; - this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Size = new System.Drawing.Size(295, 22); - this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Text = "Generae transparent video with subtitle"; - this.generaeTransparentVideoWithSubtitleToolStripMenuItem.Click += new System.EventHandler(this.generaeTransparentVideoWithSubtitleToolStripMenuItem_Click); - // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index dd8e999aa..45d65bfe9 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -1841,6 +1841,7 @@ namespace Nikse.SubtitleEdit.Forms generateBlankVideoToolStripMenuItem.Text = _language.Menu.Video.GenerateBlankVideo; generateVideoWithHardcodedSubtitleToolStripMenuItem.Text = _language.Menu.Video.GenerateVideoWithBurnedInSub; generateVideoWithSoftcodedSubtitlesToolStripMenuItem.Text = _language.Menu.Video.GenerateVideoWithEmbeddedSubs; + generaeTransparentVideoWithSubtitleToolStripMenuItem.Text = _language.Menu.Video.GenerateTransparentVideoWithSubs; videoaudioToTextToolStripMenuItem.Text = string.Format(_language.Menu.Video.VideoAudioToTextX, "Vosk/Kaldi"); audioToTextWhisperTolStripMenuItem.Text = string.Format(_language.Menu.Video.VideoAudioToTextX, "Whisper"); textToSpeechAndAddToVideoToolStripMenuItem.Text = _language.Menu.Video.TextToSpeechAndAddToVideo; diff --git a/src/ui/Forms/Main.resx b/src/ui/Forms/Main.resx index c577e339f..34a87c2c9 100644 --- a/src/ui/Forms/Main.resx +++ b/src/ui/Forms/Main.resx @@ -690,9 +690,6 @@ 652, 56 - - 652, 56 - iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -775,12 +772,12 @@ 981, 56 - - 193, 17 - 668, 17 + + 193, 17 + 17, 95 diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index 981d6bee1..9013570f4 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -2034,6 +2034,7 @@ namespace Nikse.SubtitleEdit.Logic GenerateBlankVideo = "Generate blank video...", GenerateVideoWithEmbeddedSubs = "Generate video with added/removed embedded subtitles...", GenerateVideoWithBurnedInSub = "Generate video with burned-in subtitle...", + GenerateTransparentVideoWithSubs = "Generate transparent video with subtitles...", VideoAudioToTextX = "Audio to text ({0})...", ImportChaptersFromVideo = "Import chapters from video", GenerateImportShotChanges = "Generate/import shot changes...", diff --git a/src/ui/Logic/LanguageStructure.cs b/src/ui/Logic/LanguageStructure.cs index 37ad030e5..78eac5d09 100644 --- a/src/ui/Logic/LanguageStructure.cs +++ b/src/ui/Logic/LanguageStructure.cs @@ -1845,6 +1845,7 @@ public string GenerateBlankVideo { get; set; } public string GenerateVideoWithBurnedInSub { get; set; } public string GenerateVideoWithEmbeddedSubs { get; set; } + public string GenerateTransparentVideoWithSubs { get; set; } public string VideoAudioToTextX { get; set; } public string ImportChaptersFromVideo { get; set; } public string GenerateImportShotChanges { get; set; } From 228ec5b6d44254b992643adc7d904dc2debed219 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 08:37:11 +0200 Subject: [PATCH 34/42] Work on #8534 --- LanguageBaseEnglish.xml | 1 + src/ui/Logic/LanguageDeserializer.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/LanguageBaseEnglish.xml b/LanguageBaseEnglish.xml index 490571b45..dcbd82252 100644 --- a/LanguageBaseEnglish.xml +++ b/LanguageBaseEnglish.xml @@ -1449,6 +1449,7 @@ We leverage the intrinsic rhythm of the image. Generate blank video... Generate video with burned-in subtitle... Generate video with added/removed embedded subtitles... + Generate transparent video with subtitles... Audio to text ({0})... Import chapters from video Generate/import shot changes... diff --git a/src/ui/Logic/LanguageDeserializer.cs b/src/ui/Logic/LanguageDeserializer.cs index 041e02979..c1c19d4b1 100644 --- a/src/ui/Logic/LanguageDeserializer.cs +++ b/src/ui/Logic/LanguageDeserializer.cs @@ -4744,6 +4744,9 @@ namespace Nikse.SubtitleEdit.Logic case "Main/Menu/Video/GenerateVideoWithEmbeddedSubs": language.Main.Menu.Video.GenerateVideoWithEmbeddedSubs = reader.Value; break; + case "Main/Menu/Video/GenerateTransparentVideoWithSubs": + language.Main.Menu.Video.GenerateTransparentVideoWithSubs = reader.Value; + break; case "Main/Menu/Video/VideoAudioToTextX": language.Main.Menu.Video.VideoAudioToTextX = reader.Value; break; From 16aee3339a486453824fadaa9a480a97e88bbe10 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 08:39:48 +0200 Subject: [PATCH 35/42] Fix compile error --- src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs index 33f40ed44..7c023e105 100644 --- a/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs +++ b/src/ui/Forms/GenerateTransparentVideoWithSubtitles.cs @@ -62,7 +62,6 @@ namespace Nikse.SubtitleEdit.Forms deleteToolStripMenuItem.Text = LanguageSettings.Current.DvdSubRip.Remove; clearToolStripMenuItem.Text = LanguageSettings.Current.DvdSubRip.Clear; addFilesToolStripMenuItem.Text = LanguageSettings.Current.DvdSubRip.Add; - useSourceResolutionToolStripMenuItem.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.UseSourceResolution; labelFrameRate.Text = LanguageSettings.Current.General.FrameRate; progressBar1.Visible = false; From 8c2267846b154f56875e47caf6de30cbb1fa228e Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 09:12:07 +0200 Subject: [PATCH 36/42] Fix abort for TTS Azure/ElevenLabs - thx cvrle77 :) Work on #8519 --- src/ui/Forms/Tts/TextToSpeech.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ui/Forms/Tts/TextToSpeech.cs b/src/ui/Forms/Tts/TextToSpeech.cs index 6303cab27..ba6806232 100644 --- a/src/ui/Forms/Tts/TextToSpeech.cs +++ b/src/ui/Forms/Tts/TextToSpeech.cs @@ -1129,6 +1129,11 @@ namespace Nikse.SubtitleEdit.Forms.Tts progressBar1.Refresh(); labelProgress.Refresh(); Application.DoEvents(); + + if (_abort) + { + return false; + } } progressBar1.Visible = false; @@ -1301,6 +1306,11 @@ namespace Nikse.SubtitleEdit.Forms.Tts progressBar1.Refresh(); labelProgress.Refresh(); Application.DoEvents(); + + if (_abort) + { + return false; + } } progressBar1.Visible = false; From f2d2f627f2a512842d9448855c985b045df3f5f8 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 10:04:28 +0200 Subject: [PATCH 37/42] Update change log --- Changelog.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index d273d92a1..32756870d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,28 @@ Subtitle Edit Changelog +4.0.7 (xth July 2024) BETA +* NEW: + * Add "Generate transparent video with subtitles" - thx JeditPro + * Add Edit - Modify selection - Line length + * Add support for Faster-Whisper-XXL + * Add audio settings for TTS final video file + * Add subtitle format "PodcastIndexer json" - thx rjgout + * Add new Claude 3.5 Sonnet model - thx Flash +* IMPROVED: + * Update Portuguese translation - thx hugok79 + * Update Brazilian Portuguese translation - thx igorruckert + * Update Chinese translation - thx nkh0472 + * Update Finnish translation - thx Teijo S + * Update Italian language - thx bovirus + * Update Russian translation - thx elfriob + * Update mpv to 2024-06-09 + * Update yt-dlp to 2024-05-27 +* FIXED: + * Fix auto translate crash - thx soscaster + * Fix crash in Vosk audio to text on selected lines - thx MediaExpres + * Prompt for overwrite in "Multiple replace" export - thx redactedscribe + * Fix abort for TTS Azure/ElevenLabs - thx cvrle77 + 4.0.6 (1st June 2024) * NEW: * Add "Text To Speech" - thx darnn/cvrle77/BlueBlue7891 From d4e8664a8a1df5cae84fa4e6240d1253e75ec47a Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 10:19:06 +0200 Subject: [PATCH 38/42] Update dk/sv translations --- src/ui/Languages/da-DK.xml | 4 ++++ src/ui/Languages/sv-SE.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/ui/Languages/da-DK.xml b/src/ui/Languages/da-DK.xml index dfbfedd0a..2bf3ea964 100644 --- a/src/ui/Languages/da-DK.xml +++ b/src/ui/Languages/da-DK.xml @@ -1445,6 +1445,7 @@ Vi udnytter billedets indre rytme. Generer blank video... Generer video med indbrændt sub... Generer video med indlejrede undertekster... + Generer gennemsigtig video med undertekster... Lyd til tekst ({0})... Importer kapitler fra video Generer/importer sceneændringer... @@ -2128,6 +2129,8 @@ Hvis du har redigeret denne fil med Subtitle Edit du måske finde en backup via Varighed større end CPS mindre end CPS større end + Længde mindre end + Længde større end Præcis én linje Præcis to linjer Mere end to linjer @@ -3166,6 +3169,7 @@ Fortsæt? Samler lydspor: {0} / {1}... Genererer tale fra tekst: {0} / {1}... Gennemgå lydklip + Brugerdefineret lyd encoding Gennemgå og rediger/fjern lydklip Spil Auto-fortsæt diff --git a/src/ui/Languages/sv-SE.xml b/src/ui/Languages/sv-SE.xml index ceb3ee31e..235adb17f 100644 --- a/src/ui/Languages/sv-SE.xml +++ b/src/ui/Languages/sv-SE.xml @@ -1451,6 +1451,7 @@ Vi utnyttjar bildens inneboende rytm. Generera tom video... Generera video med inbränd sub... Skapa video med inbäddade undertexter... + Skapa transparent video med undertexter... Ljud till text ({0})... Importera kapitel från video Skapa/importera scenändringar... @@ -2137,6 +2138,8 @@ Ladda ner och fortsätta? Varaktighet längre än CPS mindre än CPS större än + Längd mindre än + Längd större än Exakt en rad Exakt två rader Mer än två rader @@ -3176,6 +3179,7 @@ och N bryter Slår ihop ljudspår: {0} / {1}... Genererar tal från text: {0} / {1}... Granska ljudklipp + Anpassad ljudkodning Granska och redigera/ta bort ljudklipp Spela Auto-fortsätt From 58b15fa3a20e0696090d0fe53d3b3e259e2344ce Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Sun, 23 Jun 2024 10:08:06 +0100 Subject: [PATCH 39/42] Refactor AutoTranslate download error handling The AutoTranslate download functionality has been refactored to improve error handling. An optional parameter has been added to the DownloadOllamaModelsAsync method to control whether or not to show error notifications. Also, the GetOllamaClient method has been simplified for readability and maintainability. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.cs | 27 +++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index 701382295..160290aa1 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1172,9 +1172,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate if (GetCurrentEngine().GetType() == typeof(OllamaTranslate)) { - nikseComboBoxEngine.Enabled = false; await DownloadOllamaModelsAsync(); - nikseComboBoxEngine.Enabled = true; } } @@ -1453,10 +1451,10 @@ namespace Nikse.SubtitleEdit.Forms.Translate private async void UpdateLocalModelsToolStripMenuItem_Click(object sender, EventArgs e) { - await DownloadOllamaModelsAsync(); + await DownloadOllamaModelsAsync(shouldNotifyOnError: true); } - private async Task DownloadOllamaModelsAsync() + private async Task DownloadOllamaModelsAsync(bool shouldNotifyOnError = false) { try { @@ -1468,12 +1466,11 @@ namespace Nikse.SubtitleEdit.Forms.Translate } catch (Exception exception) { -#if DEBUG - MessageBox.Show(exception.Message); -#else - MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); - SeLogger.Error(exception, "Unable to get ollama models"); -#endif + if (shouldNotifyOnError) + { + MessageBox.Show("Unable to get ollama models - is ollama running?" + Environment.NewLine + exception.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); + SeLogger.Error(exception, "Unable to get ollama models"); + } } async Task> GetModelsAsync(string url) @@ -1504,14 +1501,8 @@ namespace Nikse.SubtitleEdit.Forms.Translate private HttpClient _httpClient; - private HttpClient GetOllamaClient() - { - return _httpClient ?? (_httpClient = new HttpClient - { - Timeout = TimeSpan.FromSeconds(3) - }); - } - + private HttpClient GetOllamaClient() => _httpClient ?? (_httpClient = new HttpClient()); + private void FillOllamaModels(string[] models) { if (!(GetCurrentEngine() is OllamaTranslate)) From 58831aec024caf31447168db021ed2c83e023e83 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Sun, 23 Jun 2024 11:35:45 +0100 Subject: [PATCH 40/42] Safeguard http client disposal in AutoTranslate This update adds a null-conditional operator before disposing the http client in AutoTranslate form. This ensures that _httpClient.Dispose() only gets called if _httpClient is not null, preventing potential NullReferenceException. Signed-off-by: Ivandro Jao --- src/ui/Forms/Translate/AutoTranslate.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/Forms/Translate/AutoTranslate.Designer.cs b/src/ui/Forms/Translate/AutoTranslate.Designer.cs index 676d44da7..7492c7643 100644 --- a/src/ui/Forms/Translate/AutoTranslate.Designer.cs +++ b/src/ui/Forms/Translate/AutoTranslate.Designer.cs @@ -18,7 +18,7 @@ components.Dispose(); } - _httpClient.Dispose(); + _httpClient?.Dispose(); base.Dispose(disposing); } From 9fa1bdac8478489817b508d59ecf4996ecbcf3ca Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 23 Jun 2024 13:05:45 +0200 Subject: [PATCH 41/42] Update change log --- Changelog.txt | 8 +- src/ui/Forms/ColorChooser.cs | 210 ++++++++++++------------ src/ui/Logic/ColorChooser/ColorWheel.cs | 1 - 3 files changed, 109 insertions(+), 110 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 32756870d..c95efa481 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,7 +7,7 @@ * Add support for Faster-Whisper-XXL * Add audio settings for TTS final video file * Add subtitle format "PodcastIndexer json" - thx rjgout - * Add new Claude 3.5 Sonnet model - thx Flash + * Add new Anthropic Claude 3.5 Sonnet model - thx Flash * IMPROVED: * Update Portuguese translation - thx hugok79 * Update Brazilian Portuguese translation - thx igorruckert @@ -21,7 +21,7 @@ * Fix auto translate crash - thx soscaster * Fix crash in Vosk audio to text on selected lines - thx MediaExpres * Prompt for overwrite in "Multiple replace" export - thx redactedscribe - * Fix abort for TTS Azure/ElevenLabs - thx cvrle77 + * Fix "abort" for TTS Azure/ElevenLabs - thx cvrle77 4.0.6 (1st June 2024) * NEW: @@ -56,7 +56,7 @@ * Add Swedish to ChatGPT translate - thx Stefan * Allow larger subtitle preview font size - thx kadrimarzouki * FIXED: - * Fix for Antrophic translate - thx venomousraid + * Fix for Anthropic translate - thx venomousraid * Fix possible crash in teletext reading - thx yellobyte * Fix unwanted text boxes background color change - thx Leon * Fix Whisper on selection in waveform in "translation mode" - thx rRobis @@ -76,7 +76,7 @@ * Add new shortcut "Insert new subtitle at video pos (fill)" - thx Leon/AuroraMartell * Add "LM Studio" translate (local) - thx fznx922 * Add Ollama translate (local) - thx despairTK/Copy2Translator - * Add Antrophic translate + * Add Anthropic translate * Add distilled models for Purfview Faster Whisper * IMPROVED: * Update German translation - thx Netspark diff --git a/src/ui/Forms/ColorChooser.cs b/src/ui/Forms/ColorChooser.cs index 2c63e6adc..69f2be3bf 100644 --- a/src/ui/Forms/ColorChooser.cs +++ b/src/ui/Forms/ColorChooser.cs @@ -62,15 +62,15 @@ namespace Nikse.SubtitleEdit.Forms private TrackBar _tbValue; private bool _showAlpha = true; private readonly Timer _hexCodeEditTimer; - private Panel panelC0; - private Panel panelC1; - private Panel panelC2; - private Panel panelC3; - private Panel panelC7; - private Panel panelC6; - private Panel panelC5; - private Panel panelC4; - private Button buttonColorPicker; + private Panel _panelC0; + private Panel _panelC1; + private Panel _panelC2; + private Panel _panelC3; + private Panel _panelC7; + private Panel _panelC6; + private Panel _panelC5; + private Panel _panelC4; + private Button _buttonColorPicker; private bool _hexEditOn; public ColorChooser() @@ -95,25 +95,25 @@ namespace Nikse.SubtitleEdit.Forms } }; - panelC0.BackColor = Configuration.Settings.General.LastColorPickerColor; - panelC1.BackColor = Configuration.Settings.General.LastColorPickerColor1; - panelC2.BackColor = Configuration.Settings.General.LastColorPickerColor2; - panelC3.BackColor = Configuration.Settings.General.LastColorPickerColor3; - panelC4.BackColor = Configuration.Settings.General.LastColorPickerColor4; - panelC5.BackColor = Configuration.Settings.General.LastColorPickerColor5; - panelC6.BackColor = Configuration.Settings.General.LastColorPickerColor6; - panelC7.BackColor = Configuration.Settings.General.LastColorPickerColor7; + _panelC0.BackColor = Configuration.Settings.General.LastColorPickerColor; + _panelC1.BackColor = Configuration.Settings.General.LastColorPickerColor1; + _panelC2.BackColor = Configuration.Settings.General.LastColorPickerColor2; + _panelC3.BackColor = Configuration.Settings.General.LastColorPickerColor3; + _panelC4.BackColor = Configuration.Settings.General.LastColorPickerColor4; + _panelC5.BackColor = Configuration.Settings.General.LastColorPickerColor5; + _panelC6.BackColor = Configuration.Settings.General.LastColorPickerColor6; + _panelC7.BackColor = Configuration.Settings.General.LastColorPickerColor7; if (Configuration.Settings.General.LastColorPickerDropper == Color.Transparent) { - buttonColorPicker.Visible = false; + _buttonColorPicker.Visible = false; } else { - buttonColorPicker.BackColor = Configuration.Settings.General.LastColorPickerDropper; - buttonColorPicker.BackgroundImage = Properties.Resources.color_picker_small2; - buttonColorPicker.ImageAlign = ContentAlignment.MiddleCenter; - buttonColorPicker.BackgroundImageLayout = ImageLayout.Center; + _buttonColorPicker.BackColor = Configuration.Settings.General.LastColorPickerDropper; + _buttonColorPicker.BackgroundImage = Properties.Resources.color_picker_small2; + _buttonColorPicker.ImageAlign = ContentAlignment.MiddleCenter; + _buttonColorPicker.BackgroundImageLayout = ImageLayout.Center; } } @@ -299,7 +299,7 @@ namespace Nikse.SubtitleEdit.Forms // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events - // when you update the NumericUpdownControls. + // when you update the NumericUpDownControls. _changeType = ChangeStyle.RGB; _alphaRedGreenBlue = new ColorHandler.Argb(_tbAlpha.Value, _tbRed.Value, _tbGreen.Value, _tbBlue.Value); SetHsv(ColorHandler.RgbToHsv(_alphaRedGreenBlue)); @@ -377,15 +377,15 @@ namespace Nikse.SubtitleEdit.Forms this._pnlSelectedColor = new System.Windows.Forms.Panel(); this._buttonCancel = new System.Windows.Forms.Button(); this._buttonOk = new System.Windows.Forms.Button(); - this.panelC0 = new System.Windows.Forms.Panel(); - this.panelC1 = new System.Windows.Forms.Panel(); - this.panelC2 = new System.Windows.Forms.Panel(); - this.panelC3 = new System.Windows.Forms.Panel(); - this.panelC7 = new System.Windows.Forms.Panel(); - this.panelC6 = new System.Windows.Forms.Panel(); - this.panelC5 = new System.Windows.Forms.Panel(); - this.panelC4 = new System.Windows.Forms.Panel(); - this.buttonColorPicker = new System.Windows.Forms.Button(); + this._panelC0 = new System.Windows.Forms.Panel(); + this._panelC1 = new System.Windows.Forms.Panel(); + this._panelC2 = new System.Windows.Forms.Panel(); + this._panelC3 = new System.Windows.Forms.Panel(); + this._panelC7 = new System.Windows.Forms.Panel(); + this._panelC6 = new System.Windows.Forms.Panel(); + this._panelC5 = new System.Windows.Forms.Panel(); + this._panelC4 = new System.Windows.Forms.Panel(); + this._buttonColorPicker = new System.Windows.Forms.Button(); this._flowLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this._tbRed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this._tbGreen)).BeginInit(); @@ -731,99 +731,99 @@ namespace Nikse.SubtitleEdit.Forms // // panelC0 // - this.panelC0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC0.Location = new System.Drawing.Point(295, 97); - this.panelC0.Name = "panelC0"; - this.panelC0.Size = new System.Drawing.Size(21, 20); - this.panelC0.TabIndex = 62; - this.panelC0.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC0_MouseClick); + this._panelC0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC0.Location = new System.Drawing.Point(295, 97); + this._panelC0.Name = "_panelC0"; + this._panelC0.Size = new System.Drawing.Size(21, 20); + this._panelC0.TabIndex = 62; + this._panelC0.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC0_MouseClick); // // panelC1 // - this.panelC1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC1.Location = new System.Drawing.Point(322, 97); - this.panelC1.Name = "panelC1"; - this.panelC1.Size = new System.Drawing.Size(21, 20); - this.panelC1.TabIndex = 63; - this.panelC1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC1_MouseClick); + this._panelC1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC1.Location = new System.Drawing.Point(322, 97); + this._panelC1.Name = "_panelC1"; + this._panelC1.Size = new System.Drawing.Size(21, 20); + this._panelC1.TabIndex = 63; + this._panelC1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC1_MouseClick); // // panelC2 // - this.panelC2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC2.Location = new System.Drawing.Point(349, 97); - this.panelC2.Name = "panelC2"; - this.panelC2.Size = new System.Drawing.Size(21, 20); - this.panelC2.TabIndex = 63; - this.panelC2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC2_MouseClick); + this._panelC2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC2.Location = new System.Drawing.Point(349, 97); + this._panelC2.Name = "_panelC2"; + this._panelC2.Size = new System.Drawing.Size(21, 20); + this._panelC2.TabIndex = 63; + this._panelC2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC2_MouseClick); // // panelC3 // - this.panelC3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC3.Location = new System.Drawing.Point(376, 97); - this.panelC3.Name = "panelC3"; - this.panelC3.Size = new System.Drawing.Size(21, 20); - this.panelC3.TabIndex = 64; - this.panelC3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC3_MouseClick); + this._panelC3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC3.Location = new System.Drawing.Point(376, 97); + this._panelC3.Name = "_panelC3"; + this._panelC3.Size = new System.Drawing.Size(21, 20); + this._panelC3.TabIndex = 64; + this._panelC3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC3_MouseClick); // // panelC7 // - this.panelC7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC7.Location = new System.Drawing.Point(376, 124); - this.panelC7.Name = "panelC7"; - this.panelC7.Size = new System.Drawing.Size(21, 20); - this.panelC7.TabIndex = 68; - this.panelC7.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC7_MouseClick); + this._panelC7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC7.Location = new System.Drawing.Point(376, 124); + this._panelC7.Name = "_panelC7"; + this._panelC7.Size = new System.Drawing.Size(21, 20); + this._panelC7.TabIndex = 68; + this._panelC7.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC7_MouseClick); // // panelC6 // - this.panelC6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC6.Location = new System.Drawing.Point(349, 124); - this.panelC6.Name = "panelC6"; - this.panelC6.Size = new System.Drawing.Size(21, 20); - this.panelC6.TabIndex = 66; - this.panelC6.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC6_MouseClick); + this._panelC6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC6.Location = new System.Drawing.Point(349, 124); + this._panelC6.Name = "_panelC6"; + this._panelC6.Size = new System.Drawing.Size(21, 20); + this._panelC6.TabIndex = 66; + this._panelC6.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC6_MouseClick); // // panelC5 // - this.panelC5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC5.Location = new System.Drawing.Point(322, 124); - this.panelC5.Name = "panelC5"; - this.panelC5.Size = new System.Drawing.Size(21, 20); - this.panelC5.TabIndex = 67; - this.panelC5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC5_MouseClick); + this._panelC5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC5.Location = new System.Drawing.Point(322, 124); + this._panelC5.Name = "_panelC5"; + this._panelC5.Size = new System.Drawing.Size(21, 20); + this._panelC5.TabIndex = 67; + this._panelC5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC5_MouseClick); // // panelC4 // - this.panelC4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelC4.Location = new System.Drawing.Point(295, 124); - this.panelC4.Name = "panelC4"; - this.panelC4.Size = new System.Drawing.Size(21, 20); - this.panelC4.TabIndex = 65; - this.panelC4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC4_MouseClick); + this._panelC4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._panelC4.Location = new System.Drawing.Point(295, 124); + this._panelC4.Name = "_panelC4"; + this._panelC4.Size = new System.Drawing.Size(21, 20); + this._panelC4.TabIndex = 65; + this._panelC4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panelC4_MouseClick); // // buttonColorPicker // - this.buttonColorPicker.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonColorPicker.Location = new System.Drawing.Point(295, 150); - this.buttonColorPicker.Name = "buttonColorPicker"; - this.buttonColorPicker.Size = new System.Drawing.Size(102, 74); - this.buttonColorPicker.TabIndex = 69; - this.buttonColorPicker.UseVisualStyleBackColor = true; - this.buttonColorPicker.Click += new System.EventHandler(this.buttonColorPicker_Click); + this._buttonColorPicker.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this._buttonColorPicker.Location = new System.Drawing.Point(295, 150); + this._buttonColorPicker.Name = "_buttonColorPicker"; + this._buttonColorPicker.Size = new System.Drawing.Size(102, 74); + this._buttonColorPicker.TabIndex = 69; + this._buttonColorPicker.UseVisualStyleBackColor = true; + this._buttonColorPicker.Click += new System.EventHandler(this.buttonColorPicker_Click); // // ColorChooser // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(413, 441); - this.Controls.Add(this.buttonColorPicker); - this.Controls.Add(this.panelC7); - this.Controls.Add(this.panelC3); - this.Controls.Add(this.panelC6); - this.Controls.Add(this.panelC2); - this.Controls.Add(this.panelC5); - this.Controls.Add(this.panelC4); - this.Controls.Add(this.panelC1); - this.Controls.Add(this.panelC0); + this.Controls.Add(this._buttonColorPicker); + this.Controls.Add(this._panelC7); + this.Controls.Add(this._panelC3); + this.Controls.Add(this._panelC6); + this.Controls.Add(this._panelC2); + this.Controls.Add(this._panelC5); + this.Controls.Add(this._panelC4); + this.Controls.Add(this._panelC1); + this.Controls.Add(this._panelC0); this.Controls.Add(this._buttonCancel); this.Controls.Add(this._buttonOk); this.Controls.Add(this._label5); @@ -1024,46 +1024,46 @@ namespace Nikse.SubtitleEdit.Forms private void panelC0_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC0); + PanelColorClick(_panelC0); } private void panelC1_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC1); + PanelColorClick(_panelC1); } private void panelC2_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC2); + PanelColorClick(_panelC2); } private void panelC3_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC3); + PanelColorClick(_panelC3); } private void panelC4_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC4); + PanelColorClick(_panelC4); } private void panelC5_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC5); + PanelColorClick(_panelC5); } private void panelC6_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC6); + PanelColorClick(_panelC6); } private void panelC7_MouseClick(object sender, MouseEventArgs e) { - PanelColorClick(panelC7); + PanelColorClick(_panelC7); } private void _tbHexCode_MouseUp(object sender, MouseEventArgs e) @@ -1076,7 +1076,7 @@ namespace Nikse.SubtitleEdit.Forms private void buttonColorPicker_Click(object sender, EventArgs e) { - PanelColorClick(buttonColorPicker); + PanelColorClick(_buttonColorPicker); } private void ColorChooser_Shown(object sender, EventArgs e) diff --git a/src/ui/Logic/ColorChooser/ColorWheel.cs b/src/ui/Logic/ColorChooser/ColorWheel.cs index 4e088aad3..f7f95da64 100644 --- a/src/ui/Logic/ColorChooser/ColorWheel.cs +++ b/src/ui/Logic/ColorChooser/ColorWheel.cs @@ -557,6 +557,5 @@ namespace Nikse.SubtitleEdit.Logic.ColorChooser Dispose(true); GC.SuppressFinalize(this); } - } } From 662c84b6ad00569b04250d93c914778923e7d300 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 24 Jun 2024 07:22:45 +0200 Subject: [PATCH 42/42] =?UTF-8?q?Update=20Bulgarian=20translation=20-=20th?= =?UTF-8?q?x=20=D0=9A=D0=B0=D0=BB=D0=B8=D0=BD=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/Languages/bg-BG.xml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ui/Languages/bg-BG.xml b/src/ui/Languages/bg-BG.xml index a036a3fe8..3541b2a8c 100644 --- a/src/ui/Languages/bg-BG.xml +++ b/src/ui/Languages/bg-BG.xml @@ -3,7 +3,7 @@ Subtitle Edit 4.0.6 - Последен превод на български 20.05.2024: KalinM + Последен превод на български 24.06.2024: KalinM bg-BG OK @@ -18,6 +18,7 @@ Преглед Покажи преглед Скрий прегледа + Файл със субтитри Субтитри Всички файлове Видео файлове @@ -1021,6 +1022,7 @@ https://github.com/SubtitleEdit/subtitleedit Заемане на крайна позиция Използване на източника Използване резолюцията на източника + Изходен файл/папка... Генериране на видео с Добавяне/Премахване на вградени субтитри @@ -1060,15 +1062,7 @@ https://github.com/SubtitleEdit/subtitleedit Към: Превод Моля изчакайте... това може да продължи малко - С помощта на Google преводач - С помощта на Microsoft преводач С помощта на {0} - Съжаляваме, но за да използвате най-новия преводач на Microsoft, ви е необходим ключ от Microsoft за когнитивни услуги «Преводач на текст". - -Отворете "Опции -> Настройки -> Автоматичен превод", за да въведете вашия ключ. - Трудно се превежда без API ключ... (бавни и ограничени данни) -За да използвате API ключ, отворете "Опции -> Настройки -> Автоматичен превод", за да въведете вашия API ключ за преводач на Google. - Услуги: Обединяване на редове: Обединяване макс. два реда Обединяване на изречения @@ -1095,6 +1089,7 @@ https://github.com/SubtitleEdit/subtitleedit Закъснение между повикванията на сървъра Макс. брой байтове при всяко повикване на сървъра Запитване за {0} + Превеждане на всеки ред поотделно Сравнителен превод в Google и Microsoft @@ -1453,6 +1448,7 @@ https://github.com/SubtitleEdit/subtitleedit Генериране на празно видео ... Генериране на видео с вградени субтитри ... Генериране на видео с Добавяне/Премахване на вградени субтитри ... + Генериране на прозрачно видео със субтитри... Аудио в текст чрез {0} разпознаване на реч ... Импорт на глави от видео Създаване/Импортиране на промените в сцената ... @@ -2141,6 +2137,8 @@ https://github.com/SubtitleEdit/subtitleedit Продължителност по-голяма от CPS по-малко от CPS по-голям от + Дължината е по-малка от + Дължината е по-голяма от Точно един ред Точно два реда Повече от два реда @@ -3179,6 +3177,7 @@ https://github.com/SubtitleEdit/subtitleedit Обединяване на аудио запис: {0} / {1}... Генериране на реч от текст: {0} / {1}... Преглед на аудио клипове + Потребителско аудио кодиране Преглеждане и редактиране/премахване на аудио клипове Възпроизвеждане Авт. продължаване