Fix encapsulation of IN_*/OUT_* in DiscSystem

these properties imply builder semantics but the classes aren't builders
This commit is contained in:
YoshiRulz 2020-05-19 16:58:31 +10:00 committed by James Groom
parent 21cdf5120b
commit 0706b96afe
9 changed files with 32 additions and 31 deletions

View File

@ -318,11 +318,12 @@ namespace BizHawk.Client.DiscoHawk
sw.WriteLine("BEGIN COMPARE: {0}\nSRC {1} vs DST {2}", infile, loadDiscInterface, cmpif); sw.WriteLine("BEGIN COMPARE: {0}\nSRC {1} vs DST {2}", infile, loadDiscInterface, cmpif);
//reload the original disc, with new policies as needed //reload the original disc, with new policies as needed
var dmj = new DiscMountJob { IN_DiscInterface = loadDiscInterface, IN_FromPath = infile }; var dmj = new DiscMountJob
if (cmpif == DiscInterface.MednaDisc)
{ {
dmj.IN_DiscMountPolicy.CUE_PregapContradictionModeA = false; IN_DiscInterface = loadDiscInterface,
} IN_DiscMountPolicy = new DiscMountPolicy { CUE_PregapContradictionModeA = cmpif != DiscInterface.MednaDisc },
IN_FromPath = infile
};
dmj.Run(); dmj.Run();

View File

@ -121,33 +121,33 @@ namespace BizHawk.Emulation.DiscSystem.CUE
/// <summary> /// <summary>
/// input: the CueFile to analyze /// input: the CueFile to analyze
/// </summary> /// </summary>
public CUE_File IN_CueFile; public CUE_File IN_CueFile { private get; set; }
/// <summary> /// <summary>
/// The context used for this compiling job /// The context used for this compiling job
/// TODO - rename something like context /// TODO - rename something like context
/// </summary> /// </summary>
public CUE_Context IN_CueContext; public CUE_Context IN_CueContext { internal get; set; }
/// <summary> /// <summary>
/// output: high level disc info /// output: high level disc info
/// </summary> /// </summary>
public CompiledDiscInfo OUT_CompiledDiscInfo; public CompiledDiscInfo OUT_CompiledDiscInfo { get; private set; }
/// <summary> /// <summary>
/// output: CD-Text set at the global level (before any track commands) /// output: CD-Text set at the global level (before any track commands)
/// </summary> /// </summary>
public CompiledCDText OUT_GlobalCDText; public CompiledCDText OUT_GlobalCDText { get; private set; }
/// <summary> /// <summary>
/// output: The compiled file info /// output: The compiled file info
/// </summary> /// </summary>
public List<CompiledCueFile> OUT_CompiledCueFiles; public List<CompiledCueFile> OUT_CompiledCueFiles { get; private set; }
/// <summary> /// <summary>
/// output: The compiled track info /// output: The compiled track info
/// </summary> /// </summary>
public List<CompiledCueTrack> OUT_CompiledCueTracks; public List<CompiledCueTrack> OUT_CompiledCueTracks { get; private set; }
/// <summary> /// <summary>
/// output: An integer between 0 and 10 indicating how costly it will be to load this disc completely. /// output: An integer between 0 and 10 indicating how costly it will be to load this disc completely.
@ -156,7 +156,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
/// 1 - Requires minimal processing (indexing ECM) /// 1 - Requires minimal processing (indexing ECM)
/// 10 - Requires ages, decoding audio data, etc. /// 10 - Requires ages, decoding audio data, etc.
/// </summary> /// </summary>
public int OUT_LoadTime; public int OUT_LoadTime { get; private set; }
//----------------------------------------------------------------- //-----------------------------------------------------------------

View File

