Esempio n. 1
0
        private static void EnumerateDevices()
        {
            {
                Device[] audioInputDevices = new Device[NativePlugin.GetAudioInputDeviceCount()];
                for (int i = 0; i < audioInputDevices.Length; i++)
                {
                    audioInputDevices[i] = new Device(DeviceType.AudioInput, i, NativePlugin.GetAudioInputDeviceName(i), NativePlugin.GetAudioInputDeviceMediaApi(i));
                }
                _audioInputDevices = new DeviceList(audioInputDevices);
            }

            _isEnumerated = true;
        }
Esempio n. 2
0
        private void CreateGUI()
        {
            switch (_movieCapture.ResolutionDownScale)
            {
            default:
            case CaptureBase.DownScale.Original:
                _downScaleIndex = 0;
                break;

            case CaptureBase.DownScale.Half:
                _downScaleIndex = 1;
                break;

            case CaptureBase.DownScale.Quarter:
                _downScaleIndex = 2;
                break;

            case CaptureBase.DownScale.Eighth:
                _downScaleIndex = 3;
                break;

            case CaptureBase.DownScale.Sixteenth:
                _downScaleIndex = 4;
                break;

            case CaptureBase.DownScale.Custom:
                _downScaleIndex = 5;
                break;
            }

            if (CodecManager.VideoCodecs.Count > 0)
            {
                _videoCodecNames        = new string[CodecManager.VideoCodecs.Count];
                _videoCodecConfigurable = new bool[CodecManager.VideoCodecs.Count];
                int i = 0;
                foreach (Codec codec in CodecManager.VideoCodecs)
                {
                    _videoCodecNames[i]        = codec.Name;
                    _videoCodecConfigurable[i] = codec.HasConfigwindow;
                    i++;
                }
            }
            if (CodecManager.AudioCodecs.Count > 0)
            {
                _audioCodecNames        = new string[CodecManager.AudioCodecs.Count];
                _audioCodecConfigurable = new bool[CodecManager.AudioCodecs.Count];
                int i = 0;
                foreach (Codec codec in CodecManager.AudioCodecs)
                {
                    _audioCodecNames[i]        = codec.Name;
                    _audioCodecConfigurable[i] = codec.HasConfigwindow;
                    i++;
                }
            }
            int numAudioDevices = NativePlugin.GetAudioInputDeviceCount();

            if (numAudioDevices > 0)
            {
                _audioDeviceNames = new string[numAudioDevices];
                for (int i = 0; i < numAudioDevices; i++)
                {
                    _audioDeviceNames[i] = NativePlugin.GetAudioInputDeviceName(i);
                }
            }

            _movieCapture.SelectVideoCodec();
            _movieCapture.SelectAudioCodec();
            _movieCapture.SelectAudioInputDevice();
        }