Exemplo n.º 1
0
        public static InstrumentInfo [] GetInstrumentInfo(NSUrl url)
        {
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }

            InstrumentInfo [] result = null;
            IntPtr            array  = IntPtr.Zero;
            var error = CopyInstrumentInfoFromSoundBank(url.Handle, ref array);

            if (array != IntPtr.Zero)
            {
                var dicts = NSArray.ArrayFromHandle <NSDictionary> (array);
                result = new InstrumentInfo [dicts.Length];
                for (int i = 0; i < dicts.Length; i++)
                {
                    result [i] = new InstrumentInfo(dicts [i]);
                }
                CFObject.CFRelease(array);
            }
            return((error != 0) ? null : result);
        }
Exemplo n.º 2
0
        public static InstrumentInfo[] GetInstrumentInfo(NSUrl url)
        {
            if (url == null)
                throw new ArgumentNullException ("url");

            InstrumentInfo [] result = null;
            IntPtr array = IntPtr.Zero;
            var error = CopyInstrumentInfoFromSoundBank (url.Handle, ref array);
            if (array != IntPtr.Zero) {
                var dicts = NSArray.ArrayFromHandle<NSDictionary> (array);
                result = new InstrumentInfo [dicts.Length];
                for (int i = 0; i < dicts.Length; i++)
                    result [i] = new InstrumentInfo (dicts [i]);
                CFObject.CFRelease (array);
            }
            return (error != 0) ? null : result;
        }