com.shinolab.autd3-sdk.core 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/AUTD3.Core.asmdef +14 -0
  2. package/AUTD3.Core.asmdef.meta +7 -0
  3. package/AssemblyInfo.cs +14 -0
  4. package/AssemblyInfo.cs.meta +11 -0
  5. package/Command.cs +11 -0
  6. package/Command.cs.meta +11 -0
  7. package/Config.cs +57 -0
  8. package/Config.cs.meta +11 -0
  9. package/Coords.cs +58 -0
  10. package/Coords.cs.meta +11 -0
  11. package/Geometry.cs +167 -0
  12. package/Geometry.cs.meta +11 -0
  13. package/GlobalUsings.cs +7 -0
  14. package/GlobalUsings.cs.meta +11 -0
  15. package/LICENSE.md +21 -0
  16. package/LICENSE.md.meta +7 -0
  17. package/MonoPInvokeCallbackAttribute.cs +15 -0
  18. package/MonoPInvokeCallbackAttribute.cs.meta +11 -0
  19. package/Native.cs +108 -0
  20. package/Native.cs.meta +11 -0
  21. package/Plugins/linux-x64/libautd3_core.so +0 -0
  22. package/Plugins/linux-x64/libautd3_core.so.meta +35 -0
  23. package/Plugins/linux-x64.meta +8 -0
  24. package/Plugins/osx-arm64/libautd3_core.dylib +0 -0
  25. package/Plugins/osx-arm64/libautd3_core.dylib.meta +35 -0
  26. package/Plugins/osx-arm64.meta +8 -0
  27. package/Plugins/win-x64/autd3_core.dll +0 -0
  28. package/Plugins/win-x64/autd3_core.dll.meta +35 -0
  29. package/Plugins/win-x64.meta +8 -0
  30. package/Plugins.meta +8 -0
  31. package/README.md +41 -0
  32. package/README.md.meta +7 -0
  33. package/SamplingConfig.cs +134 -0
  34. package/SamplingConfig.cs.meta +11 -0
  35. package/THIRD-PARTY-LICENSES.md +834 -0
  36. package/THIRD-PARTY-LICENSES.md.meta +7 -0
  37. package/Types.cs +251 -0
  38. package/Types.cs.meta +11 -0
  39. package/Units.cs +184 -0
  40. package/Units.cs.meta +11 -0
  41. package/csc.rsp +2 -0
  42. package/csc.rsp.meta +7 -0
  43. package/package.json +13 -0
  44. package/package.json.meta +7 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "AUTD3.Core",
