Exemplo n.º 1
0
        public static IEnumerable <CaptureDevice> GetCaptureDevices(out CaptureDevice defaultDevice)
        {
            //if (!IsCaptureSupported)
            //	throw new NotSupportedException();

            OpenAL.Debug("Getting capture devices");

            defaultDevice = null;

            string defaultName = Marshal.PtrToStringAnsi(alcGetString(IntPtr.Zero, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));

            var strings = ReadStringsFromMemory(alcGetString(IntPtr.Zero, ALC_CAPTURE_DEVICE_SPECIFIER));

            CaptureDevice[] devices = new CaptureDevice[strings.Length];
            for (int i = 0; i < strings.Length; ++i)
            {
                string s = strings[i];
                devices[i] = new CaptureDevice(s);

                if (s == defaultName)
                {
                    defaultDevice = devices[i];
                }

                OpenAL.DebugFormat("Found capture device {0}{1}", s, (s == defaultName) ? " (Default)" : String.Empty);
            }

            return(devices);
        }
Exemplo n.º 2
0
        public static IEnumerable<CaptureDevice> GetCaptureDevices(out CaptureDevice defaultDevice)
        {
            //if (!IsCaptureSupported)
            //	throw new NotSupportedException();

            OpenAL.Debug ("Getting capture devices");

            defaultDevice = null;

            string defaultName = Marshal.PtrToStringAnsi (alcGetString (IntPtr.Zero, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));

            var strings = ReadStringsFromMemory (alcGetString (IntPtr.Zero, ALC_CAPTURE_DEVICE_SPECIFIER));
            CaptureDevice[] devices = new CaptureDevice[strings.Length];
            for (int i = 0; i < strings.Length; ++i)
            {
                string s = strings[i];
                devices[i] = new CaptureDevice (s);

                if (s == defaultName)
                    defaultDevice = devices[i];

                OpenAL.DebugFormat ("Found capture device {0}{1}", s, (s == defaultName) ? " (Default)" : String.Empty);
            }

            return devices;
        }