summaryrefslogtreecommitdiff
path: root/mkvlib/c/sdk.cs
diff options
context:
space:
mode:
authorb5f0d6c3 <[email protected]>2022-03-23 10:05:46 +0800
committerb5f0d6c3 <[email protected]>2022-03-23 10:05:46 +0800
commit825aa89ea0f6ca70daaf4e51421cb7b9d20d7eb4 (patch)
treec2bb280ad18cd41d21e3d1fe8b487f8c3f0bd9f2 /mkvlib/c/sdk.cs
parent342b29b8767d8ea2f4c84e3ba6a2e33c413e1ef3 (diff)
update sdks
Diffstat (limited to 'mkvlib/c/sdk.cs')
-rw-r--r--mkvlib/c/sdk.cs28
1 files changed, 26 insertions, 2 deletions
diff --git a/mkvlib/c/sdk.cs b/mkvlib/c/sdk.cs
index 18aff8c..4699b1d 100644
--- a/mkvlib/c/sdk.cs
+++ b/mkvlib/c/sdk.cs
@@ -41,7 +41,16 @@ public static class mkvlib
static extern bool A2P(bool a2p, bool apc, int pr, int pf);
[DllImport("mkvlib.so")]
- static extern bool GetFontsList(IntPtr dir, logCallback lcb);
+ static extern IntPtr GetFontsList(IntPtr dir, logCallback lcb);
+
+ [DllImport("mkvlib.so")]
+ static extern void Cache(IntPtr p);
+
+ [DllImport("mkvlib.so")]
+ static extern IntPtr CreateFontsCache(IntPtr dir, IntPtr output, logCallback lcb);
+
+ [DllImport("mkvlib.so")]
+ static extern bool CopyFontsFromCache(IntPtr subs, IntPtr dist, logCallback lcb);
#endregion
@@ -109,12 +118,27 @@ public static class mkvlib
A2P(a2p, apc, pr, pf);
}
- public string[] GetFontsList(string dir, Action<string> lcb)
+ public static string[] GetFontsList(string dir, Action<string> lcb)
{
string result = css(GetFontsList(cs(dir), _lcb(lcb)));
return JsonSerializer.Deserialize<string[]>(result);
}
+ public static void Cache(string p)
+ {
+ Cache(cs(p));
+ }
+
+ public static string[] CreateFontsCache(string dir, string output, Action<string> lcb)
+ {
+ string result = css(CreateFontsCache(cs(dir), cs(output), _lcb(lcb)));
+ return JsonSerializer.Deserialize<string[]>(result);
+ }
+
+ public static bool CopyFontsFromCache(string subs, string dist, Action<string> lcb)
+ {
+ return CopyFontsFromCache(cs(subs), cs(dist), _lcb(lcb));
+ }
delegate void logCallback(IntPtr ptr);
static logCallback _lcb(Action<string> lcb)