diff --git a/DICUI.Check/Program.cs b/DICUI.Check/Program.cs index f983143c..78d74bd8 100644 --- a/DICUI.Check/Program.cs +++ b/DICUI.Check/Program.cs @@ -9,26 +9,60 @@ namespace DICUI.Check { public static void Main(string[] args) { - if (args.Length < 2) + // Help options + if (args.Length == 0 + || args[0] == "/h" || args[0] == "/?" + || args[0] == "-h" || args[0] == "-?") { - DisplayHelp("Invalid number of arguments"); + DisplayHelp(); return; } - // Check for a valid mapped type and/or system - bool valid = MediaTypeFromString(args[0], out MediaType mediaType, out KnownSystem knownSystem); - if (!valid) + // List options + if (args[0] == "/lm" || args[0] == "/listmedia" + || args[0] == "-lm" || args[0] == "--listmedia") + { + ListMediaTypes(); + Console.ReadLine(); + return; + } + else if (args[0] == "/ls" || args[0] == "/listsystems" + || args[0] == "-ls" || args[0] == "--listsystems") + { + ListKnownSystems(); + Console.ReadLine(); + return; + } + + // Normal operation check + if (args.Length < 3) + { + DisplayHelp("Invalid number of arguments"); + return; + } + + // Check the MediaType + var mediaType = Converters.StringToMediaType(args[0].Trim('"')); + if (mediaType == MediaType.NONE) { DisplayHelp($"{args[0]} is not a recognized media type"); return; } + // Check the KnownSystem + var knownSystem = Converters.StringToKnownSystem(args[1].Trim('"')); + if (knownSystem == KnownSystem.NONE) + { + DisplayHelp($"{args[1]} is not a recognized system"); + return; + } + // Make a new Progress object var progress = new Progress(); progress.ProgressChanged += ProgressUpdated; // Loop through all the rest of the args - for (int i = 1; i < args.Length; i++) + for (int i = 2; i < args.Length; i++) { // Check for a file if (!File.Exists(args[i])) @@ -54,72 +88,73 @@ namespace DICUI.Check } } + /// + /// Display help for DICUI.Check + /// + /// Error string to prefix the help text with private static void DisplayHelp(string error = null) { if (error != null) Console.WriteLine(error); Console.WriteLine("Usage:"); - Console.WriteLine("DICUI.Check.exe ..."); + Console.WriteLine("DICUI.Check.exe ..."); Console.WriteLine(); - Console.WriteLine(@"Media Types:\r\n + Console.WriteLine(@"Common Media Types:\r\n +bd / bluray - BD-ROM cd / cdrom - CD-ROM dvd - DVD-ROM -gd / gdrom - GD-ROM -hddvd - HD-DVD -bd / bluray - BD-ROM fd / floppy - Floppy Disk -umd - UMD -xbox - XBOX DVD"); +gd / gdrom - GD-ROM +umd - UMD"); + Console.WriteLine("Run 'DICUI.Check.exe [-lm|--listmedia' for more options"); + Console.WriteLine(); + Console.WriteLine(@"Common Systems:\r\n +apple / mac - Apple Macintosh +cdi - Philips CD-i +ibm / ibmpc - IBM PC Compatible +psx / ps1 - Sony PlayStation +ps2 - Sony PlayStation 2 +psp - Sony PlayStation Portable +saturn - Sega Saturn +xbox - Microsoft XBOX +x360 - Microsoft XBOX 360"); + Console.WriteLine("Run 'DICUI.Check.exe [-ls|--listsystems' for more options"); } - private static bool MediaTypeFromString(string val, out MediaType type, out KnownSystem system) + /// + /// List all media types with their short usable names + /// + private static void ListMediaTypes() { - switch (val.ToLowerInvariant()) + Console.WriteLine("Supported Media Types:"); + foreach (var val in Enum.GetValues(typeof(MediaType))) { - case "cd": - case "cdrom": - type = MediaType.CDROM; - system = KnownSystem.IBMPCCompatible; - return true; - case "dvd": - type = MediaType.DVD; - system = KnownSystem.IBMPCCompatible; - return true; - case "gd": - case "gdrom": - type = MediaType.GDROM; - system = KnownSystem.SegaDreamcast; - return true; - case "hddvd": - type = MediaType.HDDVD; - system = KnownSystem.HDDVDVideo; - return true; - case "bd": - case "bluray": - type = MediaType.BluRay; - system = KnownSystem.BDVideo; - return true; - case "fd": - case "floppy": - type = MediaType.FloppyDisk; - system = KnownSystem.IBMPCCompatible; - return true; - case "umd": - type = MediaType.UMD; - system = KnownSystem.SonyPlayStationPortable; - return true; - case "xbox": - type = MediaType.DVD; - system = KnownSystem.MicrosoftXBOX; - return true; - default: - type = MediaType.NONE; - system = KnownSystem.NONE; - return false; + if (((MediaType)val) == MediaType.NONE) + continue; + + Console.WriteLine($"{((MediaType?)val).ShortName()} - {((MediaType?)val).Name()}"); } } + /// + /// List all known systems with their short usable names + /// + private static void ListKnownSystems() + { + Console.WriteLine("Supported Known Systems:"); + foreach (var val in Enum.GetValues(typeof(KnownSystem))) + { + if (((KnownSystem)val) == KnownSystem.NONE) + continue; + + Console.WriteLine($"{((KnownSystem?)val).ShortName()} - {((KnownSystem?)val).Name()}"); + } + } + + /// + /// Simple process counter to write to console + /// private static void ProgressUpdated(object sender, Result value) { Console.WriteLine(value.Message); diff --git a/DICUI.Library/Utilities/Converters.cs b/DICUI.Library/Utilities/Converters.cs index b08dc711..033513da 100644 --- a/DICUI.Library/Utilities/Converters.cs +++ b/DICUI.Library/Utilities/Converters.cs @@ -356,6 +356,268 @@ namespace DICUI.Utilities } } + /// + /// Get the short string representation of the MediaType enum values + /// + /// MediaType value to convert + /// Short string representing the value, if possible + public static string MediaTypeToShortString(MediaType? type) + { + switch (type) + { + #region Punched Media + + case MediaType.ApertureCard: + return "aperture"; + case MediaType.JacquardLoomCard: + return "jacquard loom card"; + case MediaType.MagneticStripeCard: + return "magnetic stripe"; + case MediaType.OpticalPhonecard: + return "optical phonecard"; + case MediaType.PunchedCard: + return "punchcard"; + case MediaType.PunchedTape: + return "punchtape"; + + #endregion + + #region Tape + + case MediaType.OpenReel: + return "open reel"; + case MediaType.DataCartridge: + return "data cartridge"; + case MediaType.Cassette: + return "cassette"; + + #endregion + + #region Disc / Disc + + case MediaType.BluRay: + return "bdrom"; + case MediaType.CDROM: + return "cdrom"; + case MediaType.DVD: + return "dvd"; + case MediaType.FloppyDisk: + return "fd"; + case MediaType.Floptical: + return "floptical"; + case MediaType.GDROM: + return "gdrom"; + case MediaType.HDDVD: + return "HD-DVD-ROM"; + case MediaType.HardDisk: + return "Hard Disk"; + case MediaType.IomegaBernoulliDisk: + return "Iomega Bernoulli Disk"; + case MediaType.IomegaJaz: + return "Iomega Jaz"; + case MediaType.IomegaZip: + return "Iomega Zip"; + case MediaType.LaserDisc: + return "LD-ROM / LV-ROM"; + case MediaType.Nintendo64DD: + return "64DD Disk"; + case MediaType.NintendoFamicomDiskSystem: + return "Famicom Disk System Disk"; + case MediaType.NintendoGameCube: + return "GameCube Disc"; + case MediaType.NintendoWiiOpticalDisc: + return "Wii Optical Disc"; + case MediaType.NintendoWiiUOpticalDisc: + return "Wii U Optical Disc"; + case MediaType.UMD: + return "UMD"; + + #endregion + + // Unsorted Formats + case MediaType.Cartridge: + return "Cartridge"; + case MediaType.CED: + return "CED"; + + case MediaType.NONE: + default: + return "Unknown"; + } + } + + /// + /// Get the MediaType enum value for a given string + /// + /// String value to convert + /// MediaType represented by the string, if possible + public static MediaType StringToMediaType(string type) + { + switch (type.ToLowerInvariant()) + { + #region Punched Media + + case "aperture": + case "aperturecard": + case "aperture card": + return MediaType.ApertureCard; + case "jacquardloom": + case "jacquardloomcard": + case "jacquard loom card": + return MediaType.JacquardLoomCard; + case "magneticstripe": + case "magneticstripecard": + case "magnetic stripe card": + return MediaType.MagneticStripeCard; + case "opticalphone": + case "opticalphonecard": + case "optical phonecard": + return MediaType.OpticalPhonecard; + case "punchcard": + case "punchedcard": + case "punched card": + return MediaType.PunchedCard; + case "punchtape": + case "punchedtape": + case "punched tape": + return MediaType.PunchedTape; + + #endregion + + #region Tape + + case "openreel": + case "openreeltape": + case "open reel tape": + return MediaType.OpenReel; + case "datacart": + case "datacartridge": + case "datatapecartridge": + case "data tape cartridge": + return MediaType.DataCartridge; + case "cassette": + case "cassettetape": + case "cassette tape": + return MediaType.Cassette; + + #endregion + + #region Disc / Disc + + case "bd": + case "bdrom": + case "bd-rom": + case "bluray": + return MediaType.BluRay; + case "cd": + case "cdrom": + case "cd-rom": + return MediaType.CDROM; + case "dvd": + case "dvd5": + case "dvd-5": + case "dvd9": + case "dvd-9": + case "dvdrom": + case "dvd-rom": + return MediaType.DVD; + case "fd": + case "floppy": + case "floppydisk": + case "floppy disk": + case "floppy diskette": + return MediaType.FloppyDisk; + case "floptical": + return MediaType.Floptical; + case "gd": + case "gdrom": + case "gd-rom": + return MediaType.GDROM; + case "hddvd": + case "hd-dvd": + case "hddvdrom": + case "hd-dvd-rom": + return MediaType.HDDVD; + case "hdd": + case "harddisk": + case "hard disk": + return MediaType.HardDisk; + case "bernoullidisk": + case "iomegabernoullidisk": + case "bernoulli disk": + case "iomega bernoulli disk": + return MediaType.IomegaBernoulliDisk; + case "jaz": + case "iomegajaz": + case "iomega jaz": + return MediaType.IomegaJaz; + case "zip": + case "zipdisk": + case "iomegazip": + case "iomega zip": + return MediaType.IomegaZip; + case "ldrom": + case "lvrom": + case "ld-rom": + case "lv-rom": + case "laserdisc": + case "laservision": + case "ld-rom / lv-rom": + return MediaType.LaserDisc; + case "64dd": + case "n64dd": + case "64dddisk": + case "n64dddisk": + case "64dd disk": + case "n64dd disk": + return MediaType.Nintendo64DD; + case "fds": + case "famicom": + case "nfds": + case "nintendofamicom": + case "famicomdisksystem": + case "famicom disk system": + case "famicom disk system disk": + return MediaType.NintendoFamicomDiskSystem; + case "gc": + case "gamecube": + case "nintendogamecube": + case "nintendo gamecube": + case "gamecube disc": + return MediaType.NintendoGameCube; + case "wii": + case "nintendowii": + case "nintendo wii": + case "nintendo wii disc": + case "wii optical disc": + return MediaType.NintendoWiiOpticalDisc; + case "wiiu": + case "nintendowiiu": + case "nintendo wiiu": + case "nintendo wiiu disc": + case "wiiu optical disc": + case "wii u optical disc": + return MediaType.NintendoWiiUOpticalDisc; + case "umd": + return MediaType.UMD; + + #endregion + + // Unsorted Formats + case "cartridge": + return MediaType.Cartridge; + case "ced": + case "rcaced": + case "rca ced": + case "videodisc": + case "rca videodisc": + return MediaType.CED; + + default: + return MediaType.NONE; + } + } + /// /// Get the string representation of the KnownSystem enum values /// @@ -520,7 +782,7 @@ namespace DICUI.Utilities case KnownSystem.NichibutsuSuperCD: return "Nichibutsu Super CD"; case KnownSystem.NichibutsuXRateSystem: - return "NichibutsuX-Rate System"; + return "Nichibutsu X-Rate System"; case KnownSystem.PanasonicM2: return "Panasonic M2"; case KnownSystem.PhotoPlayVarious: @@ -602,5 +864,900 @@ namespace DICUI.Utilities return "Unknown"; } } + + /// + /// Get the short string representation of the KnownSystem enum values + /// + /// KnownSystem value to convert + /// Short string representing the value, if possible + public static string KnownSystemToShortString(KnownSystem? sys) + { + switch (sys) + { + #region Consoles + + case KnownSystem.BandaiPlaydiaQuickInteractiveSystem: + return "playdia"; + case KnownSystem.BandaiApplePippin: + return "pippin"; + case KnownSystem.CommodoreAmigaCD32: + return "cd32"; + case KnownSystem.CommodoreAmigaCDTV: + return "cdtv"; + case KnownSystem.MattelHyperscan: + return "hyperscan"; + case KnownSystem.MicrosoftXBOX: + return "xbox"; + case KnownSystem.MicrosoftXBOX360: + return "x360"; + case KnownSystem.MicrosoftXBOXOne: + return "xbone"; + case KnownSystem.NECPCEngineTurboGrafxCD: + return "pcecd"; + case KnownSystem.NECPCFX: + return "pcfx"; + case KnownSystem.NintendoGameCube: + return "gc"; + case KnownSystem.NintendoWii: + return "wii"; + case KnownSystem.NintendoWiiU: + return "wiiu"; + case KnownSystem.Panasonic3DOInteractiveMultiplayer: + return "3do"; + case KnownSystem.PhilipsCDi: + return "cdi"; + case KnownSystem.SegaCDMegaCD: + return "mcd"; + case KnownSystem.SegaDreamcast: + return "dc"; + case KnownSystem.SegaSaturn: + return "saturn"; + case KnownSystem.SNKNeoGeoCD: + return "ngcd"; + case KnownSystem.SonyPlayStation: + return "psx"; + case KnownSystem.SonyPlayStation2: + return "ps2"; + case KnownSystem.SonyPlayStation3: + return "ps3"; + case KnownSystem.SonyPlayStation4: + return "ps4"; + case KnownSystem.SonyPlayStationPortable: + return "psp"; + case KnownSystem.VMLabsNuon: + return "nuon"; + case KnownSystem.VTechVFlashVSmilePro: + return "vflash"; + case KnownSystem.ZAPiTGamesGameWaveFamilyEntertainmentSystem: + return "gamewave"; + + #endregion + + #region Computers + + case KnownSystem.AcornArchimedes: + return "archimedes"; + case KnownSystem.AppleMacintosh: + return "mac"; + case KnownSystem.CommodoreAmigaCD: + return "amigacd"; + case KnownSystem.FujitsuFMTowns: + return "fmtowns"; + case KnownSystem.IBMPCCompatible: + return "ibm"; + case KnownSystem.NECPC88: + return "pc88"; + case KnownSystem.NECPC98: + return "pc98"; + case KnownSystem.SharpX68000: + return "x68k"; + + #endregion + + #region Arcade + + case KnownSystem.AmigaCUBOCD32: + return "cubo"; + case KnownSystem.AmericanLaserGames3DO: + return "alg 3do"; + case KnownSystem.Atari3DO: + return "atari 3do"; + case KnownSystem.Atronic: + return "atronic"; + case KnownSystem.AUSCOMSystem1: + return "auscom"; + case KnownSystem.BallyGameMagic: + return "game magic"; + case KnownSystem.CapcomCPSystemIII: + return "cps3"; + case KnownSystem.GlobalVRVarious: + return "globalvr"; + case KnownSystem.GlobalVRVortek: + return "vortek"; + case KnownSystem.GlobalVRVortekV3: + return "vortek v3"; + case KnownSystem.ICEPCHardware: + return "ice"; + case KnownSystem.IncredibleTechnologiesEagle: + return "eagle"; + case KnownSystem.IncredibleTechnologiesVarious: + return "itpc"; + case KnownSystem.KonamieAmusement: + return "e-amusement"; + case KnownSystem.KonamiFirebeat: + return "firebeat"; + case KnownSystem.KonamiGVSystem: + return "gv system"; + case KnownSystem.KonamiM2: + return "konami m2"; + case KnownSystem.KonamiPython: + return "python"; + case KnownSystem.KonamiPython2: + return "python 2"; + case KnownSystem.KonamiSystem573: + return "system 573"; + case KnownSystem.KonamiTwinkle: + return "twinkle"; + case KnownSystem.KonamiVarious: + return "konami pc"; + case KnownSystem.MeritIndustriesBoardwalk: + return "boardwalk"; + case KnownSystem.MeritIndustriesMegaTouchAurora: + return "megatouch aurora"; + case KnownSystem.MeritIndustriesMegaTouchForce: + return "megatouch force"; + case KnownSystem.MeritIndustriesMegaTouchION: + return "megatouch ion"; + case KnownSystem.MeritIndustriesMegaTouchMaxx: + return "megatouch maxx"; + case KnownSystem.MeritIndustriesMegaTouchXL: + return "megatouch xl"; + case KnownSystem.NamcoCapcomSystem256: + return "system 256"; + case KnownSystem.NamcoCapcomTaitoSystem246: + return "system 246"; + case KnownSystem.NamcoSegaNintendoTriforce: + return "triforce"; + case KnownSystem.NamcoSystem12: + return "system 12"; + case KnownSystem.NamcoSystem357: + return "system 357"; + case KnownSystem.NewJatreCDi: + return "new jatre cdi"; + case KnownSystem.NichibutsuHighRateSystem: + return "nichibutsu hrs"; + case KnownSystem.NichibutsuSuperCD: + return "nichibutsu scd"; + case KnownSystem.NichibutsuXRateSystem: + return "nichibutsu xrs"; + case KnownSystem.PanasonicM2: + return "panasonic m2"; + case KnownSystem.PhotoPlayVarious: + return "photoplay"; + case KnownSystem.RawThrillsVarious: + return "raw thrills"; + case KnownSystem.SegaChihiro: + return "chihiro"; + case KnownSystem.SegaEuropaR: + return "europar"; + case KnownSystem.SegaLindbergh: + return "lindbergh"; + case KnownSystem.SegaNaomi: + return "naomi"; + case KnownSystem.SegaNaomi2: + return "naomi 2"; + case KnownSystem.SegaNu: + return "nu"; + case KnownSystem.SegaRingEdge: + return "ringedge"; + case KnownSystem.SegaRingEdge2: + return "ringedge 2"; + case KnownSystem.SegaRingWide: + return "ringwide"; + case KnownSystem.SegaTitanVideo: + return "stv"; + case KnownSystem.SegaSystem32: + return "system 32"; + case KnownSystem.SeibuCATSSystem: + return "seibu cats"; + case KnownSystem.TABAustriaQuizard: + return "quizard"; + case KnownSystem.TandyMemorexVisualInformationSystem: + return "vis"; + case KnownSystem.TsunamiTsuMoMultiGameMotionSystem: + return "tsumo"; + + #endregion + + #region Others + + case KnownSystem.AudioCD: + return "audio"; + case KnownSystem.BDVideo: + return "bd-video"; + case KnownSystem.DVDVideo: + return "dvd-video"; + case KnownSystem.EnhancedCD: + return "enhanced cd"; + case KnownSystem.EnhancedDVD: + return "enhanced dvd"; + case KnownSystem.EnhancedBD: + return "enhanced bd"; + case KnownSystem.HasbroVideoNow: + return "videonow"; + case KnownSystem.HDDVDVideo: + return "hddvd-video"; + case KnownSystem.PalmOS: + return "palmos"; + case KnownSystem.PhilipsCDiDigitalVideo: + return "cdi digital video"; + case KnownSystem.PhotoCD: + return "photo cd"; + case KnownSystem.PlayStationGameSharkUpdates: + return "gameshark"; + case KnownSystem.RainbowDisc: + return "rainbow"; + case KnownSystem.TaoiKTV: + return "iktv"; + case KnownSystem.TomyKissSite: + return "kiss-site"; + case KnownSystem.VideoCD: + return "vcd"; + + #endregion + + case KnownSystem.NONE: + default: + return "unknown"; + } + } + + /// + /// Get the KnownSystem enum value for a given string + /// + /// String value to convert + /// KnownSystem represented by the string, if possible + public static KnownSystem StringToKnownSystem(string sys) + { + switch (sys) + { + #region Consoles + + case "playdia": + case "playdiaqis": + case "playdiaquickinteractivesystem": + case "bandaiplaydia": + case "bandaiplaydiaquickinteractivesystem": + case "bandai playdia quick interactive system": + return KnownSystem.BandaiPlaydiaQuickInteractiveSystem; + case "pippin": + case "bandaipippin": + case "bandai pippin": + case "applepippin": + case "apple pippin": + case "bandaiapplepippin": + case "bandai apple pippin": + case "bandai / apple pippin": + return KnownSystem.BandaiApplePippin; + case "cd32": + case "amigacd32": + case "amiga cd32": + case "commodoreamigacd32": + case "commodore amiga cd32": + return KnownSystem.CommodoreAmigaCD32; + case "cdtv": + case "amigacdtv": + case "amiga cdtv": + case "commodoreamigacdtv": + case "commodore amiga cdtv": + return KnownSystem.CommodoreAmigaCDTV; + case "hyperscan": + case "mattelhyperscan": + case "mattel hyperscan": + return KnownSystem.MattelHyperscan; + case "xbox": + case "microsoftxbox": + case "microsoft xbox": + return KnownSystem.MicrosoftXBOX; + case "x360": + case "xbox360": + case "microsoftx360": + case "microsoftxbox360": + case "microsoft x360": + case "microsoft xbox 360": + return KnownSystem.MicrosoftXBOX360; + case "xb1": + case "xbone": + case "xboxone": + case "microsoftxbone": + case "microsoftxboxone": + case "microsoft xbone": + case "microsoft xbox one": + return KnownSystem.MicrosoftXBOXOne; + case "pcecd": + case "pce-cd": + case "tgcd": + case "tg-cd": + case "necpcecd": + case "nectgcd": + case "nec pc-engine cd": + case "nec turbografx cd": + case "nec pc-engine / turbografx cd": + return KnownSystem.NECPCEngineTurboGrafxCD; + case "pcfx": + case "pc-fx": + case "pcfxga": + case "pc-fxga": + case "necpcfx": + case "necpcfxga": + case "nec pc-fx": + case "nec pc-fxga": + case "nec pc-fx / pc-fxga": + return KnownSystem.NECPCFX; + case "gc": + case "gamecube": + case "ngc": + case "nintendogamecube": + case "nintendo gamecube": + return KnownSystem.NintendoGameCube; + case "wii": + case "nintendowii": + case "nintendo wii": + return KnownSystem.NintendoWii; + case "wiiu": + case "wii u": + case "nintendowiiu": + case "nintendo wii u": + return KnownSystem.NintendoWiiU; + case "3do": + case "3do interactive multiplayer": + case "panasonic3do": + case "panasonic 3do": + case "panasonic 3do interactive multiplayer": + return KnownSystem.Panasonic3DOInteractiveMultiplayer; + case "cdi": + case "cd-i": + case "philipscdi": + case "philips cdi": + case "philips cd-i": + return KnownSystem.PhilipsCDi; + case "scd": + case "mcd": + case "smcd": + case "segacd": + case "megacd": + case "segamegacd": + case "sega cd": + case "mega cd": + case "sega cd / mega cd": + return KnownSystem.SegaCDMegaCD; + case "dc": + case "sdc": + case "dreamcast": + case "segadreamcast": + case "sega dreamcast": + return KnownSystem.SegaDreamcast; + case "saturn": + case "segasaturn": + case "sega saturn": + return KnownSystem.SegaSaturn; + case "ngcd": + case "neogeocd": + case "neogeo cd": + case "neo geo cd": + case "snk ngcd": + case "snk neogeo cd": + case "snk neo geo cd": + return KnownSystem.SNKNeoGeoCD; + case "ps1": + case "psx": + case "playstation": + case "sonyps1": + case "sony ps1": + case "sonypsx": + case "sony psx": + case "sonyplaystation": + case "sony playstation": + return KnownSystem.SonyPlayStation; + case "ps2": + case "playstation2": + case "playstation 2": + case "sonyps2": + case "sony ps2": + case "sonyplaystation2": + case "sony playstation 2": + return KnownSystem.SonyPlayStation2; + case "ps3": + case "playstation3": + case "playstation 3": + case "sonyps3": + case "sony ps3": + case "sonyplaystation3": + case "sony playstation 3": + return KnownSystem.SonyPlayStation3; + case "ps4": + case "playstation4": + case "playstation 4": + case "sonyps4": + case "sony ps4": + case "sonyplaystation4": + case "sony playstation 4": + return KnownSystem.SonyPlayStation4; + case "psp": + case "playstationportable": + case "playstation portable": + case "sonypsp": + case "sony psp": + case "sonyplaystationportable": + case "sony playstation portable": + return KnownSystem.SonyPlayStationPortable; + case "nuon": + case "vmlabsnuon": + case "vm labs nuon": + return KnownSystem.VMLabsNuon; + case "vflash": + case "vsmile": + case "vsmilepro": + case "vsmile pro": + case "v.flash": + case "v.smile": + case "v.smilepro": + case "v.smile pro": + case "vtechvflash": + case "vtech vflash": + case "vtech v.flash": + case "vtechvsmile": + case "vtech vsmile": + case "vtech v.smile": + case "vtechvsmilepro": + case "vtech vsmile pro": + case "vtech v.smile pro": + case "vtech v.flash - v.smile pro": + return KnownSystem.VTechVFlashVSmilePro; + case "gamewave": + case "game wave": + case "zapit": + case "zapitgamewave": + case "zapit game wave": + case "zapit games game wave family entertainment system": + return KnownSystem.ZAPiTGamesGameWaveFamilyEntertainmentSystem; + + #endregion + + #region Computers + + case "acorn": + case "archimedes": + case "acornarchimedes": + case "acorn archimedes": + return KnownSystem.AcornArchimedes; + case "apple": + case "mac": + case "applemac": + case "macintosh": + case "applemacintosh": + case "apple mac": + case "apple macintosh": + return KnownSystem.AppleMacintosh; + case "amiga": + case "amigacd": + case "amiga cd": + case "commodoreamiga": + case "commodore amiga": + case "commodoreamigacd": + case "commodore amiga cd": + return KnownSystem.CommodoreAmigaCD; + case "fmtowns": + case "fmt": + case "fm towns": + case "fujitsufmtowns": + case "fujitsu fm towns": + case "fujitsu fm towns series": + return KnownSystem.FujitsuFMTowns; + case "ibm": + case "ibmpc": + case "pc": + case "ibm pc": + case "ibm pc compatible": + return KnownSystem.IBMPCCompatible; + case "pc88": + case "pc-88": + case "necpc88": + case "nec pc88": + case "nec pc-88": + return KnownSystem.NECPC88; + case "pc98": + case "pc-98": + case "necpc98": + case "nec pc98": + case "nec pc-98": + return KnownSystem.NECPC98; + case "x68k": + case "x68000": + case "sharpx68k": + case "sharp x68k": + case "sharpx68000": + case "sharp x68000": + return KnownSystem.SharpX68000; + + #endregion + + #region Arcade + + case "cubo": + case "cubocd32": + case "cubo cd32": + case "amigacubocd32": + case "amiga cubo cd32": + return KnownSystem.AmigaCUBOCD32; + case "alg3do": + case "alg 3do": + case "americanlasergames3do": + case "american laser games 3do": + return KnownSystem.AmericanLaserGames3DO; + case "atari3do": + case "atari 3do": + return KnownSystem.Atari3DO; + case "atronic": + return KnownSystem.Atronic; + case "auscom": + case "auscomsystem1": + case "auscom system 1": + return KnownSystem.AUSCOMSystem1; + case "gamemagic": + case "game magic": + case "ballygamemagic": + case "bally game magic": + return KnownSystem.BallyGameMagic; + case "cps3": + case "cpsiii": + case "cps 3": + case "cp system 3": + case "cp system iii": + case "capcomcps3": + case "capcomcpsiii": + case "capcom cps 3": + case "capcom cps iii": + case "capcom cp system 3": + case "capcom cp system iii": + return KnownSystem.CapcomCPSystemIII; + case "globalvr": + case "global vr": + case "global vr pc-based systems": + return KnownSystem.GlobalVRVarious; + case "vortek": + case "globalvrvortek": + case "global vr vortek": + return KnownSystem.GlobalVRVortek; + case "vortekv3": + case "vortek v3": + case "globalvrvortekv3": + case "global vr vortek v3": + return KnownSystem.GlobalVRVortekV3; + case "ice": + case "icepc": + case "ice pc": + case "ice pc-based hardware": + return KnownSystem.ICEPCHardware; + case "iteagle": + case "eagle": + case "incredible technologies eagle": + return KnownSystem.IncredibleTechnologiesEagle; + case "itpc": + case "incredible technologies pc-based systems": + return KnownSystem.IncredibleTechnologiesVarious; + case "eamusement": + case "e-amusement": + case "konamieamusement": + case "konami eamusement": + case "konamie-amusement": + case "konami e-amusement": + return KnownSystem.KonamieAmusement; + case "firebeat": + case "konamifirebeat": + case "konami firebeat": + return KnownSystem.KonamiFirebeat; + case "gvsystem": + case "gv system": + case "konamigvsystem": + case "konami gv system": + return KnownSystem.KonamiGVSystem; + case "konamim2": + case "konami m2": + return KnownSystem.KonamiM2; + case "python": + case "konamipython": + case "konami python": + return KnownSystem.KonamiPython; + case "python2": + case "python 2": + case "konamipython2": + case "konami python 2": + return KnownSystem.KonamiPython2; + case "system573": + case "system 573": + case "konamisystem573": + case "konami system 573": + return KnownSystem.KonamiSystem573; + case "twinkle": + case "konamitwinkle": + case "konami twinkle": + return KnownSystem.KonamiTwinkle; + case "konamipc": + case "konami pc": + case "konami pc-based systems": + return KnownSystem.KonamiVarious; + case "boardwalk": + case "meritindustriesboardwalk": + case "merit industries boardwalk": + return KnownSystem.MeritIndustriesBoardwalk; + case "megatouchaurora": + case "megatouch aurora": + case "meritindustriesmegatouchaurora": + case "merit industries megatouch aurora": + return KnownSystem.MeritIndustriesMegaTouchAurora; + case "megatouchforce": + case "megatouch force": + case "meritindustriesmegatouchforce": + case "merit industries megatouch force": + return KnownSystem.MeritIndustriesMegaTouchForce; + case "megatouchion": + case "megatouch ion": + case "meritindustriesmegatouchion": + case "merit industries megatouch ion": + return KnownSystem.MeritIndustriesMegaTouchION; + case "megatouchmaxx": + case "megatouch maxx": + case "meritindustriesmegatouchmaxx": + case "merit industries megatouch maxx": + return KnownSystem.MeritIndustriesMegaTouchMaxx; + case "megatouchxl": + case "megatouch xl": + case "meritindustriesmegatouchxl": + case "merit industries megatouch xl": + return KnownSystem.MeritIndustriesMegaTouchXL; + case "system256": + case "system 256": + case "supersystem256": + case "super system 256": + case "namcosystem256": + case "namco system 256": + case "namcosupersystem256": + case "namco super system 256": + case "capcomsystem256": + case "capcom system 256": + case "capcomsupersystem256": + case "capcom super system 256": + case "namco / capcom system 256/super system 256": + return KnownSystem.NamcoCapcomSystem256; + case "system246": + case "system 246": + case "namcosystem246": + case "namco system 246": + case "capcomsystem246": + case "capcom system 246": + case "taitosystem246": + case "taito system 246": + case "namco / capcom / taito system 246": + return KnownSystem.NamcoCapcomTaitoSystem246; + case "triforce": + case "namcotriforce": + case "namco triforce": + case "segatriforce": + case "sega triforce": + case "nintendotriforce": + case "nintendo triforce": + case "namco / sega / nintendo triforce": + return KnownSystem.NamcoSegaNintendoTriforce; + case "system12": + case "system 12": + case "namcosystem12": + case "namco system 12": + return KnownSystem.NamcoSystem12; + case "system357": + case "system 357": + case "namcosystem357": + case "namco system 357": + return KnownSystem.NamcoSystem357; + case "newjatrecdi": + case "new jatre cdi": + case "new jatre cd-i": + return KnownSystem.NewJatreCDi; + case "hrs": + case "highratesytem": + case "high rate system": + case "nichibutsuhrs": + case "nichibutsu hrs": + case "nichibutsu high rate system": + return KnownSystem.NichibutsuHighRateSystem; + case "supercd": + case "super cd": + case "nichibutsuscd": + case "nichibutsu scd": + case "nichibutsusupercd": + case "nichibutsu supercd": + case "nichibutsu super cd": + return KnownSystem.NichibutsuSuperCD; + case "xrs": + case "xratesystem": + case "x-rate system": + case "nichibutsuxrs": + case "nichibutsu xrs": + case "nichibutsu x-rate system": + return KnownSystem.NichibutsuXRateSystem; + case "panasonicm2": + case "panasonic m2": + return KnownSystem.PanasonicM2; + case "photoplay": + case "photoplaypc": + case "photoplay pc": + case "photoplay pc-based systems": + return KnownSystem.PhotoPlayVarious; + case "rawthrills": + case "raw thrills": + case "raw thrills pc-based systems": + return KnownSystem.RawThrillsVarious; + case "chihiro": + case "segachihiro": + case "sega chihiro": + return KnownSystem.SegaChihiro; + case "europar": + case "europa-r": + case "segaeuropar": + case "sega europar": + case "sega europa-r": + return KnownSystem.SegaEuropaR; + case "lindbergh": + case "segalindbergh": + case "sega lindbergh": + return KnownSystem.SegaLindbergh; + case "naomi": + case "seganaomi": + case "sega naomi": + return KnownSystem.SegaNaomi; + case "naomi2": + case "naomi 2": + case "seganaomi2": + case "sega naomi 2": + return KnownSystem.SegaNaomi2; + case "nu": + case "seganu": + case "sega nu": + return KnownSystem.SegaNu; + case "ringedge": + case "segaringedge": + case "sega ringedge": + return KnownSystem.SegaRingEdge; + case "ringedge2": + case "ringedge 2": + case "segaringedge2": + case "sega ringedge 2": + return KnownSystem.SegaRingEdge2; + case "ringwide": + case "segaringwide": + case "sega ringwide": + return KnownSystem.SegaRingWide; + case "stv": + case "titanvideo": + case "titan video": + case "segatitanvideo": + case "sega titan video": + return KnownSystem.SegaTitanVideo; + case "system32": + case "system 32": + case "segasystem32": + case "sega system 32": + return KnownSystem.SegaSystem32; + case "cats": + case "seibucats": + case "seibu cats": + case "seibu cats system": + return KnownSystem.SeibuCATSSystem; + case "quizard": + case "tabaustriaquizard": + case "tab-austria quizard": + return KnownSystem.TABAustriaQuizard; + case "vis": + case "tandyvis": + case "tandy vis": + case "tandyvisualinformationsystem": + case "tandy visual information system": + case "memorexvis": + case "memorex vis": + case "memorexvisualinformationsystem": + case "memorex visual information sytem": + case "tandy / memorex visual information system": + return KnownSystem.TandyMemorexVisualInformationSystem; + case "tsumo": + case "tsunamitsumo": + case "tsunami tsumo": + case "tsunami tsumo multi-game motion system": + return KnownSystem.TsunamiTsuMoMultiGameMotionSystem; + + #endregion + + #region Others + + case "audio": + case "audiocd": + case "audio cd": + return KnownSystem.AudioCD; + case "bdvideo": + case "bd-video": + case "blurayvideo": + case "bluray video": + return KnownSystem.BDVideo; + case "dvdvideo": + case "dvd-video": + return KnownSystem.DVDVideo; + case "enhancedcd": + case "enhanced cd": + case "enhancedcdrom": + case "enhanced cdrom": + case "enhanced cd-rom": + return KnownSystem.EnhancedCD; + case "enhanceddvd": + case "enhanced dvd": + return KnownSystem.EnhancedDVD; + case "enhancedbd": + case "enhanced bd": + case "enhancedbluray": + case "enhanced bluray": + return KnownSystem.EnhancedBD; + case "videonow": + case "hasbrovideonow": + case "hasbro videonow": + return KnownSystem.HasbroVideoNow; + case "hddvdvideo": + case "hddvd-video": + case "hd-dvd-video": + return KnownSystem.HDDVDVideo; + case "palm": + case "palmos": + return KnownSystem.PalmOS; + case "cdidv": + case "cdidigitalvideo": + case "cdi digital video": + case "cd-i digital video": + case "philipscdidigitalvideo": + case "philips cdi digital video": + case "philips cd-i digital video": + return KnownSystem.PhilipsCDiDigitalVideo; + case "photo": + case "photocd": + case "photo cd": + return KnownSystem.PhotoCD; + case "gameshark": + case "psgameshark": + case "ps gameshark": + case "playstationgameshark": + case "playstation gameshark": + case "playstation gameshark updates": + return KnownSystem.PlayStationGameSharkUpdates; + case "rainbow": + case "rainbowdisc": + case "rainbow disc": + return KnownSystem.RainbowDisc; + case "iktv": + case "taoiktv": + case "tao iktv": + return KnownSystem.TaoiKTV; + case "kisssite": + case "kiss-site": + case "tomykisssite": + case "tomy kisssite": + case "tomy kiss-site": + return KnownSystem.TomyKissSite; + case "vcd": + case "videocd": + case "video cd": + return KnownSystem.VideoCD; + + #endregion + + default: + return KnownSystem.NONE; + } + } } } \ No newline at end of file diff --git a/DICUI.Library/Utilities/Extensions.cs b/DICUI.Library/Utilities/Extensions.cs index eb71b3ac..5abf4137 100644 --- a/DICUI.Library/Utilities/Extensions.cs +++ b/DICUI.Library/Utilities/Extensions.cs @@ -34,6 +34,11 @@ namespace DICUI.Utilities return Converters.MediaTypeToString(type); } + public static string ShortName(this MediaType? type) + { + return Converters.MediaTypeToShortString(type); + } + public static string Extension(this MediaType? type) { return Converters.MediaTypeToExtension(type); @@ -67,6 +72,11 @@ namespace DICUI.Utilities return Converters.KnownSystemToString(system); } + public static string ShortName(this KnownSystem? system) + { + return Converters.KnownSystemToShortString(system); + } + public static KnownSystemCategory Category(this KnownSystem? system) { if (system < KnownSystem.MarkerConsoleEnd)