Merge branch 'SubtitleEdit:main' into main

This commit is contained in:
Mihai Pavelescu 2024-06-24 11:03:52 +03:00 committed by GitHub
commit fa82cc2a09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
98 changed files with 6520 additions and 6549 deletions

View File

@ -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 Anthropic 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
@ -33,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
@ -53,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

View File

@ -77,6 +77,7 @@
<Word from="bes" to="bijes" />
<Word from="besa" to="bijesa" />
<Word from="besan" to="bijesan" />
<Word from="besede" to="besjede" />
<Word from="besom" to="bijesom" />
<Word from="besu" to="bijesu" />
<Word from="besprekorna" to="besprijekorna" />
@ -395,6 +396,7 @@
<Word from="donijeo" to="donio" />
<Word from="Donijeo" to="Donio" />
<Word from="Donijeću" to="Donijet ću" />
<Word from="Donro" to="Dobro" />
<Word from="dopreti" to="doprijeti" />
<Word from="dosledan" to="dosljedan" />
<Word from="dosap" to="došao" />
@ -643,6 +645,7 @@
<Word from="igraćeš" to="igrat ćeš" />
<Word from="ilustrujete" to="ilustrirate" />
<Word from="ilustruju" to="ilustriraju" />
<Word from="imail" to="e-mail" />
<Word from="inaće" to="inače" />
<Word from="inačr" to="inače" />
<Word from="inspirisao" to="inspirirao" />
@ -1461,6 +1464,8 @@
<Word from="odolevaš" to="odolijevaš" />
<Word from="odneti" to="odnijeti" />
<Word from="odrešene" to="odriješene" />
<Word from="odsedam" to="odsjedam" />
<Word from="Odsečena" to="Odsječena" />
<Word from="Odseo" to="Odsjeo" />
<Word from="odseo" to="odsjeo" />
<Word from="odsela" to="odsjela" />
@ -1478,6 +1483,7 @@
<Word from="okoreli" to="okorjeli" />
<Word from="omžeš" to="možeš" />
<Word from="onde" to="ondje" />
<Word from="onik" to="onim" />
<Word from="onlajn" to="online" />
<Word from="opuštano" to="opušteno" />
<Word from="organizuj" to="organiziraj" />
@ -1492,6 +1498,7 @@
<Word from="osjećanja" to="osjećaje" />
<Word from="Osiguraćete" to="Osigurat ćete" />
<Word from="Osiguraću" to="Osigurat ću" />
<Word from="osmah" to="odmah" />
<Word from="Osmeh" to="Osmjeh" />
<Word from="osmeh" to="osmjeh" />
<Word from="osmeha" to="osmjeha" />
@ -1523,7 +1530,6 @@
<Word from="osvetlila" to="osvijetlila" />
<Word from="osvetlite" to="osvijetlite" />
<Word from="osvjetlite" to="osvijetlite" />
<Word from="osvetliti" to="osvijetliti" />
<Word from="osvežava" to="osvježava" />
<Word from="osvežavanja" to="osvježavanja" />
<Word from="osvežen" to="osvježen" />
@ -1558,6 +1564,7 @@
<Word from="ovsena" to="zobena" />
<Word from="ovsenu" to="zobenu" />
<Word from="ozljeđen" to="ozlijeđen" />
<Word from="ožedneo" to="ožednio" />
<!-- p -->
<Word from="pakuj" to="pakiraj" />
<Word from="pakuje" to="pakira" />
@ -1671,6 +1678,7 @@
<Word from="podjelim" to="podijelim" />
<Word from="počeću" to="počet ću" />
<Word from="poči" to="poći" />
<Word from="počmu" to="poćnu" />
<Word from="poćela" to="počela" />
<Word from="podatek" to="podatke" />
<Word from="podjelimo" to="podijelimo" />
@ -1769,6 +1777,7 @@
<Word from="poslat" to="poslan" />
<Word from="poslata" to="poslana" />
<Word from="poslate" to="poslane" />
<Word from="Poslato" to="Poslano" />
<Word from="poslato" to="poslano" />
<Word from="posle" to="poslije" />
<Word from="Posle" to="Poslije" />
@ -1791,6 +1800,7 @@
<Word from="poštedeću" to="poštedjet ću" />
<Word from="Poštedeću" to="poštedjet ću" />
<Word from="poteram" to="potjeram" />
<Word from="potpisaćete" to="potpisat ćete" />
<Word from="povesne" to="povijesne" />
<Word from="Povinuju" to="Pokoravaju" />
<Word from="povinuju" to="pokoravaju" />
@ -1809,6 +1819,7 @@
<Word from="pravougli" to="pravokutni" />
<Word from="pre" to="prije" />
<Word from="Pre" to="Prije" />
<Word from="prihe" to="prije" />
<Word from="pream" to="prema" />
<Word from="predela" to="predjela" />
<Word from="predele" to="predjele" />
@ -1964,6 +1975,7 @@
<Word from="promijena" to="promjena" />
<Word from="promovisao" to="promovirao" />
<Word from="propoved" to="propovijed" />
<Word from="propoveda" to="propovijeda" />
<Word from="propovedao" to="propovijedao" />
<Word from="Propovedao" to="Propovijedao" />
<Word from="propovedi" to="propovijedi" />
@ -1981,7 +1993,6 @@
<Word from="prosleđena" to="proslijeđena" />
<Word from="prostituiše" to="prostituira" />
<Word from="prostituišu" to="prostituiraju" />
<Word from="proosvetliti" to="prosvijetliti" />
<Word from="prošvercovala" to="prošvercala" />
<Word from="prošvercovao" to="prošvercao" />
<Word from="Prošvercovao" to="Prošvercao" />
@ -2007,6 +2018,7 @@
<Word from="proturečili" to="proturječili" />
<Word from="proturečnost" to="proturječnost" />
<Word from="proturečnosti" to="proturječnosti" />
<Word from="prov" to="prvo" />
<Word from="proznao" to="priznao" />
<Word from="Proznao" to="Priznao" />
<Word from="ptišao" to="otišao" />
@ -2200,6 +2212,7 @@
<Word from="sertifikatu" to="certifikatu" />
<Word from="sertifikatom" to="certifikatom" />
<Word from="sesti" to="sjesti" />
<Word from="sekao" to="rezao" />
<Word from="sekire" to="sjekire" />
<Word from="sekiraj" to="brini" />
<Word from="sekiram" to="brinem" />
@ -2232,6 +2245,7 @@
<Word from="Sječaš" to="Sjećaš" />
<Word from="sješću" to="sjest ću" />
<Word from="sješće" to="sjest će" />
<Word from="skećam" to="sjećam" />
<Word from="skelet" to="kostur" />
<Word from="skuhaću" to="skuhat ću" />
<Word from="Skuhaću" to="Skuhat ću" />
@ -2441,6 +2455,7 @@
<Word from="Stidela" to="Stidjela" />
<Word from="stideti" to="stidjeti" />
<Word from="stiditi" to="stidjeti" />
<Word from="stigoa" to="stigao" />
<Word from="stim" to="s tim" />
<Word from="stojati" to="stajati" />
<Word from="stovri" to="stvori" />
@ -2537,6 +2552,7 @@
<Word from="svkai" to="svaki" />
<Word from="svojoh" to="svojih" />
<Word from="svoke" to="svoje" />
<Word from="svoej" to="svoje" />
<Word from="svugde" to="svugdje" />
<Word from="Svugde" to="Svugdje" />
<Word from="svr" to="sve" />
@ -2899,6 +2915,7 @@
<Word from="videše" to="vidješe" />
<Word from="vidjeo" to="vidio" />
<Word from="Vidjeo" to="Vidio" />
<Word from="vikaću" to="vikat ću" />
<Word from="visr" to="više" />
<Word from="vjerojatnoća" to="vjerojatnost" />
<Word from="vjerojatnoće" to="vjerojatnosti" />
@ -3260,6 +3277,7 @@
<Word from="Franses" to="Frances" />
<Word from="Fredi" to="Freddie" />
<Word from="Fren" to="Fran" />
<Word from="Gete" to="Goethe" />
<Word from="Grečen" to="Gretchen" />
<Word from="Grejs" to="Grace" />
<Word from="Gremi" to="Grammy" />
@ -4296,6 +4314,7 @@
<RegEx find="([aeiou])čijo(?![mj])" replaceWith="$1čio" />
<RegEx find="činij" replaceWith="zdjel" />
<RegEx find="čjan" replaceWith="čajn" />
<RegEx find="čkpj" replaceWith="čkoj" />
<RegEx find="č[mn]p" replaceWith="čno" />
<RegEx find="čnas" replaceWith="nčas" />
<RegEx find="([čČ])ovi?j?e([kč])" replaceWith="$1ovje$2" />
@ -4484,6 +4503,7 @@
<RegEx find="jereti" replaceWith="hereti" />
<RegEx find="Jereti" replaceWith="Hereti" />
<RegEx find="jevanđelj" replaceWith="evanđelj" />
<RegEx find="kađe" replaceWith="kaže" />
<RegEx find="\b([kK])af([aeiou]|om|ama|anama|ic[aeiu]|an[aeiuo]|anom|ansk[aeiuo])\b" replaceWith="$1av$2" />
<RegEx find="([kK]alib(?:ar|r[aeui]))\. *([0-9])" replaceWith="$1 .$2" />
<RegEx find="arantin" replaceWith="aranten" />
@ -4532,6 +4552,7 @@
<RegEx find="oriš[ćč]en" replaceWith="orišten" />
<RegEx find="([kK])orj?en" replaceWith="$1orijen" />
<RegEx find="\b([kK])orp([aei])" replaceWith="$1ošar$2" />
<RegEx find="kpj" replaceWith="koj" />
<RegEx find="kpr" replaceWith="kor" />
<RegEx find="ritikova([olt])" replaceWith="ritizira$1" />
<RegEx find="ritikuje" replaceWith="ritizira" />
@ -4943,6 +4964,7 @@
<RegEx find="([sSzZ])vesn" replaceWith="$1vjesn" />
<!-- razlikuju se svjetlo i svijetlo no tu automatske pomoći nema, već je na korisnicima da dodaju i gdje je potrebno! -->
<RegEx find="\b([sS])vetl" replaceWith="$1vjetl" />
<RegEx find="svetliti" replaceWith="svijetliti" />
<RegEx find="\b([sS])vešteni" replaceWith="$1većeni" />
<RegEx find="([sS])vež([aeiu]|e[mg]|[io]m|oj|in[aeiou]|inom)?\b" replaceWith="$1vjež$2" />
<RegEx find="\b([sS])vj?et([au]|om)?\b(?!\s+([A-ZČĐŠŽ]|vod|stvari?|čovj?ek|pism|zemlj))" replaceWith="$1vijet$2" />
@ -5316,7 +5338,7 @@
<RegEx find="jdi?n" replaceWith="jedin" />
<RegEx find="jerm" replaceWith="jem" />
<RegEx find="jho" replaceWith="jno" />
<RegEx find="jr([dgklst])" replaceWith="je$1" />
<RegEx find="jr([dgklnst])" replaceWith="je$1" />
<RegEx find="jw" replaceWith="je" />
<RegEx find="kba" replaceWith="kva" />
<RegEx find="kcj" replaceWith="kcij" />
@ -5372,6 +5394,8 @@
<RegEx find="(?&lt;![Mm])ekd" replaceWith="egd" />
<RegEx find="([mv])ešten" replaceWith="$1ješten" />
<RegEx find="mkes" replaceWith="mjes" />
<RegEx find="mkes" replaceWith="mjes" />
<RegEx find="mipl" replaceWith="mišl" />
<RegEx find="mnet" replaceWith="ment" />
<RegEx find="miniš[eu]" replaceWith="minira" />
<RegEx find="m([io]t?)rić" replaceWith="m$1rit ć" />
@ -5548,6 +5572,7 @@
<RegEx find="seden" replaceWith="sjeden" />
<RegEx find="selektuj" replaceWith="odaber" />
<RegEx find="shvt" replaceWith="shvat" />
<RegEx find="Sistin" replaceWith="Sikstin" />
<RegEx find="slk" replaceWith="slj" />
<RegEx find="sljen" replaceWith="slen" />
<RegEx find="sj([pv])" replaceWith="s$1j" />
@ -5557,7 +5582,7 @@
<RegEx find="(?&lt;!star)aćemo" replaceWith="at ćemo" />
<RegEx find="\bstaral" replaceWith="brinul" />
<RegEx find="\bStaral" replaceWith="Brinul" />
<RegEx find="tba" replaceWith="tva" />
<RegEx find="tb([ao])" replaceWith="tv$1" />
<RegEx find="stkl" replaceWith="stakl" />
<RegEx find="struis" replaceWith="struir" />
<RegEx find="struiše" replaceWith="struira" />
@ -5697,6 +5722,7 @@
<RegEx find="([kv])ršić" replaceWith="$1ršit ć" />
<RegEx find="vrtel" replaceWith="vrtjel" />
<RegEx find="vrza" replaceWith="veza" />
<RegEx find="vrzn" replaceWith="vezn" />
<RegEx find="vsj" replaceWith="vaj" />
<RegEx find="vsn" replaceWith="van" />
<RegEx find="([zZ])amenit" replaceWith="$1amijenit" />

