diff --git a/CHANGELIST.md b/CHANGELIST.md index 5f4c6a5e..a52a6ac6 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -154,6 +154,7 @@ - Remove unused reporter delegate - Move StringEventArgs to Frontend - Decouple execution contexts from Options class +- Combine remaining Core into Frontend ### 3.1.9a (2024-05-21) diff --git a/MPF.Check/Program.cs b/MPF.Check/Program.cs index cb3b5a7d..d7a50502 100644 --- a/MPF.Check/Program.cs +++ b/MPF.Check/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using BinaryObjectScanner; -using MPF.Core; using MPF.Frontend; using SabreTools.RedumpLib.Data; using SabreTools.RedumpLib.Web; diff --git a/MPF.Core/Enumerations.cs b/MPF.Core/Enumerations.cs deleted file mode 100644 index 10cf1e7f..00000000 --- a/MPF.Core/Enumerations.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace MPF.Core -{ - /// - /// Program that is being used to dump media - /// - public enum InternalProgram - { - NONE = 0, - - // Dumping support - Aaru, - DiscImageCreator, - Redumper, - - // Verification support only - CleanRip, - PS3CFW, - UmdImageCreator, - XboxBackupCreator, - } - - /// - /// Drive read method option - /// - public enum RedumperReadMethod - { - NONE = 0, - - BE, - D8, - BE_CDDA, - } - - /// - /// Drive sector order option - /// - public enum RedumperSectorOrder - { - NONE = 0, - - DATA_C2_SUB, - DATA_SUB_C2, - DATA_SUB, - DATA_C2, - } -} diff --git a/MPF.Frontend/ComboBoxItems/Element.cs b/MPF.Frontend/ComboBoxItems/Element.cs index 25d15452..7d7a80fc 100644 --- a/MPF.Frontend/ComboBoxItems/Element.cs +++ b/MPF.Frontend/ComboBoxItems/Element.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MPF.Core; namespace MPF.Frontend.ComboBoxItems { diff --git a/MPF.Frontend/DumpEnvironment.cs b/MPF.Frontend/DumpEnvironment.cs index fb1a1086..113dd231 100644 --- a/MPF.Frontend/DumpEnvironment.cs +++ b/MPF.Frontend/DumpEnvironment.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using BinaryObjectScanner; using MPF.ExecutionContexts; using MPF.Processors; -using MPF.Core; using Newtonsoft.Json; using SabreTools.RedumpLib; using SabreTools.RedumpLib.Data; @@ -50,7 +49,7 @@ namespace MPF.Frontend /// /// Options object representing user-defined options /// - private readonly Core.Options _options; + private readonly Frontend.Options _options; /// /// Processor object representing how to process the outputs @@ -118,7 +117,7 @@ namespace MPF.Frontend /// /// /// - public DumpEnvironment(Core.Options options, + public DumpEnvironment(Frontend.Options options, string outputPath, Drive? drive, RedumpSystem? system, diff --git a/MPF.Frontend/EnumExtensions.cs b/MPF.Frontend/EnumExtensions.cs index b3508b04..9d84ebf9 100644 --- a/MPF.Frontend/EnumExtensions.cs +++ b/MPF.Frontend/EnumExtensions.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Collections.Concurrent; #endif using System.Reflection; -using MPF.Core; using SabreTools.RedumpLib.Data; namespace MPF.Frontend diff --git a/MPF.Frontend/Enumerations.cs b/MPF.Frontend/Enumerations.cs index 273666e0..0f1951d4 100644 --- a/MPF.Frontend/Enumerations.cs +++ b/MPF.Frontend/Enumerations.cs @@ -11,6 +11,25 @@ namespace MPF.Frontend Removable, } + /// + /// Program that is being used to dump media + /// + public enum InternalProgram + { + NONE = 0, + + // Dumping support + Aaru, + DiscImageCreator, + Redumper, + + // Verification support only + CleanRip, + PS3CFW, + UmdImageCreator, + XboxBackupCreator, + } + /// /// Log level for output /// @@ -21,4 +40,29 @@ namespace MPF.Frontend ERROR, SECRET, } + + /// + /// Drive read method option + /// + public enum RedumperReadMethod + { + NONE = 0, + + BE, + D8, + BE_CDDA, + } + + /// + /// Drive sector order option + /// + public enum RedumperSectorOrder + { + NONE = 0, + + DATA_C2_SUB, + DATA_SUB_C2, + DATA_SUB, + DATA_C2, + } } \ No newline at end of file diff --git a/MPF.Core/Options.cs b/MPF.Frontend/Options.cs similarity index 99% rename from MPF.Core/Options.cs rename to MPF.Frontend/Options.cs index 59b22c69..1d2e1e63 100644 --- a/MPF.Core/Options.cs +++ b/MPF.Frontend/Options.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using SabreTools.RedumpLib.Data; -namespace MPF.Core +namespace MPF.Frontend { public class Options { diff --git a/MPF.Frontend/OptionsLoader.cs b/MPF.Frontend/OptionsLoader.cs index d927c57b..33112d6f 100644 --- a/MPF.Frontend/OptionsLoader.cs +++ b/MPF.Frontend/OptionsLoader.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using MPF.Core; using Newtonsoft.Json; using SabreTools.RedumpLib; using SabreTools.RedumpLib.Data; diff --git a/MPF.Frontend/ProtectionTool.cs b/MPF.Frontend/ProtectionTool.cs index 23392bac..330807a7 100644 --- a/MPF.Frontend/ProtectionTool.cs +++ b/MPF.Frontend/ProtectionTool.cs @@ -20,7 +20,7 @@ namespace MPF.Frontend /// Optional progress callback /// Detected copy protection(s) if possible, null on error public static async Task<(string?, Dictionary>?)> GetCopyProtection(Drive? drive, - Core.Options options, + Frontend.Options options, IProgress? progress = null) { if (options.ScanForProtection && drive?.Name != null) @@ -40,7 +40,7 @@ namespace MPF.Frontend /// Optional progress callback /// Set of all detected copy protections with an optional error string public static async Task<(Dictionary>?, string?)> RunProtectionScanOnPath(string path, - Core.Options options, + Frontend.Options options, IProgress? progress = null) { try diff --git a/MPF.Frontend/SubmissionGenerator.cs b/MPF.Frontend/SubmissionGenerator.cs index 41ba2ca3..6d6af3e8 100644 --- a/MPF.Frontend/SubmissionGenerator.cs +++ b/MPF.Frontend/SubmissionGenerator.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using BinaryObjectScanner; using MPF.Processors; -using MPF.Core; using SabreTools.RedumpLib; using SabreTools.RedumpLib.Data; using SabreTools.RedumpLib.Web; @@ -44,7 +43,7 @@ namespace MPF.Frontend Drive? drive, RedumpSystem? system, MediaType? mediaType, - Core.Options options, + Frontend.Options options, BaseProcessor processor, IProgress? resultProgress = null, IProgress? protectionProgress = null) @@ -149,9 +148,9 @@ namespace MPF.Frontend /// Existing SubmissionInfo object to fill /// Optional result progress callback #if NET40 - public static bool FillFromRedump(Core.Options options, SubmissionInfo info, IProgress? resultProgress = null) + public static bool FillFromRedump(Frontend.Options options, SubmissionInfo info, IProgress? resultProgress = null) #else - public async static Task FillFromRedump(Core.Options options, SubmissionInfo info, IProgress? resultProgress = null) + public async static Task FillFromRedump(Frontend.Options options, SubmissionInfo info, IProgress? resultProgress = null) #endif { // If no username is provided diff --git a/MPF.Frontend/ViewModels/CheckDumpViewModel.cs b/MPF.Frontend/ViewModels/CheckDumpViewModel.cs index 0b6b89e5..dbfa2a17 100644 --- a/MPF.Frontend/ViewModels/CheckDumpViewModel.cs +++ b/MPF.Frontend/ViewModels/CheckDumpViewModel.cs @@ -5,7 +5,6 @@ using System.IO; using System.Linq; using System.Threading.Tasks; using BinaryObjectScanner; -using MPF.Core; using MPF.Frontend.ComboBoxItems; using SabreTools.RedumpLib.Data; @@ -21,11 +20,11 @@ namespace MPF.Frontend.ViewModels /// /// Access to the current options /// - public Core.Options Options + public Frontend.Options Options { get => _options; } - private readonly Core.Options _options; + private readonly Frontend.Options _options; /// /// Indicates if SelectionChanged events can be executed diff --git a/MPF.Frontend/ViewModels/CreateIRDViewModel.cs b/MPF.Frontend/ViewModels/CreateIRDViewModel.cs index a9a617b3..d55c67e3 100644 --- a/MPF.Frontend/ViewModels/CreateIRDViewModel.cs +++ b/MPF.Frontend/ViewModels/CreateIRDViewModel.cs @@ -1,7 +1,6 @@ using System; using System.ComponentModel; using System.IO; -using MPF.Core; using MPF.Processors; namespace MPF.Frontend.ViewModels diff --git a/MPF.Frontend/ViewModels/DiscInformationViewModel.cs b/MPF.Frontend/ViewModels/DiscInformationViewModel.cs index 78031744..bfcf86b8 100644 --- a/MPF.Frontend/ViewModels/DiscInformationViewModel.cs +++ b/MPF.Frontend/ViewModels/DiscInformationViewModel.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Linq; -using MPF.Core; using MPF.Frontend.ComboBoxItems; using SabreTools.RedumpLib.Data; diff --git a/MPF.Frontend/ViewModels/MainViewModel.cs b/MPF.Frontend/ViewModels/MainViewModel.cs index 78fe721e..e4b39d1a 100644 --- a/MPF.Frontend/ViewModels/MainViewModel.cs +++ b/MPF.Frontend/ViewModels/MainViewModel.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Threading.Tasks; using BinaryObjectScanner; using MPF.Frontend.ComboBoxItems; -using MPF.Core; using SabreTools.IO; using SabreTools.RedumpLib.Data; @@ -19,7 +18,7 @@ namespace MPF.Frontend.ViewModels /// /// Access to the current options /// - public Core.Options Options + public Frontend.Options Options { get => _options; set @@ -28,7 +27,7 @@ namespace MPF.Frontend.ViewModels OptionsLoader.SaveToConfig(_options); } } - private Core.Options _options; + private Frontend.Options _options; /// /// Indicates if SelectionChanged events can be executed @@ -963,13 +962,13 @@ namespace MPF.Frontend.ViewModels /// /// Indicates if the settings were saved or not /// Options representing the new, saved values - public void UpdateOptions(bool savedSettings, Core.Options? newOptions) + public void UpdateOptions(bool savedSettings, Frontend.Options? newOptions) { // Get which options to save var optionsToSave = savedSettings ? newOptions : Options; // Ensure the first run flag is unset - var continuingOptions = new Core.Options(optionsToSave) { FirstRun = false }; + var continuingOptions = new Frontend.Options(optionsToSave) { FirstRun = false }; this.Options = continuingOptions; // If settings were changed, reinitialize the UI diff --git a/MPF.Frontend/ViewModels/OptionsViewModel.cs b/MPF.Frontend/ViewModels/OptionsViewModel.cs index bc530c5a..6223d578 100644 --- a/MPF.Frontend/ViewModels/OptionsViewModel.cs +++ b/MPF.Frontend/ViewModels/OptionsViewModel.cs @@ -2,7 +2,6 @@ using System.ComponentModel; using System.Linq; using System.Threading.Tasks; -using MPF.Core; using MPF.Frontend.ComboBoxItems; using SabreTools.RedumpLib.Web; diff --git a/MPF.Test/Core/Converters/EnumConverterTests.cs b/MPF.Test/Core/Converters/EnumConverterTests.cs index 354effab..f5e1136b 100644 --- a/MPF.Test/Core/Converters/EnumConverterTests.cs +++ b/MPF.Test/Core/Converters/EnumConverterTests.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using MPF.Core; using MPF.Frontend; using Xunit; diff --git a/MPF.Test/Core/Utilities/EnumExtensionsTests.cs b/MPF.Test/Core/Utilities/EnumExtensionsTests.cs index c9d109e3..cf09fc12 100644 --- a/MPF.Test/Core/Utilities/EnumExtensionsTests.cs +++ b/MPF.Test/Core/Utilities/EnumExtensionsTests.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using MPF.Core; using SabreTools.RedumpLib.Data; using Xunit; diff --git a/MPF.Test/Library/DumpEnvironmentTests.cs b/MPF.Test/Library/DumpEnvironmentTests.cs index 20dba14f..8c1d24f5 100644 --- a/MPF.Test/Library/DumpEnvironmentTests.cs +++ b/MPF.Test/Library/DumpEnvironmentTests.cs @@ -1,5 +1,4 @@ -using MPF.Core; -using MPF.Frontend; +using MPF.Frontend; using SabreTools.RedumpLib.Data; using Xunit; diff --git a/MPF.Test/Modules/DiscImageCreatorTests.cs b/MPF.Test/Modules/DiscImageCreatorTests.cs index 1dde40c5..67a1bb5b 100644 --- a/MPF.Test/Modules/DiscImageCreatorTests.cs +++ b/MPF.Test/Modules/DiscImageCreatorTests.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using MPF.Core; using MPF.ExecutionContexts.DiscImageCreator; +using MPF.Frontend; using SabreTools.RedumpLib.Data; using Xunit; diff --git a/MPF.UI/ElementConverter.cs b/MPF.UI/ElementConverter.cs index 356d18c2..8ac1057f 100644 --- a/MPF.UI/ElementConverter.cs +++ b/MPF.UI/ElementConverter.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; -using MPF.Core; +using MPF.Frontend; using MPF.Frontend.ComboBoxItems; using SabreTools.RedumpLib.Data; diff --git a/MPF.UI/UserControls/LogOutput.xaml.cs b/MPF.UI/UserControls/LogOutput.xaml.cs index ff3e6622..fc6f1f6b 100644 --- a/MPF.UI/UserControls/LogOutput.xaml.cs +++ b/MPF.UI/UserControls/LogOutput.xaml.cs @@ -5,7 +5,6 @@ using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Media; using System.Windows.Threading; -using MPF.Core; using MPF.Frontend; #pragma warning disable IDE1006 // Naming Styles diff --git a/MPF.UI/Windows/DiscInformationWindow.xaml.cs b/MPF.UI/Windows/DiscInformationWindow.xaml.cs index fe1411c2..baa25839 100644 --- a/MPF.UI/Windows/DiscInformationWindow.xaml.cs +++ b/MPF.UI/Windows/DiscInformationWindow.xaml.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Windows; using System.Windows.Controls; -using MPF.Core; +using MPF.Frontend; using MPF.Frontend.ViewModels; using MPF.UI.UserControls; using SabreTools.RedumpLib.Data; diff --git a/MPF.UI/Windows/OptionsWindow.xaml.cs b/MPF.UI/Windows/OptionsWindow.xaml.cs index d1ee2aa7..94090a24 100644 --- a/MPF.UI/Windows/OptionsWindow.xaml.cs +++ b/MPF.UI/Windows/OptionsWindow.xaml.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Forms; -using MPF.Core; +using MPF.Frontend; using MPF.Frontend.ViewModels; using WPFCustomMessageBox;