/// <summary> /// This methods is used to initialize elements that are not /// initialized in the designer. /// </summary> protected override sealed void InitializeCustomElements() { base.InitializeCustomElements(); this.btnHelp.Click += this.btnHelp_Click; this.pnlCanvas.Resize += this.pnlCanvas_Resize; // Sets the counter value for updating mouse and gaze cursor. // Should give a frame rate of about 20 Hz // So if GazeSamping rate is 60 Hz to get 20 Hz it should be set to 3. this.xResolution = Document.ActiveDocument.ExperimentSettings.WidthStimulusScreen; this.yResolution = Document.ActiveDocument.ExperimentSettings.HeightStimulusScreen; this.xPosition = PresentationScreen.GetPresentationBounds().X; this.yPosition = PresentationScreen.GetPresentationBounds().Y; this.systemHasSecondaryScreen = SecondaryScreen.SystemHasSecondaryScreen(); this.delegateNewSlideAvailable = this.NewSlideAvailable; this.trialDataList = new List<TrialsData>(); this.trialEventList = new List<TrialEvent>(); this.slideCounter = 0; this.trialSequenceCounter = -1; this.recordingStarttime = -5; this.timeLock = new object(); this.lastTimeStamp = -1; this.recordTimerWatch = new Stopwatch(); ////this.watch.Start(); this.generalTrigger = new Trigger { OutputDevice = TriggerOutputDevices.LPT, Signaling = TriggerSignaling.None, SignalingTime = 10, Value = 255, PortAddress = 0x0378 }; // Take primary monitor int monitorIndex = 0; if (PresentationScreen.GetPresentationScreen() != Screen.PrimaryScreen) { // otherwise take the secondary sceen. monitorIndex = 1; } this.screenCaptureProperties = new ScreenCaptureProperties( "OgamaCapture", string.Empty, "Microsoft Video 1", string.Empty, 10, Document.ActiveDocument.PresentationSize, string.Empty, CaptureMode.Video, monitorIndex, this.recordPicture); this.rawDataLists = new List<RawData>[NUMWRITINGTHREADS]; for (int i = 0; i < NUMWRITINGTHREADS; i++) { this.rawDataLists[i] = new List<RawData>(); } if (SecondaryScreen.SystemHasSecondaryScreen()) { if (Settings.Default.PresentationScreenMonitor == "Primary") { this.btnPrimary.Checked = true; this.btnSecondary.Checked = false; } else { this.btnPrimary.Checked = false; this.btnSecondary.Checked = true; } } else { this.btnPrimary.Visible = false; this.btnSecondary.Visible = false; } this.trackerInterfaces = new Dictionary<HardwareTracker, Tracker>(); }
/// <summary> /// This method should be called after the <see cref="CaptureDeviceProperties"/> /// for the screen capturing are set to initialize the <see cref="DSScreenCapture"/> /// one time. /// </summary> /// <param name="screenCapturePropertiesLocal"> /// The <see cref="ScreenCaptureProperties"/> /// to be used for the screen capturing. /// </param> private void InitializeScreenCapture(ScreenCaptureProperties screenCapturePropertiesLocal) { this.screenCapture = new DSScreenCapture( screenCapturePropertiesLocal.VideoCompressor, screenCapturePropertiesLocal.FrameRate, screenCapturePropertiesLocal.MonitorIndex); this.screenCapture.PreviewWindow = screenCapturePropertiesLocal.PreviewWindow; }