public override void BeginInterruption(AVAudioPlayer player) { if (cbBeginInterruption != null) { cbBeginInterruption(player, EventArgs.Empty); } }
public override void DecoderError(AVAudioPlayer player, NSError error) { if (cbDecoderError != null) { cbDecoderError(player, new AVErrorEventArgs(error)); } }
public override void FinishedPlaying(AVAudioPlayer player, bool flag) { if (cbFinishedPlaying != null) { cbFinishedPlaying(player, new AVStatusEventArgs(flag)); } if (player.Handle == IntPtr.Zero) { throw new ObjectDisposedException("player", "the player object was Dispose()d during the callback, this has corrupted the state of the program"); } }
public static AVAudioPlayer FromData(NSData data) { unsafe { var ap = new AVAudioPlayer(data, IntPtr.Zero); if (ap.Handle == IntPtr.Zero) { return(null); } return(ap); } }
public static AVAudioPlayer FromUrl(NSUrl url) { unsafe { var ap = new AVAudioPlayer(url, IntPtr.Zero); if (ap.Handle == IntPtr.Zero) { return(null); } return(ap); } }
public static AVAudioPlayer FromData(NSData data, out NSError error) { unsafe { IntPtr errhandle; IntPtr ptrtohandle = (IntPtr)(&errhandle); var ap = new AVAudioPlayer(data, ptrtohandle); if (ap.Handle == IntPtr.Zero) { error = (NSError)Runtime.GetNSObject(errhandle); return(null); } else { error = null; } return(ap); } }