diff options
| author | ac79b0c6 <[email protected]> | 2022-05-21 00:07:38 +0800 |
|---|---|---|
| committer | ac79b0c6 <[email protected]> | 2022-05-21 00:07:38 +0800 |
| commit | 476af930619eba5cafb6b71d3cf9bc8257013be9 (patch) | |
| tree | bfe50896aa7b707716c1d374fbb8b41443507455 /mkvtool-gui | |
| parent | 35ca76e3cad6526b65b6a68136e5e2b54038c80e (diff) | |
update mkvtool-gui
Diffstat (limited to 'mkvtool-gui')
| -rw-r--r-- | mkvtool-gui/MainWindow.axaml | 5 | ||||
| -rw-r--r-- | mkvtool-gui/MainWindow.axaml.cs | 6 | ||||
| -rw-r--r-- | mkvtool-gui/sdk.cs | 21 |
3 files changed, 21 insertions, 11 deletions
diff --git a/mkvtool-gui/MainWindow.axaml b/mkvtool-gui/MainWindow.axaml index 4023497..eaa8b6a 100644 --- a/mkvtool-gui/MainWindow.axaml +++ b/mkvtool-gui/MainWindow.axaml @@ -281,18 +281,19 @@ <Controls:ToggleSwitch Content="Check mode" IsChecked="True" Name="ssa3" /> <Controls:ToggleSwitch Content="Strict for check mode" IsChecked="True" Name="ssa4" /> <Controls:ToggleSwitch Content="Not rename subsetted font" IsChecked="False" Name="ssa5" /> + <Controls:ToggleSwitch Content="Not overwrite existing file" IsChecked="False" Name="ssa6" /> <StackPanel Orientation="Horizontal" Margin="5"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <TextBlock Text="PGS resolution:" VerticalAlignment="Center" TextAlignment="Center" /> - <TextBox Name="ssa6" Text="1080p" /> + <TextBox Name="ssa7" Text="1080p" /> </StackPanel> </StackPanel> <StackPanel Orientation="Horizontal" Margin="5"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <TextBlock Text="PGS frame rate:" VerticalAlignment="Center" TextAlignment="Center" /> - <TextBox Name="ssa7" Text="23.976" /> + <TextBox Name="ssa8" Text="23.976" /> </StackPanel> </StackPanel> <Button Margin="10" Content="Save" Click="SaveBtn_OnClick" diff --git a/mkvtool-gui/MainWindow.axaml.cs b/mkvtool-gui/MainWindow.axaml.cs index 4a17d4e..a44abd7 100644 --- a/mkvtool-gui/MainWindow.axaml.cs +++ b/mkvtool-gui/MainWindow.axaml.cs @@ -635,11 +635,13 @@ namespace mkvtool bool ck = this.FindControl<ToggleSwitch>("ssa3").IsChecked == true; bool cks = this.FindControl<ToggleSwitch>("ssa4").IsChecked == true; bool n = this.FindControl<ToggleSwitch>("ssa5").IsChecked == true; - string pr = this.FindControl<TextBox>("ssa6").Text; - string pf = this.FindControl<TextBox>("ssa7").Text; + bool no = this.FindControl<ToggleSwitch>("ssa6").IsChecked == true; + string pr = this.FindControl<TextBox>("ssa7").Text; + string pf = this.FindControl<TextBox>("ssa8").Text; mkvlib.A2P(a2p, apc, pr, pf); mkvlib.Check(ck, cks); mkvlib.NRename(n); + mkvlib.NOverwrite(no); } void PrintResult(string str1, string str2) diff --git a/mkvtool-gui/sdk.cs b/mkvtool-gui/sdk.cs index ba183a5..d174357 100644 --- a/mkvtool-gui/sdk.cs +++ b/mkvtool-gui/sdk.cs @@ -5,10 +5,10 @@ using System.Text.Json; public static class mkvlib { - const string so = "mkvlib.so"; - #region imports + const string so = "mkvlib.so"; + [DllImport(so, EntryPoint = "Version")] static extern IntPtr _Version(); @@ -52,7 +52,7 @@ public static class mkvlib static extern void A2P(bool a2p, bool apc, IntPtr pr, IntPtr pf); [DllImport(so)] - static extern IntPtr GetFontsList(IntPtr files, logCallback lcb); + static extern IntPtr GetFontsList(IntPtr files, IntPtr fonts, logCallback lcb); [DllImport(so)] static extern void Cache(IntPtr ccs); @@ -63,6 +63,9 @@ public static class mkvlib [DllImport(so, EntryPoint = "NRename")] static extern void _NRename(bool n); + [DllImport(so, EntryPoint = "NOverwrite")] + static extern void _NOverwrite(bool n); + [DllImport(so, EntryPoint = "Check")] static extern void _Check(bool check, bool strict); @@ -157,11 +160,11 @@ public static class mkvlib A2P(a2p, apc, cs(pr), cs(pf)); } - public static string[] GetFontsList(string[] files, Action<string> lcb) + public static string[][] GetFontsList(string[] files, string fonts, Action<string> lcb) { string _files = JsonSerializer.Serialize(files); - string result = css(GetFontsList(cs(_files), _lcb(lcb))); - return JsonSerializer.Deserialize<string[]>(result); + string result = css(GetFontsList(cs(_files), cs(fonts), _lcb(lcb))); + return JsonSerializer.Deserialize<string[][]>(result); } public static void Cache(string[] ccs) @@ -180,6 +183,11 @@ public static class mkvlib _NRename(n); } + public static void NOverwrite(bool n) + { + _NOverwrite(n); + } + public static void Check(bool check, bool strict) { _Check(check, strict); @@ -221,5 +229,4 @@ public static class mkvlib { return Marshal.PtrToStringUTF8(ptr); } - }
\ No newline at end of file |