View File

@ -1449,6 +1449,7 @@ We leverage the intrinsic rhythm of the image.</CreateSimpleChainingToolTip>
<GenerateBlankVideo>Generate blank video...</GenerateBlankVideo>
<GenerateVideoWithBurnedInSub>Generate video with burned-in subtitle...</GenerateVideoWithBurnedInSub>
<GenerateVideoWithEmbeddedSubs>Generate video with added/removed embedded subtitles...</GenerateVideoWithEmbeddedSubs>
<GenerateTransparentVideoWithSubs>Generate transparent video with subtitles...</GenerateTransparentVideoWithSubs>
<VideoAudioToTextX>Audio to text ({0})...</VideoAudioToTextX>
<ImportChaptersFromVideo>Import chapters from video</ImportChaptersFromVideo>
<GenerateImportShotChanges>Generate/import shot changes...</GenerateImportShotChanges>
@ -3175,6 +3176,7 @@ Continue?</RestoreDefaultSettingsMsg>
<MergingAudioTrackXOfY>Merging audio track: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Generating speech from text: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Review audio clips</ReviewAudioClips>
<CustomAudioEncoding>Custom audio encoding</CustomAudioEncoding>
<ReviewInfo>Review and edit/remove audio clips</ReviewInfo>
<Play>Play</Play>
<AutoContinue>Auto-continue</AutoContinue>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,60 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>UpdateAssemblyInfo</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<FileAlignment>512</FileAlignment>
<TargetFramework>net48</TargetFramework>
<OutputType>Exe</OutputType>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DBD4656C-5F40-4067-A70B-C4460DE20F77}</ProjectGuid>
<RootNamespace>UpdateAssemblyInfo</RootNamespace>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugType>pdbonly</DebugType>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommandLineRunner.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,46 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>UpdateLanguageFiles</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<FileAlignment>512</FileAlignment>
<TargetFramework>net48</TargetFramework>
<OutputType>Exe</OutputType>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{36BCA2A7-EE6B-45FD-AF90-D3F76A84DA76}</ProjectGuid>
<RootNamespace>UpdateLanguageFiles</RootNamespace>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugType>pdbonly</DebugType>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\ui\Logic\Language.cs">
<Link>Language.cs</Link>
@ -51,19 +15,5 @@
<Compile Include="..\ui\Logic\LanguageStructure.cs">
<Link>LanguageStructure.cs</Link>
</Compile>
<Compile Include="LanguageDeserializerGenerator.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,58 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.2" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>UpdateResourceScript</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<FileAlignment>512</FileAlignment>
<TargetFramework>net48</TargetFramework>
<OutputType>Exe</OutputType>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2CB9698C-F0A8-42FF-8938-DE047292D5FE}</ProjectGuid>
<RootNamespace>UpdateResourceScript</RootNamespace>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugType>pdbonly</DebugType>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -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
{
@ -51,7 +52,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;
}

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -13,7 +13,7 @@ namespace Nikse.SubtitleEdit.Core.Common
{
private static readonly Lazy<Configuration> Instance = new Lazy<Configuration>(() => new Configuration());
private readonly Lazy<Settings> _settings;
private readonly Lazy<Settings.Settings> _settings;
private readonly IEnumerable<Encoding> _encodings;
public static readonly string BaseDirectory = GetBaseDirectory();
@ -59,7 +59,7 @@ namespace Nikse.SubtitleEdit.Core.Common
private Configuration()
{
_encodings = GetAvailableEncodings();
_settings = new Lazy<Settings>(Settings.GetSettings);
_settings = new Lazy<Settings.Settings>(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<Encoding> AvailableEncodings => Instance.Value._encodings;

View File

@ -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

View File

@ -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
{

View File

@ -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);

View File

@ -51,7 +51,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.4" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="UTF.Unknown" Version="2.5.1" />
<PackageReference Include="zlib.net-mutliplatform" Version="1.0.6" />

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
using Nikse.SubtitleEdit.Core.Common;
namespace Nikse.SubtitleEdit.Core.Settings
{
public class AssaStorageCategory
{
public string Name { get; set; }
public bool IsDefault { get; set; }
public List<SsaStyle> Styles { get; set; }
}
}

View File

@ -0,0 +1,220 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}
}
}

View File

@ -0,0 +1,16 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

View File

@ -0,0 +1,22 @@
using System.Drawing;
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

View File

@ -0,0 +1,340 @@
using System.Linq;
using System.Text;
namespace Nikse.SubtitleEdit.Core.Settings
{
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();
}
}
}

View File

@ -0,0 +1,836 @@
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.Settings
{
public class GeneralSettings
{
public List<RulesProfile> 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 = "<Auto>";
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 = "<br />";
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<RulesProfile>();
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<RulesProfile> 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
});
}
}
}

View File

@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace Nikse.SubtitleEdit.Core.Settings
{
public class MultipleSearchAndReplaceGroup
{
public string Name { get; set; }
public bool Enabled { get; set; }
public List<MultipleSearchAndReplaceSetting> Rules { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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; }
}
}

