ParseDecimalValueFromValue() public static method

public static ParseDecimalValueFromValue ( string value, string>.Dictionary dict ) : decimal
value string
dict string>.Dictionary
return decimal
Exemplo n.º 1
0
        private void OnAnyValuechanged()
        {
            if (_eventLock.Lock() && Editable)
            {
                var activeTrack = SelectedTrack;

                if (activeTrack != null)
                {
                    activeTrack.TargetAudioCodec = SelectedAudioCodec;

                    activeTrack.Bitrate = BitRateTypedValue * 1000;
                    activeTrack.ReComputeStreamSizeByBitrate();

                    activeTrack.Channels = Convert.ToInt32(comboChannels.ActiveText);

                    var samplingRateTypedValue = SupportMethods.ParseDecimalValueFromValue(comboSampleRate.ActiveText, MediaConvertGUIConfiguration.DefaultSamplingRates);
                    activeTrack.SamplingRateHz = samplingRateTypedValue;
                }

                _eventLock.Unlock();
            }
            ;

            Fill();
        }
Exemplo n.º 2
0
        private void OnAnyValueChanged()
        {
            if (Editable && MovieInfo != null && MovieInfo.FirstVideoTrack != null)
            {
                if (_eventLock.Lock())
                {
                    var m = MovieInfo.FirstVideoTrack;

                    // reactivating disabled?
                    if (chBoxResolution.Active && !MovieInfo.EditResolution)
                    {
                        entryWidth.Text  = m.Width.ToString();
                        entryHeight.Text = m.Height.ToString();
                    }
                    if (chBoxBitRate.Active && !MovieInfo.EditBitRate)
                    {
                        comboBitRate.Entry.Text = (m.BitrateKbps).ToString();
                    }

                    if (chBoxAspect.Active && !MovieInfo.EditAspect)
                    {
                        comboAspect.Entry.Text = m.Aspect;
                    }

                    if (chBoxFrameRate.Active && !MovieInfo.EditFrameRate)
                    {
                        comboFrameRate.Entry.Text = m.FrameRate.ToString();
                    }


                    MovieInfo.EditResolution = chBoxResolution.Active;
                    MovieInfo.EditAspect     = chBoxAspect.Active;
                    MovieInfo.EditBitRate    = chBoxBitRate.Active;
                    MovieInfo.EditFrameRate  = chBoxFrameRate.Active;

                    if (chBoxBitRate.Active)
                    {
                        var bitRateTypedValue = SupportMethods.ParseDecimalValueFromValue(comboBitRate.ActiveText, MediaConvertGUIConfiguration.DefaultVideoBitRates);
                        m.Bitrate = bitRateTypedValue * 1000;
                    }

                    if (chBoxResolution.Active)
                    {
                        if (SupportMethods.IsNumeric(entryWidth.Text))
                        {
                            m.Width = Convert.ToInt32(entryWidth.Text);
                        }

                        if (SupportMethods.IsNumeric(entryHeight.Text))
                        {
                            m.Height = Convert.ToInt32(entryHeight.Text);
                        }
                    }

                    if (chBoxFrameRate.Active)
                    {
                        if (SupportMethods.IsNumeric(comboFrameRate.ActiveText))
                        {
                            m.FrameRate = SupportMethods.ToDecimal(comboFrameRate.ActiveText);
                        }
                    }

                    if (chBoxAspect.Active)
                    {
                        m.Aspect = comboAspect.ActiveText;
                    }

                    if (chBoxRotation.Active)
                    {
                        if (SupportMethods.IsNumeric(comboRotation.ActiveText))
                        {
                            m.RotatationAngle = SupportMethods.ToDecimal(comboRotation.ActiveText);
                        }
                    }
                    MovieInfo.EditRotation = chBoxRotation.Active;

                    MovieInfo.AutoRotate = checkAutorotate.Active;
                    if (checkAutorotate.Active)
                    {
                        // reseting Rotation angle to 0
                        m.RotatationAngle = 0;
                    }

                    MovieInfo.TargetVideoCodec = MediaConvertGUIConfiguration.GetVideoCodecByName(comboCodec.ActiveText);
                    comboCodec.TooltipText     = MovieInfo.TargetVideoCodec.Title;

                    _eventLock.Unlock();
                    Fill();
                }
            }
        }