Esempio n. 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);
        }
Esempio n. 2
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);
            }
        }
Esempio n. 3
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;
		}