mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Make sure that detected disc type is shown; cleanup
This commit is contained in:
@@ -634,7 +634,7 @@ namespace DICUI.Forms.Windows
|
||||
{
|
||||
ViewModels.LoggerViewModel.VerboseLog("Trying to detect media type for drive {0}.. ", drive.Letter);
|
||||
_currentMediaType = Validators.GetDiscType(drive.Letter);
|
||||
ViewModels.LoggerViewModel.VerboseLogLn(_currentMediaType != null ? "unable to detect." : ("detected " + _currentMediaType.Name() + "."));
|
||||
ViewModels.LoggerViewModel.VerboseLogLn(_currentMediaType == null ? "unable to detect." : ("detected " + _currentMediaType.Name() + "."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,6 @@ namespace DICUI.Utilities
|
||||
case MediaType.Cassette:
|
||||
return ".wav";
|
||||
case MediaType.NONE:
|
||||
case MediaType.CED:
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -462,9 +462,7 @@ namespace DICUI.Utilities
|
||||
|
||||
var collection = searcher.Get();
|
||||
foreach (ManagementObject queryObj in collection)
|
||||
{
|
||||
deviceId = (string)queryObj["DeviceID"];
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -474,9 +472,7 @@ namespace DICUI.Utilities
|
||||
|
||||
// If we got no valid device, we don't care and just return
|
||||
if (deviceId == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get all relevant disc information
|
||||
try
|
||||
@@ -487,16 +483,12 @@ namespace DICUI.Utilities
|
||||
foreach (var disc in discMaster)
|
||||
{
|
||||
if (disc.ToString().Contains(deviceId))
|
||||
{
|
||||
id = disc.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// If we couldn't find the drive, we don't care and return
|
||||
if (id == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Otherwise, we get the media type, if any
|
||||
MsftDiscRecorder2 recorder = new MsftDiscRecorder2();
|
||||
@@ -505,9 +497,7 @@ namespace DICUI.Utilities
|
||||
dataWriter.Recorder = recorder;
|
||||
var media = dataWriter.CurrentPhysicalMediaType;
|
||||
if (media != IMAPI_MEDIA_PHYSICAL_TYPE.IMAPI_MEDIA_TYPE_UNKNOWN)
|
||||
{
|
||||
return Converters.IMAPIDiskTypeToMediaType(media);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace DICUI.Windows
|
||||
|
||||
if (currentSystem != null)
|
||||
{
|
||||
_mediaTypes = Validators.GetValidMediaTypes(currentSystem).ToList();
|
||||
_mediaTypes = Validators.GetValidMediaTypes(currentSystem);
|
||||
MediaTypeComboBox.ItemsSource = _mediaTypes;
|
||||
|
||||
MediaTypeComboBox.IsEnabled = _mediaTypes.Count > 1;
|
||||
@@ -628,7 +628,7 @@ namespace DICUI.Windows
|
||||
{
|
||||
ViewModels.LoggerViewModel.VerboseLog("Trying to detect media type for drive {0}.. ", drive.Letter);
|
||||
_currentMediaType = Validators.GetDiscType(drive.Letter);
|
||||
ViewModels.LoggerViewModel.VerboseLogLn(_currentMediaType != null ? "unable to detect." : ("detected " + _currentMediaType.Name() + "."));
|
||||
ViewModels.LoggerViewModel.VerboseLogLn(_currentMediaType == null ? "unable to detect." : ("detected " + _currentMediaType.Name() + "."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user