示例#1
0
        public static IList<ushort> GetAvailableSamplingFrequencies(Mp3Type mp3Types)
        {
            var output = new List<ushort> {0};

            if (mp3Types.Contains(Mp3Type.Mpeg10)) {
                output.AddRange(Mpeg10.SamplingFrequencies);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg20)) {
                output.AddRange(Mpeg20.SamplingFrequencies);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg25)) {
                output.AddRange(Mpeg25.SamplingFrequencies);
            }

            return output;
        }
示例#2
0
        public static IList<ushort> GetAvailableBitrates(Mp3Type mp3Types)
        {
            var output = new HashSet<ushort>();

            if (mp3Types.Contains(Mp3Type.Mpeg10)) {
                output.UnionWith(Mpeg10.Bitrates);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg20)) {
                output.UnionWith(Mpeg20.Bitrates);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg25)) {
                output.UnionWith(Mpeg25.Bitrates);
            }

            var tmp = new List<ushort>(output);
            return tmp.OrderByDescending(x => x).ToList();
        }
示例#3
0
        public Mp3Type GetAvailableMp3Types()
        {
            Mp3Type output = 0;

            if (LameEncoderInterface.MP3Types.Mpeg10.Bitrates.Contains(Value))
            {
                output |= Mp3Type.Mpeg10;
            }

            if (LameEncoderInterface.MP3Types.Mpeg20.Bitrates.Contains(Value))
            {
                output |= Mp3Type.Mpeg20;
            }

            if (LameEncoderInterface.MP3Types.Mpeg25.Bitrates.Contains(Value))
            {
                output |= Mp3Type.Mpeg25;
            }

            return(output);
        }
示例#4
0
        private void RadioButtonBitrateNonVbr_Checked(object sender, RoutedEventArgs e)
        {
            if (!IsInitialized)
            {
                return;
            }

            if (Equals(sender, RadioButtonBitrateConstant))
            {
                BitrateSelectorNonVbr.UpdateValidValues(SamplingFrequencySelectorNonVbr.GetAvailableMp3Types());
                SamplingFrequencySelectorNonVbr.UpdateValidValues(BitrateSelectorNonVbr.GetAvailableMp3Types());
            }
            else
            {
                const Mp3Type allMp3Types = Mp3Type.Mpeg10 | Mp3Type.Mpeg20 | Mp3Type.Mpeg25;
                BitrateSelectorNonVbr.UpdateValidValues(allMp3Types);
                SamplingFrequencySelectorNonVbr.UpdateValidValues(allMp3Types);
            }

            GridQualityOptionsNonVbr.Visibility = Visibility.Visible;
            GridQualityOptionsVbr.Visibility    = Visibility.Hidden;
        }
示例#5
0
        public static IList <ushort> GetAvailableSamplingFrequencies(Mp3Type mp3Types)
        {
            var output = new List <ushort> {
                0
            };

            if (mp3Types.Contains(Mp3Type.Mpeg10))
            {
                output.AddRange(Mpeg10.SamplingFrequencies);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg20))
            {
                output.AddRange(Mpeg20.SamplingFrequencies);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg25))
            {
                output.AddRange(Mpeg25.SamplingFrequencies);
            }

            return(output);
        }
示例#6
0
        public static IList <ushort> GetAvailableBitrates(Mp3Type mp3Types)
        {
            var output = new HashSet <ushort>();

            if (mp3Types.Contains(Mp3Type.Mpeg10))
            {
                output.UnionWith(Mpeg10.Bitrates);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg20))
            {
                output.UnionWith(Mpeg20.Bitrates);
            }

            if (mp3Types.Contains(Mp3Type.Mpeg25))
            {
                output.UnionWith(Mpeg25.Bitrates);
            }

            var tmp = new List <ushort>(output);

            return(tmp.OrderByDescending(x => x).ToList());
        }
 public void UpdateValidValues(Mp3Type newMp3Types)
 {
     ValidValues = LameEncoderInterface.MP3Types.Any.GetAvailableSamplingFrequencies(newMp3Types);
 }
 public void UpdateValidValues(Mp3Type newMp3Types)
 {
     ValidValues = LameEncoderInterface.MP3Types.Any.GetAvailableBitrates(newMp3Types);
 }
 public void UpdateValidValues(Mp3Type newMp3Types)
 {
     ValidValues = LameEncoderInterface.MP3Types.Any.GetAvailableSamplingFrequencies(newMp3Types);
 }
示例#10
0
 public static bool Contains(this Mp3Type value, Mp3Type flag)
 {
     return((value & flag) == flag);
 }
示例#11
0
 public void UpdateValidValues(Mp3Type newMp3Types)
 {
     ValidValues = LameEncoderInterface.MP3Types.Any.GetAvailableBitrates(newMp3Types);
 }
示例#12
0
 public static bool Contains(this Mp3Type value, Mp3Type flag)
 {
     return (value & flag) == flag;
 }