public QueueTitlesDialogViewModel(List<Title> allTitles) { this.main = Ioc.Container.GetInstance<MainViewModel>(); this.selectedTitles = new ObservableCollection<TitleSelectionViewModel>(); this.selectRange = Config.QueueTitlesUseRange; this.startRange = Config.QueueTitlesStartTime; this.endRange = Config.QueueTitlesEndTime; this.titleStartOverrideEnabled = Config.QueueTitlesUseTitleOverride; this.titleStartOverride = Config.QueueTitlesTitleOverride; this.directoryOverrideEnabled = Config.QueueTitlesUseDirectoryOverride; this.directoryOverride = Config.QueueTitlesDirectoryOverride; this.nameOverrideEnabled = Config.QueueTitlesUseNameOverride; this.nameOverride = Config.QueueTitlesNameOverride; this.titles = new List<TitleSelectionViewModel>(); foreach (Title title in allTitles) { var titleVM = new TitleSelectionViewModel(title, this); this.titles.Add(titleVM); } // Perform range selection if enabled. if (this.selectRange) { this.SetSelectedFromRange(); } this.selectedTitles.CollectionChanged += (sender, args) => { this.RaisePropertyChanged(() => this.TitleDetailsVisible); if (this.selectedTitles.Count == 1) { Title title = this.selectedTitles[0].Title; // Do preview var previewProfile = new VCProfile { CustomCropping = true, Cropping = new Cropping(), VideoEncoder = "x264", AudioEncodings = new List<AudioEncoding>() }; var previewJob = new VCJob { RangeType = VideoRangeType.All, Title = title.TitleNumber, EncodingProfile = previewProfile }; this.PreviewImage = this.main.ScanInstance.GetPreview(previewJob.HbJob, 2); this.RaisePropertyChanged(() => this.TitleText); } }; }
public QueueTitlesDialogViewModel(List <Title> allTitles) { this.main = Ioc.Container.GetInstance <MainViewModel>(); this.selectedTitles = new ObservableCollection <TitleSelectionViewModel>(); this.selectRange = Config.QueueTitlesUseRange; this.startRange = Config.QueueTitlesStartTime; this.endRange = Config.QueueTitlesEndTime; this.titleStartOverrideEnabled = Config.QueueTitlesUseTitleOverride; this.titleStartOverride = Config.QueueTitlesTitleOverride; this.directoryOverrideEnabled = Config.QueueTitlesUseDirectoryOverride; this.directoryOverride = Config.QueueTitlesDirectoryOverride; this.nameOverrideEnabled = Config.QueueTitlesUseNameOverride; this.nameOverride = Config.QueueTitlesNameOverride; this.titles = new List <TitleSelectionViewModel>(); foreach (Title title in allTitles) { var titleVM = new TitleSelectionViewModel(title, this); this.titles.Add(titleVM); } // Perform range selection if enabled. if (this.selectRange) { this.SetSelectedFromRange(); } this.selectedTitles.CollectionChanged += (sender, args) => { this.RaisePropertyChanged(() => this.TitleDetailsVisible); if (this.selectedTitles.Count == 1) { Title title = this.selectedTitles[0].Title; // Do preview var previewProfile = new VCProfile { CustomCropping = true, Cropping = new Cropping(), VideoEncoder = "x264", AudioEncodings = new List <AudioEncoding>() }; var previewJob = new VCJob { RangeType = VideoRangeType.All, Title = title.TitleNumber, EncodingProfile = previewProfile }; this.PreviewImage = this.main.ScanInstance.GetPreview(previewJob.HbJob, 2); this.RaisePropertyChanged(() => this.TitleText); } }; }
public void HandleCheckChanged(TitleSelectionViewModel changedTitleVM, bool newValue) { if (this.SelectedTitles.Contains(changedTitleVM)) { foreach (TitleSelectionViewModel titleVM in this.SelectedTitles) { if (titleVM != changedTitleVM && titleVM.Selected != newValue) { titleVM.SetSelected(newValue); } } } }
private void RefreshTitles() { this.titles.Clear(); if (this.main.SourceData != null) { foreach (SourceTitle title in this.main.SourceData.Titles) { var titleVM = new TitleSelectionViewModel(title, this); this.titles.Add(titleVM); } // Perform range selection if enabled. this.SetSelectedFromRange(); } }
public void HandleCheckChanged(TitleSelectionViewModel changedTitleVM, bool newValue) { if (this.SelectedTitles.Contains(changedTitleVM)) { foreach (TitleSelectionViewModel titleVM in this.SelectedTitles) { if (titleVM != changedTitleVM && titleVM.Selected != newValue) { titleVM.SetSelected(newValue); } } } }