1 --- cdp-0.33/cdp.h.changer Fri Nov 10 01:10:42 1995
2 +++ cdp-0.33/cdp.h Thu Sep 9 20:48:14 1999
7 - BOOL fCmdTable, fNoFastIn, fCmdVersion;
8 + BOOL fCmdTable, fNoFastIn, fCmdVersion, fCmdStop;
12 --- cdp-0.33/cdp.c.changer Thu Sep 9 20:48:14 1999
13 +++ cdp-0.33/cdp.c Thu Sep 9 20:50:31 1999
16 dispInfo.fNoFollowMode = ! dispInfo.fNoFollowMode;
17 if ( ! dispInfo.fNoFollowMode && cdStatus.cur_track != dispInfo.view_track ) {
18 - cd_play( &cdStatus, dispInfo.view_track, 0, cdStatus.cur_ntracks + 1);
19 + if ( !cdStatus.thiscd.trk[dispInfo.view_track - 1].data )
20 + cd_play( &cdStatus, dispInfo.view_track, 0, cdStatus.cur_ntracks + 1);
22 + dispInfo.view_track = cdStatus.cur_track;
30 +/* Skip data tracks in either direction */
31 +static inline int wrapAround( int cur_track, int delta )
35 + new_track = normalizeTrackNum( cur_track + delta );
36 + while ( cdStatus.thiscd.trk[new_track-1].data ) {
37 + new_track = normalizeTrackNum( new_track + delta );
38 + if ( new_track == cur_track )
45 static void handleTrackMoveKey( displayInfoType * pInfo,
48 if ( pInfo->fNoFollowMode ) {
49 pInfo->view_track = normalizeTrackNum( pInfo->view_track + delta );
51 - cd_play( &cdStatus, normalizeTrackNum( cdStatus.cur_track + delta ), 0,
52 + cd_play( &cdStatus, wrapAround( cdStatus.cur_track, delta ), 0,
53 cdStatus.cur_ntracks + 1);
57 if ( strcmp( str, "stop" ) == 0 ) {
58 pInfoMode->fCmdVersion = TRUE;
59 pInfoMode->fNoAutoPlay = TRUE;
60 + pInfoMode->fCmdStop = TRUE;
63 if ( strcmp( str, "play" ) == 0 ) {
67 cdStatus.cur_track = 1;
68 - if ( pMode->fCmdTable )
69 + if ( pMode->fCmdTable ) {
72 + if ( cdStatus.cur_cdmode == CDPLAY )
75 + if ( pMode->fCmdStop )
76 + cd_stop ( &cdStatus );
78 if ( ! pMode->fNoAutoPlay ) {
79 if ( pMode->startTrack > 0
80 && pMode->startTrack <= cdStatus.cur_ntracks + 1 )
81 --- cdp-0.33/hardware.c.changer Thu Sep 9 20:48:14 1999
82 +++ cdp-0.33/hardware.c Thu Sep 9 20:48:14 1999
87 + * track_frame( pStatus, frame)
89 + * Calculate track number from frame number
91 +int track_frame( cdStatusType *pStatus, int frame )
95 + for ( i = 0; i < pStatus->thiscd.ntracks-1; i++ ) {
96 + if( frame < pStatus->thiscd.trk[i+1].start )
100 + return pStatus->thiscd.ntracks;
105 * play_chunk( pStatus, start, end)
107 * Play the CD from one position to another (both in frames.)
109 static void play_chunk( cdStatusType * pStatus, int start, int end )
111 struct cdrom_msf msf;
112 + struct cdrom_ti ti;
114 if ( ! pStatus->fTOCRead || pStatus->cd_fd < 0 )
116 @@ -371,12 +390,30 @@
119 if (ioctl (pStatus->cd_fd, CDROMPLAYMSF, &msf)) {
120 - printf ("play(%d,%d)\n", start, end);
121 +/* printf ("play(%d,%d)\n", start, end);
122 printf ("msf = %d:%d:%d %d:%d:%d\n",
123 msf.cdmsf_min0, msf.cdmsf_sec0, msf.cdmsf_frame0,
124 msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1);
125 perror ("CDROMPLAYMSF");
129 + /* Fall back to track index playing, because some
130 + "enhanced" CDs won't work with CDROMPLAYMSF */
131 + ti.cdti_trk0 = track_frame(pStatus, start);
133 + ti.cdti_trk1 = track_frame(pStatus, end);
136 + /* Skip to the next audio track (autoplay game CDs) */
137 + while ( pStatus->thiscd.trk[ti.cdti_trk0 - 1].data) {
139 + if ( ti.cdti_trk0 > ti.cdti_trk1 )
142 + if (ioctl (pStatus->cd_fd, CDROMPLAYTRKIND, &ti)) {
143 + perror ("CDROMPLAYTRKIND");