AUDIO: replaced kDriverName in MidiDriver::detectDevice()

(This is irrelevant for the MT-32 emulator, but makes sense for plugins which really have more than one device)
This commit is contained in:
athrxx 2011-06-06 00:17:24 +02:00
parent 6d80255cec
commit 8d23f692f2
2 changed files with 6 additions and 3 deletions

View file

@ -111,6 +111,8 @@ Common::String MidiDriver::getDeviceString(DeviceHandle handle, DeviceStringType
return d->getMusicDriverName(); return d->getMusicDriverName();
else if (type == kDriverId) else if (type == kDriverId)
return d->getMusicDriverId(); return d->getMusicDriverId();
else if (type == kDeviceName)
return d->getCompleteName();
else if (type == kDeviceId) else if (type == kDeviceId)
return d->getCompleteId(); return d->getCompleteId();
else else
@ -199,7 +201,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
return reslt; return reslt;
} else { } else {
// If the expressly selected device is unavailable we display a warning and continue. // If the expressly selected device is unavailable we display a warning and continue.
failedDevStr = getDeviceString(hdl, MidiDriver::kDriverName); failedDevStr = getDeviceString(hdl, MidiDriver::kDeviceName);
Common::String warningMsg = "Failed to detect the selected audio device '" + failedDevStr +"'. See log file for more information. Attempting to fall back to the next available device..."; Common::String warningMsg = "Failed to detect the selected audio device '" + failedDevStr +"'. See log file for more information. Attempting to fall back to the next available device...";
GUI::MessageDialog dialog(warningMsg); GUI::MessageDialog dialog(warningMsg);
dialog.runModal(); dialog.runModal();
@ -239,8 +241,8 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
// If the preferred (expressly requested) device is unavailable we display a warning and continue. // If the preferred (expressly requested) device is unavailable we display a warning and continue.
// Don't warn about the missing device if we did already (this becomes relevant if the failing // Don't warn about the missing device if we did already (this becomes relevant if the failing
// device is selected as preferred device and also as GM or MT-32 device). // device is selected as preferred device and also as GM or MT-32 device).
if (failedDevStr != getDeviceString(hdl, MidiDriver::kDriverName)) { if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) {
Common::String warningMsg = "Failed to detect the preferred device '" + getDeviceString(hdl, MidiDriver::kDriverName) + "'. See log file for more information. Attempting to fall back to the next available device..."; Common::String warningMsg = "Failed to detect the preferred device '" + getDeviceString(hdl, MidiDriver::kDeviceName) + "'. See log file for more information. Attempting to fall back to the next available device...";
GUI::MessageDialog dialog(warningMsg); GUI::MessageDialog dialog(warningMsg);
dialog.runModal(); dialog.runModal();
} }

View file

@ -142,6 +142,7 @@ public:
enum DeviceStringType { enum DeviceStringType {
kDriverName, kDriverName,
kDriverId, kDriverId,
kDeviceName,
kDeviceId kDeviceId
}; };