/// <summary>
 /// Initializes a new instance of the <see cref="SubtitleBehaviours"/> class.
 /// </summary>
 /// <param name="behaviours">
 /// The behaviours.
 /// </param>
 public SubtitleBehaviours(SubtitleBehaviours behaviours)
 {
     this.SelectedBehaviour        = behaviours.selectedBehaviour;
     this.SelectedBurnInBehaviour  = behaviours.selectedBurnInBehaviour;
     this.SelectedLangauges        = new BindingList <string>(behaviours.SelectedLangauges.ToList());
     this.AddClosedCaptions        = behaviours.AddClosedCaptions;
     this.AddForeignAudioScanTrack = behaviours.AddForeignAudioScanTrack;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Clone this object
        /// </summary>
        /// <returns>
        /// The <see cref="object"/>.
        /// </returns>
        public SubtitleBehaviours Clone()
        {
            SubtitleBehaviours cloned = new SubtitleBehaviours
            {
                SelectedBehaviour        = this.selectedBehaviour,
                SelectedLangauges        = new BindingList <string>(),
                AddClosedCaptions        = this.addClosedCaptions,
                AddForeignAudioScanTrack = this.addForeignAudioScanTrack,
            };

            foreach (var item in this.SelectedLangauges)
            {
                cloned.SelectedLangauges.Add(item);
            }

            return(cloned);
        }
        /// <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;
                    if (title != null && title.Resolution != null)
                    {
                        this.CustomWidth = title.Resolution.Width;
                        this.CustomHeight = title.Resolution.Height;
                    }
                    break;
                case Anamorphic.Strict:
                    this.SelectedPictureSettingMode = PresetPictureSettingsMode.SourceMaximum;
                    break;
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubtitleBehaviours"/> class.
 /// </summary>
 /// <param name="behaviours">
 /// The behaviours.
 /// </param>
 public SubtitleBehaviours(SubtitleBehaviours behaviours)
 {
     this.SelectedBehaviour       = behaviours.selectedBehaviour;
     this.SelectedBurnInBehaviour = behaviours.selectedBurnInBehaviour;
     this.SelectedLangauges       = new BindingList <string>(behaviours.SelectedLangauges.ToList());
 }
        /// <summary>
        /// The setup languages.
        /// </summary>
        /// <param name="behaviours">
        /// The behaviours.
        /// </param>
        public void SetupLanguages(SubtitleBehaviours behaviours)
        {
            // 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.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;

                foreach (string selectedItem in behaviours.SelectedLangauges)
                {
                    this.AvailableLanguages.Remove(selectedItem);
                    this.SubtitleBehaviours.SelectedLangauges.Add(selectedItem);
                }
            }
        }
Exemplo n.º 6
0
        /// <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);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubtitleBehaviours"/> class.
 /// </summary>
 /// <param name="behaviours">
 /// The behaviours.
 /// </param>
 public SubtitleBehaviours(SubtitleBehaviours behaviours)
 {
     this.SelectedBehaviour = behaviours.selectedBehaviour;
     this.SelectedBurnInBehaviour = behaviours.selectedBurnInBehaviour;
     this.SelectedLangauges = new BindingList<string>(behaviours.SelectedLangauges.ToList());
 }
Exemplo n.º 8
0
        /// <summary>
        /// Clone this object
        /// </summary>
        /// <returns>
        /// The <see cref="object"/>.
        /// </returns>
        public SubtitleBehaviours Clone()
        {
            SubtitleBehaviours cloned = new SubtitleBehaviours
            {
                SelectedBehaviour = this.selectedBehaviour, 
                SelectedBurnInBehaviour = this.selectedBurnInBehaviour, 
                SelectedLangauges = new BindingList<string>(), 
                AddClosedCaptions = this.addClosedCaptions, 
                AddForeignAudioScanTrack = this.addForeignAudioScanTrack, 
            };

            foreach (var item in this.SelectedLangauges)
            {
                cloned.SelectedLangauges.Add(item);
            }

            return cloned;
        }