Example #1
0
        private void SetExtension(string newExtension)
        {
            // Make sure the output extension is set correctly based on the users preferences and selection.
            if (newExtension == ".mp4" || newExtension == ".m4v")
            {
                switch ((Mp4Behaviour)this.userSettingService.GetUserSetting <int>(UserSettingConstants.UseM4v))
                {
                case Mp4Behaviour.Auto:     // Auto
                    newExtension = MP4Helper.RequiresM4v(this.Task) ? ".m4v" : ".mp4";
                    break;

                case Mp4Behaviour.MP4:     // MP4
                    newExtension = ".mp4";
                    break;

                case Mp4Behaviour.M4V:     // M4v
                    newExtension = ".m4v";
                    break;
                }
            }

            // Now disable controls that are not required. The Following are for MP4 only!
            if (newExtension == ".mkv" || newExtension == ".webm")
            {
                this.OptimizeMP4   = false;
                this.IPod5GSupport = false;
                this.AlignAVStart  = false;
            }

            if (!VideoEncoderHelpers.IsH264(this.task.VideoEncoder))
            {
                this.IPod5GSupport = false;
            }

            this.NotifyOfPropertyChange(() => this.IsMkvOrWebm);
            this.NotifyOfPropertyChange(() => this.IsIpodAtomVisible);

            // Update The browse file extension display
            if (Path.HasExtension(newExtension))
            {
                this.OnOutputFormatChanged(new OutputFormatChangedEventArgs(newExtension));
            }

            // Update the UI Display
            this.NotifyOfPropertyChange(() => this.Task);
        }
        private void SetExtension(string newExtension)
        {
            // Make sure the output extension is set correctly based on the users preferences and selection.
            if (newExtension == ".mp4" || newExtension == ".m4v")
            {
                switch (this.userSettingService.GetUserSetting <int>(UserSettingConstants.UseM4v, typeof(int)))
                {
                case 0:     // Auto
                    newExtension = MP4Helper.RequiresM4v(this.Task) ? ".m4v" : ".mp4";
                    break;

                case 1:     // MP4
                    newExtension = ".mp4";
                    break;

                case 2:     // M4v
                    newExtension = ".m4v";
                    break;
                }
            }

            // Now disable controls that are not required. The Following are for MP4 only!
            if (newExtension == ".mkv")
            {
                this.OptimizeMP4   = false;
                this.IPod5GSupport = false;
                this.AlignAVStart  = false;
            }

            this.NotifyOfPropertyChange(() => this.IsMkv);

            // Update The browse file extension display
            if (Path.HasExtension(newExtension))
            {
                this.OnOutputFormatChanged(new OutputFormatChangedEventArgs(newExtension));
            }

            // Update the UI Display
            this.NotifyOfPropertyChange(() => this.Task);
        }