~ubuntu-branches/ubuntu/hoary/cdrtools/hoary

« back to all changes in this revision

Viewing changes to cdda2wav/mycdrom.h

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2002-04-09 10:03:06 UTC
  • Revision ID: james.westby@ubuntu.com-20020409100306-t4hagiv7gm0fhggv
Tags: upstream-1.10
ImportĀ upstreamĀ versionĀ 1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)mycdrom.h        1.4 00/06/15 Copyright 1998,1999 Heiko Eissfeldt */
 
2
#if defined(__linux__)
 
3
# include <linux/cdrom.h>
 
4
#else
 
5
# if defined HAVE_SYS_CDIO_H
 
6
#  include <sys/cdio.h>
 
7
 
 
8
#  if (defined (__sun) && defined (SVR4))
 
9
#   if 0
 
10
/* just for info */
 
11
/* Sun has this cdda reading ioctl: CDROMCDDA */
 
12
/*
 
13
 * Definition of CD-DA structure
 
14
 */
 
15
struct cdrom_cdda {
 
16
 unsigned int cdda_addr;
 
17
 unsigned int cdda_length;
 
18
 caddr_t  cdda_data;
 
19
 unsigned char cdda_subcode;
 
20
};
 
21
/*
 
22
To get the subcode information related to CD-DA data, the following values are
 
23
 appropriate for the cdda_subcode field:
 
24
 
 
25
CDROM_DA_NO_SUBCODE
 
26
CD-DA data with no subcode.
 
27
 
 
28
CDROM_DA_SUBQ
 
29
CD-DA data with sub Q code.
 
30
 
 
31
CDROM_DA_ALL_SUBCODE
 
32
CD-DA data with all subcode.
 
33
 
 
34
CDROM_DA_SUBCODE_ONLY
 
35
All subcode only.
 
36
 
 
37
To allocate the memory related to CD-DA and/or subcode data, the following
 
38
 values are appropriate for each data block transferred:
 
39
 
 
40
CD-DA data with no subcode
 
41
2352 bytes
 
42
 
 
43
CD-DA data with sub Q code
 
44
2368 bytes
 
45
 
 
46
CD-DA data with all subcode
 
47
2448 bytes
 
48
 
 
49
All subcode only
 
50
96 bytes
 
51
*/
 
52
 
 
53
#   endif
 
54
#  else /* Sun SVR4 */
 
55
#   if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
 
56
#    if !defined CDIOCREADAUDIO
 
57
#     undef HAVE_IOCTL_INTERFACE
 
58
#    else
 
59
 
 
60
#define CDROM_LBA       CD_LBA_FORMAT
 
61
#define CDROM_MSF       CD_MSF_FORMAT
 
62
#define CDROM_DATA_TRACK        0x04
 
63
#define CDROM_LEADOUT   0xAA
 
64
 
 
65
#define CDROMSTOP       CDIOCSTOP
 
66
#define CDROMSTART      CDIOCSTART
 
67
#define CDROMREADTOCHDR CDIOREADTOCHEADER
 
68
#define CDROMREADTOCENTRY       CDIOREADTOCENTRY
 
69
#define CDROMPLAYMSF    CDIOCPLAYMSF
 
70
#define CDROMREADAUDIO  CDIOCREADAUDIO
 
71
#define CDROM_GET_MCN   CDIOCREADSUBCHANNEL
 
72
#define CDROMSUBCHNL    CDIOCREADSUBCHANNEL
 
73
 
 
74
#ifndef CDIOREADTOCENTRY
 
75
#define CDIOREADTOCENTRY        CDIOREADTOCENTRYS
 
76
#endif
 
77
 
 
78
#define cdrom_tochdr ioc_toc_header
 
79
#define cdth_trk0       starting_track
 
80
#define cdth_trk1       ending_track
 
81
 
 
82
#define cdrom_tocentry ioc_read_toc_single_entry
 
83
#define cdte_track      track
 
84
#define cdte_format     address_format
 
85
#define cdte_adr        entry.addr_type
 
86
#define cdte_ctrl       entry.control
 
87
#define cdte_addr       entry.addr
 
88
 
 
89
#define cdrom_read_audio ioc_read_audio
 
90
#define addr_format     address_format
 
91
#define buff            buffer
 
92
 
 
93
#define cdrom_msf       ioc_play_msf
 
94
#define cdmsf_min0      start_m
 
95
#define cdmsf_sec0      start_s
 
96
#define cdmsf_frame0    start_f
 
97
#define cdmsf_min1      end_m
 
98
#define cdmsf_sec1      end_s
 
99
#define cdmsf_frame1    end_f
 
100
 
 
101
#define cdrom_subchnl   ioc_read_subchannel
 
102
#define cdsc_audiostatus data->header.audio_status
 
103
#define cdsc_format     data->what.position.data_format
 
104
#define cdsc_adr        data->what.position.addr_type
 
105
#define cdsc_ctrl       data->what.position.control
 
106
#define cdsc_trk        data->what.position.track_number
 
107
#define cdsc_ind        data->what.position.index_number
 
108
#define cdsc_absaddr    data->what.position.absaddr
 
109
#define cdsc_reladdr    data->what.position.reladdr
 
110
#    endif
 
111
#   else /* *BSD */
 
112
#    undef HAVE_IOCTL_INTERFACE
 
113
#   endif
 
114
#  endif /* not SUN SVR4 */
 
115
# else /* HAVE_SYS_CDIO_H */
 
116
#  if defined HAVE_SUNDEV_SRREG_H
 
117
#   include <sundev/srreg.h>
 
118
#   if !defined CDROMCDDA
 
119
#    undef HAVE_IOCTL_INTERFACE
 
120
#   endif
 
121
#  endif
 
122
# endif /* not HAVE_SYS_CDIO_H */
 
123
#endif /* not linux */