From: Christian P. <cp...@us...> - 2005-01-31 11:09:06
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5290/include/pclasses/System Added Files: CdRomDevice.h Log Message: Added CdRomDevice. --- NEW FILE: CdRomDevice.h --- /*************************************************************************** * Copyright (C) 2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef P_System_CdRomDevice_h #define P_System_CdRomDevice_h #include <pclasses/Export.h> #include <pclasses/System/StorageDevice.h> #include <list> namespace P { namespace System { //! CD-ROM device class PSYSTEM_EXPORT CdRomDevice: public StorageDevice { public: enum DriveStatus { NoInfo, NoDisc, TrayOpen, DriveNotReady, DiscOk }; enum DiscStatus { DiscUnknown, DiscAudio, DiscData1, DiscData2, DiscXA21, DiscXA22, DiscMixed }; //! TOC-Entry class Track; //! List of TOC-Entries typedef std::list<Track> TrackList; CdRomDevice(const std::string& path, AccessMode access, ShareMode share) throw(IO::IOError); ~CdRomDevice() throw(); DriveStatus driveStatus() throw(IO::IOError); DiscStatus discStatus() throw(IO::IOError); void eject() throw(IO::IOError); TrackList readTOC() throw(IO::IOError); void play(uint8_t startMin, uint8_t startSec, uint8_t startFrame, uint8_t endMin, uint8_t endSec, uint8_t endFrame) throw(IO::IOError); void play(const Track& trk) throw(IO::IOError); void stop() throw(IO::IOError); void pause() throw(IO::IOError); void resume() throw(IO::IOError); }; class PSYSTEM_EXPORT CdRomDevice::Track { public: enum Type { Data, Audio }; Track(unsigned int num, Type type, size_t lba); ~Track(); unsigned int num() const throw(); Type type() const throw(); size_t lba() const throw(); uint8_t minute() const throw(); uint8_t second() const throw(); uint8_t frame() const throw(); private: unsigned int _num; Type _type; size_t _lba; uint8_t _msf[3]; }; } // !namespace System } // !namespace P #endif |