Exemple #1
0
        public MusicPlayerStatus AddUserEvent(double timestamp, MusicEventUserData userData)
        {
            if (userData == null)
            {
                throw new ArgumentNullException("userData");
            }
            var ptr = userData.ToUnmanaged();
            var ret = MusicTrackNewUserEvent(handle, timestamp, ptr);

            Marshal.FreeHGlobal(ptr);
            return(ret);
        }
Exemple #2
0
        public MusicPlayerStatus AddUserEvent(double timestamp, MusicEventUserData userData)
        {
            if (userData is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(userData));
            }
            var ptr = userData.ToUnmanaged();
            var ret = MusicTrackNewUserEvent(Handle, timestamp, ptr);

            Marshal.FreeHGlobal(ptr);
            return(ret);
        }
Exemple #3
0
        static void UserCallbackProxy(IntPtr inClientData, IntPtr inSequence, IntPtr inTrack, double inEventTime, IntPtr inEventData, double inStartSliceBeat, double inEndSliceBeat)
        {
            MusicSequenceUserCallback userCallback;

            lock (userCallbackHandles)
                userCallbackHandles.TryGetValue(inSequence, out userCallback);

            if (userCallback != null)
            {
                var userEventData = new MusicEventUserData(inEventData);
                var musicSequence = MusicSequence.Lookup(inSequence);
                var musicTrack    = new MusicTrack(musicSequence, inTrack, false);

                userCallback(musicTrack, inEventTime, userEventData, inStartSliceBeat, inEndSliceBeat);
            }
        }