/// <summary> /// The show audio defaults. /// </summary> public void ShowSubtitleDefaultsPanel() { this.SubtitleDefaultsViewModel.SetupPreset(this.SubtitleBehaviours); if (this.SubtitleDefaultsViewModel.ShowWindow()) { this.SubtitleBehaviours = new SubtitleBehaviours(this.SubtitleDefaultsViewModel.SubtitleBehaviours); this.OnTabStatusChanged(null); } }
/// <summary> /// Setup this tab for the specified preset. /// </summary> /// <param name="preset"> /// The preset. /// </param> /// <param name="task"> /// The task. /// </param> public void SetPreset(Preset preset, EncodeTask task) { // Note, We don't support Subtitles in presets yet. this.Task = task; this.NotifyOfPropertyChange(() => this.Task); this.SubtitleBehaviours = new SubtitleBehaviours(preset.SubtitleTrackBehaviours); this.SubtitleDefaultsViewModel.SetupPreset(preset); this.AutomaticSubtitleSelection(); }
/// <summary> /// Update this preset. /// The given parameters should be copy-constructed. /// </summary> /// <param name="task"> /// The task. /// </param> /// <param name="audioBehaviours"> /// The audio behaviours. /// </param> /// <param name="subtitleBehaviours"> /// The subtitle behaviours. /// </param> public void Update(EncodeTask task, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours) { // Copy over Max Width / Height for the following picture settings modes. if (this.PictureSettingsMode == PresetPictureSettingsMode.Custom || this.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum) { task.MaxWidth = this.Task.MaxWidth; task.MaxHeight = this.Task.MaxHeight; } this.Task = task; this.AudioTrackBehaviours = new AudioBehaviours(audioBehaviours); this.SubtitleTrackBehaviours = new SubtitleBehaviours(subtitleBehaviours); }
/// <summary> /// The setup languages. /// </summary> /// <param name="behaviours"> /// The behaviours. /// </param> public void SetupLanguages(SubtitleBehaviours behaviours) { // Reset this.IsApplied = false; // Step 1, Set the behaviour mode this.SubtitleBehaviours.SelectedBehaviour = SubtitleBehaviourModes.None; this.SubtitleBehaviours.SelectedBurnInBehaviour = SubtitleBurnInBehaviourModes.None; this.SubtitleBehaviours.AddClosedCaptions = false; this.SubtitleBehaviours.AddForeignAudioScanTrack = false; this.SubtitleBehaviours.AddExternalSubtitles = false; this.SubtitleBehaviours.SelectedLangauges.Clear(); // Step 2, Get all the languages IDictionary <string, string> langList = LanguageUtilities.MapLanguages(); langList = (from entry in langList orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); // Step 3, Setup Available Languages this.AvailableLanguages.Clear(); foreach (string item in langList.Keys) { this.AvailableLanguages.Add(item); } // Step 4, Set the Selected Languages if (behaviours != null) { this.SubtitleBehaviours.SelectedBehaviour = behaviours.SelectedBehaviour; this.SubtitleBehaviours.SelectedBurnInBehaviour = behaviours.SelectedBurnInBehaviour; this.SubtitleBehaviours.AddClosedCaptions = behaviours.AddClosedCaptions; this.SubtitleBehaviours.AddForeignAudioScanTrack = behaviours.AddForeignAudioScanTrack; this.subtitleBehaviours.AddExternalSubtitles = behaviours.AddExternalSubtitles; foreach (string selectedItem in behaviours.SelectedLangauges) { this.AvailableLanguages.Remove(selectedItem); this.SubtitleBehaviours.SelectedLangauges.Add(selectedItem); } } }
/// <summary> /// Prepare the Preset window to create a Preset Object later. /// </summary> /// <param name="task"> /// The Encode Task. /// </param> /// <param name="title"> /// The title. /// </param> /// <param name="audioBehaviours"> /// The audio Behaviours. /// </param> /// <param name="subtitleBehaviours"> /// The subtitle Behaviours. /// </param> public void Setup(EncodeTask task, Title title, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours) { this.Preset.Task = new EncodeTask(task); this.Preset.AudioTrackBehaviours = audioBehaviours.Clone(); this.Preset.SubtitleTrackBehaviours = subtitleBehaviours.Clone(); this.audioDefaultsViewModel = new AudioDefaultsViewModel(this.Preset.Task); this.audioDefaultsViewModel.Setup(this.Preset, this.Preset.Task); this.subtitlesDefaultsViewModel = new SubtitlesDefaultsViewModel(); this.subtitlesDefaultsViewModel.SetupLanguages(subtitleBehaviours); this.selectedTitle = title; switch (task.Anamorphic) { default: this.SelectedPictureSettingMode = PresetPictureSettingsMode.Custom; if (title != null && title.Resolution != null) { this.CustomWidth = title.Resolution.Width; this.CustomHeight = title.Resolution.Height; } break; case Anamorphic.Automatic: this.SelectedPictureSettingMode = PresetPictureSettingsMode.SourceMaximum; break; } }
/// <summary> /// Update this preset. /// The given parameters should be copy-constructed. /// </summary> /// <param name="task"> /// The task. /// </param> /// <param name="audioBehaviours"> /// The audio behaviours. /// </param> /// <param name="subtitleBehaviours"> /// The subtitle behaviours. /// </param> public void Update(EncodeTask task, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours) { this.Task = task; this.AudioTrackBehaviours = audioBehaviours; this.SubtitleTrackBehaviours = subtitleBehaviours; }
/// <summary> /// Prepare the Preset window to create a Preset Object later. /// </summary> /// <param name="task"> /// The Encode Task. /// </param> /// <param name="title"> /// The title. /// </param> /// <param name="audioBehaviours"> /// The audio Behaviours. /// </param> /// <param name="subtitleBehaviours"> /// The subtitle Behaviours. /// </param> public void Setup(EncodeTask task, Title title, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours) { this.Preset.Task = new EncodeTask(task); this.Preset.AudioTrackBehaviours = audioBehaviours.Clone(); this.Preset.SubtitleTrackBehaviours = subtitleBehaviours.Clone(); this.selectedTitle = title; switch (task.Anamorphic) { default: this.SelectedPictureSettingMode = PresetPictureSettingsMode.Custom; break; case Anamorphic.Strict: this.SelectedPictureSettingMode = PresetPictureSettingsMode.SourceMaximum; break; } }