1 /*  cdrdao - write audio CD-Rs in disc-at-once mode
2  *
3  *  Copyright (C) 1998-2001  Andreas Mueller <mueller@daneb.ping.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 __GENERIC_MMC_RAW_H__
21 #define __GENERIC_MMC_RAW_H__
22 
23 #include "GenericMMC.h"
24 #include "PQChannelEncoder.h"
25 #include "PWSubChannel96.h"
26 
27 class GenericMMCraw : public GenericMMC, private PQChannelEncoder {
28 public:
29 
30   GenericMMCraw(ScsiIf *scsiIf, unsigned long options);
31   ~GenericMMCraw();
32 
33   static CdrDriver *instance(ScsiIf *scsiIf, unsigned long options);
34 
35   int multiSession(bool);
36 
37   int subChannelEncodingMode(TrackData::SubChannelMode) const;
38 
39   int initDao(const Toc *);
40   int startDao();
41   int finishDao();
42 
43   int writeData(TrackData::Mode, TrackData::SubChannelMode, long &lba,
44 		const char *buf, long len);
45 
46 protected:
47 
48   int setWriteParameters(int);
49 
50 private:
51   unsigned char *encodeBuffer_; // buffer for encoding sub-channels
52   unsigned char *encSubChannel_; // holds encoded sub-channels
53 
54   SubChannel *subChannel_; // sub channel template
55 
56   int subChannelMode_; /* selected sub-channel writing mode:
57 			  0: undefined
58 			  1: 16 byte PQ
59 			  2: 96 byte PW packed
60 			  3: 96 byte PW raw
61 		       */
62 
63   long cdTextStartLba_;
64   long cdTextEndLba_;
65   const PWSubChannel96 **cdTextSubChannels_;
66   long cdTextSubChannelCount_;
67   long cdTextSubChannelAct_;
68 
69   long nextWritableAddress();
70   int getMultiSessionInfo(int sessionNr, int multi, SessionInfo *info);
71   int getSubChannelModeFromToc();
72   int setSubChannelMode();
73 };
74 
75 #endif
76