1
/* cdrdao - write audio CD-Rs in disc-at-once mode
3
* Copyright (C) 1998-2001 Andreas Mueller <mueller@daneb.ping.de>
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.
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.
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.
20
#ifndef __PLEXTOR_READER_H__
21
#define __PLEXTOR_READER_H__
23
#include "CdrDriver.h"
25
#define OPT_PLEX_USE_PARANOIA 0x0001 // always use paranoia method for DAE
26
#define OPT_PLEX_DAE_READ10 0x0002 // use READ10 for DAE
27
#define OPT_PLEX_DAE_D4_12 0x0004 // use 12 byte command 0xD4 for DAE
29
/*! \def OPT_PLEX_NOSLOW_ON_ERR
30
\brief Don't slow down read speed if any read error encountered
32
By default is activated, so the unit slows down. Passing
33
this option will disable it; unit won't slow down. Driver checks
34
previous status and restores it.
36
byte 3 [ x x x x x x x re ] 1 means don't slow down, 0 default
38
#define OPT_PLEX_NOSLOW_ON_ERR 0x0010
40
/*! \def OPT_PLEX_TRANSF_BEF_MAX
41
\brief Start to transfer data before max speed reached
43
By default is disabled, so unit reaches max speed before beginning
44
transfer. Passing this options will enable it; unit will transfer
45
data before reaching max speed. Driver checks previous status and
48
byte 3 [ x x x x x x td x ] 1 means don't wait for max speed, 0 default
50
#define OPT_PLEX_TRANSF_BEF_MAX 0x0020
52
/*! \def OPT_PLEX_NOSLOW_ON_VIB
53
\brief Don't slowdown to avoid vibrations
55
By default is activated, so unit slows down. Passing this option
56
will disable it; unit won't slow down. Driver checks previous status
59
byte 3 [ x x x x x sl x x ] 1 means don't slow down, 0 default
61
#define OPT_PLEX_NOSLOW_ON_VIB 0x0040
66
class PlextorReader : public CdrDriver {
69
PlextorReader(ScsiIf *scsiIf, unsigned long options);
72
* Its only purpose is to reset Plextor special features to their value
73
* before cdrdao initialization.
76
static CdrDriver *instance(ScsiIf *scsiIf, unsigned long options);
78
unsigned long getReadCapabilities(const CdToc *, int) const { return 0; }
80
// not used for readers
81
int bigEndianSamples() const { return 0;}
85
int loadUnload(int) const { return 0; }
87
int initDao(const Toc *);
92
inline int ReadErrorsSlowDown () {return slow_down_on_read_errors;}
93
inline int VibrationsSlowDown () {return slow_down_on_vibrations;}
94
inline int WaitMaxSpeed () {return transfer_data_before_max_speed;}
95
/*! \brief Controls wheter drive slows down when a read error occurs
97
Special plextor feature;
98
\param slowdown 0 to disable slowdown, 1 to enable (default)
99
\return 1 on success, -1 on error
101
int ReadErrorsSlowDown (int slowdown);
102
/*! \brief Controls wheter drive slows down when paused to avoid
105
Special plextor feature, available on PX-20 and later
106
\param slowdown 0 to disable slowdown, 1 to enable (default)
107
\return 1 on success, -1 on error
109
int VibrationsSlowDown (int slowdown);
110
/*! \brief Controls wheter drive waits for max speed before transferring data
112
Special plextor feature, available on PX-20 and later
113
\param wait 0 to transfer before maximum speed, 1 to wait (default)
114
\return 1 on success, -1 on error
116
int WaitMaxSpeed (int wait);
118
DiskInfo *diskInfo();
120
Toc *readDiskToc(int, const char *);
121
Toc *readDisk(int, const char *);
125
/*! \brief Drive model, as index of following
127
{ 1,"CD-ROM PX-4XCH" }, { 2,"CD-ROM PX-4XCS" },
128
{ 3,"CD-ROM PX-4XCE" }, { 4,"CD-ROM PX-6X" },
129
{ 5,"CD-ROM PX-8X" }, { 6,"CD-ROM PX-12" },
130
{ 7,"CD-ROM PX-20" }, { 8,"CD-ROM PX-32" },
135
CdRawToc *getRawToc(int sessionNr, int *len);
137
int getTrackIndex(long lba, int *trackNr, int *indexNr,
139
int readCatalog(Toc *, long startLba, long endLba);
140
int analyzeTrack(TrackData::Mode, int trackNr, long startLba, long endLba,
142
int *indexCnt, long *pregap, char *isrcCode,
144
int readIsrc(int trackNr, char *);
146
long readTrackData(TrackData::Mode mode, TrackData::SubChannelMode,
147
long lba, long len, unsigned char *buf);
148
int readSubChannels(TrackData::SubChannelMode, long lba, long len,
149
SubChannel ***, Sample *);
150
int readAudioRange(ReadDiskInfo *, int fd, long start, long end,
151
int startTrack, int endTrack, TrackInfo *trackInfo);
155
void playAudioBlock(long start, long len);
156
int readSubChannelData(int *trackNr, int *indexNr, long *,
159
int readAudioRangePlextor(ReadDiskInfo *, int fd, long start, long end,
160
int startTrack, int endTrack, TrackInfo *);
161
/* These can be -1 if not available, 0 or 1 */
162
int slow_down_on_read_errors;
163
int transfer_data_before_max_speed;
164
int slow_down_on_vibrations;
165
/* Original status of plextor special features */
166
unsigned char orig_byte3;