using System.Collections.Generic; using System.Linq; using SabreTools.RedumpLib.Data; namespace MPF.Frontend { /// /// Constant values for UI /// public static class InterfaceConstants { /// /// Set of all accepted speed values /// private static readonly List _speedValues = [1, 2, 3, 4, 6, 8, 12, 16, 20, 24, 32, 40, 44, 48, 52, 56, 72]; /// /// Set of accepted speeds for CD and GD media /// public static IList CD => _speedValues.Where(s => s <= 72).ToList(); /// /// Set of accepted speeds for DVD media /// public static IList DVD => _speedValues.Where(s => s <= 24).ToList(); /// /// Set of accepted speeds for HD-DVD media /// public static IList HDDVD => _speedValues.Where(s => s <= 24).ToList(); /// /// Set of accepted speeds for BD media /// public static IList BD => _speedValues.Where(s => s <= 16).ToList(); /// /// Set of accepted speeds for all other media /// public static IList Unknown => _speedValues.Where(s => s <= 1).ToList(); /// /// Get list of all drive speeds for a given MediaType /// /// MediaType? that represents the current item /// Read-only list of drive speeds public static IList GetSpeedsForMediaType(MediaType? type) { return type switch { MediaType.CDROM or MediaType.GDROM => CD, MediaType.DVD or MediaType.NintendoGameCubeGameDisc or MediaType.NintendoWiiOpticalDisc => DVD, MediaType.HDDVD => HDDVD, MediaType.BluRay => BD, _ => Unknown, }; } } }