@ -33,12 +33,12 @@ namespace BizHawk.Emulation.DiscSystem.CUE
/// <summary> /// <summary>
/// The results of the compile job, a prerequisite for this /// The results of the compile job, a prerequisite for this
/// </summary> /// </summary>
public CompileCueJob IN_CompileJob; public CompileCueJob IN_CompileJob { private get; set; }
/// <summary> /// <summary>
/// The resulting disc /// The resulting disc
/// </summary> /// </summary>
public Disc OUT_Disc; public Disc OUT_Disc { get; private set; }
private enum BurnType private enum BurnType
{ {

View File

@ -17,17 +17,17 @@ namespace BizHawk.Emulation.DiscSystem.CUE
/// <summary> /// <summary>
/// input: the cue string to parse /// input: the cue string to parse
/// </summary> /// </summary>
public string IN_CueString; public string IN_CueString { private get; set; }
/// <summary> /// <summary>
/// output: the resulting minimally-processed cue file /// output: the resulting minimally-processed cue file
/// </summary> /// </summary>
public CUE_File OUT_CueFile; public CUE_File OUT_CueFile { get; private set; }
/// <summary> /// <summary>
/// Indicates whether parsing will be strict or lenient /// Indicates whether parsing will be strict or lenient
/// </summary> /// </summary>
public bool IN_Strict = false; public bool IN_Strict { private get; set; } = false;
class CueLineParser class CueLineParser

View File

@ -27,12 +27,12 @@ namespace BizHawk.Emulation.DiscSystem
/// <summary> /// <summary>
/// Whether there were any errors /// Whether there were any errors
/// </summary> /// </summary>
public bool OUT_ErrorLevel = false; public bool OUT_ErrorLevel { get; private set; } = false;
/// <summary> /// <summary>
/// output: log transcript of the job /// output: log transcript of the job
/// </summary> /// </summary>
public string OUT_Log; public string OUT_Log { get; private set; }
/// <summary> /// <summary>
/// Finishes logging. Flushes the output and closes the logging mechanism /// Finishes logging. Flushes the output and closes the logging mechanism

View File

@ -14,34 +14,34 @@ namespace BizHawk.Emulation.DiscSystem
/// <summary> /// <summary>
/// The filename to be loaded /// The filename to be loaded
/// </summary> /// </summary>
public string IN_FromPath; public string IN_FromPath { private get; set; }
/// <summary> /// <summary>
/// Slow-loading cues won't finish loading if this threshold is exceeded. /// Slow-loading cues won't finish loading if this threshold is exceeded.
/// Set to 10 to always load a cue /// Set to 10 to always load a cue
/// </summary> /// </summary>
public int IN_SlowLoadAbortThreshold = 10; public int IN_SlowLoadAbortThreshold { private get; set; } = 10;
/// <summary> /// <summary>
/// Cryptic policies to be used when mounting the disc. /// Cryptic policies to be used when mounting the disc.
/// </summary> /// </summary>
public DiscMountPolicy IN_DiscMountPolicy = new DiscMountPolicy(); public DiscMountPolicy IN_DiscMountPolicy { private get; set; } = new DiscMountPolicy();
/// <summary> /// <summary>
/// The interface to be used for loading the disc. /// The interface to be used for loading the disc.
/// Usually you'll want DiscInterface.BizHawk, but others can be used for A/B testing /// Usually you'll want DiscInterface.BizHawk, but others can be used for A/B testing
/// </summary> /// </summary>
public DiscInterface IN_DiscInterface = DiscInterface.BizHawk; public DiscInterface IN_DiscInterface { private get; set; } = DiscInterface.BizHawk;
/// <summary> /// <summary>
/// The resulting disc /// The resulting disc
/// </summary> /// </summary>
public Disc OUT_Disc; public Disc OUT_Disc { get; private set; }
/// <summary> /// <summary>
/// Whether a mount operation was aborted due to being too slow /// Whether a mount operation was aborted due to being too slow
/// </summary> /// </summary>
public bool OUT_SlowLoadAborted; public bool OUT_SlowLoadAborted { get; private set; }
/// <exception cref="NotSupportedException"><see cref="IN_DiscInterface"/> is <see cref="DiscInterface.LibMirage"/></exception> /// <exception cref="NotSupportedException"><see cref="IN_DiscInterface"/> is <see cref="DiscInterface.LibMirage"/></exception>
public void Run() public void Run()

View File

@ -13,12 +13,12 @@ namespace BizHawk.Emulation.DiscSystem.SBI
/// <summary> /// <summary>
/// The file to be loaded /// The file to be loaded
/// </summary> /// </summary>
public string IN_Path; public string IN_Path { private get; set; }
/// <summary> /// <summary>
/// The resulting interpreted data /// The resulting interpreted data
/// </summary> /// </summary>
public SubQPatchData OUT_Data; public SubQPatchData OUT_Data { get; private set; }
/// <exception cref="SBIParseException">file at <see cref="IN_Path"/> does not contain valid header or contains misformatted record</exception> /// <exception cref="SBIParseException">file at <see cref="IN_Path"/> does not contain valid header or contains misformatted record</exception>
public void Run() public void Run()

View File

@ -14,22 +14,22 @@ namespace BizHawk.Emulation.DiscSystem
/// <summary> /// <summary>
/// "First Recorded Track Number" value for TOC (usually 1) /// "First Recorded Track Number" value for TOC (usually 1)
/// </summary> /// </summary>
public int IN_FirstRecordedTrackNumber; public int IN_FirstRecordedTrackNumber { private get; set; }
/// <summary> /// <summary>
/// "Last Recorded Track Number" value for TOC /// "Last Recorded Track Number" value for TOC
/// </summary> /// </summary>
public int IN_LastRecordedTrackNumber; public int IN_LastRecordedTrackNumber { private get; set; }
/// <summary> /// <summary>
/// The absolute timestamp of the lead-out track /// The absolute timestamp of the lead-out track
/// </summary> /// </summary>
public int IN_LeadoutTimestamp; public int IN_LeadoutTimestamp { private get; set; }
/// <summary> /// <summary>
/// The session format for this TOC /// The session format for this TOC
/// </summary> /// </summary>
public SessionFormat IN_Session1Format; public SessionFormat IN_Session1Format { private get; set; }
/// <summary>appends the new entries to the provided list</summary> /// <summary>appends the new entries to the provided list</summary>
/// <exception cref="InvalidOperationException"><see cref="IN_Session1Format"/> is <see cref="SessionFormat.None"/> or a non-member</exception> /// <exception cref="InvalidOperationException"><see cref="IN_Session1Format"/> is <see cref="SessionFormat.None"/> or a non-member</exception>

View File

@ -4,7 +4,7 @@ namespace BizHawk.Emulation.DiscSystem
{ {
class Synthesize_DiscStructure_From_DiscTOC_Job class Synthesize_DiscStructure_From_DiscTOC_Job
{ {
public Disc IN_Disc; public Disc IN_Disc { private get; set; }
public DiscTOC TOCRaw; public DiscTOC TOCRaw;
public DiscStructure Result; public DiscStructure Result;