View File

@ -0,0 +1,21 @@
using System;
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Text;
namespace Nikse.SubtitleEdit.Core.Settings
{
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));
}
}
}

View File

@ -0,0 +1,14 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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; }
}
}

View File

@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
namespace Nikse.SubtitleEdit.Core.Settings
{
public class RecentFilesSettings
{
private const int MaxRecentFiles = 25;
[XmlArrayItem("FileName")]
public List<RecentFileEntry> Files { get; set; }
public RecentFilesSettings()
{
Files = new List<RecentFileEntry>();
}
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;
}
}
}

View File

@ -0,0 +1,38 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,540 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using Nikse.SubtitleEdit.Core.Common;
namespace Nikse.SubtitleEdit.Core.Settings
{
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<PluginShortcut> 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<PluginShortcut>();
}
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;
}
}
}
}

View File

@ -0,0 +1,22 @@
using System.Drawing;
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

View File

@ -0,0 +1,224 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using Nikse.SubtitleEdit.Core.Common;
namespace Nikse.SubtitleEdit.Core.Settings
{
public class SubtitleSettings
{
public List<AssaStorageCategory> AssaStyleStorageCategories { get; set; }
public List<string> 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<AssaStorageCategory>();
AssaOverrideTagHistory = new List<string>();
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;
}
}
}

View File

@ -0,0 +1,671 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using Nikse.SubtitleEdit.Core.Common;
namespace Nikse.SubtitleEdit.Core.Settings
{
public class ToolsSettings
{
public List<AssaTemplateItem> 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<string> 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 bool GenTransparentVideoNonAssaBox { 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<AssaTemplateItem>();
StartSceneIndex = 1;
EndSceneIndex = 1;
VerifyPlaySeconds = 2;
FixShortDisplayTimesAllowMoveStartTime = false;
RemoveEmptyLinesBetweenText = true;
MusicSymbol = "♪";
MusicSymbolReplace = "♪,â™," + // ♪ + ♫ in UTF-8 opened as ANSI
"<s M/>,<s m/>," + // 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 <br>HH:mm:ss;dddd dd MMMM yyyy <br>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<string>();
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;
}
}
}

View File

@ -0,0 +1,18 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
public class VerifyCompletenessSettings
{
public ListSortEnum ListSort { get; set; }
public enum ListSortEnum : int
{
Coverage = 0,
Time = 1,
}
public VerifyCompletenessSettings()
{
ListSort = ListSortEnum.Coverage;
}
}
}

View File

@ -0,0 +1,87 @@
using System.Drawing;
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

View File

@ -0,0 +1,77 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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;
}
}
}

View File

@ -0,0 +1,15 @@
namespace Nikse.SubtitleEdit.Core.Settings
{
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";
}
}
}

View File

@ -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<string> 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();
}
}
}

View File

@ -177,6 +177,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
new PhoenixSubtitle(),
new PinnacleImpression(),
new PListCaption(),
new PodcastIndexer(),
new ProjectionSubtitleList(),
new QubeMasterImport(),
new QuickTimeText(),

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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

View File

@ -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
{

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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<object>());

View File

@ -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

View File

@ -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
{

View File

@ -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)

View File

@ -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
{

View File

@ -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
{

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -0,0 +1,887 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class GenerateTransparentVideoWithSubtitles
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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.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.contextMenuStripRes = new System.Windows.Forms.ContextMenuStrip(this.components);
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.checkBoxRightToLeft = new System.Windows.Forms.CheckBox();
this.groupBoxVideo = new System.Windows.Forms.GroupBox();
this.buttonVideoChooseStandardRes = new System.Windows.Forms.Button();
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();
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";
//
// bAspectRatio916180270ToolStripMenuItem
//
this.bAspectRatio916180270ToolStripMenuItem.Name = "bAspectRatio916180270ToolStripMenuItem";
this.bAspectRatio916180270ToolStripMenuItem.Size = new System.Drawing.Size(367, 22);
this.bAspectRatio916180270ToolStripMenuItem.Text = "1/4 B - Aspect Ratio 916 - (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 916 - (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 916 - (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 916 - (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 916 - (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 916 - (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 169 - (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 169 - (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 169 - (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 169 - (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 169 - (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 169 - (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 169 - (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 169 - (4096x2160)";
this.x2160ToolStripMenuItem.Click += new System.EventHandler(this.ResolutionPickClick);
//
// contextMenuStripRes
//
this.contextMenuStripRes.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
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, 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
//
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});
//
// 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";
//
// 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";
//
// 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;
//
// 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";
//
// 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";
//
// 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.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GenerateTransparentVideoWithSubtitles_FormClosing);
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.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;
}
}

View File

@ -0,0 +1,641 @@
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.Main.Menu.Video.GenerateTransparentVideoWithSubs.Trim('.');
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;
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.GenTransparentVideoNonAssaBox;
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);
panelOutlineColor.BackColor = Configuration.Settings.Tools.GenVideoNonAssaBoxColor;
panelForeColor.BackColor = Configuration.Settings.Tools.GenVideoNonAssaTextColor;
}
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;
labelInfo.Text = assa ? LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn : 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<SsaStyle> { 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;
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;
}
var 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";
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);
}
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;
}
}
}

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStripBatch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>6, 10</value>
</metadata>
<metadata name="contextMenuStripRes.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>185, 10</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>352, 10</value>
</metadata>
<metadata name="contextMenuStripGenerate.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>440, 10</value>
</metadata>
</root>

View File

@ -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();
@ -2302,6 +2303,7 @@ namespace Nikse.SubtitleEdit.Forms
this.generateBlankVideoToolStripMenuItem,
this.generateVideoWithSoftcodedSubtitlesToolStripMenuItem,
this.generateVideoWithHardcodedSubtitleToolStripMenuItem,
this.generaeTransparentVideoWithSubtitleToolStripMenuItem,
this.audioToTextWhisperTolStripMenuItem,
this.videoaudioToTextToolStripMenuItem,
this.textToSpeechAndAddToVideoToolStripMenuItem,
@ -2418,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";
@ -6545,5 +6554,6 @@ namespace Nikse.SubtitleEdit.Forms
private ToolStripMenuItem videoInfoToolStripMenuItem;
private ToolStripMenuItem openContainingFolderToolStripMenuItem;
private ToolStripMenuItem insertNewSubtitleHereToolStripMenuItem;
private ToolStripMenuItem generaeTransparentVideoWithSubtitleToolStripMenuItem;
}
}

View File

@ -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;
@ -1086,7 +1087,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 +1109,7 @@ namespace Nikse.SubtitleEdit.Forms
SelectListViewIndexAndEnsureVisible(_subtitle.GetIndex(e.Paragraph));
}
timerWaveform.Start();
timerWaveform?.Start();
}
private void AudioWaveform_OnParagraphRightClicked(object sender, AudioVisualizer.ParagraphEventArgs e)
@ -1840,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;
@ -2324,7 +2326,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 +4143,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 +8969,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 +9188,7 @@ namespace Nikse.SubtitleEdit.Forms
toolStripMenuItemSetLanguage.Visible = false;
toolStripMenuItemSetLayer.Visible = false;
List<string> 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<string>();
toolStripMenuItemWebVTT.Visible = false;
@ -9817,6 +9834,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)
@ -36861,5 +36900,22 @@ namespace Nikse.SubtitleEdit.Forms
ShowStatus(string.Format(_language.VideoControls.NewTextInsertAtX, newParagraph.StartTime.ToShortString()));
}
private void generaeTransparentVideoWithSubtitleToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!IsSubtitleLoaded)
{
DisplaySubtitleNotLoadedMessage();
return;
}
using (var form = new GenerateTransparentVideoWithSubtitles(_subtitle, GetCurrentSubtitleFormat(), _videoInfo))
{
if (form.ShowDialog(this) != DialogResult.OK)
{
return;
}
}
}
}
}
}

View File

@ -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

View File

@ -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
{
@ -92,6 +93,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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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))
{

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View File

@ -17,6 +17,8 @@
{
components.Dispose();
}
_httpClient?.Dispose();
base.Dispose(disposing);
}
@ -52,6 +54,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 +68,7 @@
this.subtitleListViewSource = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.contextMenuStrip2.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.contextMenuStripOlamaModels.SuspendLayout();
this.SuspendLayout();
//
// progressBar1
@ -262,6 +268,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, 48);
//
// 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)));
@ -420,6 +448,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);
@ -443,6 +472,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);
@ -495,6 +525,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 +565,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;
}
}

View File

