File: vu_nec.h

package info (click to toggle)
xmcd 2.6-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,464 kB
  • ctags: 5,075
  • sloc: ansic: 51,322; sh: 4,039; makefile: 82; pascal: 67
file content (129 lines) | stat: -rw-r--r-- 4,028 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
 *   libdi - CD Audio Player Device Interface Library
 *
 *   Copyright (C) 1993-2000  Ti Kan
 *   E-mail: ti@amb.org
 *
 *   This library is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU Library General Public
 *   License as published by the Free Software Foundation; either
 *   version 2 of the License, or (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *   Library General Public License for more details.
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this library; if not, write to the Free
 *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 *   NEC vendor-unique support
 *
 *   The name "NEC" is a trademark of NEC Corporation, and is used here
 *   for identification purposes only.
 */
#ifndef __VU_NEC_H__
#define __VU_NEC_H__

#ifdef VENDOR_NEC

#ifndef LINT
static char *_vu_nec_h_ident_ = "@(#)vu_nec.h	6.9 99/12/27";
#endif


/* NEC vendor-unique commands */
#define OP_VN_AUDSRCH		0xd8	/* NEC audio search */
#define OP_VN_AUDPLAY		0xd9	/* NEC play audio */
#define OP_VN_STILL		0xda	/* NEC still */
#define OP_VN_SETSTOP		0xd8	/* NEC set stop time */
#define OP_VN_EJECT		0xdc	/* NEC eject */
#define OP_VN_RDSUBQ		0xdd	/* NEC read subcode Q */
#define OP_VN_RDTOC		0xde	/* NEC read TOC */


/* NEC audio status codes */
#define NAUD_PLAYING		0x00
#define NAUD_PAUSED		0x01
#define NAUD_SRCH_PAUSED	0x02
#define NAUD_COMPLETED		0x03


/* Return data lengths */
#define SZ_VN_RDSUBQ		10	/* NEC read subcode Q data size */
#define SZ_VN_RDTOC		4	/* NEC read TOC data size */


/* NEC read sub-code Q command data */
typedef struct nsubq_data {
	unsigned int	audio_status:8;	/* audio status */
#if _BYTE_ORDER_ == _L_ENDIAN_
	unsigned int	preemph:1;	/* preemphasis */
	unsigned int	copyallow:1;	/* digital copy allow */
	unsigned int	trktype:1;	/* 0=audio 1=data */
	unsigned int	audioch:1;	/* 0=2ch 1=4ch */
	unsigned int	reserved:4;	/* reserved */
#else	/* _BYTE_ORDER_ == _B_ENDIAN_ */
	unsigned int	reserved:4;	/* reserved */
	unsigned int	audioch:1;	/* 0=2ch 1=4ch */
	unsigned int	trktype:1;	/* 0=audio 1=data */
	unsigned int	copyallow:1;	/* digital copy allow */
	unsigned int	preemph:1;	/* preemphasis */
#endif	/* _BYTE_ORDER_ */
	unsigned int	trkno:8;	/* track number (BCD) */
	unsigned int	idxno:8;	/* index number (BCD) */

	byte_t		rel_min;	/* trk relative minutes (BCD) */
	byte_t		rel_sec;	/* trk relative seconds (BCD) */
	byte_t		rel_frame;	/* trk relative frame (BCD) */
	byte_t		abs_min;	/* absolute minutes (BCD) */

	byte_t		abs_sec;	/* absolute seconds (BCD) */
	byte_t		abs_frame;	/* absolute frame (BCD) */
	byte_t		pad1[2];	/* pad for alignment */
} nsubq_data_t;


/* NEC read TOC command data */
typedef struct ninfo_00 {		/* track information */
	byte_t		first_trk;	/* first track (BCD) */
	byte_t		last_trk;	/* last track (BCD) */
	byte_t		reserved[2];	/* reserved */
} ninfo_00_t;

typedef struct ninfo_01 {		/* lead-out track starting time */
	byte_t		min;		/* minutes (BCD) */
	byte_t		sec;		/* seconds (BCD) */
	byte_t		frame;		/* frame (BCD) */
	byte_t		reserved;	/* reserved */
} ninfo_01_t;

typedef struct ninfo_02 {		/* specified track starting time */
	byte_t		min;		/* minutes (BCD) */
	byte_t		sec;		/* seconds (BCD) */
	byte_t		frame;		/* frame (BCD) */
	byte_t		trktype;	/* track type */
} ninfo_02_t;


/* Public function prototypes */
extern bool_t	nec_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
			byte_t, byte_t);
extern bool_t	nec_pause_resume(bool_t);
extern bool_t	nec_get_playstatus(curstat_t *, byte_t *);
extern bool_t	nec_get_toc(curstat_t *);
extern bool_t	nec_mute(bool_t);
extern bool_t	nec_eject(void);
extern void	nec_init(void);

#else

#define nec_init	NULL

#endif	/* VENDOR_NEC */

#endif	/* __VU_NEC_H__ */