diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-02-26 16:30:42 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-02-26 16:30:42 +0200 |
| commit | 5942bb7a13e5ad26c720a1b95ae4ea766eeeda25 (patch) | |
| tree | 2a855ce1065c875e615f5b040f984cb3fb84e518 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels | |
| parent | 4c052df707280abd208b03aa88cf904e0eb6b9bf (diff) | |
| parent | 6549d8672a93893599e921d9f1938af7dcabb8bf (diff) | |
| download | Tango-5942bb7a13e5ad26c720a1b95ae4ea766eeeda25.tar.gz Tango-5942bb7a13e5ad26c720a1b95ae4ea766eeeda25.zip | |
MERGE!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs index 269007dac..840863752 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs @@ -122,6 +122,26 @@ namespace Tango.MachineStudio.DataCapture.ViewModels /// </summary> public RelayCommand MediaPlayPauseCommand { get; set; } + /// <summary> + /// Gets or sets the media seek forward command. + /// </summary> + public RelayCommand MediaSeekForwardCommand { get; set; } + + /// <summary> + /// Gets or sets the media seek backward command. + /// </summary> + public RelayCommand MediaSeekBackwardCommand { get; set; } + + /// <summary> + /// Gets or sets the media seek command. + /// </summary> + public RelayCommand<double> MediaSeekCommand { get; set; } + + /// <summary> + /// Gets or sets the media seek hold command. + /// </summary> + public RelayCommand MediaSeekHoldCommand { get; set; } + #endregion #region Constructors @@ -148,6 +168,10 @@ namespace Tango.MachineStudio.DataCapture.ViewModels MediaRecordingCommand = new RelayCommand(StartDiagnosticsRecording, () => !Recorder.IsRecording && MachineOperator != null && !Player.IsPlaying); MediaStopCommand = new RelayCommand(StopRecorderOrPlayer, () => Recorder.IsRecording || Player.IsPlaying); MediaPlayPauseCommand = new RelayCommand(DiagnosticsTogglePlayPause, () => !Recorder.IsRecording && SelectedRecording != null); + MediaSeekForwardCommand = new RelayCommand(MediaSeekForward, () => !Recorder.IsRecording && Player.IsPlaying); + MediaSeekBackwardCommand = new RelayCommand(MediaSeekBackward, () => !Recorder.IsRecording && Player.IsPlaying); + MediaSeekCommand = new RelayCommand<double>(MediaSeek, (x) => Player.IsPlaying); + MediaSeekHoldCommand = new RelayCommand(MediaSeekHold,() => Player.IsPlaying); _recordingsFolder = Path.Combine(SettingsManager.DefaultFolder, "Recordings"); Directory.CreateDirectory(_recordingsFolder); @@ -321,6 +345,39 @@ namespace Tango.MachineStudio.DataCapture.ViewModels InvalidateRelayCommands(); } + private void MediaSeekBackward() + { + if (Player.IsPlaying) + { + Player.Seek(Player.CurrentFrame - 200); + } + } + + private void MediaSeekForward() + { + if (Player.IsPlaying) + { + Player.Seek(Player.CurrentFrame + 200); + } + } + + private void MediaSeek(double frame) + { + if (Player != null) + { + Player.Seek((int)frame); + Player.Play(); + } + } + + private void MediaSeekHold() + { + if (Player != null) + { + Player.Pause(); + } + } + #endregion } } |
