diff options
author | Matthew Hoops | 2015-10-03 13:18:18 -0400 |
---|---|---|
committer | Johannes Schickel | 2016-03-13 13:57:13 +0100 |
commit | dc0d4fcf303458e9044866dd05a30c317e07eef0 (patch) | |
tree | a7469c85baf20860d4d778e1b140c42cb5f74758 /backends/audiocd/macosx | |
parent | 4a6c7b5c831f6d054033d9ded5cb83e4eb6f8d56 (diff) | |
download | scummvm-rg350-dc0d4fcf303458e9044866dd05a30c317e07eef0.tar.gz scummvm-rg350-dc0d4fcf303458e9044866dd05a30c317e07eef0.tar.bz2 scummvm-rg350-dc0d4fcf303458e9044866dd05a30c317e07eef0.zip |
BACKENDS: Add support for opening a CD on Mac OS X by path or drive
Diffstat (limited to 'backends/audiocd/macosx')
-rw-r--r-- | backends/audiocd/macosx/macosx-audiocd.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/backends/audiocd/macosx/macosx-audiocd.cpp b/backends/audiocd/macosx/macosx-audiocd.cpp index a8ba712621..76bae95500 100644 --- a/backends/audiocd/macosx/macosx-audiocd.cpp +++ b/backends/audiocd/macosx/macosx-audiocd.cpp @@ -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(); |