BACKENDS: Add support for opening a CD on Mac OS X by path or drive

This commit is contained in:
Matthew Hoops 2015-10-03 13:18:18 -04:00 committed by Johannes Schickel
parent 4a6c7b5c83
commit dc0d4fcf30

View File

@ -52,6 +52,7 @@ public:
protected:
bool openCD(int drive);
bool openCD(const Common::String &drive);
private:
struct Drive {
@ -135,6 +136,24 @@ bool MacOSXAudioCDManager::openCD(int drive) {
return findTrackNames(cddaDrives[drive].mountPoint);
}
bool MacOSXAudioCDManager::openCD(const Common::String &drive) {
closeCD();
DriveList drives = detectAllDrives();
for (uint32 i = 0; i < drives.size(); i++) {
if (drives[i].fsType != "cddafs")
continue;
if (drives[i].mountPoint == drive || drives[i].deviceName == drive) {
debug(1, "Using '%s' as the CD drive", drives[i].mountPoint.c_str());
return findTrackNames(drives[i].mountPoint);
}
}
return false;
}
void MacOSXAudioCDManager::closeCD() {
stop();
_trackMap.clear();