private void RangeSlider_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var pos = e.GetPosition(Tracks).X; var slider = (RangeSlider)sender; var tr = slider.DataContext as TrackInfo; if (tr is MediaTrack) { Model.MediaTracks.Remove((MediaTrack)tr); PatchWindow.Stop(); PatchWindow.Source = null; } else { Model.Subtitles.Remove((Subtitle)tr); } }
private void addTrack(string path, bool isTutoPatch, int episodeNumber, EditorModel model) { var seconds = Model.WindowState.TimeSet; var track = new MediaTrack(path, Model.ScaleInfo, isTutoPatch); track.ModelHash = model == null ? "" : model.Montage.RawVideoHash; track.EpisodeNumber = episodeNumber; track.LeftShiftInSeconds = seconds; track.TopShift = Top; track.DurationInPixels = 10; Model.PropertyChanged += (s, a) => track.NotifyScaleChanged(); Model.MediaTracks.Add(track); PatchWindow.MediaOpened += SetPatchDuration; PatchWindow.Stop(); PatchWindow.Source = null; PatchWindow.Source = new Uri(path); PatchWindow.Play(); //need to fire event to get duration PatchWindow.Pause(); }
private void addTrack(string path) { var seconds = ViewTimeline.Position.TotalSeconds; var track = new TrackInfo(path); track.LeftShift = seconds; track.TopShift = prevoiusTop; track.DurationInSeconds = 10; Model.MediaTracks.Add(track); PatchWindow.MediaOpened += SetPatchDuration; PatchWindow.Stop(); PatchWindow.Source = null; PatchWindow.Source = new Uri(path); PatchWindow.Play(); //need to fire event to get duration PatchWindow.Pause(); //prevoiusTop += 30; //TimeScroll.Height += trackHeight; //mainwindow.Height += trackHeight; //CurrentTime.Height += trackHeight; }