private void OnMidiTick(Object o, int position) { if (position < TrackProgress.Maximum) { TrackProgress.Invoke(t => t.Value = position); CurrentProgressInfo.Invoke(t => t.Text = player.CurrentTime); } }
public MiniHud() { InitializeComponent(); TrackProgress.IsEnabled = false; TrackProgress.PreviewMouseUp += (x, y) => { if (MainWindow.currentlyPlayingAudioFile == null) { return; } var d = new DoubleAnimation() { To = MainWindow.currentlyPlayingAudioFile.TotalTime.TotalSeconds, From = TrackProgress.Value, Duration = new Duration(TimeSpan.FromSeconds(MainWindow.currentlyPlayingAudioFile.TotalTime.TotalSeconds - TrackProgress.Value)) }; TrackProgress.BeginAnimation(ProgressBar.ValueProperty, d); MainWindow.PlayPauseDialx.VisualStatePlay(); MainWindow.MiniHud.TrackStatus.Text = "Status: Playing"; MainWindow.trackAnim = d; try { MainWindow.outputDevice.Play(); } catch (Exception) { } }; TrackProgress.PreviewMouseMove += (sender, args) => { if (MainWindow.currentlyPlayingAudioFile == null) { return; } if (args.LeftButton == MouseButtonState.Pressed) { TrackProgress.RaiseEvent(new MouseButtonEventArgs(args.MouseDevice, args.Timestamp, MouseButton.Left) { RoutedEvent = UIElement.PreviewMouseLeftButtonDownEvent, Source = args.Source }); TrackProgress.BeginAnimation(ProgressBar.ValueProperty, null); var ts = TimeSpan.FromSeconds(TrackProgress.Value); MainWindow.currentlyPlayingAudioFile.CurrentTime = ts; MainWindow.MiniHud.TrackCurrentPos.Text = string.Format("{0:00}:{1:00}:{2:00}", (int)(ts.TotalHours), ts.Minutes, ts.Seconds); try { MainWindow.outputDevice.Play(); } catch (Exception) { } } }; }
public void UpdatePlayer() { TrackProgress.Invoke(t => t.Maximum = player.MaxTick); TrackProgress.Invoke(t => t.Value = 0); if (player.CurrentTick < player.MaxTick) { TrackProgress.Invoke(t => t.Value = player.CurrentTick); } Bitmap playPauseBmp = (player.IsPlaying ? Properties.Resources.Pause : Properties.Resources.Play); TrackPlay.Invoke(t => t.Image = playPauseBmp); }
public IActionResult Update(string id, TrackProgress itemIn) { var book = TrackDataProxy.Get(id); if (book == null) { return(NotFound()); } TrackDataProxy.Update(id, itemIn); return(NoContent()); }
private void TrackProgressExecute(object obj) { var progressModel = new ProgressModel { GoalId = SelectedGoal.GoalId, Date = DateTime.Now }; var newProgessViewModel = new AddProgressViewModel(progressModel, _client); var dialog = new TrackProgress(); dialog.DataContext = newProgessViewModel; var result = dialog.ShowDialog(); if (result.GetValueOrDefault()) { Progress.Add(new ProgressViewModel(SelectedGoal, newProgessViewModel.Progress)); } }
private void TrackProgress_MouseUp(object sender, MouseEventArgs e) { if (!player.Loaded) { return; } if (e.Button == MouseButtons.Left && !player.IsPlaying) { if (trackHoldPlaying) { player.Play(); } UpdatePlayer(); if (player.CurrentTick > player.MaxTick) { return; } TrackProgress.Invoke(t => t.Value = (int)player.CurrentTick); } }
private void Start() { trackProgress = FindObjectOfType <TrackProgress>(); light = GetComponentInChildren <Light>(); }
/// <summary> /// Initializes a new instance of the <see cref="ItSeez3D.AsyncWebRequest`1"/> class. /// </summary> /// <param name="initialState">Initial value to be returned by State property. Usually a name of the /// operation, e.g. "Downloading file".</param> /// <param name="progressTracking">Set to UPLOAD if you're uploading file to server, DOWNLOAD otherwise.</param> public AsyncWebRequest(string initialState = "", TrackProgress progressTracking = TrackProgress.DOWNLOAD) : base(initialState) { this.progressTracking = progressTracking; }
public ActionResult <TrackProgress> Create(TrackProgress item) { TrackDataProxy.Create(item); return(CreatedAtRoute("GetTrack", new { id = item.Id.ToString() }, item)); }