Inheritance: IDisposable
Exemplo n.º 1
0
		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);
		}
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 static public CFUrl FromUrlString(string url, CFUrl baseurl)
 {
     using (var str = new CFString(url)){
         IntPtr handle = CFURLCreateWithString(IntPtr.Zero, str.Handle, baseurl != null ? baseurl.Handle : IntPtr.Zero);
         if (handle == IntPtr.Zero)
         {
             return(null);
         }
         return(new CFUrl(handle));
     }
 }
Exemplo n.º 4
0
		static public CFUrl FromUrlString (string url, CFUrl baseurl)
		{
			using (var str = new CFString (url)){
				return FromStringHandle (str.Handle, baseurl);
			}
		}
Exemplo n.º 5
0
        public static ExtAudioFile OpenUrl(CFUrl url)
        {
            if (url == null)
                throw new ArgumentNullException ("url");

            ExtAudioFileError err;
            IntPtr ptr;
            unsafe {
                err = ExtAudioFileOpenUrl(url.Handle, (IntPtr)(&ptr));
            }
            if (err != 0)
            {
                throw new ArgumentException(String.Format("Error code:{0}", err));
            }
            if (ptr == IntPtr.Zero)
            {
                throw new InvalidOperationException("Can not get object instance");
            }

            return new ExtAudioFile(ptr);
        }
Exemplo n.º 6
0
        public static ExtAudioFile CreateWithUrl(CFUrl url,
            AudioFileType fileType, 
            AudioStreamBasicDescription inStreamDesc, 
            //AudioChannelLayout channelLayout, 
            AudioFileFlags flag)
        {
            if (url == null)
                throw new ArgumentNullException ("url");

            int err;
            IntPtr ptr = new IntPtr();
            unsafe {
                err = ExtAudioFileCreateWithUrl(url.Handle, fileType, ref inStreamDesc, IntPtr.Zero, (uint)flag,
                    (IntPtr)(&ptr));
            }
            if (err != 0)
            {
                throw new ArgumentException(String.Format("Error code:{0}", err));
            }
            if (ptr == IntPtr.Zero)
            {
                throw new InvalidOperationException("Can not get object instance");
            }

            return new ExtAudioFile(ptr);
        }
Exemplo n.º 7
0
 static public CFUrl FromUrlString(string url, CFUrl baseurl)
 {
     using (var str = new CFString(url)){
         return(FromStringHandle(str.Handle, baseurl));
     }
 }
Exemplo n.º 8
0
 public static CFUrl FromUrlString(string url, CFUrl baseurl)
 {
     using (var str = new CFString (url)){
         IntPtr handle = CFURLCreateWithString (IntPtr.Zero, str.Handle, baseurl != null ? baseurl.Handle : IntPtr.Zero);
         if (handle == IntPtr.Zero)
             return null;
         return new CFUrl (handle);
     }
 }