diff options
author | sr55 <[email protected]> | 2019-01-14 22:17:45 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2019-01-14 22:18:05 +0000 |
commit | 740348fefc3872d74b1a49752e48e36c20656303 (patch) | |
tree | cd26954a9c7eae2d5cf76d9291feba4056e7d81e /win | |
parent | 8f99ad6571508d67b237ef106dc60c6cbec88f6d (diff) |
WinGui: Initial support for SSA file import.
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrake.Interop/HandBrake.Interop.csproj | 2 | ||||
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs (renamed from win/CS/HandBrake.Interop/Interop/Json/Encode/SRT.cs) | 4 | ||||
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.de.resx | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/SubtitlesView.xaml | 2 |
10 files changed, 26 insertions, 23 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrake.Interop.csproj b/win/CS/HandBrake.Interop/HandBrake.Interop.csproj index d7cc5090a..5bf710caa 100644 --- a/win/CS/HandBrake.Interop/HandBrake.Interop.csproj +++ b/win/CS/HandBrake.Interop/HandBrake.Interop.csproj @@ -105,7 +105,7 @@ <Compile Include="Interop\Json\Encode\Range.cs" /> <Compile Include="Interop\Json\Encode\SubtitleSearch.cs" /> <Compile Include="Interop\Json\Encode\Source.cs" /> - <Compile Include="Interop\Json\Encode\SRT.cs" /> + <Compile Include="Interop\Json\Encode\SubImport.cs" /> <Compile Include="Interop\Json\Encode\Subtitles.cs" /> <Compile Include="Interop\Json\Encode\SubtitleTrack.cs" /> <Compile Include="Interop\Json\Encode\Video.cs" /> diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/SRT.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs index 96f42a52f..8399daa69 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/SRT.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubImport.cs @@ -12,7 +12,7 @@ namespace HandBrake.Interop.Interop.Json.Encode /// <summary> /// The srt. /// </summary> - public class SRT + public class SubImport { /// <summary> /// Gets or sets the codeset. @@ -28,5 +28,7 @@ namespace HandBrake.Interop.Interop.Json.Encode /// Gets or sets the language. /// </summary> public string Language { get; set; } + + public string Format { get; set; } } }
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs index ab51a1db9..9c4456e9b 100644 --- a/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs @@ -47,6 +47,6 @@ namespace HandBrake.Interop.Interop.Json.Encode /// <summary> /// Gets or sets the srt. /// </summary> - public SRT SRT { get; set; } + public SubImport Import { get; set; } } }
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index f63893372..df97f4a66 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -4660,11 +4660,11 @@ namespace HandBrakeWPF.Properties { } /// <summary> - /// Looks up a localized string similar to Import SRT. + /// Looks up a localized string similar to Import Subtitle. /// </summary> - public static string SubtitlesView_ImportSRT { + public static string SubtitlesView_ImportSubtitle { get { - return ResourceManager.GetString("SubtitlesView_ImportSRT", resourceCulture); + return ResourceManager.GetString("SubtitlesView_ImportSubtitle", resourceCulture); } } diff --git a/win/CS/HandBrakeWPF/Properties/Resources.de.resx b/win/CS/HandBrakeWPF/Properties/Resources.de.resx index ae572bb56..de7a22085 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.de.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.de.resx @@ -1641,8 +1641,8 @@ Dies beeinflusst nicht die momentanen Einstellungen im Untertitel-Tab. </value> <data name="SubtitlesView_BurnInBehaviour" xml:space="preserve"> <value>Einbrennverhalten:</value> </data> - <data name="SubtitlesView_ImportSRT" xml:space="preserve"> - <value>SRT importieren</value> + <data name="SubtitlesView_ImportSubtitle" xml:space="preserve"> + <value>SRT / SSA importieren</value> </data> <data name="SubtitlesView_TrackSelectionBehaviour" xml:space="preserve"> <value>Spurverhalten:</value> diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index f611f0020..baf8533d9 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -1642,8 +1642,8 @@ This will not affect your current settings in the Subtitle tab.</value> <data name="SubtitlesView_BurnInBehaviour" xml:space="preserve">
<value>Burn-In Behaviour:</value>
</data>
- <data name="SubtitlesView_ImportSRT" xml:space="preserve">
- <value>Import SRT</value>
+ <data name="SubtitlesView_ImportSubtitle" xml:space="preserve">
+ <value>Import Subtitle</value>
</data>
<data name="SubtitlesView_TrackSelectionBehaviour" xml:space="preserve">
<value>Track Selection Behaviour:</value>
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs index 46ff1e97a..3c6e4d35c 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs @@ -234,9 +234,10 @@ namespace HandBrakeWPF.Services.Encode.Factories Default = item.Default, Offset = item.SrtOffset, Burn = item.Burned, - SRT = - new SRT + Import = + new SubImport { + Format = item.SrtPath.EndsWith("srt") ? "SRT" : "SSA", Filename = item.SrtPath, Codeset = item.SrtCharCode, Language = item.SrtLangCode diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs index ea19c367e..3daf6b353 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs @@ -260,12 +260,12 @@ namespace HandBrakeWPF.Services.Encode.Factories subtitleTrack.Default = subtitle.Default; subtitleTrack.Forced = subtitle.Forced; - if (!string.IsNullOrEmpty(subtitle.SRT.Filename)) + if (!string.IsNullOrEmpty(subtitle.Import.Filename)) { - subtitleTrack.SubtitleType = SubtitleType.SRT; - subtitleTrack.SrtCharCode = subtitle.SRT.Codeset; - subtitleTrack.SrtFileName = subtitle.SRT.Filename; - subtitleTrack.SrtLangCode = subtitle.SRT.Language; + subtitleTrack.SubtitleType = subtitle.Import.Filename.EndsWith("srt") ? SubtitleType.SRT : SubtitleType.SSA; + subtitleTrack.SrtCharCode = subtitle.Import.Codeset; + subtitleTrack.SrtFileName = subtitle.Import.Filename; + subtitleTrack.SrtLangCode = subtitle.Import.Language; subtitleTrack.SrtLang = HandBrakeLanguagesHelper.Get(subtitleTrack.SrtLangCode).EnglishName; subtitleTrack.SrtOffset = subtitleTrack.SrtOffset; } diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index a847bc060..e164f1192 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -238,11 +238,11 @@ namespace HandBrakeWPF.ViewModels public void Import()
{
OpenFileDialog dialog = new OpenFileDialog
- {
- Filter = "SRT files (*.srt)|*.srt",
- CheckFileExists = true,
- Multiselect = true
- };
+ {
+ Filter = "Subtitle files (*.srt, *.ssa)|*.srt;*.ssa",
+ CheckFileExists = true,
+ Multiselect = true
+ };
if (this.Task != null && this.Task.Source != null)
{
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml index 9bec61cc4..01195259a 100644 --- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml +++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml @@ -84,7 +84,7 @@ <Button MinWidth="75" Grid.Column="1"
cal:Message.Attach="[Event Click] = [Action Import]"
- Content="{x:Static Properties:Resources.SubtitlesView_ImportSRT}"
+ Content="{x:Static Properties:Resources.SubtitlesView_ImportSubtitle}"
Margin="0,0,10,0"/>
<Button MinWidth="65" Grid.Column="2"
Margin="0,0,10,0"
|