@ -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;
}
@ -408,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");
@ -1188,10 +1165,15 @@ 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))
{
await DownloadOllamaModelsAsync();
}
}
private void nikseComboBoxUrl_SelectedIndexChanged(object sender, EventArgs e)
@ -1466,5 +1448,79 @@ namespace Nikse.SubtitleEdit.Forms.Translate
SetupLanguageSettings();
}
}
private async void UpdateLocalModelsToolStripMenuItem_Click(object sender, EventArgs e)
{
await DownloadOllamaModelsAsync(shouldNotifyOnError: true);
}
private async Task DownloadOllamaModelsAsync(bool shouldNotifyOnError = false)
{
try
{
var models = await GetModelsAsync(nikseComboBoxUrl.Text.Replace("generate", "tags")).ConfigureAwait(true);
if (models.Count > 0)
{
FillOllamaModels(models.ToArray());
}
}
catch (Exception exception)
{
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<List<string>> GetModelsAsync(string url)
{
var result = await GetOllamaClient().GetAsync(new Uri(url)).ConfigureAwait(false);
var bytes = await result.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
if (!result.IsSuccessStatusCode)
{
return new List<string>();
}
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() => _httpClient ?? (_httpClient = new HttpClient());
private void FillOllamaModels(string[] models)
{
if (!(GetCurrentEngine() is OllamaTranslate))
{
return;
}
comboBoxFormality.BeginUpdate();
var v = comboBoxFormality.Text;
comboBoxFormality.Items.Clear();
comboBoxFormality.Items.AddRange(models);
comboBoxFormality.Text = v;
comboBoxFormality.EndUpdate();
}
private void findModelsToolStripMenuItem_Click(object sender, EventArgs e)
{
UiUtil.OpenUrl("https://ollama.com/library");
}
}
}

View File

@ -123,4 +123,7 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStripOlamaModels.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>327, 17</value>
</metadata>
</root>

View File

@ -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
@ -89,6 +90,24 @@ namespace Nikse.SubtitleEdit.Forms.Translate
private void buttonOk_Click(object sender, EventArgs e)
{
if (nikseTextBoxPrompt.Text.Contains('{'))
{
MessageBox.Show("Character not allowed in prompt: {");
return;
}
if (nikseTextBoxPrompt.Text.Contains('}'))
{
MessageBox.Show("Character not allowed in prompt: }");
return;
}
if (nikseTextBoxPrompt.Text.Length > 1000)
{
MessageBox.Show("Too many characters in prompt");
return;
}
Configuration.Settings.Tools.AutoTranslateDelaySeconds = (int)nikseUpDownDelay.Value;
Configuration.Settings.Tools.AutoTranslateMaxBytes = (int)nikseUpDownMaxBytes.Value;

View File

@ -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
{

View File

@ -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;
}
}

View File

@ -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)
{
@ -917,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)
@ -1048,72 +1068,79 @@ 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();
if (_abort)
{
return false;
}
}
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<AzureVoiceModel> GetAzureVoices(bool useCache)
@ -1217,73 +1244,80 @@ 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 = $"<speak version='1.0' xml:lang='en-US'><voice xml:lang='en-US' xml:gender='{voice.Gender}' name='{voice.ShortName}'>{System.Net.WebUtility.HtmlEncode(text)}</voice></speak>";
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();
if (_abort)
{
return false;
}
}
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 = $"<speak version='1.0' xml:lang='en-US'><voice xml:lang='en-US' xml:gender='{voice.Gender}' name='{voice.ShortName}'>{System.Net.WebUtility.HtmlEncode(text)}</voice></speak>";
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)
@ -1790,22 +1824,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))
@ -1887,29 +1923,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<ElevenLabModel>();
}
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<ElevenLabModel>();
}
File.WriteAllBytes(jsonFileName, bytes);
}
if (File.Exists(jsonFileName))
@ -1975,24 +2013,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<string>();
}
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<string>();
}
File.WriteAllBytes(jsonFileName, bytes);
}
}
if (File.Exists(jsonFileName))
@ -2313,5 +2353,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);
}
}
}
}

View File