3
+ "rootNamespace": "AUTD3",
4
+ "references": [],
5
+ "includePlatforms": [],
6
+ "excludePlatforms": [],
7
+ "allowUnsafeCode": false,
8
+ "overrideReferences": false,
9
+ "precompiledReferences": [],
10
+ "autoReferenced": true,
11
+ "defineConstraints": [],
12
+ "versionDefines": [],
13
+ "noEngineReferences": false
14
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: d2df842e7bf3bb76f479f6096a54639d
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,14 @@
1
+ using System.Runtime.CompilerServices;
2
+
3
+ // Declared in source (not as csproj <InternalsVisibleTo> items) so that Unity, which
4
+ // compiles these sources via an .asmdef and never sees the csproj, grants the same access.
5
+ [assembly: InternalsVisibleTo("AUTD3")]
6
+ [assembly: InternalsVisibleTo("AUTD3.Pattern")]
7
+ [assembly: InternalsVisibleTo("AUTD3.Pattern.Holo")]
8
+ [assembly: InternalsVisibleTo("AUTD3.Modulation")]
9
+ [assembly: InternalsVisibleTo("AUTD3.Link.Ethercrab")]
10
+ [assembly: InternalsVisibleTo("AUTD3.Link.Soem")]
11
+ [assembly: InternalsVisibleTo("AUTD3.Link.Remote")]
12
+ [assembly: InternalsVisibleTo("AUTD3.Link.TwinCAT")]
13
+ [assembly: InternalsVisibleTo("AUTD3.Link.Nop")]
14
+ [assembly: InternalsVisibleTo("AUTD3.Tests")]
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 5b8eaefeaab460c69ecd881f31dd9f35
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Command.cs ADDED
@@ -0,0 +1,11 @@
1
+ using System;
2
+
3
+ namespace AUTD3
4
+ {
5
+
6
+
7
+ public interface ICommand
8
+ {
9
+ internal IntPtr CreateOp();
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a865496907547a29c30d0cb1b96cf888
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Config.cs ADDED
@@ -0,0 +1,57 @@
1
+ using System;
2
+
3
+ namespace AUTD3
4
+ {
5
+ public enum GpioIn : byte
6
+ {
7
+ I0 = 0,
8
+ I1 = 1,
9
+ I2 = 2,
10
+ I3 = 3,
11
+ }
12
+
13
+ public readonly struct LoopBehavior
14
+ {
15
+ internal ushort Rep { get; }
16
+
17
+ private LoopBehavior(ushort rep)
18
+ {
19
+ Rep = rep;
20
+ }
21
+
22
+ public static LoopBehavior Infinite => new LoopBehavior(0xFFFF);
23
+
24
+ public static LoopBehavior Once => new LoopBehavior(0);
25
+
26
+ public static LoopBehavior Finite(ushort count)
27
+ {
28
+ if (count == 0)
29
+ {
30
+ throw new Autd3Exception("loop count must be >= 1");
31
+ }
32
+ return new LoopBehavior((ushort)(count - 1));
33
+ }
34
+ }
35
+
36
+ public readonly struct TransitionMode
37
+ {
38
+ internal byte Mode { get; }
39
+ internal ulong Value { get; }
40
+
41
+ private TransitionMode(byte mode, ulong value)
42
+ {
43
+ Mode = mode;
44
+ Value = value;
45
+ }
46
+
47
+ public static TransitionMode SyncIdx => new TransitionMode(0x00, 0);
48
+
49
+ public static TransitionMode SysTime(DcSysTime sysTime) => new TransitionMode(0x01, sysTime.SysTime);
50
+
51
+ public static TransitionMode Gpio(GpioIn gpio) => new TransitionMode(0x02, (byte)gpio);
52
+
53
+ public static TransitionMode Ext => new TransitionMode(0xF0, 0);
54
+
55
+ public static TransitionMode Immediate => new TransitionMode(0xFF, 0);
56
+ }
57
+ }
package/Config.cs.meta ADDED
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 7f3ba63639259ee069daa20eee17d43b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Coords.cs ADDED
@@ -0,0 +1,58 @@
1
+ namespace AUTD3
2
+ {
3
+ using SnVector3 = System.Numerics.Vector3;
4
+ using SnQuaternion = System.Numerics.Quaternion;
5
+
6
+ internal static class Coords
7
+ {
8
+ #if UNITY_5_3_OR_NEWER || AUTD3_UNITY
9
+ internal static SnVector3 Point(Vector3 v) => new SnVector3(v.x * 1000f, v.y * 1000f, -v.z * 1000f);
10
+
11
+ internal static SnVector3 Dir(Vector3 v) => SnVector3.Normalize(new SnVector3(v.x, v.y, -v.z));
12
+
13
+ internal static SnQuaternion Rotation(Quaternion q) => new SnQuaternion(-q.x, -q.y, q.z, q.w);
14
+
15
+ internal static Vector3 FromPoint(SnVector3 v) => new Vector3(v.X * 0.001f, v.Y * 0.001f, -v.Z * 0.001f);
16
+
17
+ internal static Vector3 FromDir(SnVector3 v)
18
+ {
19
+ var n = SnVector3.Normalize(v);
20
+ return new Vector3(n.X, n.Y, -n.Z);
21
+ }
22
+
23
+ internal static Quaternion FromRotation(SnQuaternion q) => new Quaternion(-q.X, -q.Y, q.Z, q.W);
24
+
25
+ internal static Quaternion IdentityRotation => Quaternion.identity;
26
+ #else
27
+ internal static SnVector3 Point(Vector3 v) => v;
28
+
29
+ internal static SnVector3 Dir(Vector3 v) => SnVector3.Normalize(v);
30
+
31
+ internal static SnQuaternion Rotation(Quaternion q) => q;
32
+
33
+ internal static Vector3 FromPoint(SnVector3 v) => v;
34
+
35
+ internal static Vector3 FromDir(SnVector3 v) => SnVector3.Normalize(v);
36
+
37
+ internal static Quaternion FromRotation(SnQuaternion q) => q;
38
+
39
+ internal static Quaternion IdentityRotation => Quaternion.Identity;
40
+ #endif
41
+
42
+ internal static float[] PointArray(Vector3 v)
43
+ {
44
+ var c = Point(v);
45
+ return new[] { c.X, c.Y, c.Z };
46
+ }
47
+
48
+ internal static float[] DirArray(Vector3 v)
49
+ {
50
+ var c = Dir(v);
51
+ return new[] { c.X, c.Y, c.Z };
52
+ }
53
+
54
+ internal static Vector3 FromPointArray(float[] xyz) => FromPoint(new SnVector3(xyz[0], xyz[1], xyz[2]));
55
+
56
+ internal static Vector3 FromDirArray(float[] xyz) => FromDir(new SnVector3(xyz[0], xyz[1], xyz[2]));
57
+ }
58
+ }
package/Coords.cs.meta ADDED
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: b4bb1116aa93b6f81837889c9b004ecb
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Geometry.cs ADDED
@@ -0,0 +1,167 @@
1
+ using System;
2
+ using System.Collections;
3
+ using System.Collections.Generic;
4
+ using System.Numerics;
5
+
6
+ namespace AUTD3
7
+ {
8
+ public sealed class Geometry : IDisposable, IEnumerable<Device>
9
+ {
10
+ internal IntPtr Handle { get; private set; }
11
+
12
+ public Geometry(IReadOnlyList<Autd3> devices)
13
+ {
14
+ var native = new NativeCore.Autd3Device[devices.Count];
15
+ for (var i = 0; i < devices.Count; i++)
16
+ {
17
+ native[i] = devices[i].ToNative();
18
+ }
19
+ var handle = NativeCore.autd3_core_geometry_new(native, (UIntPtr)native.Length);
20
+ if (handle == IntPtr.Zero)
21
+ {
22
+ throw new Autd3Exception("failed to create geometry");
23
+ }
24
+ Handle = handle;
25
+ }
26
+
27
+ public int NumDevices => (int)NativeCore.autd3_core_geometry_num_devices(Handle);
28
+
29
+ public int NumTransducers => (int)NativeCore.autd3_core_geometry_num_transducers(Handle);
30
+
31
+ public bool IsEmpty => NumDevices == 0;
32
+
33
+ public Vector3 Center
34
+ {
35
+ get
36
+ {
37
+ var xyz = new float[3];
38
+ NativeCore.autd3_core_geometry_center(Handle, xyz);
39
+ return Coords.FromPointArray(xyz);
40
+ }
41
+ }
42
+
43
+ public Device this[int dev] => new Device(Handle, (UIntPtr)dev);
44
+
45
+ public IEnumerator<Device> GetEnumerator()
46
+ {
47
+ var count = NumDevices;
48
+ for (var i = 0; i < count; i++)
49
+ {
50
+ yield return this[i];
51
+ }
52
+ }
53
+
54
+ IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
55
+
56
+ public void Dispose()
57
+ {
58
+ if (Handle != IntPtr.Zero)
59
+ {
60
+ NativeCore.autd3_core_geometry_free(Handle);
61
+ Handle = IntPtr.Zero;
62
+ }
63
+ GC.SuppressFinalize(this);
64
+ }
65
+
66
+ ~Geometry()
67
+ {
68
+ if (Handle != IntPtr.Zero)
69
+ {
70
+ NativeCore.autd3_core_geometry_free(Handle);
71
+ }
72
+ }
73
+ }
74
+
75
+ public readonly struct Device
76
+ {
77
+ private readonly IntPtr _geometry;
78
+ private readonly UIntPtr _dev;
79
+
80
+ internal Device(IntPtr geometry, UIntPtr dev)
81
+ {
82
+ _geometry = geometry;
83
+ _dev = dev;
84
+ }
85
+
86
+ internal IntPtr GeometryHandle => _geometry;
87
+
88
+ internal UIntPtr DeviceIndex => _dev;
89
+
90
+ public int Idx => (int)NativeCore.autd3_core_device_idx(_geometry, _dev);
91
+
92
+ public int NumTransducers => (int)NativeCore.autd3_core_device_num_transducers(_geometry, _dev);
93
+
94
+ public Quaternion Rotation
95
+ {
96
+ get
97
+ {
98
+ var wijk = new float[4];
99
+ NativeCore.autd3_core_device_rotation(_geometry, _dev, wijk);
100
+ return Coords.FromRotation(new System.Numerics.Quaternion(wijk[1], wijk[2], wijk[3], wijk[0]));
101
+ }
102
+ }
103
+
104
+ public Vector3 Center
105
+ {
106
+ get
107
+ {
108
+ var xyz = new float[3];
109
+ NativeCore.autd3_core_device_center(_geometry, _dev, xyz);
110
+ return Coords.FromPointArray(xyz);
111
+ }
112
+ }
113
+
114
+ public Vector3 XDirection => DeviceDirection(NativeCore.autd3_core_device_direction_x);
115
+
116
+ public Vector3 YDirection => DeviceDirection(NativeCore.autd3_core_device_direction_y);
117
+
118
+ public Vector3 AxialDirection => DeviceDirection(NativeCore.autd3_core_device_direction_axial);
119
+
120
+ public Vector3 Position(int tr)
121
+ {
122
+ var xyz = new float[3];
123
+ if (NativeCore.autd3_core_transducer_position(_geometry, _dev, (UIntPtr)tr, xyz) != 0)
124
+ throw new ArgumentOutOfRangeException(nameof(tr));
125
+ return Coords.FromPointArray(xyz);
126
+ }
127
+
128
+ public Vector3 Direction(int tr)
129
+ {
130
+ var xyz = new float[3];
131
+ if (NativeCore.autd3_core_transducer_direction(_geometry, _dev, (UIntPtr)tr, xyz) != 0)
132
+ throw new ArgumentOutOfRangeException(nameof(tr));
133
+ return Coords.FromDirArray(xyz);
134
+ }
135
+
136
+ public Vector3[] Positions
137
+ {
138
+ get
139
+ {
140
+ var n = NumTransducers;
141
+ var result = new Vector3[n];
142
+ for (var i = 0; i < n; i++)
143
+ result[i] = Position(i);
144
+ return result;
145
+ }
146
+ }
147
+
148
+ public Vector3[] Directions
149
+ {
150
+ get
151
+ {
152
+ var n = NumTransducers;
153
+ var result = new Vector3[n];
154
+ for (var i = 0; i < n; i++)
155
+ result[i] = Direction(i);
156
+ return result;
157
+ }
158
+ }
159
+
160
+ private Vector3 DeviceDirection(Action<IntPtr, UIntPtr, float[]> native)
161
+ {
162
+ var xyz = new float[3];
163
+ native(_geometry, _dev, xyz);
164
+ return Coords.FromDirArray(xyz);
165
+ }
166
+ }
167
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: bc2e313ffbe60b42fe89c0cd5b6ea815
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,7 @@
1
+ #if UNITY_5_3_OR_NEWER || AUTD3_UNITY
2
+ global using Vector3 = UnityEngine.Vector3;
3
+ global using Quaternion = UnityEngine.Quaternion;
4
+ #else
5
+ global using Vector3 = System.Numerics.Vector3;
6
+ global using Quaternion = System.Numerics.Quaternion;
7
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 6c1dbfa5a317dcb014b166badb023a17
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shun Suzuki
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: f0502811a2075a9cbcba694f30d157fd
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,15 @@
1
+ using System;
2
+
3
+ namespace AUTD3
4
+ {
5
+ [AttributeUsage(AttributeTargets.Method)]
6
+ internal sealed class MonoPInvokeCallbackAttribute : Attribute
7
+ {
8
+ public MonoPInvokeCallbackAttribute(Type type)
9
+ {
10
+ Type = type;
11
+ }
12
+
13
+ public Type Type { get; }
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: d035c1f7b3b475f4d7ce7e840adf2207
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Native.cs ADDED
@@ -0,0 +1,108 @@
1
+ using System;
2
+ using System.Runtime.InteropServices;
3
+ using System.Text;
4
+
5
+ namespace AUTD3
6
+ {
7
+ internal static class NativeCore
8
+ {
9
+ private const string Lib = "autd3_core";
10
+
11
+ [StructLayout(LayoutKind.Sequential)]
12
+ internal struct Autd3Device
13
+ {
14
+ public float Ox, Oy, Oz;
15
+ public float Rw, Rx, Ry, Rz;
16
+ }
17
+
18
+ [DllImport(Lib)]
19
+ internal static extern IntPtr autd3_core_geometry_new(Autd3Device[] devices, UIntPtr len);
20
+
21
+ [DllImport(Lib)]
22
+ internal static extern UIntPtr autd3_core_geometry_num_devices(IntPtr geometry);
23
+
24
+ [DllImport(Lib)]
25
+ internal static extern void autd3_core_geometry_center(IntPtr geometry, [Out] float[] outXyz);
26
+
27
+ [DllImport(Lib)]
28
+ internal static extern UIntPtr autd3_core_geometry_num_transducers(IntPtr geometry);
29
+
30
+ [DllImport(Lib)]
31
+ internal static extern UIntPtr autd3_core_device_num_transducers(IntPtr geometry, UIntPtr dev);
32
+
33
+ [DllImport(Lib)]
34
+ internal static extern UIntPtr autd3_core_device_idx(IntPtr geometry, UIntPtr dev);
35
+
36
+ [DllImport(Lib)]
37
+ internal static extern void autd3_core_device_rotation(IntPtr geometry, UIntPtr dev, [Out] float[] outWijk);
38
+
39
+ [DllImport(Lib)]
40
+ internal static extern void autd3_core_device_center(IntPtr geometry, UIntPtr dev, [Out] float[] outXyz);
41
+
42
+ [DllImport(Lib)]
43
+ internal static extern void autd3_core_device_direction_x(IntPtr geometry, UIntPtr dev, [Out] float[] outXyz);
44
+
45
+ [DllImport(Lib)]
46
+ internal static extern void autd3_core_device_direction_y(IntPtr geometry, UIntPtr dev, [Out] float[] outXyz);
47
+
48
+ [DllImport(Lib)]
49
+ internal static extern void autd3_core_device_direction_axial(IntPtr geometry, UIntPtr dev, [Out] float[] outXyz);
50
+
51
+ [DllImport(Lib)]
52
+ internal static extern int autd3_core_transducer_position(IntPtr geometry, UIntPtr dev, UIntPtr tr, [Out] float[] outXyz);
53
+
54
+ [DllImport(Lib)]
55
+ internal static extern int autd3_core_transducer_direction(IntPtr geometry, UIntPtr dev, UIntPtr tr, [Out] float[] outXyz);
56
+
57
+ [DllImport(Lib)]
58
+ internal static extern void autd3_core_geometry_free(IntPtr geometry);
59
+
60
+ [DllImport(Lib)]
61
+ internal static extern float autd3_core_phase_radian(byte value);
62
+
63
+ [DllImport(Lib)]
64
+ internal static extern IntPtr autd3_core_sampling_config_divide(ushort divide);
65
+
66
+ [DllImport(Lib)]
67
+ internal static extern IntPtr autd3_core_sampling_config_freq(float hz);
68
+
69
+ [DllImport(Lib)]
70
+ internal static extern IntPtr autd3_core_sampling_config_freq_nearest(float hz);
71
+
72
+ [DllImport(Lib)]
73
+ internal static extern IntPtr autd3_core_sampling_config_period(ulong nanos);
74
+
75
+ [DllImport(Lib)]
76
+ internal static extern IntPtr autd3_core_sampling_config_period_nearest(ulong nanos);
77
+
78
+ [DllImport(Lib)]
79
+ internal static extern int autd3_core_sampling_config_divide_value(IntPtr config, out ushort outValue);
80
+
81
+ [DllImport(Lib)]
82
+ internal static extern int autd3_core_sampling_config_freq_value(IntPtr config, out float outValue);
83
+
84
+ [DllImport(Lib)]
85
+ internal static extern int autd3_core_sampling_config_period_value(IntPtr config, out ulong outValue);
86
+
87
+ [DllImport(Lib)]
88
+ internal static extern void autd3_core_sampling_config_free(IntPtr config);
89
+ }
90
+
91
+ internal static class NativeUtil
92
+ {
93
+ internal static string Utf8(byte[] buffer)
94
+ {
95
+ var n = Array.IndexOf<byte>(buffer, 0);
96
+ if (n < 0)
97
+ {
98
+ n = buffer.Length;
99
+ }
100
+ return Encoding.UTF8.GetString(buffer, 0, n);
101
+ }
102
+
103
+ internal static string PtrToString(IntPtr ptr)
104
+ {
105
+ return ptr == IntPtr.Zero ? string.Empty : Marshal.PtrToStringUTF8(ptr) ?? string.Empty;
106
+ }
107
+ }
108
+ }
package/Native.cs.meta ADDED
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 6db87b4fa582a9534579d13b722d75f8
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,35 @@
1
+ fileFormatVersion: 2
2
+ guid: 1cb2ad1c0f740329d28b1e9b627819e8
3
+ PluginImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ iconMap: {}
7
+ executionOrder: {}
8
+ defineConstraints: []
9
+ isPreloaded: 0
10
+ isOverridable: 0
11
+ isExplicitlyReferenced: 0
12
+ validateReferences: 1
13
+ platformData:
14
+ - first:
15
+ Any:
16
+ second:
17
+ enabled: 0
18
+ settings: {}
19
+ - first:
20
+ Editor: Editor
21
+ second:
22
+ enabled: 1
23
+ settings:
24
+ CPU: x86_64
25
+ DefaultValueInitialized: true
26
+ OS: Linux
27
+ - first:
28
+ Standalone: Linux64
29
+ second:
30
+ enabled: 1
31
+ settings:
32
+ CPU: x86_64
33
+ userData:
34
+ assetBundleName:
35
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 573a48b880bbe6eca4e05c970f2bbf2f
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,35 @@
1
+ fileFormatVersion: 2
2
+ guid: d720eb96543b4e013e452a41d0d58e8a
3
+ PluginImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ iconMap: {}
7
+ executionOrder: {}
8
+ defineConstraints: []
9
+ isPreloaded: 0
10
+ isOverridable: 0
11
+ isExplicitlyReferenced: 0
12
+ validateReferences: 1
13
+ platformData:
14
+ - first:
15
+ Any:
16
+ second:
17
+ enabled: 0
18
+ settings: {}
19
+ - first:
20
+ Editor: Editor
21
+ second:
22
+ enabled: 1
23
+ settings:
24
+ CPU: ARM64
25
+ DefaultValueInitialized: true
26
+ OS: OSX
27
+ - first:
28
+ Standalone: OSXUniversal
29
+ second:
30
+ enabled: 1
31
+ settings:
32
+ CPU: ARM64
33
+ userData:
34
+ assetBundleName:
35
+ assetBundleVariant: