diff --git a/MainWindow.xaml b/MainWindow.xaml
index a2002525..5b9481dc 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -30,28 +30,30 @@
-
+
-
-
-
-
-
+
+
+
-
+
+
+
+
+
@@ -76,9 +78,6 @@
-
-
-
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index 1e4335dd..b6f3ba04 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -63,6 +63,11 @@ namespace DICUI
GetOutputNames();
}
+ private void cmb_DriveSpeed_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ EnsureDiscInformation();
+ }
+
#endregion
#region Helpers
@@ -77,6 +82,8 @@ namespace DICUI
cmb_DiscType.DisplayMemberPath = "Item1";
cmb_DiscType.SelectedIndex = 0;
cmb_DiscType_SelectionChanged(null, null);
+
+ btn_Start.IsEnabled = false;
}
///
@@ -136,16 +143,13 @@ namespace DICUI
string driveLetter = cmb_DriveLetter.Text;
string outputDirectory = txt_OutputDirectory.Text;
string outputFilename = txt_OutputFilename.Text;
- int driveSpeed = (int)cmb_DriveSpeed.SelectedItem;
btn_Start.IsEnabled = false;
- // Get the discType and processArguments from a given system and disc combo
+ // Get the currently selected item
var selected = cmb_DiscType.SelectedValue as Tuple;
- string discType = Utilities.GetBaseCommand(selected.Item3);
- List defaultParams = Utilities.GetDefaultParameters(selected.Item2, selected.Item3);
// Validate that everything is good
- if (discType == null || defaultParams == null)
+ if (string.IsNullOrWhiteSpace(txt_CustomParameters.Text))
{
lbl_Status.Content = "Error! Current configuration is not supported!";
return;
@@ -164,11 +168,7 @@ namespace DICUI
{
Process process = new Process();
process.StartInfo.FileName = dicPath;
- process.StartInfo.Arguments = discType
- + " " + driveLetter
- + " \"" + Path.Combine(outputDirectory, outputFilename) + "\" "
- + (selected.Item3 != DiscType.BD25 && selected.Item3 != DiscType.BD50 ? driveSpeed + " " : "")
- + string.Join(" ", defaultParams);
+ process.StartInfo.Arguments = txt_CustomParameters.Text;
process.Start();
process.WaitForExit();
});
@@ -181,7 +181,7 @@ namespace DICUI
if (!File.Exists(sgRawPath))
{
lbl_Status.Content = "Error! Could not find sg-raw!";
- return;
+ break;
}
Process sgraw = new Process()
@@ -199,7 +199,7 @@ namespace DICUI
if (!File.Exists(psxtPath))
{
lbl_Status.Content = "Error! Could not find psxt001z!";
- return;
+ break;
}
// Invoke the program with all 3 configurations
@@ -273,17 +273,21 @@ namespace DICUI
{
case DiscType.NONE:
lbl_Status.Content = "Please select a valid disc type";
+ btn_Start.IsEnabled = false;
break;
case DiscType.GameCubeGameDisc:
case DiscType.GDROM:
lbl_Status.Content = string.Format("{0} discs are partially supported by DIC", Utilities.DiscTypeToString(tuple.Item3));
+ btn_Start.IsEnabled = true;
break;
case DiscType.HDDVD:
case DiscType.UMD:
lbl_Status.Content = string.Format("{0} discs are not currently supported by DIC", Utilities.DiscTypeToString(tuple.Item3));
+ btn_Start.IsEnabled = true;
break;
default:
lbl_Status.Content = string.Format("{0} ready to dump", Utilities.DiscTypeToString(tuple.Item3));
+ btn_Start.IsEnabled = true;
break;
}
@@ -298,6 +302,40 @@ namespace DICUI
cmb_DriveSpeed.IsEnabled = true;
break;
}
+
+ // Special case for Custom input
+ if (tuple.Item1 == "Custom Input" && tuple.Item2 == KnownSystem.NONE && tuple.Item3 == DiscType.NONE)
+ {
+ txt_CustomParameters.IsEnabled = true;
+ txt_OutputFilename.IsEnabled = false;
+ txt_OutputDirectory.IsEnabled = false;
+ btn_OutputDirectoryBrowse.IsEnabled = false;
+ cmb_DriveLetter.IsEnabled = false;
+ cmb_DriveSpeed.IsEnabled = false;
+ lbl_Status.Content = "User input mode";
+ }
+ else
+ {
+ txt_CustomParameters.IsEnabled = false;
+ txt_OutputFilename.IsEnabled = true;
+ txt_OutputDirectory.IsEnabled = true;
+ btn_OutputDirectoryBrowse.IsEnabled = true;
+ cmb_DriveLetter.IsEnabled = true;
+ cmb_DriveSpeed.IsEnabled = true;
+
+ // Populate with the correct params for inputs (if we're not on the default option)
+ if (cmb_DiscType.SelectedIndex > 0)
+ {
+ var selected = cmb_DiscType.SelectedValue as Tuple;
+ string discType = Utilities.GetBaseCommand(selected.Item3);
+ List defaultParams = Utilities.GetDefaultParameters(selected.Item2, selected.Item3);
+ txt_CustomParameters.Text = discType
+ + " " + cmb_DriveLetter.Text
+ + " \"" + Path.Combine(txt_OutputDirectory.Text, txt_OutputFilename.Text + Utilities.GetDefaultExtension(selected.Item3)) + "\" "
+ + (selected.Item3 != DiscType.BD25 && selected.Item3 != DiscType.BD50 ? (int)cmb_DriveSpeed.SelectedItem + " " : "")
+ + string.Join(" ", defaultParams);
+ }
+ }
}
///
diff --git a/Utilities.cs b/Utilities.cs
index 41d0eefc..475cceb8 100644
--- a/Utilities.cs
+++ b/Utilities.cs
@@ -603,6 +603,9 @@ namespace DICUI
}
}
+ // Add final mapping for "Custom"
+ mapping.Add(new Tuple("Custom Input", KnownSystem.NONE, DiscType.NONE));
+
return mapping;
}