@ -0,0 +1,147 @@
namespace Nikse.SubtitleEdit.Forms.Tts
{
sealed partial class TtsAudioEncoding
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@ -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;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -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
{

View File

@ -3,7 +3,7 @@
<General>
<Title>Subtitle Edit</Title>
<Version>4.0.6</Version>
<TranslatedBy>Последен превод на български 20.05.2024: KalinM</TranslatedBy>
<TranslatedBy>Последен превод на български 24.06.2024: KalinM</TranslatedBy>
<CultureName>bg-BG</CultureName>
<HelpFile />
<Ok>OK</Ok>
@ -18,6 +18,7 @@
<Preview>Преглед</Preview>
<ShowPreview>Покажи преглед</ShowPreview>
<HidePreview>Скрий прегледа</HidePreview>
<SubtitleFile>Файл със субтитри</SubtitleFile>
<SubtitleFiles>Субтитри</SubtitleFiles>
<AllFiles>Всички файлове</AllFiles>
<VideoFiles>Видео файлове</VideoFiles>
@ -1021,6 +1022,7 @@ https://github.com/SubtitleEdit/subtitleedit
<GetEndPosition>Заемане на крайна позиция</GetEndPosition>
<UseSource>Използване на източника</UseSource>
<UseSourceResolution>Използване резолюцията на източника</UseSourceResolution>
<OutputSettings>Изходен файл/папка...</OutputSettings>
</GenerateVideoWithBurnedInSubs>
<GenerateVideoWithEmbeddedSubs>
<Title>Генериране на видео с Добавяне/Премахване на вградени субтитри</Title>
@ -1060,15 +1062,7 @@ https://github.com/SubtitleEdit/subtitleedit
<To>Към:</To>
<Translate>Превод</Translate>
<PleaseWait>Моля изчакайте... това може да продължи малко</PleaseWait>
<PoweredByGoogleTranslate>С помощта на Google преводач</PoweredByGoogleTranslate>
<PoweredByMicrosoftTranslate>С помощта на Microsoft преводач</PoweredByMicrosoftTranslate>
<PoweredByX>С помощта на {0}</PoweredByX>
<MsClientSecretNeeded>Съжаляваме, но за да използвате най-новия преводач на Microsoft, ви е необходим ключ от Microsoft за когнитивни услуги «Преводач на текст".
Отворете "Опции -&gt; Настройки -&gt; Автоматичен превод", за да въведете вашия ключ.</MsClientSecretNeeded>
<GoogleNoApiKeyWarning>Трудно се превежда без API ключ... (бавни и ограничени данни)
За да използвате API ключ, отворете "Опции -&gt; Настройки -&gt; Автоматичен превод", за да въведете вашия API ключ за преводач на Google.</GoogleNoApiKeyWarning>
<Service>Услуги:</Service>
<LineMergeHandling>Обединяване на редове:</LineMergeHandling>
<ProcessorMergeNext>Обединяване макс. два реда</ProcessorMergeNext>
<ProcessorSentence>Обединяване на изречения</ProcessorSentence>
@ -1095,6 +1089,7 @@ https://github.com/SubtitleEdit/subtitleedit
<Delay>Закъснение между повикванията на сървъра</Delay>
<MaxBytes>Макс. брой байтове при всяко повикване на сървъра</MaxBytes>
<PromptX>Запитване за {0}</PromptX>
<TranslateLinesSeparately>Превеждане на всеки ред поотделно</TranslateLinesSeparately>
</GoogleTranslate>
<GoogleOrMicrosoftTranslate>
<Title>Сравнителен превод в Google и Microsoft</Title>
@ -1453,6 +1448,7 @@ https://github.com/SubtitleEdit/subtitleedit
<GenerateBlankVideo>Генериране на празно видео ...</GenerateBlankVideo>
<GenerateVideoWithBurnedInSub>Генериране на видео с вградени субтитри ...</GenerateVideoWithBurnedInSub>
<GenerateVideoWithEmbeddedSubs>Генериране на видео с Добавяне/Премахване на вградени субтитри ...</GenerateVideoWithEmbeddedSubs>
<GenerateTransparentVideoWithSubs>Генериране на прозрачно видео със субтитри...</GenerateTransparentVideoWithSubs>
<VideoAudioToTextX>Аудио в текст чрез {0} разпознаване на реч ...</VideoAudioToTextX>
<ImportChaptersFromVideo>Импорт на глави от видео</ImportChaptersFromVideo>
<GenerateImportShotChanges>Създаване/Импортиране на промените в сцената ...</GenerateImportShotChanges>
@ -2141,6 +2137,8 @@ https://github.com/SubtitleEdit/subtitleedit
<DurationGreaterThan>Продължителност по-голяма от</DurationGreaterThan>
<CpsLessThan>CPS по-малко от</CpsLessThan>
<CpsGreaterThan>CPS по-голям от</CpsGreaterThan>
<LengthLessThan>Дължината е по-малка от</LengthLessThan>
<LengthGreaterThan>Дължината е по-голяма от</LengthGreaterThan>
<ExactlyOneLine>Точно един ред</ExactlyOneLine>
<ExactlyTwoLines>Точно два реда</ExactlyTwoLines>
<MoreThanTwoLines>Повече от два реда</MoreThanTwoLines>
@ -3179,6 +3177,7 @@ https://github.com/SubtitleEdit/subtitleedit
<MergingAudioTrackXOfY>Обединяване на аудио запис: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Генериране на реч от текст: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Преглед на аудио клипове</ReviewAudioClips>
<CustomAudioEncoding>Потребителско аудио кодиране</CustomAudioEncoding>
<ReviewInfo>Преглеждане и редактиране/премахване на аудио клипове</ReviewInfo>
<Play>Възпроизвеждане</Play>
<AutoContinue>Авт. продължаване</AutoContinue>

View File

@ -1445,6 +1445,7 @@ Vi udnytter billedets indre rytme.</CreateSimpleChainingToolTip>
<GenerateBlankVideo>Generer blank video...</GenerateBlankVideo>
<GenerateVideoWithBurnedInSub>Generer video med indbrændt sub...</GenerateVideoWithBurnedInSub>
<GenerateVideoWithEmbeddedSubs>Generer video med indlejrede undertekster...</GenerateVideoWithEmbeddedSubs>
<GenerateTransparentVideoWithSubs>Generer gennemsigtig video med undertekster...</GenerateTransparentVideoWithSubs>
<VideoAudioToTextX>Lyd til tekst ({0})...</VideoAudioToTextX>
<ImportChaptersFromVideo>Importer kapitler fra video</ImportChaptersFromVideo>
<GenerateImportShotChanges>Generer/importer sceneændringer...</GenerateImportShotChanges>
@ -2128,6 +2129,8 @@ Hvis du har redigeret denne fil med Subtitle Edit du måske finde en backup via
<DurationGreaterThan>Varighed større end</DurationGreaterThan>
<CpsLessThan>CPS mindre end</CpsLessThan>
<CpsGreaterThan>CPS større end</CpsGreaterThan>
<LengthLessThan>Længde mindre end</LengthLessThan>
<LengthGreaterThan>Længde større end</LengthGreaterThan>
<ExactlyOneLine>Præcis én linje</ExactlyOneLine>
<ExactlyTwoLines>Præcis to linjer</ExactlyTwoLines>
<MoreThanTwoLines>Mere end to linjer</MoreThanTwoLines>
@ -3166,6 +3169,7 @@ Fortsæt?</RestoreDefaultSettingsMsg>
<MergingAudioTrackXOfY>Samler lydspor: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Genererer tale fra tekst: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Gennemgå lydklip</ReviewAudioClips>
<CustomAudioEncoding>Brugerdefineret lyd encoding</CustomAudioEncoding>
<ReviewInfo>Gennemgå og rediger/fjern lydklip</ReviewInfo>
<Play>Spil</Play>
<AutoContinue>Auto-fortsæt</AutoContinue>

View File

@ -3,7 +3,7 @@
<General>
<Title>Subtitle Edit</Title>
<Version>4.0.6</Version>
<TranslatedBy>Suomentanut vm, päivittänyt Teijo S. [15-04-2024]</TranslatedBy>
<TranslatedBy>Suomentanut vm, päivittänyt Teijo S. [04-06-2024]</TranslatedBy>
<CultureName>fi-FI</CultureName>
<HelpFile />
<Ok>&amp;OK</Ok>
@ -19,6 +19,7 @@
<Preview>Esikatselu</Preview>
<ShowPreview>Näytä esikatselu</ShowPreview>
<HidePreview>Piilota esikatselu</HidePreview>
<SubtitleFile>Tekstitystiedosto</SubtitleFile>
<SubtitleFiles>Tekstitystiedostot</SubtitleFiles>
<AllFiles>Kaikki tiedostot</AllFiles>
<VideoFiles>Videotiedostot</VideoFiles>
@ -55,7 +56,7 @@
<FrameRate>Kuvataajuus</FrameRate>
<Name>Nimi</Name>
<FileNameXAndSize>Tiedostonimi: {0} ({1})</FileNameXAndSize>
<ResolutionX>Resoluutio: {0}</ResolutionX>
<ResolutionX>Tarkkuus: {0}</ResolutionX>
<FrameRateX>Kuvataajuus: {0:0.0 ###}</FrameRateX>
<TotalFramesX>Kuvia yhteensä: {0: #,## 0.##}</TotalFramesX>
<VideoEncodingX>Videokoodaus: {0}</VideoEncodingX>
@ -260,14 +261,14 @@ HUOM! Tarkista vapaa levytila.</WaveFileMalformed>
<TakePosFromVideo>Kaappaa videon sijainti</TakePosFromVideo>
</AssaProgressBarGenerator>
<AssaResolutionChanger>
<Title>Muuta ASSA-resoluutiota</Title>
<SourceVideoRes>Lähderesoluutio</SourceVideoRes>
<TargetVideoRes>Kohderesoluutio</TargetVideoRes>
<ChangeResolutionMargins>Muuta reunuksen resoluutiota</ChangeResolutionMargins>
<ChangeResolutionFontSize>Muuta fonttikoon resoluutiota</ChangeResolutionFontSize>
<ChangeResolutionPositions>Muuta sijainnin resoluutiota</ChangeResolutionPositions>
<ChangeResolutionDrawing>Muuta piirustuksen resoluutiota</ChangeResolutionDrawing>
<SourceAndTargetEqual>Lähde- ja kohderesoluutiot ovat samat - ei muutettavaa.</SourceAndTargetEqual>
<Title>Muuta ASSA-tarkkuutta</Title>
<SourceVideoRes>Lähdetarkkuuus</SourceVideoRes>
<TargetVideoRes>Kohdetarkkuuus</TargetVideoRes>
<ChangeResolutionMargins>Muuta reunuksen tarkkuutta</ChangeResolutionMargins>
<ChangeResolutionFontSize>Muuta fonttikoon tarkkuutta</ChangeResolutionFontSize>
<ChangeResolutionPositions>Muuta sijainnin tarkkuutta</ChangeResolutionPositions>
<ChangeResolutionDrawing>Muuta piirustuksen tarkkuutta</ChangeResolutionDrawing>
<SourceAndTargetEqual>Lähde- ja kohdetarkkuudet ovat samat - ei muutettavaa.</SourceAndTargetEqual>
</AssaResolutionChanger>
<ImageColorPicker>
<Title>Värinpoimintatyökalu</Title>
@ -302,7 +303,7 @@ rostiedosto</DrawingFile>
<CurrentTextPositionX>Tekstin sijainti: {0}</CurrentTextPositionX>
<SetPosInfo>Napsauta videota paikan asettamiseksi/siirtämiseksi</SetPosInfo>
<Clipboard>Leikepöytä</Clipboard>
<ResolutionMissing>ToistoResoX/ToistoResoY ei ole asetettu - asetaanko tarkkuus nyt?</ResolutionMissing>
<ResolutionMissing>ToistoTarkkX/ToistoTarkkY ei ole asetettu - asetaanko tarkkuus nyt?</ResolutionMissing>
<RotateXAxis>Kierrä {0}-akselia</RotateXAxis>
<DistortX>Vääristä {0}</DistortX>
</AssaSetPosition>
@ -382,8 +383,8 @@ rostiedosto</DrawingFile>
<SearchFolderScanVideo>Etsi videotiedostoja myös hakukansiosta (hidas)</SearchFolderScanVideo>
</BatchConvert>
<BeautifyTimeCodes>
<Title>Kaunista aikaleimat</Title>
<TitleSelectedLines>Kaunista aikaleimat ({0} valittua riviä)</TitleSelectedLines>
<Title>Sievistä aikaleimat</Title>
<TitleSelectedLines>Sievistä aikaleimat ({0} valittua riviä)</TitleSelectedLines>
<GroupTimeCodes>Aikaleimat</GroupTimeCodes>
<AlignTimeCodes>Tahdista aikaleimat kehysten aikaleimoihin</AlignTimeCodes>
<ExtractExactTimeCodes>Käytä FFprobea kehysten tarkkojen aikaleimojen purkamiseksi</ExtractExactTimeCodes>
@ -729,7 +730,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<TextLeftJustifiedText>Vasemmalle tasattu teksti</TextLeftJustifiedText>
<TextCenteredText>Keskitetty teksti</TextCenteredText>
<TextRightJustifiedText>Oikealle tasattu teksti</TextRightJustifiedText>
<UseBoxForOneNewLine>*KESKEN*</UseBoxForOneNewLine>
<UseBoxForOneNewLine>Valinta 'Käytä taustaväriä' vain yhdelle uudelle riville</UseBoxForOneNewLine>
</EbuSaveOptions>
<EffectKaraoke>
<Title>Karaoke tehoste</Title>
@ -800,7 +801,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<Depth>Syvyys</Depth>
<ExportAllLines>Vie kaikki rivit</ExportAllLines>
<XImagesSavedInY>Tallennettu {0} kuvaa kohteeseen {1}</XImagesSavedInY>
<VideoResolution>Resoluutio</VideoResolution>
<VideoResolution>Tarkkuuus</VideoResolution>
<Align>Tasaus</Align>
<Left>Vasen</Left>
<Right>Oikea</Right>
@ -1025,6 +1026,9 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<AlignRight>Tasaus oikealle</AlignRight>
<GetStartPosition>Lue aloituskohta</GetStartPosition>
<GetEndPosition>Lue lopetuskohta</GetEndPosition>
<UseSource>Käytä lähdettä</UseSource>
<UseSourceResolution>Käytä lähteen tarkkuutta</UseSourceResolution>
<OutputSettings>Tulostiedosto/kansio...</OutputSettings>
</GenerateVideoWithBurnedInSubs>
<GenerateVideoWithEmbeddedSubs>
<Title>Luo video lisätyin/poistetuin upotetuin tekstityksin</Title>
@ -1065,13 +1069,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<To>Mihin:</To>
<Translate>Käännä</Translate>
<PleaseWait>Odota... kestää vähän aikaa</PleaseWait>
<PoweredByGoogleTranslate>Käytetty Google-kääntäjää</PoweredByGoogleTranslate>
<PoweredByMicrosoftTranslate>Käytetty Microsoft-kääntäjää</PoweredByMicrosoftTranslate>
<PoweredByX>Käytetty {0}</PoweredByX>
<MsClientSecretNeeded>Uusimman Microsoft-kääntäjän käyttö edellyttää Microsoftin "Kääntäjä-teksti" -avainta. Syötä avain käyttämällä valikkopolkua Valinnat -&gt; Asetukset -&gt; Työkalut.
</MsClientSecretNeeded>
<GoogleNoApiKeyWarning>Yritä kääntämistä ilman API-avainta (hidas, rajoitettu sanavarasto)</GoogleNoApiKeyWarning>
<Service>Palvelu:</Service>
<LineMergeHandling>Rivien yhdistäminen:</LineMergeHandling>
<ProcessorMergeNext>Yhdistä enintään kaksi riviä</ProcessorMergeNext>
<ProcessorSentence>Yhdistä rivit</ProcessorSentence>
@ -1091,6 +1089,13 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<XRequiresAnApiKey>"{0}" vaatii API-avaimen.</XRequiresAnApiKey>
<ReadMore>Halautko lisätietoja?</ReadMore>
<Formality>Muodollisuus</Formality>
<TranslateCurrentLine>Käännä vain nykyinen rivi</TranslateCurrentLine>
<ReTranslateCurrentLine>Käännä nykyinen rivi uudelleen</ReTranslateCurrentLine>
<MergeSplitStrategy>Jakauta käsittely</MergeSplitStrategy>
<Delay>Palvelinkutsujen viive</Delay>
<MaxBytes>Palvelinkutsujen enimmäiskoko (tavua)</MaxBytes>
<PromptX>Pyydä syöte: {0}</PromptX>
<TranslateLinesSeparately>Käännä jokainen rivi erikseen</TranslateLinesSeparately>
</GoogleTranslate>
<GoogleOrMicrosoftTranslate>
<Title>Google vastaan Microsoft-kääntäjä</Title>
@ -1418,7 +1423,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<Duration>Kesto</Duration>
<ListErrors>Luetteloi virheet..</ListErrors>
<NetflixQualityCheck>Netflix-laadun tarkistus</NetflixQualityCheck>
<BeautifyTimeCodes>Kaunista aikaleimat...</BeautifyTimeCodes>
<BeautifyTimeCodes>Sievistä aikaleimat...</BeautifyTimeCodes>
<TextAlphabetically>Teksti - aakkosjärjestyksessä</TextAlphabetically>
<TextSingleLineMaximumLength>Teksti - suurin yhden rivin pituus</TextSingleLineMaximumLength>
<TextTotalLength>Teksti - pituus yhteensä</TextTotalLength>
@ -1513,7 +1518,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<VisualSync>Visuaalinen tahdistus</VisualSync>
<SpellCheck>Oikoluku</SpellCheck>
<NetflixQualityCheck>Netflix-laaduntarkastus</NetflixQualityCheck>
<BeautifyTimeCodes>Kaunista aikaleimat</BeautifyTimeCodes>
<BeautifyTimeCodes>Sievistä aikaleimat</BeautifyTimeCodes>
<Settings>Asetukset</Settings>
<Help>Ohje</Help>
<Layout>Asettelu</Layout>
@ -1590,7 +1595,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<KaraokeEffect>Karaoketehoste</KaraokeEffect>
<ShowSelectedLinesEarlierLater>Näytä valitut rivit aikaisemmin/myöhemmin</ShowSelectedLinesEarlierLater>
<VisualSyncSelectedLines>Valittujen rivien visuaalinen tahdistus</VisualSyncSelectedLines>
<BeautifyTimeCodesOfSelectedLines>Kaunista valittujen rivien aikaleimat...</BeautifyTimeCodesOfSelectedLines>
<BeautifyTimeCodesOfSelectedLines>Sievistä valittujen rivien aikaleimat...</BeautifyTimeCodesOfSelectedLines>
<GoogleAndMicrosoftTranslateSelectedLine>Google/Microsoft-käännös alkuperäiselle riville</GoogleAndMicrosoftTranslateSelectedLine>
<SelectedLines>Valitut rivit</SelectedLines>
<TranslateSelectedLines>Käännä valitut rivit</TranslateSelectedLines>
@ -1614,6 +1619,7 @@ Hyödynnämme kuvan sisäistä rytmiä.</CreateSimpleChainingToolTip>
<GoToSourceView>Siirry lähdenäkymään</GoToSourceView>
<GoToListView>Siirry luettelonäkymään</GoToListView>
<ExtractAudio>Irroita ääni</ExtractAudio>
<MediaInfo>Mediatiedot</MediaInfo>
</ContextMenu>
</Menu>
<Controls>
@ -1743,10 +1749,10 @@ Haluatko aloittaa asiakirjan alusta ja hakea kerran vielä?</FindContinue>
<CommonErrorsFixed>Yleisiä virheitä korjattu</CommonErrorsFixed>
<BeforeRenumbering>Ennen uudelleennumerointia</BeforeRenumbering>
<RenumberedStartingFromX>Uudelleen numeroitiin alkaen: {0}</RenumberedStartingFromX>
<BeforeBeautifyTimeCodes>Ennen aikaleimojen kaunistamista</BeforeBeautifyTimeCodes>
<BeforeBeautifyTimeCodesSelectedLines>Ennen aikaleimojen kaunistamista valituilla riveillä</BeforeBeautifyTimeCodesSelectedLines>
<BeautifiedTimeCodes>Aikaleimat kaunistettu</BeautifiedTimeCodes>
<BeautifiedTimeCodesSelectedLines>Valittujen rivien aikaleimat kaunistettu</BeautifiedTimeCodesSelectedLines>
<BeforeBeautifyTimeCodes>Ennen aikaleimojen sievistämistä</BeforeBeautifyTimeCodes>
<BeforeBeautifyTimeCodesSelectedLines>Ennen aikaleimojen sievistämistä valituilla riveillä</BeforeBeautifyTimeCodesSelectedLines>
<BeautifiedTimeCodes>Aikaleimat sievistetty</BeautifiedTimeCodes>
<BeautifiedTimeCodesSelectedLines>Valittujen rivien aikaleimat sievistetty</BeautifiedTimeCodesSelectedLines>
<BeforeRemovalOfTextingForHearingImpaired>Ennen tekstityksen poistamista kuulovammaisille</BeforeRemovalOfTextingForHearingImpaired>
<TextingForHearingImpairedRemovedOneLine>Tekstitys kuulovammaisille poistettu: Yksi rivi</TextingForHearingImpairedRemovedOneLine>
<TextingForHearingImpairedRemovedXLines>Tekstitys kuulovammaisille poistettu: {0} riviä</TextingForHearingImpairedRemovedXLines>
@ -2123,6 +2129,11 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<EvenLines>Parilliset rivit</EvenLines>
<DurationLessThan>Kesto alle</DurationLessThan>
<DurationGreaterThan>Kesto yli</DurationGreaterThan>
<CpsLessThan>Merkkejä sekunnissa vähemmän kuin</CpsLessThan>
<CpsGreaterThan>Merkkejä sekunnissa enemmän kuin</CpsGreaterThan>
<LengthLessThan>Pituus vähemmän kuin</LengthLessThan>
<LengthGreaterThan>Pituus en
emmän kuin</LengthGreaterThan>
<ExactlyOneLine>Tasan yksi rivi</ExactlyOneLine>
<ExactlyTwoLines>Tasan kaksi riviä</ExactlyTwoLines>
<MoreThanTwoLines>Enemmän kuin kaksi riviä</MoreThanTwoLines>
@ -2304,7 +2315,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<WordLists>Sanaluettelot</WordLists>
<SsaStyle>Sub Station Alpha</SsaStyle>
<Network>Verkko</Network>
<FileTypeAssociations>Tiedostotyyppien liitännät</FileTypeAssociations>
<FileTypeAssociations>Tiedostotyyppien liitokset</FileTypeAssociations>
<Rules>Säännöt</Rules>
<ShowToolBarButtons>Työkalupalkin kuvakkeet</ShowToolBarButtons>
<New>Uusi</New>
@ -2317,7 +2328,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<BurnIn>Upotettu</BurnIn>
<SpellCheck>Oikoluku</SpellCheck>
<NetflixQualityCheck>Netflix-laaduntarkastus</NetflixQualityCheck>
<BeautifyTimeCodes>Kaunista aikaleimat</BeautifyTimeCodes>
<BeautifyTimeCodes>Sievistä aikaleimat</BeautifyTimeCodes>
<SettingsName>Asetukset</SettingsName>
<ToggleBookmarks>Kirjanmerkit päälle/pois</ToggleBookmarks>
<FocusTextBox>Tarkenna tekstilaatikkoon</FocusTextBox>
@ -2370,9 +2381,9 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<StartInSourceView>Käynnistä lähdenäkymässä</StartInSourceView>
<RemoveBlankLinesWhenOpening>Poista tekstityksestä tyhjät rivit avattaessa</RemoveBlankLinesWhenOpening>
<RemoveBlankLines>Poista tekstityksestä tyhjät rivit</RemoveBlankLines>
<ApplyAssaOverrideTags>Käytä valintaan ASSA päällekirjoitusmerkintöjä</ApplyAssaOverrideTags>
<SetAssaPosition>Aseta/hae ASSA sijainti</SetAssaPosition>
<SetAssaResolution>Aseta ASSA tarkkuus (ToistoResoX/ToistoResoY)</SetAssaResolution>
<ApplyAssaOverrideTags>Käytä valintaan ASSA-päällekirjoitusmerkintöjä</ApplyAssaOverrideTags>
<SetAssaPosition>Aseta/hae ASSA-sijainti</SetAssaPosition>
<SetAssaResolution>Aseta ASSA-tarkkuus (ToistoResoX/ToistoResoY)</SetAssaResolution>
<SetAssaBgBox>Aseta ASSA taustalaatikko</SetAssaBgBox>
<TakeAutoBackup>Luo varmuuskopio nyt</TakeAutoBackup>
<ShowLineBreaksAs>Rivinvaihtojen esitystapa luettelonäkymässä:</ShowLineBreaksAs>
@ -2527,13 +2538,15 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<CpsLineLengthStyleCalcNoSpace>Laske kaikki paitsi välilyönnit</CpsLineLengthStyleCalcNoSpace>
<CpsLineLengthStyleCalcCjk>CJK 1, latin 0.5</CpsLineLengthStyleCalcCjk>
<CpsLineLengthStyleCalcCjkNoSpace>CJK 1, latin 0.5, välilyönti 0</CpsLineLengthStyleCalcCjkNoSpace>
<CpsLineLengthStyleCalcIncludeCompositionCharacters>Sisällytä sävellysmerkit</CpsLineLengthStyleCalcIncludeCompositionCharacters>
<CpsLineLengthStyleCalcIncludeCompositionCharactersNotSpace>Sisällytä sävellysmerkit, ei välilyöntejä</CpsLineLengthStyleCalcIncludeCompositionCharactersNotSpace>
<CpsLineLengthStyleCalcNoSpaceOrPunctuation>Ei välilyöntiä tai välimerkkejä ()[]-:;,.!?</CpsLineLengthStyleCalcNoSpaceOrPunctuation>
<CpsLineLengthStyleCalcNoSpaceOrPunctuationCpsOnly>Ei välilyöntiä tai välimerkkejä, vain merkit</CpsLineLengthStyleCalcNoSpaceOrPunctuationCpsOnly>
<MusicSymbol>Musiikkisymboli</MusicSymbol>
<MusicSymbolsReplace>Korvattavat musiikkisymbolit (pilkuin eroteltuina)</MusicSymbolsReplace>
<FixCommonOcrErrorsUseHardcodedRules>Korjaa yleiset tekstintunnistusvirheet</FixCommonOcrErrorsUseHardcodedRules>
<UseWordSplitList>Käytä sanottejan ositusluetteloa (OCR + FCE)</UseWordSplitList>
<AvoidPropercase>Vältä erisinimiä</AvoidPropercase>
<AvoidPropercase>Vältä erisnimiä</AvoidPropercase>
<FixCommonerrorsFixShortDisplayTimesAllowMoveStartTime>Korjaa liian lyhyet kestot aloitusaikaa muuttamalla</FixCommonerrorsFixShortDisplayTimesAllowMoveStartTime>
<FixCommonErrorsSkipStepOne>Ohita ensimmäinen vaihe (korjaussääntöjen ohitus)</FixCommonErrorsSkipStepOne>
<DefaultFormat>Oletusmuoto</DefaultFormat>
@ -2770,7 +2783,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<ListViewColumnTextUp>Sarake, teksti ylös</ListViewColumnTextUp>
<ListViewColumnTextDown>Sarake, teksti alas</ListViewColumnTextDown>
<ListViewGoToNextError>Siirry seuraavaan virheeseen</ListViewGoToNextError>
<ListViewListErrors>Luetteloi virheeet</ListViewListErrors>
<ListViewListErrors>Luetteloi virheet</ListViewListErrors>
<ListViewListSortByX>Järjestä {0} mukaan</ListViewListSortByX>
<ShowStyleManager>Käynnistä tyylinhallinta</ShowStyleManager>
<MainTextBoxMoveLastWordDown>Siirrä viimeinen sana seuraavalle riville</MainTextBoxMoveLastWordDown>
@ -2806,7 +2819,9 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<HowToSignUp>Tilinluontiohje</HowToSignUp>
<MicrosoftTranslateApiKey>Avain</MicrosoftTranslateApiKey>
<MicrosoftTranslateTokenEndpoint>Avainten tarjontapalvelu</MicrosoftTranslateTokenEndpoint>
<FontNote>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". </FontNote>
<FontNote>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". </FontNote>
<RestoreDefaultSettings>Palauta oletusarvoihin</RestoreDefaultSettings>
<RestoreDefaultSettingsMsg>Palautetaanko kaikki asetukset oletusarvoihinsa?</RestoreDefaultSettingsMsg>
<RemoveTimeCodes>Poista aikaleimat</RemoveTimeCodes>
@ -2828,8 +2843,8 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<BDOpensInEdit>Muokkaa</BDOpensInEdit>
<ShortcutsAllowSingleLetterOrNumberInTextBox>Pikavalinnat: Salli yksittäinen kirjain/numero tekstilaatikossa</ShortcutsAllowSingleLetterOrNumberInTextBox>
<ShortcutCustomToggle>Pikavalinnat: Mukautettu alku/loppu päälle/pois</ShortcutCustomToggle>
<UpdateFileTypeAssociations>Päivitä tiedostotyyppien kytkennät</UpdateFileTypeAssociations>
<FileTypeAssociationsUpdated>Tiedostotyyppien kytkennät päivitetty</FileTypeAssociationsUpdated>
<UpdateFileTypeAssociations>Päivitä tiedostotyyppien liitokset</UpdateFileTypeAssociations>
<FileTypeAssociationsUpdated>Tiedostotyyppien liitokset päivitetty</FileTypeAssociationsUpdated>
<CustomContinuationStyle>Muokkaa omaa jatkamistyyliä</CustomContinuationStyle>
<LoadStyle>Lataa tyyli</LoadStyle>
<Suffix>Pääte</Suffix>
@ -3039,8 +3054,8 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<SyncPoint>Tahdistus kohta</SyncPoint>
<UpdatedBy>Päivittäjä</UpdatedBy>
<UpdateDetails>Päivityksen tiedot</UpdateDetails>
<Resolution>Resoluutio</Resolution>
<VideoResolution>Videon resoluutio</VideoResolution>
<Resolution>Tarkkuuus</Resolution>
<VideoResolution>Videon tarkkuuus</VideoResolution>
<FromCurrentVideo>Nykyisestä videosta</FromCurrentVideo>
<Options>Valinnat</Options>
<WrapStyle>Rivitysmuoto</WrapStyle>
@ -3153,6 +3168,12 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<AdjustingSpeedXOfY>Säädetään nopeutta: {0} / {1}...</AdjustingSpeedXOfY>
<MergingAudioTrackXOfY>Sulautetaan ääniraitaa: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Muunnetaan tektiä puheeksi: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Ääninäytteiden esikatselu</ReviewAudioClips>
<ReviewInfo>Esikatsele ja muokkaa/poista äänipätkiä</ReviewInfo>
<Play>Toista</Play>
<AutoContinue>Jatka automaattisesti</AutoContinue>
<Regenerate>Luo uudelleen</Regenerate>
<Speed>Nopeus</Speed>
</TextToSpeech>
<TimedTextSmpteTiming>
<Title>SMPTE-aikakoodaus</Title>
@ -3300,7 +3321,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<SeHandlesTextMerge>Tekstinsulautus käytössä</SeHandlesTextMerge>
</VobSubOcr>
<VobSubOcrCharacter>
<Title>ORC - manuaalinen kuva tekstiksi</Title>
<Title>ORC - Kuva tekstiksi manuaalisesti</Title>
<ShrinkSelection>Pienennä valintaa</ShrinkSelection>
<ExpandSelection>Laajenna valintaa</ExpandSelection>
<SubtitleImage>Tekstityskuva</SubtitleImage>
@ -3321,6 +3342,13 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<InspectItems>Tarkista kohteet</InspectItems>
<AddBetterMatch>Lisää parempi vastine</AddBetterMatch>
<Add>Lisää</Add>
<AddBetterMultiMatch>Lisää parempi monivastaavuus</AddBetterMultiMatch>
<AddOrUpdateMatch>Lisää tai päivitä vastaavuus</AddOrUpdateMatch>
<SelectPrevousMatch>Valitse edellinen vastaavuus</SelectPrevousMatch>
<SelectNextMatch>Valitse seuraava vastaavuus</SelectNextMatch>
<JumpPreviousMissingMatch>Siirry edelliseen puuttuvaan vastaavuuteen</JumpPreviousMissingMatch>
<JumpNextMissingMatch>Siirry seuraavaan puuttuvaan vastaavuuteen</JumpNextMissingMatch>
<FocusTextbox>Terävöitä tekstisyöte</FocusTextbox>
</VobSubOcrCharacterInspect>
<VobSubOcrNewFolder>
<Title>Uusi kansio</Title>
@ -3386,6 +3414,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<GuessTimeCodes>Arvaa aikaleimat</GuessTimeCodes>
<SeekSilence>Etsi hiljaisuutta</SeekSilence>
<InsertSubtitleHere>Lisää tähän tekstitys</InsertSubtitleHere>
<InsertSubtitleFileHere>Lisää tähän tekstitystiedosto</InsertSubtitleFileHere>
<CharsSecX>M/S: {0:0.00}</CharsSecX>
<WordsMinX>S/M: {0:0.00}</WordsMinX>
</Waveform>
@ -3420,7 +3449,7 @@ Mikäli tiedostoa on muokattu Subtitle Edit:llä, varmuuskopio voi olla käytett
<WhisperAdvanced>
<Title>Whisper Advanced - komentorivin lisäparametrit</Title>
<CommandLineArguments>Whisper Advanced - komentorivin lisäparametrit:</CommandLineArguments>
<Info>HUOM! Eri Whisper sovelluksilla on erilaiset komentorivin lisäparametrit!</Info>
<Info>HUOM! Eri Whisper-sovelluksilla on erilaiset komentorivin lisäparametrit!</Info>
<Standard>Vakio</Standard>
<StandardAsia>Vakio (Aasia)</StandardAsia>
<HighlightCurrentWord>Korosta nykyinen sana</HighlightCurrentWord>

View File

@ -3,7 +3,7 @@
<General>
<Title>Subtitle Edit</Title>
<Version>4.0.6</Version>
<TranslatedBy>Tradotto da NAMP e bovirus - Data traduzione: 04.06.2024</TranslatedBy>
<TranslatedBy>Tradotto da NAMP e bovirus - Data traduzione: 14.06.2024</TranslatedBy>
<CultureName>it-IT</CultureName>
<HelpFile />
<Ok>OK</Ok>
@ -3175,6 +3175,7 @@ Vuoi continuare?</RestoreDefaultSettingsMsg>
<MergingAudioTrackXOfY>Unione traccia audio: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Generazione parlato dal testo: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Rivedi clip audio</ReviewAudioClips>
<CustomAudioEncoding>Codifica audio personalizzata</CustomAudioEncoding>
<ReviewInfo>Rivedi e modifica/rimuovi clip audio</ReviewInfo>
<Play>Riproduci</Play>
<AutoContinue>Continua automaticamente</AutoContinue>

View File

@ -3176,6 +3176,7 @@ Continuar?</RestoreDefaultSettingsMsg>
<MergingAudioTrackXOfY>A combinar a faixa de áudio: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>A gerar voz a partir de texto: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Rever clipes de áudio</ReviewAudioClips>
<CustomAudioEncoding>Codificação áudio personalizada</CustomAudioEncoding>
<ReviewInfo>Rever e editar/remover clipes de áudio</ReviewInfo>
<Play>Reproduzir</Play>
<AutoContinue>Continuar automaticamente</AutoContinue>

View File

@ -198,7 +198,7 @@ https://github.com/SubtitleEdit/subtitleedit
<Title>Аудио в текст</Title>
<Info>Создание текста из аудио с помощью системы распознавания речи Vosk/Kaldi</Info>
<WhisperInfo>Создание текста из аудио с помощью системы распознавания речи Whisper</WhisperInfo>
<Engine>Движок:</Engine>
<Engine>Движок</Engine>
<VoskWebsite>Сайт Vosk</VoskWebsite>
<WhisperWebsite>Сайт Whisper</WhisperWebsite>
<Model>Модель</Model>
@ -1080,7 +1080,7 @@ https://github.com/SubtitleEdit/subtitleedit
<TranslateBlockInfo>Переведите исходный текст, затем скопируйте результат в буфер обмена и нажмите кнопку ниже</TranslateBlockInfo>
<TranslateBlockGetFromClipboard>Получить переведённый текст из буфера обмена
(Ctrl + V)</TranslateBlockGetFromClipboard>
<TranslateBlockCopySourceText>Копировать исходный текст в буфер обмена</TranslateBlockCopySourceText>
<TranslateBlockCopySourceText>Копировать исходный текст</TranslateBlockCopySourceText>
<TranslateBlockClipboardError1>Буфер обмена содержит исходный текст!</TranslateBlockClipboardError1>
<TranslateBlockClipboardError2>Переведите исходный текст, затем скопируйте результат в буфер обмена и повторите попытку</TranslateBlockClipboardError2>
<StartWebServerX>Запустить веб-сервер «{0}»</StartWebServerX>
@ -2144,6 +2144,8 @@ https://github.com/SubtitleEdit/subtitleedit
<DurationGreaterThan>Продолжите-ность больше</DurationGreaterThan>
<CpsLessThan>Симв./сек. меньше</CpsLessThan>
<CpsGreaterThan>Симв./сек. больше</CpsGreaterThan>
<LengthLessThan>Длина меньше</LengthLessThan>
<LengthGreaterThan>Длина больше</LengthGreaterThan>
<ExactlyOneLine>Ровно одна строка</ExactlyOneLine>
<ExactlyTwoLines>Ровно две строчки</ExactlyTwoLines>
<MoreThanTwoLines>Более двух строк</MoreThanTwoLines>
@ -3184,6 +3186,7 @@ https://github.com/SubtitleEdit/subtitleedit
<MergingAudioTrackXOfY>Объединение аудиодорожек: {0} / {1}…</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Создание речи из текста: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Просмотр аудиоклипов</ReviewAudioClips>
<CustomAudioEncoding>Пользовательское кодирование звука</CustomAudioEncoding>
<ReviewInfo>Просмотр и редактирование/удаление аудиоклипов</ReviewInfo>
<Play>Воспроизвести</Play>
<AutoContinue>Автопродолжение</AutoContinue>

View File

@ -1451,6 +1451,7 @@ Vi utnyttjar bildens inneboende rytm.</CreateSimpleChainingToolTip>
<GenerateBlankVideo>Generera tom video...</GenerateBlankVideo>
<GenerateVideoWithBurnedInSub>Generera video med inbränd sub...</GenerateVideoWithBurnedInSub>
<GenerateVideoWithEmbeddedSubs>Skapa video med inbäddade undertexter...</GenerateVideoWithEmbeddedSubs>
<GenerateTransparentVideoWithSubs>Skapa transparent video med undertexter...</GenerateTransparentVideoWithSubs>
<VideoAudioToTextX>Ljud till text ({0})...</VideoAudioToTextX>
<ImportChaptersFromVideo>Importera kapitel från video</ImportChaptersFromVideo>
<GenerateImportShotChanges>Skapa/importera scenändringar...</GenerateImportShotChanges>
@ -2137,6 +2138,8 @@ Ladda ner och fortsätta?</VideoFromUrlRequirements>
<DurationGreaterThan>Varaktighet längre än</DurationGreaterThan>
<CpsLessThan>CPS mindre än</CpsLessThan>
<CpsGreaterThan>CPS större än</CpsGreaterThan>
<LengthLessThan>Längd mindre än</LengthLessThan>
<LengthGreaterThan>Längd större än</LengthGreaterThan>
<ExactlyOneLine>Exakt en rad</ExactlyOneLine>
<ExactlyTwoLines>Exakt två rader</ExactlyTwoLines>
<MoreThanTwoLines>Mer än två rader</MoreThanTwoLines>
@ -3176,6 +3179,7 @@ och N bryter</WrapStyle2>
<MergingAudioTrackXOfY>Slår ihop ljudspår: {0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>Genererar tal från text: {0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>Granska ljudklipp</ReviewAudioClips>
<CustomAudioEncoding>Anpassad ljudkodning</CustomAudioEncoding>
<ReviewInfo>Granska och redigera/ta bort ljudklipp</ReviewInfo>
<Play>Spela</Play>
<AutoContinue>Auto-fortsätt</AutoContinue>

View File

@ -3163,6 +3163,7 @@ Command line: {1} {2}
<MergingAudioTrackXOfY>合并音轨:{0} / {1}...</MergingAudioTrackXOfY>
<GeneratingSpeechFromTextXOfY>从文本生成语音:{0} / {1}...</GeneratingSpeechFromTextXOfY>
<ReviewAudioClips>审阅音频剪辑</ReviewAudioClips>
<CustomAudioEncoding>自定义音频编码</CustomAudioEncoding>
<ReviewInfo>查看和编辑/删除音频剪辑</ReviewInfo>
<Play>播放</Play>
<AutoContinue>自动继续</AutoContinue>

View File

@ -557,6 +557,5 @@ namespace Nikse.SubtitleEdit.Logic.ColorChooser
Dispose(true);
GC.SuppressFinalize(this);
}
}
}

View File

@ -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...",
@ -3574,6 +3575,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",

View File

@ -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;
@ -8707,6 +8710,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;

View File

@ -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; }
@ -3384,6 +3385,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; }

View File

@ -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
{

View File

@ -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
}
@ -679,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;
}
}
}

File diff suppressed because it is too large Load Diff