Esempio n. 1
0
        public VideoPanelViewModel(EncodingWindowViewModel encodingWindowViewModel)
            : base(encodingWindowViewModel)
        {
            this.AutomaticChange = true;

            this.RegisterProfileProperties();


            this.encoderChoices = new List <VideoEncoderViewModel>();

            this.framerateChoices = new List <double> {
                0
            };
            foreach (var framerate in HandBrakeEncoderHelpers.VideoFramerates)
            {
                this.framerateChoices.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture));
            }

            // InputType
            this.WhenAnyValue(x => x.HasSourceData, x => x.MainViewModel.SelectedTitle.Type, (hasSourceData, titleType) =>
            {
                if (hasSourceData)
                {
                    return(DisplayConversions.DisplayTitleType((TitleType)titleType));
                }

                return(string.Empty);
            }).ToProperty(this, x => x.InputType, out this.inputType);

            // InputVideoCodec
            this.WhenAnyValue(x => x.HasSourceData, x => x.MainViewModel.SelectedTitle.VideoCodec, (hasSourceData, videoCodec) =>
            {
                if (hasSourceData)
                {
                    return(DisplayConversions.DisplayVideoCodecName(videoCodec));
                }

                return(string.Empty);
            }).ToProperty(this, x => x.InputVideoCodec, out this.inputVideoCodec);

            // InputFramerate
            this.WhenAnyValue(x => x.HasSourceData, x => x.MainViewModel.SelectedTitle.FrameRate, (hasSourceData, framerate) =>
            {
                if (hasSourceData)
                {
                    return(string.Format(EncodingRes.FpsFormat, framerate.ToDouble()));
                }

                return(string.Empty);
            }).ToProperty(this, x => x.InputFramerate, out this.inputFramerate);

            // X264SettingsVisible
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoder = selectedEncoder.Encoder.ShortName;

                return(videoEncoder == "x264");
            }).ToProperty(this, x => x.X264SettingsVisible, out this.x264SettingsVisible);

            // QsvSettingsVisible
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoder = selectedEncoder.Encoder.ShortName;

                return(videoEncoder.StartsWith("qsv_", StringComparison.OrdinalIgnoreCase));
            }).ToProperty(this, x => x.QsvSettingsVisible, out this.qsvSettingsVisible);

            // EncoderSettingsVisible
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoder = selectedEncoder.Encoder.ShortName;

                return
                (videoEncoder.StartsWith("x264", StringComparison.OrdinalIgnoreCase) ||
                 videoEncoder.StartsWith("x265", StringComparison.OrdinalIgnoreCase) ||
                 videoEncoder == "qsv_h264" ||
                 videoEncoder == "qsv_h265");
            }).ToProperty(this, x => x.EncoderSettingsVisible, out this.encoderSettingsVisible);

            // BasicEncoderSettingsVisible
            this.WhenAnyValue(x => x.SelectedEncoder, x => x.UseAdvancedTab, (selectedEncoder, useAdvancedTab) =>
            {
                if (this.selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoder = selectedEncoder.Encoder.ShortName;

                if (videoEncoder == "qsv_h264")
                {
                    return(true);
                }

                if (videoEncoder != "x264")
                {
                    return(true);
                }

                return(!useAdvancedTab);
            }).ToProperty(this, x => x.BasicEncoderSettingsVisible, out this.basicEncoderSettingsVisible);

            // ConstantFramerateToolTip
            this.WhenAnyValue(x => x.Framerate, framerate =>
            {
                if (framerate == 0)
                {
                    return(EncodingRes.CfrSameAsSourceToolTip);
                }
                else
                {
                    return(EncodingRes.CfrToolTip);
                }
            }).ToProperty(this, x => x.ConstantFramerateToolTip, out this.constantFramerateToolTip);

            // VariableFramerateToolTip
            this.WhenAnyValue(x => x.Framerate, framerate =>
            {
                if (framerate == 0)
                {
                    return(EncodingRes.VfrSameAsSourceToolTip);
                }
                else
                {
                    return(EncodingRes.VfrPeakFramerateToolTip);
                }
            }).ToProperty(this, x => x.VariableFramerateToolTip, out this.variableFramerateToolTip);

            // VfrChoiceText
            this.WhenAnyValue(x => x.Framerate, framerate =>
            {
                if (framerate == 0)
                {
                    return(EncodingRes.VfrChoice);
                }
                else
                {
                    return(EncodingRes.VfrPeakChoice);
                }
            }).ToProperty(this, x => x.VfrChoiceText, out this.vfrChoiceText);

            // TwoPassEnabled
            this.WhenAnyValue(x => x.VideoEncodeRateType, videoEncodeRateType =>
            {
                return(videoEncodeRateType != VCVideoEncodeRateType.ConstantQuality);
            }).ToProperty(this, x => x.TwoPassEnabled, out this.twoPassEnabled);

            // TurboFirstPassEnabled
            this.WhenAnyValue(x => x.VideoEncodeRateType, x => x.TwoPass, (videoEncodeRateType, twoPass) =>
            {
                return(videoEncodeRateType != VCVideoEncodeRateType.ConstantQuality && twoPass);
            }).ToProperty(this, x => x.TurboFirstPassEnabled, out this.turboFirstPassEnabled);

            // TurboFirstPassVisible
            this.WhenAnyValue(x => x.VideoEncodeRateType, x => x.SelectedEncoder, (videoEncodeRateType, selectedEncoder) =>
            {
                if (selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoderShortName = selectedEncoder.Encoder.ShortName;

                return(videoEncodeRateType != VCVideoEncodeRateType.ConstantQuality && (videoEncoderShortName == "x265" || videoEncoderShortName == "x264"));
            }).ToProperty(this, x => x.TurboFirstPassVisible, out this.turboFirstPassVisible);

            // QualityModulus
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(0);
                }

                return(Math.Round(
                           HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Granularity,
                           2));
            }).ToProperty(this, x => x.QualityModulus, out this.qualityModulus);

            // QualitySliderMin
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(0);
                }

                return(HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Low);
            }).ToProperty(this, x => x.QualitySliderMin, out this.qualitySliderMin);

            // QualitySliderMax
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(0);
                }

                return(HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).High);
            }).ToProperty(this, x => x.QualitySliderMax, out this.qualitySliderMax);

            // QualitySliderLeftText
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                if (HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Ascending)
                {
                    return(EncodingRes.LowQuality);
                }
                else
                {
                    return(EncodingRes.HighQuality);
                }
            }).ToProperty(this, x => x.QualitySliderLeftText, out this.qualitySliderLeftText);

            // QualitySliderRightText
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                if (HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Ascending)
                {
                    return(EncodingRes.HighQuality);
                }
                else
                {
                    return(EncodingRes.LowQuality);
                }
            }).ToProperty(this, x => x.QualitySliderRightText, out this.qualitySliderRightText);

            // PresetName
            this.WhenAnyValue(x => x.SelectedEncoder, x => x.PresetIndex, (selectedEncoder, presetIndex) =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                string currentPresetName = null;
                if (this.presets != null && presetIndex >= 0 && presetIndex < this.presets.Count)
                {
                    currentPresetName = this.presets[presetIndex];
                }

                if (string.IsNullOrEmpty(currentPresetName))
                {
                    currentPresetName = GetDefaultPreset(selectedEncoder.Encoder.ShortName);
                }

                switch (currentPresetName)
                {
                case "ultrafast":
                    return(EncodingRes.Preset_UltraFast);

                case "superfast":
                    return(EncodingRes.Preset_SuperFast);

                case "veryfast":
                    return(EncodingRes.Preset_VeryFast);

                case "faster":
                    return(EncodingRes.Preset_Faster);

                case "fast":
                    return(EncodingRes.Preset_Fast);

                case "medium":
                    return(EncodingRes.Preset_Medium);

                case "slow":
                    return(EncodingRes.Preset_Slow);

                case "slower":
                    return(EncodingRes.Preset_Slower);

                case "veryslow":
                    return(EncodingRes.Preset_VerySlow);

                case "placebo":
                    return(EncodingRes.Preset_Placebo);

                case "speed":
                    return(EncodingRes.QsvPreset_Speed);

                case "balanced":
                    return(EncodingRes.QsvPreset_Balanced);

                case "quality":
                    return(EncodingRes.QsvPreset_Quality);

                default:
                    return(string.Empty);
                }
            }).ToProperty(this, x => x.PresetName, out this.presetName);

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile)
            .Subscribe(_ =>
            {
                this.ReadTuneListFromProfile();
                this.RaisePropertyChanged(nameof(this.Tune));
                this.RaisePropertyChanged(nameof(this.FastDecode));
                this.RaisePropertyChanged(nameof(this.PresetIndex));
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.VideoEncoder)
            .Subscribe(_ =>
            {
                if (!this.userVideoEncoderChange)
                {
                    this.RefreshEncoderChoices(this.PresetsService.SelectedPreset.Preset.EncodingProfile.ContainerName, EncoderChoicesRefreshSource.ProfileChange);
                }
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.VideoOptions)
            .Subscribe(_ =>
            {
                if (!this.updatingLocalVideoOptions)
                {
                    this.RaisePropertyChanged(nameof(this.VideoOptions));
                }
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.ContainerName)
            .Skip(1)
            .Subscribe(containerName =>
            {
                this.RefreshEncoderChoices(containerName, EncoderChoicesRefreshSource.ContainerChange);
            });

            this.WhenAnyValue(x => x.SelectedEncoder.Encoder.ShortName)
            .Subscribe(videoEncoder =>
            {
                this.RefreshEncoderSettings(applyDefaults: false);
            });

            this.main.AudioChoiceChanged += (o, e) =>
            {
                this.NotifyAudioInputChanged();
            };

            this.main.WhenAnyValue(x => x.SelectedTitle)
            .Skip(1)
            .Subscribe(_ =>
            {
                this.NotifyAudioInputChanged();
            });

            this.AutomaticChange = false;
        }
Esempio n. 2
0
        public VideoPanelViewModel(EncodingWindowViewModel encodingWindowViewModel)
            : base(encodingWindowViewModel)
        {
            this.AutomaticChange = true;

            this.RegisterProfileProperties();


            this.encoderChoices = new List <VideoEncoderViewModel>();

            this.framerateChoices = new List <double> {
                0
            };
            foreach (var framerate in HandBrakeEncoderHelpers.VideoFramerates)
            {
                this.framerateChoices.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture));
            }

            // InputType
            this.WhenAnyValue(x => x.HasSourceData, x => x.MainViewModel.SelectedTitle.Title.Type, (hasSourceData, titleType) =>
            {
                if (hasSourceData)
                {
                    return(DisplayConversions.DisplayTitleType((TitleType)titleType));
                }

                return(string.Empty);
            }).ToProperty(this, x => x.InputType, out this.inputType);

            // InputVideoCodec
            this.WhenAnyValue(x => x.HasSourceData, x => x.MainViewModel.SelectedTitle.VideoCodec, (hasSourceData, videoCodec) =>
            {
                if (hasSourceData)
                {
                    return(DisplayConversions.DisplayVideoCodecName(videoCodec));
                }

                return(string.Empty);
            }).ToProperty(this, x => x.InputVideoCodec, out this.inputVideoCodec);

            // InputFramerate
            this.WhenAnyValue(x => x.HasSourceData, x => x.MainViewModel.SelectedTitle.FrameRate, (hasSourceData, framerate) =>
            {
                if (hasSourceData)
                {
                    return(string.Format(EncodingRes.FpsFormat, framerate.ToDouble()));
                }

                return(string.Empty);
            }).ToProperty(this, x => x.InputFramerate, out this.inputFramerate);

            // X264SettingsVisible
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoder = selectedEncoder.Encoder.ShortName;

                return(videoEncoder == "x264");
            }).ToProperty(this, x => x.X264SettingsVisible, out this.x264SettingsVisible);

            // ConstantFramerateToolTip
            this.WhenAnyValue(x => x.Framerate, framerate =>
            {
                if (framerate == 0)
                {
                    return(EncodingRes.CfrSameAsSourceToolTip);
                }
                else
                {
                    return(EncodingRes.CfrToolTip);
                }
            }).ToProperty(this, x => x.ConstantFramerateToolTip, out this.constantFramerateToolTip);

            // VariableFramerateToolTip
            this.WhenAnyValue(x => x.Framerate, framerate =>
            {
                if (framerate == 0)
                {
                    return(EncodingRes.VfrSameAsSourceToolTip);
                }
                else
                {
                    return(EncodingRes.VfrPeakFramerateToolTip);
                }
            }).ToProperty(this, x => x.VariableFramerateToolTip, out this.variableFramerateToolTip);

            // VfrChoiceText
            this.WhenAnyValue(x => x.Framerate, framerate =>
            {
                if (framerate == 0)
                {
                    return(EncodingRes.VfrChoice);
                }
                else
                {
                    return(EncodingRes.VfrPeakChoice);
                }
            }).ToProperty(this, x => x.VfrChoiceText, out this.vfrChoiceText);

            // TwoPassVisible
            this.WhenAnyValue(x => x.VideoEncodeRateType, x => x.SelectedEncoder, (videoEncodeRateType, selectedEncoder) =>
            {
                if (selectedEncoder != null)
                {
                    var encoderShortName = selectedEncoder.Encoder.ShortName;
                    if (!EncoderSupportsTwoPass(encoderShortName))
                    {
                        return(false);
                    }
                }

                return(videoEncodeRateType != VCVideoEncodeRateType.ConstantQuality);
            }).ToProperty(this, x => x.TwoPassVisible, out this.twoPassVisible);

            // TurboFirstPassEnabled
            this.WhenAnyValue(x => x.VideoEncodeRateType, x => x.TwoPass, (videoEncodeRateType, twoPass) =>
            {
                return(videoEncodeRateType != VCVideoEncodeRateType.ConstantQuality && twoPass);
            }).ToProperty(this, x => x.TurboFirstPassEnabled, out this.turboFirstPassEnabled);

            // TurboFirstPassVisible
            this.WhenAnyValue(x => x.VideoEncodeRateType, x => x.SelectedEncoder, (videoEncodeRateType, selectedEncoder) =>
            {
                if (selectedEncoder == null)
                {
                    return(false);
                }

                string videoEncoderShortName = selectedEncoder.Encoder.ShortName;

                return(videoEncodeRateType != VCVideoEncodeRateType.ConstantQuality && videoEncoderShortName.StartsWith("x26", StringComparison.Ordinal));
            }).ToProperty(this, x => x.TurboFirstPassVisible, out this.turboFirstPassVisible);

            // QualityModulus
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(0);
                }

                return(Math.Round(
                           HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Granularity,
                           2));
            }).ToProperty(this, x => x.QualityModulus, out this.qualityModulus);

            // QualitySliderMin
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(0);
                }

                return(HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Low);
            }).ToProperty(this, x => x.QualitySliderMin, out this.qualitySliderMin);

            // QualitySliderMax
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(0);
                }

                return(HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).High);
            }).ToProperty(this, x => x.QualitySliderMax, out this.qualitySliderMax);

            // QualitySliderLeftText
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                if (HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Ascending)
                {
                    return(EncodingRes.LowQuality);
                }
                else
                {
                    return(EncodingRes.HighQuality);
                }
            }).ToProperty(this, x => x.QualitySliderLeftText, out this.qualitySliderLeftText);

            // QualitySliderRightText
            this.WhenAnyValue(x => x.SelectedEncoder, selectedEncoder =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                if (HandBrakeEncoderHelpers.GetVideoQualityLimits(selectedEncoder.Encoder).Ascending)
                {
                    return(EncodingRes.HighQuality);
                }
                else
                {
                    return(EncodingRes.LowQuality);
                }
            }).ToProperty(this, x => x.QualitySliderRightText, out this.qualitySliderRightText);

            // PresetName
            this.WhenAnyValue(x => x.SelectedEncoder, x => x.Presets, x => x.PresetIndex, (selectedEncoder, localPresets, presetIndex) =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                string currentPresetName = null;
                if (localPresets != null && presetIndex >= 0 && presetIndex < localPresets.Count)
                {
                    currentPresetName = localPresets[presetIndex];
                }

                if (string.IsNullOrEmpty(currentPresetName))
                {
                    currentPresetName = GetDefaultPreset(selectedEncoder.Encoder.ShortName);
                }

                switch (currentPresetName)
                {
                case "ultrafast":
                    return(EncodingRes.Preset_UltraFast);

                case "superfast":
                    return(EncodingRes.Preset_SuperFast);

                case "veryfast":
                    return(EncodingRes.Preset_VeryFast);

                case "faster":
                    return(EncodingRes.Preset_Faster);

                case "fast":
                    return(EncodingRes.Preset_Fast);

                case "medium":
                    return(EncodingRes.Preset_Medium);

                case "slow":
                    return(EncodingRes.Preset_Slow);

                case "slower":
                    return(EncodingRes.Preset_Slower);

                case "veryslow":
                    return(EncodingRes.Preset_VerySlow);

                case "placebo":
                    return(EncodingRes.Preset_Placebo);

                case "speed":
                    return(EncodingRes.QsvPreset_Speed);

                case "balanced":
                    return(EncodingRes.QsvPreset_Balanced);

                case "quality":
                    return(EncodingRes.QsvPreset_Quality);

                case "ll":
                    return(EncodingRes.NVEncPreset_ll);

                case "hq":
                    return(EncodingRes.NVEncPreset_hq);

                case "hp":
                    return(EncodingRes.NVEncPreset_hp);

                default:
                    return(currentPresetName);
                }
            }).ToProperty(this, x => x.PresetName, out this.presetName);

            // FullParameterList
            this.WhenAnyValue(
                x => x.SelectedEncoder,
                x => x.PresetsService.SelectedPreset.Preset.EncodingProfile.VideoPreset,
                x => x.PresetsService.SelectedPreset.Preset.EncodingProfile.VideoTunes,
                x => x.VideoOptions,
                x => x.VideoProfile,
                x => x.VideoLevel,
                x => x.OutputSizeService.Size,
                (selectedEncoder, videoPreset, videoTunes, videoOptions, videoProfile, videoLevel, outputSize) =>
            {
                if (selectedEncoder == null)
                {
                    return(string.Empty);
                }

                int width, height;
                if (outputSize != null)
                {
                    width  = outputSize.OutputWidth;
                    height = outputSize.OutputHeight;
                }
                else
                {
                    width  = 640;
                    height = 480;
                }

                if (width <= 0)
                {
                    width = 640;
                }

                if (height <= 0)
                {
                    height = 480;
                }

                string parameterList = HandBrakeUtils.CreateX264OptionsString(
                    videoPreset,
                    videoTunes,
                    videoOptions?.Trim(),
                    videoProfile,
                    videoLevel,
                    width,
                    height);

                return(parameterList);
            }).ToProperty(this, x => x.FullParameterList, out this.fullParameterList);

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile)
            .Subscribe(_ =>
            {
                this.ReadTuneListFromProfile();
                this.RaisePropertyChanged(nameof(this.Tune));
                this.RaisePropertyChanged(nameof(this.FastDecode));
                this.RaisePropertyChanged(nameof(this.PresetIndex));
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.VideoEncoder)
            .Subscribe(_ =>
            {
                if (!this.userVideoEncoderChange)
                {
                    this.RefreshEncoderChoices(this.PresetsService.SelectedPreset.Preset.EncodingProfile.ContainerName, EncoderChoicesRefreshSource.ProfileChange);
                }
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.VideoOptions)
            .Subscribe(_ =>
            {
                if (!this.updatingLocalVideoOptions)
                {
                    this.RaisePropertyChanged(nameof(this.VideoOptions));
                }
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.ContainerName)
            .Skip(1)
            .Subscribe(containerName =>
            {
                this.RefreshEncoderChoices(containerName, EncoderChoicesRefreshSource.ContainerChange);

                // Refresh preset/profile/tune/level choices and values
                this.RefreshEncoderSettings(applyDefaults: false);
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.AudioCopyMask)
            .Skip(1)
            .Subscribe(copyMask =>
            {
                this.NotifyAudioChanged();
            });

            this.PresetsService.WhenAnyValue(x => x.SelectedPreset.Preset.EncodingProfile.AudioEncodings)
            .Skip(1)
            .Subscribe(copyMask =>
            {
                this.NotifyAudioChanged();
            });

            this.WhenAnyValue(x => x.SelectedEncoder.Encoder.ShortName)
            .Subscribe(videoEncoder =>
            {
                this.RefreshEncoderSettings(applyDefaults: false);
            });

            this.main.AudioTracks
            .Connect()
            .WhenAnyPropertyChanged()
            .Subscribe(_ =>
            {
                this.NotifyAudioChanged();
            });

            this.main.WhenAnyValue(x => x.SelectedTitle)
            .Skip(1)
            .Subscribe(_ =>
            {
                this.NotifyAudioChanged();
            });

            this.AutomaticChange = false;
        }