static public CFUrl FromUrlString(string url, CFUrl baseurl) { // CFString ctor will throw an ANE if null using (var str = new CFString(url)){ return(FromStringHandle(str.Handle, baseurl)); } }
internal static CFUrl FromStringHandle(IntPtr cfstringHandle, CFUrl baseurl) { IntPtr handle = CFURLCreateWithString(IntPtr.Zero, cfstringHandle, baseurl != null ? baseurl.Handle : IntPtr.Zero); if (handle == IntPtr.Zero) { return(null); } return(new CFUrl(handle)); }
internal static CFUrl FromStringHandle (IntPtr cfstringHandle, CFUrl baseurl) { IntPtr handle = CFURLCreateWithString (IntPtr.Zero, cfstringHandle, baseurl != null ? baseurl.Handle : IntPtr.Zero); if (handle == IntPtr.Zero) return null; return new CFUrl (handle); }
static public CFUrl FromUrlString (string url, CFUrl baseurl) { // CFString ctor will throw an ANE if null using (var str = new CFString (url)){ return FromStringHandle (str.Handle, baseurl); } }
public static ExtAudioFile OpenUrl(CFUrl url) { if (url == null) throw new ArgumentNullException ("url"); ExtAudioFileError err; var audioFile = OpenUrl (url.Handle, out err); if (err != ExtAudioFileError.OK) // if (err != 0) <- to keep old implementation throw new ArgumentException (String.Format ("Error code:{0}", err)); if (audioFile == null) // if (ptr == IntPtr.Zero) <- to keep old implementation throw new InvalidOperationException ("Can not get object instance"); return audioFile; }
public static ExtAudioFile OpenUrl(CFUrl url, out ExtAudioFileError error) { if (url == null) throw new ArgumentNullException ("url"); return OpenUrl (url.Handle, out error); }
public static ExtAudioFile CreateWithUrl(CFUrl url, AudioFileType fileType, AudioStreamBasicDescription inStreamDesc, //AudioChannelLayout channelLayout, AudioFileFlags flag) { if (url == null) throw new ArgumentNullException ("url"); ExtAudioFileError err; var audioFile = CreateWithUrl (url.Handle, fileType, inStreamDesc, flag, out err); if (err != ExtAudioFileError.OK) // if (err != 0) <- to keep old implementation throw new ArgumentException (String.Format ("Error code:{0}", err)); if (audioFile == null) // if (ptr == IntPtr.Zero) <- to keep old implementation throw new InvalidOperationException ("Can not get object instance"); return audioFile; }
public static ExtAudioFile CreateWithUrl(CFUrl url, AudioFileType fileType, AudioStreamBasicDescription inStreamDesc, AudioFileFlags flag, out ExtAudioFileError error) { if (url == null) throw new ArgumentNullException ("url"); return CreateWithUrl (url.Handle, fileType, inStreamDesc, flag, out error); }