コード例 #1
0
ファイル: MusicTrack.cs プロジェクト: xamarin/xamarin-macios
 public MusicPlayerStatus Merge(double sourceStartTime, double sourceEndTime, MusicTrack targetTrack, double targetInsertTime)
 {
     if (targetTrack is null)
     {
         ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(targetTrack));
     }
     return(MusicTrackMerge(Handle, sourceStartTime, sourceEndTime, targetTrack.Handle, targetInsertTime));
 }
コード例 #2
0
 public MusicPlayerStatus Merge(double sourceStartTime, double sourceEndTime, MusicTrack targetTrack, double targetInsertTime)
 {
     if (targetTrack == null)
     {
         throw new ArgumentNullException("targetTrack");
     }
     return(MusicTrackMerge(handle, sourceStartTime, sourceEndTime, targetTrack.Handle, targetInsertTime));
 }
コード例 #3
0
        public MusicPlayerStatus GetTrackIndex(MusicTrack track, out int index)
        {
            if (track == null)
            {
                throw new ArgumentNullException("track");
            }

            return(MusicSequenceGetTrackIndex(handle, track.Handle, out index));
        }
コード例 #4
0
        public MusicPlayerStatus GetTrackIndex(MusicTrack track, out int index)
        {
            if (track is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(track));
            }

            return(MusicSequenceGetTrackIndex(Handle, track.Handle, out index));
        }
コード例 #5
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);
            }
        }
コード例 #6
0
        public int GetTrackIndex(MusicTrack track)
        {
            int idx;

            if (track == null)
            {
                throw new ArgumentNullException("track");
            }
            var status = MusicSequenceGetTrackIndex(handle, track.Handle, out idx);

            if (status == MusicPlayerStatus.Success)
            {
                return(idx);
            }
            // that's never clear if the return value is the track or an error code
            return((int)status);
        }
コード例 #7
0
ファイル: MusicTrack.cs プロジェクト: cwensley/xamarin-macios
 public MusicPlayerStatus CopyInsert(double sourceStartTime, double sourceEndTime, MusicTrack targetTrack, double targetInsertTime)
 {
     if (targetTrack is null)
     {
         throw new ArgumentNullException(nameof(targetTrack));
     }
     return(MusicTrackCopyInsert(Handle, sourceStartTime, sourceEndTime, targetTrack.Handle, targetInsertTime));
 }