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); }
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); } }
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; }