1 /* cdrdao - write audio CD-Rs in disc-at-once mode 2 * 3 * Copyright (C) 1999-2001 Andreas Mueller <andreas@daneb.de> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 */ 19 20 #ifndef __SONY_CDU920_H__ 21 #define __SONY_CDU920_H__ 22 23 #include "CdrDriver.h" 24 25 class Toc; 26 class Track; 27 28 class SonyCDU920 : public CdrDriver { 29 public: 30 31 SonyCDU920(ScsiIf *scsiIf, unsigned long options); 32 ~SonyCDU920(); 33 static CdrDriver *instance(ScsiIf *scsiIf, unsigned long options); 34 getReadCapabilities(const CdToc *,int)35 unsigned long getReadCapabilities(const CdToc *, int) const { return 0; } 36 37 int bigEndianSamples() const; 38 39 int multiSession(int); 40 int speed(int); 41 42 int loadUnload(int) const; 43 44 int initDao(const Toc *); 45 int startDao(); 46 int finishDao(); 47 void abortDao(); 48 int writeData(TrackData::Mode, TrackData::SubChannelMode, long &lba, 49 const char *buf, long len); 50 51 DiskInfo *diskInfo(); 52 Toc *readDiskToc(int session, const char *audioFilename); 53 54 protected: 55 int scsiTimeout_; 56 Msf leadInStart_; // start of lead-in 57 long leadInLen_; // length of lead-in 58 59 DiskInfo diskInfo_; 60 61 int getSessionInfo(); 62 63 int readCatalog(Toc *, long startLba, long endLba); 64 int readIsrc(int, char *); 65 66 virtual int selectSpeed(); // overloaded by 'SonyCDU948' 67 virtual int setWriteParameters(); // overloaded by 'SonyCDU948' 68 69 unsigned char *createCueSheet(unsigned char leadInDataForm, 70 long *cueSheetLen); 71 int sendCueSheet(unsigned char leadInDataForm); 72 73 int readBufferCapacity(long *capacity); 74 75 int analyzeTrack(TrackData::Mode, int trackNr, long startLba, long endLba, 76 Msf *index, 77 int *indexCnt, long *pregap, char *isrcCode, 78 unsigned char *ctl); 79 80 int readSubChannels(TrackData::SubChannelMode, long lba, long len, 81 SubChannel ***, Sample *); 82 83 CdRawToc *getRawToc(int sessionNr, int *len); 84 85 long readTrackData(TrackData::Mode, TrackData::SubChannelMode, 86 long lba, long len, unsigned char *buf); 87 88 int readAudioRange(ReadDiskInfo *, int fd, long start, long end, 89 int startTrack, int endTrack, TrackInfo *); 90 91 }; 92 93 #endif 94