/// <summary> /// Handles the user clicking on the Record button /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void FileRecord_Click(object sender, RoutedEventArgs e) { string filePath = this.SaveRecordingAs(); if (!string.IsNullOrEmpty(filePath)) { // temporarily disable all buttons this.Playback.IsEnabled = false; this.Record.IsEnabled = false; this.ComparisonFile.IsEnabled = false; this.StartComparison.IsEnabled = false; this.StartTimer(3, true, () => { this.isRecording = true; this.UpdateState(); this.LastFile = filePath; this.StatusText = Properties.Resources.RecordingInProgressText; // clear tracked bodies from previous recording if (this.trackedBodies.Count > 0) { this.trackedBodies.Clear(); } // Start running the recording asynchronously OneArgDelegate recording = new OneArgDelegate(this.RecordClip); recording.BeginInvoke(filePath, null, null); }); } }
/// <summary> /// Receives a list of video model objects to be played asynchronously. /// </summary> /// <param name="videos">An ObservableCollection of VideoModel to be played.</param> public void PlayVideoList(ObservableCollection <VideoModel> videos) { OneArgDelegate playback = new OneArgDelegate(PlaybackClip); _isPlaying = true; playback.BeginInvoke(videos, null, null); }
public void StartRecording(string filePath) { // Start running the recording asynchronously OneArgDelegate recording = new OneArgDelegate(this.RecordData); recording.BeginInvoke(filePath, null, null); }
/// <summary> /// Handles the user clicking on the Play button /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void PlayBackFile_Click(object sender, RoutedEventArgs e) { string filePath = this.OpenFileForPlayback(); if (!string.IsNullOrEmpty(filePath)) { this.isPlaying = true; this.LastFile = filePath; this.StatusText = Properties.Resources.PlaybackInProgressText; this.UpdateState(); // Start running the playback asynchronously OneArgDelegate playback = new OneArgDelegate(this.PlaybackClip); playback.BeginInvoke(filePath, null, null); } }
/// <summary> /// Handles the user clicking on the Record button /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void RecordButton_Click(object sender, RoutedEventArgs e) { string filePath = this.SaveRecordingAs(); if (!string.IsNullOrEmpty(filePath)) { this.lastFile = filePath; this.isRecording = true; this.RecordPlaybackStatusText = Properties.Resources.RecordingInProgressText; this.UpdateState(); // Start running the recording asynchronously OneArgDelegate recording = new OneArgDelegate(this.RecordClip); recording.BeginInvoke(filePath, null, null); } }
public void Evaluate(int SpreadMax) { if (FInputRecord.IsChanged) { if (FInputRecord[0]) { string xefFilePath = @FInputFilename[0]; if (!string.IsNullOrEmpty(xefFilePath)) { doRecord = true; OneArgDelegate recording = new OneArgDelegate(this.RecordClip); recording.BeginInvoke(xefFilePath, null, null); } } else { StopRecording(); } } }
/// <summary> /// Constructor for playing a clip in order to calibrate parameters /// </summary> /// <param name="callingProcess">Reference to a calling object</param> /// <param name="filename">Name of the clip to be played</param> /// <param name="numFrame">Number of frames to be evaluated</param> /// <param name="joint">Body joint identifier</param> /// <param name="initialTime">Initial time of the clip</param> /// <param name="estimated">Estimated joint initial position</param> public SessionCalibrationKinect(CalibrationViewModel callingProcess, string filename, int numFrame, JointType joint, Int64 initialTime, Vector3 estimated) { _calling = callingProcess; _calibrationData = new List <Vector3>(); _calibrationResult = new Vector3(0f, 0f, 0f); _maxFramesCalibration = numFrame; _calibrationJoint = joint; _initialTime = new TimeSpan(initialTime * 10000); _estimated = estimated; _relativeTime = new TimeSpan(); _rightThighLength = new List <double>(); _rightShankLength = new List <double>(); _leftThighLength = new List <double>(); _leftShankLength = new List <double>(); finished = false; frameCount = 1; _sensor = KinectSensor.GetDefault(); if (_sensor != null) { _sensor.Open(); _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body); _reader.MultiSourceFrameArrived += CalibrationFrameArrived; } if (!string.IsNullOrEmpty(filename)) { _calling.CalibrationStatus = "Starting playback..."; OneArgDelegate playback = new OneArgDelegate(PlaybackClip); playback.BeginInvoke(filename, null, null); } }
public void Evaluate(int SpreadMax) { if (FInputPlay.IsChanged) { if (FInputPlay[0]) { string xefFilePath = @FInputFilename[0]; if (!string.IsNullOrEmpty(xefFilePath)) { doPlay = true; OneArgDelegate recording = new OneArgDelegate(this.PlayClip); recording.BeginInvoke(xefFilePath, null, null); } } else { if (playback != null) { playback.Stop(); } } } if (FInputPause.IsChanged && (playback != null)) { if (FInputPause[0]) { if ((playback.State == KStudioPlaybackState.Playing)) { playback.Pause(); } } else { if ((playback.State == KStudioPlaybackState.Paused)) { playback.Resume(); } } } if (FInputStep[0]) { if ((playback.State == KStudioPlaybackState.Playing)) { playback.Pause(); } playback.StepOnce(); } if (FInputSeek.IsChanged && (playback != null)) { TimeSpan seekTime = TimeSpan.FromSeconds(FInputSeek[0]); playback.Pause(); playback.SeekByRelativeTime(seekTime); playback.Resume(); } if (playback != null) { FRecordDuration[0] = playback.CurrentRelativeTime.TotalSeconds; FRecord[0] = playback.State.ToString(); } }
private void btnSaveLibrary_Click(object sender, RoutedEventArgs e) { DataGame.IsEnabled = false; btnSaveLibrary.IsEnabled = false; lblPlayers.Content = ""; lblRelease.Content = ((DateTime)EditRelease.SelectedDate).ToBinary(); if (EditPlayer1.IsChecked == true) { lblPlayers.Content = 1; } if (EditPlayer2.IsChecked == true) { lblPlayers.Content = 2; } if (EditPlayer3.IsChecked == true) { lblPlayers.Content = 3; } if (EditPlayer4.IsChecked == true) { lblPlayers.Content = 4; } if (EditPlayer5.IsChecked == true) { lblPlayers.Content = 5; } lblGenre.Content = ((ComboBoxItem)EditGenre.SelectedItem).Content; lblPublisher.Content = EditPublisher.Text.Trim(); lblDeveloper.Content = EditDeveloper.Text.Trim(); OneArgDelegate _ThreadMethod = new OneArgDelegate(SavingSFAFile); _ThreadMethod.BeginInvoke(new Item() { Filename = EditName.Text.Trim(), Detail = new ItemData() { Release = lblRelease.Content.ToString(), Player = lblPlayers.Content.ToString(), Genre = lblGenre.Content.ToString(), Publisher = lblPublisher.Content.ToString(), Developer = lblDeveloper.Content.ToString(), Description = EditDescription.Text.Trim() } }, null, null); if (EditPublisher.Text.Trim() == "") { lblPublisher.Content = "N/A"; } if (EditDeveloper.Text.Trim() == "") { lblDeveloper.Content = "N/A"; } if (lblPlayers.Content.ToString().Trim() == "") { lblPlayers.Content = "N/A"; } lblRelease.Content = ((DateTime)EditRelease.SelectedDate).ToShortDateString(); }
public void setVICEmsgCallback(OneArgDelegate del) { mVICEMsg = del; }
public void setErrorCallback(OneArgDelegate del, Dispatcher dispat) { mErrorCallback = del; mErrorDispatcher = dispat; }
/// <summary> /// Handles the user clicking on the Play button /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void PlayButton_Click(object sender, RoutedEventArgs e) { string filePath = this.OpenFileForPlayback(); if (!string.IsNullOrEmpty(filePath)) { this.lastFile = filePath; this.isPlaying = true; this.RecordPlaybackStatusText = Properties.Resources.PlaybackInProgressText; this.UpdateState(); // Start running the playback asynchronously OneArgDelegate playback = new OneArgDelegate(this.PlaybackClip); playback.BeginInvoke(filePath, null, null); } }
private void btnSaveLibrary_Click(object sender, RoutedEventArgs e) { DataGame.IsEnabled = false; btnSaveLibrary.IsEnabled = false; lblPlayers.Content = ""; lblRelease.Content = ((DateTime)EditRelease.SelectedDate).ToBinary(); if (EditPlayer1.IsChecked == true) lblPlayers.Content = 1; if (EditPlayer2.IsChecked == true) lblPlayers.Content = 2; if (EditPlayer3.IsChecked == true) lblPlayers.Content = 3; if (EditPlayer4.IsChecked == true) lblPlayers.Content = 4; if (EditPlayer5.IsChecked == true) lblPlayers.Content = 5; lblGenre.Content = ((ComboBoxItem)EditGenre.SelectedItem).Content; lblPublisher.Content = EditPublisher.Text.Trim(); lblDeveloper.Content = EditDeveloper.Text.Trim(); OneArgDelegate _ThreadMethod = new OneArgDelegate(SavingSFAFile); _ThreadMethod.BeginInvoke(new Item() { Filename = EditName.Text.Trim(), Detail = new ItemData() { Release= lblRelease.Content.ToString(), Player = lblPlayers.Content.ToString(), Genre = lblGenre.Content.ToString(), Publisher = lblPublisher.Content.ToString(), Developer = lblDeveloper.Content.ToString(), Description = EditDescription.Text.Trim() } }, null, null); if (EditPublisher.Text.Trim() == "") lblPublisher.Content = "N/A"; if (EditDeveloper.Text.Trim() == "") lblDeveloper.Content = "N/A"; if (lblPlayers.Content.ToString().Trim() == "") lblPlayers.Content = "N/A"; lblRelease.Content = ((DateTime)EditRelease.SelectedDate).ToShortDateString(); }