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; }
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 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); }
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; }
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); }
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 static bool Contains(this Mp3Type value, Mp3Type flag) { return((value & flag) == flag); }
public static bool Contains(this Mp3Type value, Mp3Type flag) { return (value & flag) == flag; }