From: Marc D. <ma...@us...> - 2005-02-14 16:46:56
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4932/src/System Modified Files: CdRomDevice.linux.cpp Log Message: added media change detection Index: CdRomDevice.linux.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/CdRomDevice.linux.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CdRomDevice.linux.cpp 14 Feb 2005 16:38:46 -0000 1.4 +++ CdRomDevice.linux.cpp 14 Feb 2005 16:46:46 -0000 1.5 @@ -162,6 +162,15 @@ throw IO::IOError(errno, "ioctl error on device", P_SOURCEINFO); } +bool CdRomDevice::mediaChanged() throw(IO::IOError) { + // the return value indicates whether the media was changed. + int ret = ::ioctl((int)handle(), CDROM_MEDIA_CHANGED); + if(ret >= 0) + return true; + + return false; +} + void CdRomDevice::eject() throw(IO::IOError) { int ret = ::ioctl((int)handle(), CDROMEJECT); |