// Constructor
        public CaptureDeviceForm(string dvc, bool tooltips)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            try
            {
                toolTip1.Active = tooltips;

                filters = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                //remove cameras that are already attached
                for (int i = filters.Count - 1; i >= 0; i--)
                {
                    if (CameraRig.ConnectedCameras.Where(x => x.cameraName == filters[i].MonikerString).Count() > 0)
                    {
                        filters.RemoveAt(i);
                    }
                }


                if (filters.Count == 0)
                {
                    throw new ApplicationException();
                }

                // add all devices to combo
                for (int i = 0; i < filters.Count; i++)
                {
                    deviceCombo.Items.Add(filters[i].MonikerString);
                }

                // number the webcams in case there are more than one of the same type present
                int tmpInt = 0;

                for (int f = 0; f < filters.Count; f++)
                {
                    int cnt = 1;
                    for (int i = tmpInt + 1; i < filters.Count; i++)
                    {
                        deviceCombo.Items[tmpInt] = cnt.ToString() + " - " + deviceCombo.Items[tmpInt].ToString();
                        cnt++;
                        deviceCombo.Items[i] = cnt.ToString() + " - " + deviceCombo.Items[i].ToString();
                        cnt++;
                    }
                    tmpInt++;
                }

                // set the selected index to the current webcam
                if (dvc != null)
                {
                    for (int i = 0; i < filters.Count; i++)
                    {
                        if (filters[i].MonikerString.ToString() == dvc)
                        {
                            deviceCombo.SelectedIndex = i;
                        }
                    }
                }
            }
            catch (ApplicationException)
            {
                deviceCombo.Items.Add("No local capture devices");
                deviceCombo.Enabled = false;
                okButton.Enabled    = false;
            }

            if (deviceCombo.SelectedIndex == -1)
            {
                deviceCombo.SelectedIndex = 0;
            }
        }