Exemple #1
0
        public CMTimebaseError SetMasterTimebase(CMTimebase newMasterTimebase)
        {
            if (newMasterTimebase == null)
            {
                throw new ArgumentNullException(nameof(newMasterTimebase));
            }

            return(CMTimebaseSetMasterTimebase(Handle, newMasterTimebase.Handle));
        }
Exemple #2
0
        public CMTimebaseError SetMasterTimebase(CMTimebase newMasterTimebase)
        {
            if (newMasterTimebase is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(newMasterTimebase));
            }

            return(CMTimebaseSetMasterTimebase(Handle, newMasterTimebase.Handle));
        }
Exemple #3
0
        public CMTimebase(CFAllocator?allocator, CMTimebase sourceTimebase)
        {
            if (sourceTimebase is null)
            {
                throw new ArgumentNullException(nameof(sourceTimebase));
            }

            var error = CMTimebaseCreateWithSourceTimebase(allocator.GetHandle(), sourceTimebase.Handle, out handle);

            if (error != CMTimebaseError.None)
            {
                throw new ArgumentException(error.ToString());
            }
        }
Exemple #4
0
        static IntPtr Create(CFAllocator?allocator, CMTimebase sourceTimebase)
        {
            if (sourceTimebase is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(sourceTimebase));
            }

            var error = CMTimebaseCreateWithSourceTimebase(allocator.GetHandle(), sourceTimebase.Handle, out var handle);

            if (error != CMTimebaseError.None)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentException(error.ToString());
            }
            return(handle);
        }
Exemple #5
0
        static IntPtr Create(CMTimebase masterTimebase)
        {
            if (masterTimebase is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(masterTimebase));
            }

            var error = CMTimebaseCreateWithMasterTimebase(IntPtr.Zero, masterTimebase.Handle, out var handle);

            if (error != CMTimebaseError.None)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentException(error.ToString());
            }
            return(handle);
        }
Exemple #6
0
        public CMTimebase(CMTimebase masterTimebase)
        {
            if (masterTimebase == null)
            {
                throw new ArgumentNullException("masterTimebase");
            }

            var error = CMTimebaseCreateWithMasterTimebase(IntPtr.Zero, masterTimebase.Handle, out handle);

            if (error != CMTimebaseError.None)
            {
                throw new ArgumentException(error.ToString());
            }

            CFObject.CFRetain(Handle);
        }
Exemple #7
0
 public CMTimebase(CFAllocator?allocator, CMTimebase sourceTimebase)
     : base(Create(allocator, sourceTimebase), true)
 {
 }
Exemple #8
0
 public CMTimebase(CMTimebase masterTimebase)
     : base(Create(masterTimebase), true)
 {
 }