using System.Collections.Generic; 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 = [0, 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 List CD => _speedValues.FindAll(s => s <= 72); /// /// Set of accepted speeds for DVD media /// public static List DVD => _speedValues.FindAll(s => s <= 24); /// /// Set of accepted speeds for HD-DVD media /// public static List HDDVD => _speedValues.FindAll(s => s <= 24); /// /// Set of accepted speeds for BD media /// public static List BD => _speedValues.FindAll(s => s <= 16); /// /// Get list of all drive speeds for a given MediaType /// /// MediaType? that represents the current item /// Read-only list of drive speeds public static List GetSpeedsForMediaType(MediaType? type) { #pragma warning disable IDE0072 return type switch { MediaType.CDROM or MediaType.GDROM => CD, MediaType.DVD or MediaType.NintendoGameCubeGameDisc or MediaType.NintendoWiiOpticalDisc => DVD, MediaType.HDDVD => HDDVD, MediaType.BluRay or MediaType.NintendoWiiUOpticalDisc => BD, // Default to CD speed range _ => CD, }; #pragma warning restore IDE0072 } } }