コード例 #1
0
        public static State FromInstance(Plugin plugin, Instance instance, LV2Sharp.URIDFeature map,
                                         string fileDir, string copyDir, string linkDir, string saveDir, GetPortValueFunc getValue,
                                         IntPtr userData, uint flags, Feature [] features)
        {
            var gch = GCHandle.Alloc(features);

            try {
                var featuresPtr = Marshal.UnsafeAddrOfPinnedArrayElement(features, 0);
                return(fileDir.Fixed(fileDirPtr =>
                                     copyDir.Fixed(copyDirPtr =>
                                                   linkDir.Fixed(linkDirPtr =>
                                                                 saveDir.Fixed(saveDirPtr =>
                                                                               new State(
                                                                                   Natives.lilv_state_new_from_instance(
                                                                                       plugin.Handle, instance.Handle,
                                                                                       map.Handle, fileDirPtr, copyDirPtr,
                                                                                       linkDirPtr, saveDirPtr,
                                                                                       (p1, p2, p3, p4) =>
                                                                                       getValue(p1, p2, p3, p4),
                                                                                       userData, flags,
                                                                                       featuresPtr), plugin.Allocator))))));
            } finally {
                gch.Free();
            }
        }
コード例 #2
0
 public State FromString(LV2Sharp.URIDFeature map, Node subject, string str) =>
 new State(str.Fixed(ptr => Natives.lilv_state_new_from_file(handle, map.Handle, subject.Handle, ptr)), allocator);
コード例 #3
0
 public State FromWorld(LV2Sharp.URIDFeature map, Node subject) =>
 new State(Natives.lilv_state_new_from_world(handle, map.Handle, subject.Handle), allocator);