/// <summary> /// record given camera /// </summary> /// <param name="cameraToRecord"></param> public void RecordCamera(SecurityCamera cameraToRecord, bool enableWebInterface) { CameraDisplay cameraDisplay = null; if (cameraToRecord == null) { MessageBox.Show("You must select a camera to record"); return; } if (filters.VideoInputDevices.Count > 0) { if (isRunning(cameraToRecord.Name)) { currentCameraWindow.Close(); } int cameraWindowCount = getRunningCameraCount(); for (int x = 0; x < filters.VideoInputDevices.Count; x++) { if (filters.VideoInputDevices[x].MonikerString == cameraToRecord.VideoDevice.MonikerString)//this is the camera to record { saveCameraSettings(); cameraDisplay = new CameraDisplay(); cameraDisplay.FrameSize = getFrameSize(); cameraDisplay.FTP = ftp; cameraDisplay.RecordCamera(filters.VideoInputDevices[x], filters.AudioInputDevices[0], recordingPath + cameraToRecord.Name + ".avi", enableWebInterface); cameraDisplay.Show(); //position cameraWindow cameraDisplay.Left = cameraWindowCount * 250; cameraDisplay.Top = 0; cameraDisplay.Text = cameraToRecord.Name; cameraDisplay.Tag = filters.VideoInputDevices[x].MonikerString; currentCameraWindow = cameraDisplay; lblCameraCapabilities.Text = cameraDisplay.GetCameraCapabilities; break; } } } else { MessageBox.Show("No Video input devices found"); } }
/// <summary> /// displays the camera asked for /// </summary> /// <param name="cameraToStart"></param> public void ShowCamera(SecurityCamera cameraToStart) { CameraDisplay cameraDisplay = null; if (filters.VideoInputDevices.Count > 0) { if (isRunning(cameraToStart.Name)) { currentCameraWindow.Close(); } int cameraWindowCount = getRunningCameraCount(); for (int x = 0; x < filters.VideoInputDevices.Count; x++) { if (filters.VideoInputDevices[x].MonikerString == cameraToStart.VideoDevice.MonikerString)//this is the camera to record { cameraDisplay = new CameraDisplay(filters.VideoInputDevices[x], filters.AudioInputDevices[0]); cameraDisplay.FrameSize = getFrameSize(); cameraDisplay.Show(); cameraDisplay.Left = cameraWindowCount * 450; cameraDisplay.Top = 0; cameraDisplay.Text = cameraToStart.Name; currentCameraWindow = cameraDisplay; lblCameraCapabilities.Text = cameraDisplay.GetCameraCapabilities; break; } } } else { MessageBox.Show("No Video input devices found"); } }
/// <summary> /// displays all available cameras starting a window for each /// </summary> public void ShowAllCameras() { if (filters.VideoInputDevices.Count > 0) { for (int x = 0; x < filters.VideoInputDevices.Count; x++) { if (isRunning(filters.VideoInputDevices[x].Name)) { currentCameraWindow.Close(); } CameraDisplay cameraDisplay = new CameraDisplay(filters.VideoInputDevices[x], filters.AudioInputDevices[x]); cameraDisplay.Text = "Camera " + x.ToString(); cameraDisplay.Show(); currentCameraWindow = cameraDisplay; } } else { MessageBox.Show("No Video input devices found"); } }