Esempio n. 1
0
    private void EnumDevices()
    {
        ClearDevices();
        _devices = new List <AVProLiveCameraDevice>(8);
        int numDevices = AVProLiveCameraPlugin.GetNumDevices();

        for (int i = 0; i < numDevices; i++)
        {
            string deviceName;
            if (!AVProLiveCameraPlugin.GetDeviceName(i, out deviceName))
            {
                continue;
            }

            string deviceGUID;
            if (!AVProLiveCameraPlugin.GetDeviceGUID(i, out deviceGUID))
            {
                continue;
            }

            int numModes = AVProLiveCameraPlugin.GetNumModes(i);
            if (numModes > 0)
            {
                AVProLiveCameraDevice device = new AVProLiveCameraDevice(deviceName.ToString(), deviceGUID.ToString(), i);
                _devices.Add(device);
            }
        }
    }
Esempio n. 2
0
    private void AddNewDevices()
    {
        bool isDeviceAdded = false;

        int numDevices = AVProLiveCameraPlugin.GetNumDevices();

        for (int i = 0; i < numDevices; i++)
        {
            string deviceGUID;
            if (!AVProLiveCameraPlugin.GetDeviceGUID(i, out deviceGUID))
            {
                continue;
            }

            AVProLiveCameraDevice device = FindDeviceWithGUID(deviceGUID);
            if (device == null)
            {
                string deviceName;
                if (!AVProLiveCameraPlugin.GetDeviceName(i, out deviceName))
                {
                    continue;
                }

                int numModes = AVProLiveCameraPlugin.GetNumModes(i);
                if (numModes > 0)
                {
                    device = new AVProLiveCameraDevice(deviceName.ToString(), deviceGUID.ToString(), i);
                    _devices.Add(device);
                    isDeviceAdded = true;
                }
            }
        }

        if (isDeviceAdded)
        {
            this.SendMessage("NewDeviceAdded", null, SendMessageOptions.DontRequireReceiver);
        }
    }