home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume21 / xmcd / part03 < prev    next >
Encoding:
Text File  |  1993-12-19  |  65.8 KB  |  2,084 lines

  1. Newsgroups: comp.sources.x
  2. From: ti@bazooka.amb.org (Ti Kan)
  3. Subject: v21i065:  xmcd - X11/Motif CD audio player, Part03/13
  4. Message-ID: <1993Dec19.193823.23991@sparky.sterling.com>
  5. X-Md4-Signature: 12de1d87824c11fc5be12c30ca3c3a73
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Sun, 19 Dec 1993 19:38:23 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: ti@bazooka.amb.org (Ti Kan)
  12. Posting-number: Volume 21, Issue 65
  13. Archive-name: xmcd/part03
  14. Environment: X11, OSF/Motif
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 3 (of 13)."
  23. # Contents:  help.h hotkey.h lib_demo.h lib_hita.h lib_hpux.h lib_nec.h
  24. #   lib_odt.h lib_pion.h lib_scsipt.h lib_sim.h lib_sun.h lib_svr4.h
  25. #   lib_tosh.h
  26. # Wrapped by ti@bazooka on Mon Nov  8 10:35:18 1993
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'help.h' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'help.h'\"
  30. else
  31. echo shar: Extracting \"'help.h'\" \(1136 characters\)
  32. sed "s/^X//" >'help.h' <<'END_OF_FILE'
  33. X/*
  34. X *   xmcd - Motif(tm) CD Audio Player
  35. X *
  36. X *   Copyright (C) 1993  Ti Kan
  37. X *   E-mail: ti@amb.org
  38. X *
  39. X *   This program is free software; you can redistribute it and/or modify
  40. X *   it under the terms of the GNU General Public License as published by
  41. X *   the Free Software Foundation; either version 2 of the License, or
  42. X *   (at your option) any later version.
  43. X *
  44. X *   This program is distributed in the hope that it will be useful,
  45. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  46. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  47. X *   GNU General Public License for more details.
  48. X *
  49. X *   You should have received a copy of the GNU General Public License
  50. X *   along with this program; if not, write to the Free Software
  51. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  52. X *
  53. X */
  54. X#ifndef __HELP_H__
  55. X#define __HELP_H__
  56. X
  57. X#ifndef LINT
  58. Xstatic char *_help_h_ident_ = "@(#)help.h    1.10 93/09/28";
  59. X#endif
  60. X
  61. X/* Max number of widgets supported by the help system */
  62. X#define MAX_HELP_WIDGETS    72
  63. X
  64. X/* Public functions */
  65. Xvoid    help_setup(widgets_t *);
  66. Xvoid    help_popup(Widget);
  67. X
  68. X#endif    /* __HELP_H__ */
  69. END_OF_FILE
  70. if test 1136 -ne `wc -c <'help.h'`; then
  71.     echo shar: \"'help.h'\" unpacked with wrong size!
  72. fi
  73. # end of 'help.h'
  74. fi
  75. if test -f 'hotkey.h' -a "${1}" != "-c" ; then 
  76.   echo shar: Will not clobber existing file \"'hotkey.h'\"
  77. else
  78. echo shar: Extracting \"'hotkey.h'\" \(1186 characters\)
  79. sed "s/^X//" >'hotkey.h' <<'END_OF_FILE'
  80. X/*
  81. X *   xmcd - Motif(tm) CD Audio Player
  82. X *
  83. X *   Copyright (C) 1993  Ti Kan
  84. X *   E-mail: ti@amb.org
  85. X *
  86. X *   This program is free software; you can redistribute it and/or modify
  87. X *   it under the terms of the GNU General Public License as published by
  88. X *   the Free Software Foundation; either version 2 of the License, or
  89. X *   (at your option) any later version.
  90. X *
  91. X *   This program is distributed in the hope that it will be useful,
  92. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  93. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  94. X *   GNU General Public License for more details.
  95. X *
  96. X *   You should have received a copy of the GNU General Public License
  97. X *   along with this program; if not, write to the Free Software
  98. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  99. X *
  100. X */
  101. X#ifndef __HOTKEY_H__
  102. X#define __HOTKEY_H__
  103. X
  104. X#ifndef LINT
  105. Xstatic char *_hotkey_h_ident_ = "@(#)hotkey.h    1.13 93/09/28";
  106. X#endif
  107. X
  108. X#define MAX_TRANSLATIONS_SZ    4096
  109. X
  110. X/* Public functions */
  111. Xvoid    hotkey(Widget, XEvent *, String *, Cardinal *);
  112. Xvoid    hotkey_setup(widgets_t *);
  113. Xvoid    hotkey_grabkeys(Widget);
  114. Xvoid    hotkey_ungrabkeys(Widget);
  115. X
  116. X#endif    /* __HOTKEY_H__ */
  117. END_OF_FILE
  118. if test 1186 -ne `wc -c <'hotkey.h'`; then
  119.     echo shar: \"'hotkey.h'\" unpacked with wrong size!
  120. fi
  121. # end of 'hotkey.h'
  122. fi
  123. if test -f 'lib_demo.h' -a "${1}" != "-c" ; then 
  124.   echo shar: Will not clobber existing file \"'lib_demo.h'\"
  125. else
  126. echo shar: Extracting \"'lib_demo.h'\" \(1332 characters\)
  127. sed "s/^X//" >'lib_demo.h' <<'END_OF_FILE'
  128. X/*
  129. X *   xmcd - Motif(tm) CD Audio Player
  130. X *
  131. X *   Copyright (C) 1993  Ti Kan
  132. X *   E-mail: ti@amb.org
  133. X *
  134. X *   This program is free software; you can redistribute it and/or modify
  135. X *   it under the terms of the GNU General Public License as published by
  136. X *   the Free Software Foundation; either version 2 of the License, or
  137. X *   (at your option) any later version.
  138. X *
  139. X *   This program is distributed in the hope that it will be useful,
  140. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  141. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  142. X *   GNU General Public License for more details.
  143. X *
  144. X *   You should have received a copy of the GNU General Public License
  145. X *   along with this program; if not, write to the Free Software
  146. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  147. X *
  148. X */
  149. X#ifndef __LIB_DEMO_H__
  150. X#define __LIB_DEMO_H__
  151. X
  152. X#if !defined(OSI_MODULE) || defined(DEMO_ONLY)
  153. X
  154. X#ifndef LINT
  155. Xstatic char *_lib_demo_h_ident_ = "@(#)lib_demo.h    1.16 93/09/28";
  156. X#endif
  157. X
  158. X#include "lib_sim.h"    /* CD-ROM simulator header file */
  159. X
  160. X/* Public function prototypes */
  161. Xbool_t    pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,
  162. X        byte_t, byte_t, byte_t);
  163. Xbool_t    pthru_open(char *);
  164. Xvoid    pthru_close(void);
  165. Xchar    *pthru_vers(void);
  166. X
  167. X#endif    /* OSI_MODULE */
  168. X
  169. X#endif    /* __LIB_DEMO_H__ */
  170. X
  171. END_OF_FILE
  172. if test 1332 -ne `wc -c <'lib_demo.h'`; then
  173.     echo shar: \"'lib_demo.h'\" unpacked with wrong size!
  174. fi
  175. # end of 'lib_demo.h'
  176. fi
  177. if test -f 'lib_hita.h' -a "${1}" != "-c" ; then 
  178.   echo shar: Will not clobber existing file \"'lib_hita.h'\"
  179. else
  180. echo shar: Extracting \"'lib_hita.h'\" \(7959 characters\)
  181. sed "s/^X//" >'lib_hita.h' <<'END_OF_FILE'
  182. X/*
  183. X *   xmcd - Motif(tm) CD Audio Player
  184. X *
  185. X *   Copyright (C) 1993  Ti Kan
  186. X *   E-mail: ti@amb.org
  187. X *
  188. X *   This program is free software; you can redistribute it and/or modify
  189. X *   it under the terms of the GNU General Public License as published by
  190. X *   the Free Software Foundation; either version 2 of the License, or
  191. X *   (at your option) any later version.
  192. X *
  193. X *   This program is distributed in the hope that it will be useful,
  194. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  195. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  196. X *   GNU General Public License for more details.
  197. X *
  198. X *   You should have received a copy of the GNU General Public License
  199. X *   along with this program; if not, write to the Free Software
  200. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  201. X *
  202. X *   The name "Hitachi" is a trademark of Hitachi Corporation, and is
  203. X *   used here for identification purposes.  This software and its
  204. X *   author are not affiliated in any way with Hitachi.
  205. X *
  206. X */
  207. X#ifndef __LIB_HITA_H__
  208. X#define __LIB_HITA_H__
  209. X
  210. X#ifdef HITACHI
  211. X
  212. X#ifndef LINT
  213. Xstatic char *_lib_hita_h_ident_ = "@(#)lib_hita.h    1.17 93/10/01";
  214. X#endif
  215. X
  216. X#ifndef VUSUPPORT
  217. X#define VUSUPPORT
  218. X#endif
  219. X
  220. X
  221. X/* Hitachi vendor-unique commands */
  222. X#define OP_VH_AUDPLAY        0xe0    /* Hitachi play audio */
  223. X#define OP_VH_PAUSE        0xe1    /* Hitachi pause */
  224. X#define OP_VH_PLAYTRK        0xe2    /* Hitachi play audio track */
  225. X#define OP_VH_RDINFO        0xe3    /* Hitachi read disk info */
  226. X#define OP_VH_EJECT        0xe4    /* Hitachi eject */
  227. X#define OP_VH_RDSTAT        0xe5    /* Hitachi read audio status */
  228. X#define OP_VH_PWRSAVE        0xe6    /* Hitachi power save mode */
  229. X#define OP_VH_RDXINFO        0xe8    /* Hitachi read extended disk info */
  230. X
  231. X
  232. X/* Macros to compute the real offset of the data area in several
  233. X * data structures.  The pad byte in the beginning of some structures
  234. X * are there to prevent the compiler from inserting a pad byte in
  235. X * the middle of the structure.  The alternative is to use #pragma pack(1),
  236. X * but that's not very portable.
  237. X */
  238. X#define AD_VH_PAUSE(x)        (x)    /* Hitachi pause data addr */
  239. X#define AD_VH_RDINFO(x)        ((x)+1)    /* Hitachi disk info data addr */
  240. X#define AD_VH_RDSTAT(x)        (x)    /* Hitachi audio status data addr */
  241. X#define AD_VH_RDXINFO(x)    (x)    /* Hitachi ext disk info data addr */
  242. X
  243. X
  244. X/* Return data lengths */
  245. X#define SZ_VH_PAUSE        3    /* Hitachi pause data size */
  246. X#define SZ_VH_RDINFO        303    /* Hitachi disk info data size */
  247. X#define SZ_VH_TOCHDR        3    /* Hitachi disc info header size */
  248. X#define SZ_VH_TOCENT        3    /* Hitachi disc info per-track
  249. X                     * entry size
  250. X                     */
  251. X#define SZ_VH_RDSTAT        11    /* Hitachi audio status data size */
  252. X#define SZ_VH_RDXINFO        404    /* Hitachi ext disk info data size */
  253. X
  254. X
  255. X/* Hitachi MSF location */
  256. Xtypedef struct hmsf {
  257. X#if BYTE_ORDER == LITTLE_ENDIAN
  258. X    unsigned int    min:7;            /* minute */
  259. X    unsigned int    data:1;            /* 0=audio 1=data */
  260. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  261. X    unsigned int    data:1;            /* 0=audio 1=data */
  262. X    unsigned int    min:7;            /* minute */
  263. X#endif    /* BYTE_ORDER */
  264. X    unsigned int    sec:8;            /* second */
  265. X    unsigned int    frame:8;        /* frame */
  266. X    unsigned int    res:8;            /* reserved */
  267. X} hmsf_t;
  268. X
  269. X
  270. X/* Hitachi extended MSF location */
  271. Xtypedef struct hxmsf {
  272. X#if BYTE_ORDER == LITTLE_ENDIAN
  273. X    unsigned int    adr:4;            /* ADR code */
  274. X        unsigned int    preemph:1;        /* preemphasis */
  275. X    unsigned int    copyallow:1;        /* digital copy allow */
  276. X    unsigned int    trktype:1;        /* 0=audio 1=data */
  277. X    unsigned int    audioch:1;        /* 0=2ch 1=4ch */
  278. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  279. X    unsigned int    audioch:1;        /* 0=2ch 1=4ch */
  280. X    unsigned int    trktype:1;        /* 0=audio 1=data */
  281. X    unsigned int    copyallow:1;        /* digital copy allow */
  282. X        unsigned int    preemph:1;        /* preemphasis */
  283. X    unsigned int    adr:4;            /* ADR code */
  284. X#endif    /* BYTE_ORDER */
  285. X    unsigned int    min:8;            /* minute */
  286. X    unsigned int    sec:8;            /* second */
  287. X    unsigned int    frame:8;        /* frame */
  288. X} hxmsf_t;
  289. X
  290. X
  291. X/* Hitachi Disk Info data */
  292. Xtypedef struct hdiscinfo {
  293. X    unsigned int    pad0:8;            /* pad byte for alignment */
  294. X#if BYTE_ORDER == LITTLE_ENDIAN
  295. X    unsigned int    audio:1;        /* disc has audio tracks */
  296. X    unsigned int    data:1;            /* disc has data tracks */
  297. X    unsigned int    res:6;            /* reserved */
  298. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  299. X    unsigned int    res:6;            /* reserved */
  300. X    unsigned int    data:1;            /* disc has data tracks */
  301. X    unsigned int    audio:1;        /* disc has audio tracks */
  302. X#endif    /* BYTE_ORDER */
  303. X    unsigned int    first_trk:8;        /* first track number */
  304. X    unsigned int    last_trk:8;        /* last track number */
  305. X
  306. X    byte_t        msfdata[300];        /* Track MSF address data */
  307. X} hdiscinfo_t;
  308. X
  309. X
  310. X/* Hitachi Audio Status data */
  311. Xtypedef struct haudstat {
  312. X#if BYTE_ORDER == LITTLE_ENDIAN
  313. X    unsigned int    playing:1;        /* Audio playing */
  314. X    unsigned int    res1:7;            /* Reserved */
  315. X    unsigned int    adr:4;            /* ADR code */
  316. X        unsigned int    preemph:1;        /* preemphasis */
  317. X    unsigned int    copyallow:1;        /* digital copy allow */
  318. X    unsigned int    trktype:1;        /* 0=audio 1=data */
  319. X    unsigned int    audioch:1;        /* 0=2ch 1=4ch */
  320. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  321. X    unsigned int    res1:7;            /* Reserved */
  322. X    unsigned int    playing:1;        /* Audio playing */
  323. X    unsigned int    audioch:1;        /* 0=2ch 1=4ch */
  324. X    unsigned int    trktype:1;        /* 0=audio 1=data */
  325. X    unsigned int    copyallow:1;        /* digital copy allow */
  326. X        unsigned int    preemph:1;        /* preemphasis */
  327. X    unsigned int    adr:4;            /* ADR code */
  328. X#endif    /* BYTE_ORDER */
  329. X    unsigned int    trkno:8;        /* track number */
  330. X    unsigned int    res2:8;            /* reserved */
  331. X
  332. X    hmsf_t        rel_addr;        /* relative address */
  333. X    hmsf_t        abs_addr;        /* absolute address */
  334. X} haudstat_t;
  335. X
  336. X
  337. X/* Hitachi Extended Disk Info data */
  338. Xtypedef struct hxdiscinfo {
  339. X    byte_t        res[2];            /* reserved */
  340. X    byte_t        first_trk;        /* first track number */
  341. X    byte_t        last_trk;        /* last track number */
  342. X
  343. X    byte_t        xmsfdata[400];        /* track MSF address data */
  344. X} hxdiscinfo_t;
  345. X
  346. X
  347. X/* Argument for the Hitachi play audio and Hitachi play audio by track
  348. X * commands.
  349. X */
  350. Xtypedef struct haudio_arg {
  351. X    union {
  352. X#if BYTE_ORDER == LITTLE_ENDIAN
  353. X        struct {
  354. X            byte_t    res;        /* reserved */
  355. X            byte_t    frame;        /* frame */
  356. X            byte_t    sec;        /* seconds */
  357. X            byte_t    min;        /* minutes */
  358. X        } startmsf;            /* OP_VH_AUDPLAY start */
  359. X        struct {
  360. X            byte_t    frame;        /* frame */
  361. X            byte_t    sec;        /* seconds */
  362. X            byte_t    min;        /* minutes */
  363. X            byte_t    res;        /* reserved */
  364. X        } endmsf;            /* OP_VH_AUDPLAY end */
  365. X        struct {
  366. X            byte_t    res[3];        /* reserved */
  367. X            byte_t    track;        /* track number */
  368. X        } starttrk;            /* OP_VH_PLAYTRK start */
  369. X        struct {
  370. X            byte_t    res1[2];    /* reserved */
  371. X            byte_t    track;        /* track number */
  372. X            byte_t    res2;        /* reserved */
  373. X        } endtrk;            /* OP_VH_PLAYTRK end */
  374. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  375. X        struct {
  376. X            byte_t    min;        /* minutes */
  377. X            byte_t    sec;        /* seconds */
  378. X            byte_t    frame;        /* frame */
  379. X            byte_t    res;        /* reserved */
  380. X        } startmsf;            /* OP_VH_AUDPLAY start */
  381. X        struct {
  382. X            byte_t    res;        /* reserved */
  383. X            byte_t    min;        /* minutes */
  384. X            byte_t    sec;        /* seconds */
  385. X            byte_t    frame;        /* frame */
  386. X        } endmsf;            /* OP_VH_AUDPLAY end */
  387. X        struct {
  388. X            byte_t    track;        /* track number */
  389. X            byte_t    res[3];        /* reserved */
  390. X        } starttrk;            /* OP_VH_PLAYTRK start */
  391. X        struct {
  392. X            byte_t    res2;        /* reserved */
  393. X            byte_t    track;        /* track number */
  394. X            byte_t    res1[2];    /* reserved */
  395. X        } endtrk;            /* OP_VH_PLAYTRK end */
  396. X#endif    /* BYTE_ORDER */
  397. X    } _addr;
  398. X} haudio_arg_t;
  399. X
  400. X#define addr_smin    _addr.startmsf.min
  401. X#define addr_ssec    _addr.startmsf.sec
  402. X#define addr_sframe    _addr.startmsf.frame
  403. X#define addr_emin    _addr.endmsf.min
  404. X#define addr_esec    _addr.endmsf.sec
  405. X#define addr_eframe    _addr.endmsf.frame
  406. X#define addr_strk    _addr.starttrk.track
  407. X#define addr_etrk    _addr.endtrk.track
  408. X
  409. X
  410. X/* Public function prototypes */
  411. Xbool_t    hita_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  412. X        byte_t, byte_t);
  413. Xbool_t    hita_pause_resume(bool_t);
  414. Xbool_t    hita_start_stop(bool_t, bool_t);
  415. Xbool_t    hita_get_playstatus(curstat_t *, byte_t *);
  416. Xbool_t    hita_get_toc(curstat_t *);
  417. Xbool_t    hita_mute(bool_t);
  418. Xbool_t    hita_eject(void);
  419. Xvoid    hita_init(void);
  420. Xvoid    hita_halt(void);
  421. X
  422. X#endif    /* HITACHI */
  423. X
  424. X#endif    /* __LIB_HITA_H__ */
  425. X
  426. END_OF_FILE
  427. if test 7959 -ne `wc -c <'lib_hita.h'`; then
  428.     echo shar: \"'lib_hita.h'\" unpacked with wrong size!
  429. fi
  430. # end of 'lib_hita.h'
  431. fi
  432. if test -f 'lib_hpux.h' -a "${1}" != "-c" ; then 
  433.   echo shar: Will not clobber existing file \"'lib_hpux.h'\"
  434. else
  435. echo shar: Extracting \"'lib_hpux.h'\" \(1618 characters\)
  436. sed "s/^X//" >'lib_hpux.h' <<'END_OF_FILE'
  437. X/*
  438. X *   xmcd - Motif(tm) CD Audio Player
  439. X *
  440. X *   Copyright (C) 1993  Ti Kan
  441. X *   E-mail: ti@amb.org
  442. X *
  443. X *   This program is free software; you can redistribute it and/or modify
  444. X *   it under the terms of the GNU General Public License as published by
  445. X *   the Free Software Foundation; either version 2 of the License, or
  446. X *   (at your option) any later version.
  447. X *
  448. X *   This program is distributed in the hope that it will be useful,
  449. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  450. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  451. X *   GNU General Public License for more details.
  452. X *
  453. X *   You should have received a copy of the GNU General Public License
  454. X *   along with this program; if not, write to the Free Software
  455. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  456. X *
  457. X *   This software module contains code that interfaces xmcd to
  458. X *   the HP-UX Release 9.0 operating system.  The name "HP" and "hpux"
  459. X *   are used here for identification purposes.  This software and
  460. X *   its author are not affiliated with the Hewlett-Packard Company.
  461. X */
  462. X#ifndef __LIB_HPUX_H__
  463. X#define __LIB_HPUX_H__
  464. X
  465. X#if defined(hpux) && !defined(DEMO_ONLY)
  466. X
  467. X#ifndef LINT
  468. Xstatic char *_lib_hpux_h_ident_ = "@(#)lib_hpux.h    1.4 93/09/28";
  469. X#endif
  470. X
  471. X#include <sys/scsi.h>
  472. X
  473. X#ifndef OSI_MODULE
  474. X#define OSI_MODULE
  475. X#endif
  476. X
  477. X
  478. X/* Public function prototypes */
  479. Xbool_t    pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,
  480. X        byte_t, byte_t, byte_t);
  481. Xbool_t    pthru_open(char *);
  482. Xvoid    pthru_close(void);
  483. Xchar    *pthru_vers(void);
  484. X
  485. X
  486. X#endif    /* hpux && !DEMO_ONLY */
  487. X
  488. X#endif    /* __LIB_HPUX_H__ */
  489. X
  490. END_OF_FILE
  491. if test 1618 -ne `wc -c <'lib_hpux.h'`; then
  492.     echo shar: \"'lib_hpux.h'\" unpacked with wrong size!
  493. fi
  494. # end of 'lib_hpux.h'
  495. fi
  496. if test -f 'lib_nec.h' -a "${1}" != "-c" ; then 
  497.   echo shar: Will not clobber existing file \"'lib_nec.h'\"
  498. else
  499. echo shar: Extracting \"'lib_nec.h'\" \(4957 characters\)
  500. sed "s/^X//" >'lib_nec.h' <<'END_OF_FILE'
  501. X/*
  502. X *   xmcd - Motif(tm) CD Audio Player
  503. X *
  504. X *   Copyright (C) 1993  Ti Kan
  505. X *   E-mail: ti@amb.org
  506. X *
  507. X *   This program is free software; you can redistribute it and/or modify
  508. X *   it under the terms of the GNU General Public License as published by
  509. X *   the Free Software Foundation; either version 2 of the License, or
  510. X *   (at your option) any later version.
  511. X *
  512. X *   This program is distributed in the hope that it will be useful,
  513. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  514. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  515. X *   GNU General Public License for more details.
  516. X *
  517. X *   You should have received a copy of the GNU General Public License
  518. X *   along with this program; if not, write to the Free Software
  519. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  520. X *
  521. X *   The name "NEC" is a trademark of NEC Corporation, and is
  522. X *   used here for identification purposes.  This software and its
  523. X *   author are not affiliated in any way with NEC.
  524. X *
  525. X */
  526. X#ifndef __LIB_NEC_H__
  527. X#define __LIB_NEC_H__
  528. X
  529. X#ifdef NEC
  530. X
  531. X#ifndef LINT
  532. Xstatic char *_lib_nec_h_ident_ = "@(#)lib_nec.h    1.21 93/10/01";
  533. X#endif
  534. X
  535. X#ifndef VUSUPPORT
  536. X#define VUSUPPORT
  537. X#endif
  538. X
  539. X
  540. X/* NEC vendor-unique commands */
  541. X#define OP_VN_AUDSRCH        0xd8    /* NEC audio search */
  542. X#define OP_VN_AUDPLAY        0xd9    /* NEC play audio */
  543. X#define OP_VN_STILL        0xda    /* NEC still */
  544. X#define OP_VN_SETSTOP        0xd8    /* NEC set stop time */
  545. X#define OP_VN_EJECT        0xdc    /* NEC eject */
  546. X#define OP_VN_RDSUBQ        0xdd    /* NEC read subcode Q */
  547. X#define OP_VN_RDTOC        0xde    /* NEC read TOC */
  548. X
  549. X
  550. X/* NEC audio status codes */
  551. X#define NAUD_PLAYING        0x00
  552. X#define NAUD_PAUSED        0x01
  553. X#define NAUD_SRCH_PAUSED    0x02
  554. X#define NAUD_COMPLETED        0x03
  555. X
  556. X
  557. X/* Return data lengths */
  558. X#define SZ_VN_RDSUBQ        10    /* NEC read subcode Q data size */
  559. X#define SZ_VN_RDTOC        4    /* NEC read TOC data size */
  560. X
  561. X
  562. X/* NEC read sub-code Q command data */
  563. Xtypedef struct nsubq_data {
  564. X    unsigned int    audio_status:8;    /* audio status */
  565. X#if BYTE_ORDER == LITTLE_ENDIAN
  566. X    unsigned int    preemph:1;    /* preemphasis */
  567. X    unsigned int    copyallow:1;    /* digital copy allow */
  568. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  569. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  570. X    unsigned int    reserved:4;    /* reserved */
  571. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  572. X    unsigned int    reserved:4;    /* reserved */
  573. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  574. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  575. X    unsigned int    copyallow:1;    /* digital copy allow */
  576. X    unsigned int    preemph:1;    /* preemphasis */
  577. X#endif    /* BYTE_ORDER */
  578. X    unsigned int    trkno:8;    /* track number (BCD) */
  579. X    unsigned int    idxno:8;    /* index number (BCD) */
  580. X
  581. X    byte_t        rel_min;    /* trk relative minutes (BCD) */
  582. X    byte_t        rel_sec;    /* trk relative seconds (BCD) */
  583. X    byte_t        rel_frame;    /* trk relative frame (BCD) */
  584. X    byte_t        abs_min;    /* absolute minutes (BCD) */
  585. X
  586. X    byte_t        abs_sec;    /* absolute seconds (BCD) */
  587. X    byte_t        abs_frame;    /* absolute frame (BCD) */
  588. X    byte_t        pad1[2];    /* pad for alignment */
  589. X} nsubq_data_t;
  590. X
  591. X
  592. X/* NEC read TOC command data */
  593. Xtypedef struct ninfo_00 {        /* track information */
  594. X    byte_t        first_trk;    /* first track (BCD) */
  595. X    byte_t        last_trk;    /* last track (BCD) */
  596. X    byte_t        reserved[2];    /* reserved */
  597. X} ninfo_00_t;
  598. X
  599. Xtypedef struct ninfo_01 {        /* lead-out track starting time */
  600. X    byte_t        min;        /* minutes (BCD) */
  601. X    byte_t        sec;        /* seconds (BCD) */
  602. X    byte_t        frame;        /* frame (BCD) */
  603. X    byte_t        reserved;    /* reserved */
  604. X} ninfo_01_t;
  605. X
  606. Xtypedef struct ninfo_02 {        /* specified track starting time */
  607. X    byte_t        min;        /* minutes (BCD) */
  608. X    byte_t        sec;        /* seconds (BCD) */
  609. X    byte_t        frame;        /* frame (BCD) */
  610. X    byte_t        trktype;    /* track type */
  611. X} ninfo_02_t;
  612. X
  613. X
  614. X/* Argument of NEC audio search and play audio commands */
  615. Xtypedef struct naudio_arg {
  616. X    union {                /* address */
  617. X        word32_t    tp_00;    /* absolute logical blk addr */
  618. X#if BYTE_ORDER == LITTLE_ENDIAN
  619. X        struct {
  620. X            byte_t    res;    /* reserved */
  621. X            byte_t    frame;    /* frame (BCD) */
  622. X            byte_t    sec;    /* seconds (BCD) */
  623. X            byte_t    min;    /* minutes (BCD) */
  624. X        } tp_01;
  625. X        struct {
  626. X            byte_t    res[3];    /* reserved */
  627. X            byte_t    track;    /* track number (BCD) */
  628. X        } tp_10;
  629. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  630. X        struct {
  631. X            byte_t    min;    /* minutes (BCD) */
  632. X            byte_t    sec;    /* seconds (BCD) */
  633. X            byte_t    frame;    /* frame (BCD) */
  634. X            byte_t    res;    /* reserved */
  635. X        } tp_01;
  636. X        struct {
  637. X            byte_t    track;    /* track number (BCD) */
  638. X            byte_t    res[3];    /* reserved */
  639. X        } tp_10;
  640. X#endif    /* BYTE_ORDER */
  641. X    } _addr;
  642. X} naudio_arg_t;
  643. X
  644. X#define    addr_logical    _addr.tp_00
  645. X#define    addr_min    _addr.tp_01.min
  646. X#define    addr_sec    _addr.tp_01.sec
  647. X#define    addr_frame    _addr.tp_01.frame
  648. X#define    addr_track    _addr.tp_10.track
  649. X
  650. X
  651. X/* Public function prototypes */
  652. Xbool_t    nec_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  653. X        byte_t, byte_t);
  654. Xbool_t    nec_pause_resume(bool_t);
  655. Xbool_t    nec_get_playstatus(curstat_t *, byte_t *);
  656. Xbool_t    nec_get_toc(curstat_t *);
  657. Xbool_t    nec_mute(bool_t);
  658. Xbool_t    nec_eject(void);
  659. Xvoid    nec_init(void);
  660. Xvoid    nec_halt(void);
  661. X
  662. X#endif    /* NEC */
  663. X
  664. X#endif    /* __LIB_NEC_H__ */
  665. X
  666. END_OF_FILE
  667. if test 4957 -ne `wc -c <'lib_nec.h'`; then
  668.     echo shar: \"'lib_nec.h'\" unpacked with wrong size!
  669. fi
  670. # end of 'lib_nec.h'
  671. fi
  672. if test -f 'lib_odt.h' -a "${1}" != "-c" ; then 
  673.   echo shar: Will not clobber existing file \"'lib_odt.h'\"
  674. else
  675. echo shar: Extracting \"'lib_odt.h'\" \(3895 characters\)
  676. sed "s/^X//" >'lib_odt.h' <<'END_OF_FILE'
  677. X/*
  678. X *   xmcd - Motif(tm) CD Audio Player
  679. X *
  680. X *   Copyright (C) 1993  Ti Kan
  681. X *   E-mail: ti@amb.org
  682. X *
  683. X *   This program is free software; you can redistribute it and/or modify
  684. X *   it under the terms of the GNU General Public License as published by
  685. X *   the Free Software Foundation; either version 2 of the License, or
  686. X *   (at your option) any later version.
  687. X *
  688. X *   This program is distributed in the hope that it will be useful,
  689. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  690. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  691. X *   GNU General Public License for more details.
  692. X *
  693. X *   You should have received a copy of the GNU General Public License
  694. X *   along with this program; if not, write to the Free Software
  695. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  696. X *
  697. X *   This software module contains code that interfaces xmcd to
  698. X *   the SCO Open Desktop operating system.  The name "SCO" and "ODT"
  699. X *   are used here for identification purposes.  This software and
  700. X *   its author are not affiliated with The Santa Cruz Operation, Inc.
  701. X */
  702. X#ifndef __LIB_ODT_H__
  703. X#define __LIB_ODT_H__
  704. X
  705. X#if defined(sco) && !defined(DEMO_ONLY)
  706. X
  707. X#ifndef LINT
  708. Xstatic char *_lib_odt_h_ident_ = "@(#)lib_odt.h    1.36 93/09/28";
  709. X#endif
  710. X
  711. X#include <sys/scsi.h>
  712. X#include <sys/scsicmd.h>
  713. X
  714. X#ifndef OSI_MODULE
  715. X#define OSI_MODULE
  716. X#endif
  717. X
  718. X
  719. X/* Macros to update various fields of the SCSI CDB structures.
  720. X * These are used to work around byte alignment restrictions and
  721. X * padding with some compilers.  In general, define NO_ALIGN_LIMIT
  722. X * if and only if you are sure that the compiler will not insert
  723. X * pad bytes between any field of the SCSI CDB structure.
  724. X */
  725. X
  726. X#ifdef NO_ALIGN_LIMIT
  727. X
  728. X#define CDB6_BLK(a,d)    (a)->data[0] = (byte_t) (d);        \
  729. X            (a)->data[1] = (byte_t) ((d) >> 8);
  730. X#define CDB6_LEN(a,d)    (a)->data[2] = (d)
  731. X#define CDB6_CTL(a,d)    (a)->control = (d)
  732. X#define CDB10_BLK(a,d)    (a)->block = (d)
  733. X#define CDB10_LEN(a,d)    (a)->length = (d)
  734. X#define CDB10_RSV(a,d)    (a)->reserved = (d)
  735. X#define CDB10_CTL(a,d)    (a)->control = (d)
  736. X#define CDB12_BLK(a,d)    (a)->block = (d)
  737. X#define CDB12_LEN(a,d)    (a)->length = (d)
  738. X#define CDB12_RSV(a,d)    (a)->reserved = (d)
  739. X#define CDB12_CTL(a,d)    (a)->control = (d)
  740. X
  741. X#else    /* !NO_ALIGN_LIMIT */
  742. X
  743. X#if BYTE_ORDER == LITTLE_ENDIAN
  744. X
  745. X#define CDB6_BLK(a,d)    {                    \
  746. X    register word16_t *p = (word16_t *)(void *) (a);    \
  747. X    p[1] = (d);                        \
  748. X}
  749. X#define CDB6_LEN(a,d)    {                    \
  750. X    register byte_t *p = (byte_t *) (a);            \
  751. X    p[4] = (d);                        \
  752. X}
  753. X#define CDB6_CTL(a,d)    {                    \
  754. X    register byte_t *p = (byte_t *) (a);            \
  755. X    p[5] = (d);                        \
  756. X}
  757. X#define CDB10_BLK(a,d)    {                    \
  758. X    register word16_t *p = (word16_t *)(void *) (a);    \
  759. X    p[1] = (word16_t) (d);                    \
  760. X    p[2] = (word16_t) ((d) >> 16);                \
  761. X}
  762. X#define CDB10_LEN(a,d)    {                    \
  763. X    register byte_t *p = (byte_t *) (a);            \
  764. X    p[7] = (byte_t) (d);                    \
  765. X    p[8] = (byte_t) ((d) >> 8);                \
  766. X}
  767. X#define CDB10_RSV(a,d)    {                    \
  768. X    register byte_t *p = (byte_t *) (a);            \
  769. X    p[6] = (d);                        \
  770. X}
  771. X#define CDB10_CTL(a,d)    {                    \
  772. X    register byte_t *p = (byte_t *) (a);            \
  773. X    p[9] = (d);                        \
  774. X}
  775. X#define CDB12_BLK(a,d)    {                    \
  776. X    register word16_t *p = (word16_t *)(void *) (a);    \
  777. X    p[1] = (word16_t) (d);                    \
  778. X    p[2] = (word16_t) ((d) >> 16);                \
  779. X}
  780. X#define CDB12_LEN(a,d)    {                    \
  781. X    register word16_t *p = (word16_t *)(void *) (a);    \
  782. X    p[3] = (word16_t) (d);                    \
  783. X    p[4] = (word16_t) ((d) >> 16);                \
  784. X}
  785. X#define CDB12_RSV(a,d)    {                    \
  786. X    register byte_t *p = (byte_t *) (a);            \
  787. X    p[10] = (d);                        \
  788. X}
  789. X#define CDB12_CTL(a,d)    {                    \
  790. X    register byte_t *p = (byte_t *) (a);            \
  791. X    p[11] = (d);                        \
  792. X}
  793. X
  794. X#endif    /* BYTE_ORDER == LITTLE_ENDIAN */
  795. X
  796. X#endif    /* !NO_ALIGN_LIMIT */
  797. X
  798. X
  799. X/* Public function prototypes */
  800. Xbool_t    pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,
  801. X        byte_t, byte_t, byte_t);
  802. Xbool_t    pthru_open(char *);
  803. Xvoid    pthru_close(void);
  804. Xchar    *pthru_vers(void);
  805. X
  806. X
  807. X#endif    /* sco && !DEMO_ONLY */
  808. X
  809. X#endif    /* __LIB_ODT_H__ */
  810. X
  811. END_OF_FILE
  812. if test 3895 -ne `wc -c <'lib_odt.h'`; then
  813.     echo shar: \"'lib_odt.h'\" unpacked with wrong size!
  814. fi
  815. # end of 'lib_odt.h'
  816. fi
  817. if test -f 'lib_pion.h' -a "${1}" != "-c" ; then 
  818.   echo shar: Will not clobber existing file \"'lib_pion.h'\"
  819. else
  820. echo shar: Extracting \"'lib_pion.h'\" \(7626 characters\)
  821. sed "s/^X//" >'lib_pion.h' <<'END_OF_FILE'
  822. X/*
  823. X *   xmcd - Motif(tm) CD Audio Player
  824. X *
  825. X *   Copyright (C) 1993  Ti Kan
  826. X *   E-mail: ti@amb.org
  827. X *
  828. X *   This program is free software; you can redistribute it and/or modify
  829. X *   it under the terms of the GNU General Public License as published by
  830. X *   the Free Software Foundation; either version 2 of the License, or
  831. X *   (at your option) any later version.
  832. X *
  833. X *   This program is distributed in the hope that it will be useful,
  834. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  835. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  836. X *   GNU General Public License for more details.
  837. X *
  838. X *   You should have received a copy of the GNU General Public License
  839. X *   along with this program; if not, write to the Free Software
  840. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  841. X *
  842. X *   The name "Pioneer" is a trademark of Pioneer Corporation, and is
  843. X *   used here for identification purposes.  This software and its
  844. X *   author are not affiliated in any way with Pioneer.
  845. X *
  846. X */
  847. X#ifndef __LIB_PION_H__
  848. X#define __LIB_PION_H__
  849. X
  850. X#ifdef PIONEER
  851. X
  852. X#ifndef LINT
  853. Xstatic char *_lib_pion_h_ident_ = "@(#)lib_pion.h    1.19 93/10/01";
  854. X#endif
  855. X
  856. X#ifndef VUSUPPORT
  857. X#define VUSUPPORT
  858. X#endif
  859. X
  860. X
  861. X/* Pioneer vendor-unique commands */
  862. X#define OP_VP_EJECT        0xc0    /* Pioneer magazine eject */
  863. X#define OP_VP_RDTOC        0xc1    /* Pioneer read TOC */
  864. X#define OP_VP_RDSUBQ        0xc2    /* Pioneer read subcode Q */
  865. X#define OP_VP_RDHDR        0xc3    /* Pioneer read header */
  866. X#define OP_VP_AUDSRCH        0xc8    /* Pioneer audio search */
  867. X#define OP_VP_AUDPLAY        0xc9    /* Pioneer play audio */
  868. X#define OP_VP_PAUSE        0xca    /* Pioneer pause */
  869. X#define OP_VP_AUDSTOP        0xcb    /* Pioneer audio stop */
  870. X#define OP_VP_AUDSTAT        0xcc    /* Pioneer audio status */
  871. X#define OP_VP_AUDSCAN        0xcd    /* Pioneer audio scan */
  872. X#define OP_VP_RDDSTAT        0xe0    /* Pioneer read drive status */
  873. X#define OP_VP_WRCDP        0xe3    /* Pioneer write CDP */
  874. X#define OP_VP_RDCDP        0xe4    /* Pioneer read CDP */
  875. X
  876. X
  877. X/* Pioneer audio status codes */
  878. X#define PAUD_PLAYING        0x00
  879. X#define PAUD_PAUSED        0x01
  880. X#define PAUD_MUTEPLAY        0x02
  881. X#define PAUD_COMPLETED        0x03
  882. X#define PAUD_ERROR        0x04
  883. X#define PAUD_NOSTATUS        0x05
  884. X
  885. X
  886. X/* Macros to compute the real offset of the data area in several
  887. X * data structures.  The pad byte in the beginning of these structures
  888. X * are there to prevent the compiler from inserting a pad byte in
  889. X * the middle of the structure.  The alternative is to use #pragma pack(1),
  890. X * but that's not very portable.
  891. X */
  892. X#define AD_VP_AUDSTAT(x)    ((x)+1)    /* Pioneer audio status data addr */
  893. X#define AD_VP_SUBQ(x)        ((x)+1)    /* Pioneer read subcode data addr */
  894. X
  895. X/* Return data lengths */
  896. X#define SZ_VP_RDTOC        4    /* Pioneer read TOC data size */
  897. X#define SZ_VP_RDSUBQ        9    /* Pioneer read subcode Q data size */
  898. X#define SZ_VP_AUDSTAT        6    /* Pioneer audio status data size */
  899. X
  900. X
  901. X/* Pioneer read audio status command data */
  902. Xtypedef struct paudstat_data {
  903. X    unsigned int    pad0:8;        /* pad for alignment */
  904. X    unsigned int    status:8;    /* audio status */
  905. X#if BYTE_ORDER == LITTLE_ENDIAN
  906. X    unsigned int    mode:4;        /* play mode */
  907. X    unsigned int    res1:4;        /* reserved */
  908. X    unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  909. X    unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  910. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  911. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  912. X    unsigned int    res2:4;        /* reserved */
  913. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  914. X    unsigned int    res1:4;        /* reserved */
  915. X    unsigned int    mode:4;        /* play mode */
  916. X    unsigned int    res2:4;        /* reserved */
  917. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  918. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  919. X    unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  920. X    unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  921. X#endif    /* BYTE_ORDER */
  922. X
  923. X    byte_t        abs_min;    /* absolute minutes (BCD) */
  924. X    byte_t        abs_sec;    /* absolute seconds (BCD) */
  925. X    byte_t        abs_frame;    /* absolute frame (BCD) */
  926. X    byte_t        pad1;        /* pad for alignment */
  927. X} paudstat_data_t;
  928. X
  929. X
  930. X
  931. X/* Pioneer read subcode Q command data */
  932. Xtypedef struct psubq_data {
  933. X    unsigned int    pad0:8;        /* pad for alignment */
  934. X#if BYTE_ORDER == LITTLE_ENDIAN
  935. X    unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  936. X    unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  937. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  938. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  939. X    unsigned int    res:4;        /* reserved */
  940. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  941. X    unsigned int    res:4;        /* reserved */
  942. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  943. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  944. X    unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  945. X    unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  946. X#endif    /* BYTE_ORDER */
  947. X    unsigned int    trkno:8;    /* track number (BCD) */
  948. X    unsigned int    idxno:8;    /* index number (BCD) */
  949. X
  950. X    byte_t        rel_min;    /* trk relative minutes (BCD) */
  951. X    byte_t        rel_sec;    /* trk relative seconds (BCD) */
  952. X    byte_t        rel_frame;    /* trk relative frame (BCD) */
  953. X    byte_t        abs_min;    /* absolute minutes (BCD) */
  954. X
  955. X    byte_t        abs_sec;    /* absolute seconds (BCD) */
  956. X    byte_t        abs_frame;    /* absolute frame (BCD) */
  957. X    byte_t        pad1[2];    /* pad for alignment */
  958. X} psubq_data_t;
  959. X
  960. X
  961. X/* Pioneer read TOC command data */
  962. Xtypedef struct pinfo_00 {        /* track information */
  963. X    byte_t        first_trk;    /* first track (BCD) */
  964. X    byte_t        last_trk;    /* last track (BCD) */
  965. X    byte_t        reserved[2];    /* reserved */
  966. X} pinfo_00_t;
  967. X
  968. Xtypedef struct pinfo_01 {        /* lead-out track starting time */
  969. X    byte_t        min;        /* minutes (BCD) */
  970. X    byte_t        sec;        /* seconds (BCD) */
  971. X    byte_t        frame;        /* frame (BCD) */
  972. X    byte_t        reserved;    /* reserved */
  973. X} pinfo_01_t;
  974. X
  975. Xtypedef struct pinfo_02 {        /* specified track starting time */
  976. X#if BYTE_ORDER == LITTLE_ENDIAN
  977. X    unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  978. X    unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  979. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  980. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  981. X    unsigned int    res:4;        /* reserved */
  982. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  983. X    unsigned int    res:4;        /* reserved */
  984. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  985. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  986. X    unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  987. X    unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  988. X#endif    /* BYTE_ORDER */
  989. X
  990. X    unsigned int    min:8;        /* minutes (BCD) */
  991. X    unsigned int    sec:8;        /* seconds (BCD) */
  992. X    unsigned int    frame:8;    /* frame (BCD) */
  993. X} pinfo_02_t;
  994. X
  995. X
  996. X/* Argument of Pioneer audio search and audio play commands */
  997. Xtypedef struct paudio_arg {
  998. X    union {                /* address */
  999. X        word32_t    tp_00;    /* absolute logical blk addr */
  1000. X#if BYTE_ORDER == LITTLE_ENDIAN
  1001. X        struct {
  1002. X            byte_t    frame;    /* frame (BCD) */
  1003. X            byte_t    sec;    /* seconds (BCD) */
  1004. X            byte_t    min;    /* minutes (BCD) */
  1005. X            byte_t    res;    /* reserved */
  1006. X        } tp_01;
  1007. X        struct {
  1008. X            byte_t    track;    /* track number (BCD) */
  1009. X            byte_t    res[3];    /* reserved */
  1010. X        } tp_10;
  1011. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1012. X        struct {
  1013. X            byte_t    res;    /* reserved */
  1014. X            byte_t    min;    /* minutes (BCD) */
  1015. X            byte_t    sec;    /* seconds (BCD) */
  1016. X            byte_t    frame;    /* frame (BCD) */
  1017. X        } tp_01;
  1018. X        struct {
  1019. X            byte_t    res[3];    /* reserved */
  1020. X            byte_t    track;    /* track number (BCD) */
  1021. X        } tp_10;
  1022. X#endif    /* BYTE_ORDER */
  1023. X    } _addr;
  1024. X} paudio_arg_t;
  1025. X
  1026. X#define    addr_logical    _addr.tp_00
  1027. X#define    addr_min    _addr.tp_01.min
  1028. X#define    addr_sec    _addr.tp_01.sec
  1029. X#define    addr_frame    _addr.tp_01.frame
  1030. X#define    addr_track    _addr.tp_10.track
  1031. X
  1032. X
  1033. X/* Public function prototypes */
  1034. Xbool_t    pion_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  1035. X        byte_t, byte_t);
  1036. Xbool_t    pion_pause_resume(bool_t);
  1037. Xbool_t    pion_get_playstatus(curstat_t *, byte_t *);
  1038. Xbool_t    pion_get_toc(curstat_t *);
  1039. Xbool_t    pion_eject(void);
  1040. Xvoid    pion_init(void);
  1041. Xvoid    pion_halt(void);
  1042. X
  1043. X#endif    /* PIONEER */
  1044. X
  1045. X#endif    /* __LIB_PION_H__ */
  1046. X
  1047. END_OF_FILE
  1048. if test 7626 -ne `wc -c <'lib_pion.h'`; then
  1049.     echo shar: \"'lib_pion.h'\" unpacked with wrong size!
  1050. fi
  1051. # end of 'lib_pion.h'
  1052. fi
  1053. if test -f 'lib_scsipt.h' -a "${1}" != "-c" ; then 
  1054.   echo shar: Will not clobber existing file \"'lib_scsipt.h'\"
  1055. else
  1056. echo shar: Extracting \"'lib_scsipt.h'\" \(13069 characters\)
  1057. sed "s/^X//" >'lib_scsipt.h' <<'END_OF_FILE'
  1058. X/*
  1059. X *   xmcd - Motif(tm) CD Audio Player
  1060. X *
  1061. X *   Copyright (C) 1993  Ti Kan
  1062. X *   E-mail: ti@amb.org
  1063. X *
  1064. X *   This program is free software; you can redistribute it and/or modify
  1065. X *   it under the terms of the GNU General Public License as published by
  1066. X *   the Free Software Foundation; either version 2 of the License, or
  1067. X *   (at your option) any later version.
  1068. X *
  1069. X *   This program is distributed in the hope that it will be useful,
  1070. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1071. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1072. X *   GNU General Public License for more details.
  1073. X *
  1074. X *   You should have received a copy of the GNU General Public License
  1075. X *   along with this program; if not, write to the Free Software
  1076. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1077. X *
  1078. X */
  1079. X#ifndef __LIB_SCSIPT_H__
  1080. X#define __LIB_SCSIPT_H__
  1081. X
  1082. X#ifndef LINT
  1083. Xstatic char *_lib_scsipt_h_ident_ = "@(#)lib_scsipt.h    1.37 93/09/28";
  1084. X#endif
  1085. X
  1086. X#ifndef CDLIB_MODULE
  1087. X#define CDLIB_MODULE
  1088. X#endif
  1089. X
  1090. X
  1091. X/* Vendor unique operations code */
  1092. X#define VENDOR_SCSI2        0    /* Use SCSI-2 audio commands */
  1093. X#define VENDOR_TOSHIBA        1    /* Use Toshiba audio commands */
  1094. X#define VENDOR_NEC        2    /* Use NEC audio commands */
  1095. X#define VENDOR_PIONEER        3    /* Use Pioneer audio commands */
  1096. X#define VENDOR_HITACHI        4    /* Use Hitachi audio commands */
  1097. X
  1098. X
  1099. X/* Data direction code */
  1100. X#define READ_OP            0    /* SCSI data direction */
  1101. X#define WRITE_OP        1    /* SCSI data direction */
  1102. X
  1103. X
  1104. X/* Play audio format codes */
  1105. X#define ADDR_BLK        0x01    /* block address specified */
  1106. X#define ADDR_MSF        0x02    /* MSF address specified */
  1107. X#define ADDR_TRKIDX        0x04    /* track/index numbers specified */
  1108. X#define ADDR_OPTEND        0x80    /* End address can be ignored */
  1109. X
  1110. X
  1111. X/* Misc constants */
  1112. X#define MAX_SRCH_BLKS        225    /* max search play blks per sample */
  1113. X#define MAX_SCSIVOL        0xff    /* SCSI Mode Sense/Mode Select audio
  1114. X                     * volume maximum value.
  1115. X                     */
  1116. X#define MAX_RECOVERR        20    /* Max number of err recovery tries */
  1117. X#define ERR_SKIPBLKS        10    /* Number of frame to skip on error */
  1118. X#define ERR_CLRTHRESH        1500    /* If there hasn't been any errors
  1119. X                     * for this many blocks of audio
  1120. X                     * playback, then the previous errors
  1121. X                     * count is cleared.
  1122. X                     */
  1123. X
  1124. X
  1125. X/* SCSI command opcodes */
  1126. X
  1127. X/* 6-byte commands */
  1128. X#define OP_S_TEST        0x00    /* test unit ready */
  1129. X#define OP_S_REZERO        0x01    /* rezero */
  1130. X#define OP_S_RSENSE        0x03    /* request sense */
  1131. X#define OP_S_SEEK        0x0b    /* seek */
  1132. X#define OP_S_INQUIR        0x12    /* inquiry */
  1133. X#define OP_S_MSELECT        0x15    /* mode select */
  1134. X#define OP_S_MSENSE        0x1a    /* mode sense */
  1135. X#define OP_S_START        0x1b    /* start/stop unit */
  1136. X#define OP_S_PREVENT        0x1e    /* prevent/allow medium removal */
  1137. X
  1138. X/* 10-byte commands */
  1139. X#define OP_M_RDCAP        0x25    /* read capacity */
  1140. X#define OP_M_RDSUBQ        0x42    /* read subchannel */
  1141. X#define OP_M_RDTOC        0x43    /* read TOC */
  1142. X#define OP_M_RDHDR        0x44    /* read header */
  1143. X#define OP_M_PLAY        0x45    /* play audio */
  1144. X#define OP_M_PLAYMSF        0x47    /* play audio MSF */
  1145. X#define OP_M_PLAYTI        0x48    /* play audio track/index */
  1146. X#define OP_M_PLAYTR        0x49    /* play audio track relative */
  1147. X#define OP_M_PAUSE        0x4b    /* pause/resume */
  1148. X
  1149. X/* 12-byte commands */
  1150. X#define OP_L_PLAY        0xa5    /* play audio */
  1151. X#define OP_L_PLAYTR        0xa9    /* play audio track relative */
  1152. X
  1153. X
  1154. X/* Data buffer lengths */
  1155. X#define SZ_RDSUBQ        48    /* max read sub-channel Q data size */
  1156. X#define SZ_RDTOC        804    /* max read TOC data size */
  1157. X#define SZ_TOCHDR        4    /* TOC header size */
  1158. X#define SZ_TOCENT        8    /* TOC per-track entry size */
  1159. X#define SZ_MSENSE        60    /* max mode sense/mode sel data size */
  1160. X#define SZ_RSENSE        18    /* max request sense data size */
  1161. X
  1162. X/* Data buffer address */
  1163. X#define AD_RSENSE(x)        ((byte_t *) (x) + 1)
  1164. X                    /* start of real request sense data */
  1165. X
  1166. X
  1167. X/* Read Sub-channel audio status */
  1168. X#define AUDIO_NOTVALID        0x00    /* audio status not valid */
  1169. X#define AUDIO_PLAYING        0x11    /* audio play in progress */
  1170. X#define AUDIO_PAUSED        0x12    /* audio play paused */
  1171. X#define AUDIO_COMPLETED        0x13    /* audio play successfully completed */
  1172. X#define AUDIO_FAILED        0x14    /* audio played stopped due to error */
  1173. X#define AUDIO_NOSTATUS        0x15    /* no audio status */
  1174. X
  1175. X
  1176. X/* Mode sense/mode select page codes */
  1177. X#define PG_ERRECOV        0x01    /* error recovery parameters page */
  1178. X#define PG_DISCONN        0x02    /* disconn/conn parameters page */
  1179. X#define PG_CDROMCTL        0x0d    /* cd-rom control parameters page */
  1180. X#define PG_AUDIOCTL        0x0e    /* audio control parameters page */
  1181. X#define PG_ALL            0x3f    /* 0x01, 0x02, 0x0d and 0x0e */
  1182. X
  1183. X
  1184. X/* Read sub-channel format codes */
  1185. X#define SUB_ALL            0x00    /* sub-Q channel data */
  1186. X#define SUB_CURPOS        0x01    /* current CD-ROM position */
  1187. X#define SUB_CATNO        0x02    /* media catalog num (UPC/bar code) */
  1188. X#define SUB_ISRC        0x03    /* track ISRC code */
  1189. X
  1190. X
  1191. X/* Inquiry data misc definitions */
  1192. X#define DEV_ROM            0x05    /* ROM peripheral device type */
  1193. X#define DEV_CONNECTED        0x00    /* peripheral qualifier */
  1194. X
  1195. X
  1196. X/* The inquiry data structure */
  1197. Xtypedef struct inquiry_data {
  1198. X#if BYTE_ORDER == LITTLE_ENDIAN
  1199. X    unsigned int    type:5;        /* peripheral device type */
  1200. X    unsigned int    pqual:3;    /* peripheral qualifier */
  1201. X    unsigned int    qualif:7;    /* device type qualifier */
  1202. X    unsigned int    rmb:1;        /* removable media */
  1203. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1204. X    unsigned int    pqual:3;    /* peripheral qualifier */
  1205. X    unsigned int    type:5;        /* peripheral device type */
  1206. X    unsigned int    rmb:1;        /* removable media */
  1207. X    unsigned int    qualif:7;    /* device type qualifier */
  1208. X#endif    /* BYTE_ORDER */
  1209. X
  1210. X    unsigned int    ver:8;        /* SCSI version */
  1211. X    unsigned int    res1:8;        /* reserved */
  1212. X
  1213. X    byte_t        len;        /* length of additional data */
  1214. X    byte_t        res2[3];    /* reserved */
  1215. X    byte_t        vendor[8];    /* vendor ID */
  1216. X    byte_t        prod[16];    /* product ID */
  1217. X    byte_t        revnum[4];    /* revision number */
  1218. X} inquiry_data_t;
  1219. X
  1220. X
  1221. X/* The Mode Sense/Mode Select data structures */
  1222. X
  1223. X/* Block descriptor data structure */
  1224. Xtypedef struct blk_desc {
  1225. X    unsigned int    dens_code:8;    /* density code */
  1226. X    unsigned int    num_blks:24;    /* number of blocks */
  1227. X
  1228. X    unsigned int    res:8;        /* reserved */
  1229. X    unsigned int    blk_len:24;    /* block length */
  1230. X} blk_desc_t;
  1231. X
  1232. X/* Audio-parameters page data structure */
  1233. Xtypedef struct audio_pg {
  1234. X#if BYTE_ORDER == LITTLE_ENDIAN
  1235. X    unsigned int    pg_code:6;    /* page code */
  1236. X    unsigned int    res:2;        /* reserved */
  1237. X    unsigned int    pg_len:8;    /* page length */
  1238. X    unsigned int    res1:1;        /* reserved */
  1239. X    unsigned int    sotc:1;        /* SOTC */
  1240. X    unsigned int    immed:1;    /* immediate */
  1241. X    unsigned int    res2:5;        /* reserved */
  1242. X    unsigned int    res3:8;        /* reserved */
  1243. X
  1244. X    unsigned int    res4:16;    /* reserved */
  1245. X    unsigned int    audio_bps:16;    /* logical blocks per second */
  1246. X
  1247. X    unsigned int    p0_ch_ctrl:4;    /* port 0 channel control */
  1248. X    unsigned int    res5:4;        /* reserved */
  1249. X    unsigned int    p0_vol:8;    /* port 0 volume */
  1250. X    unsigned int    p1_ch_ctrl:4;    /* port 1 channel control */
  1251. X    unsigned int    res6:4;        /* reserved */
  1252. X    unsigned int    p1_vol:8;    /* port 1 volume */
  1253. X
  1254. X    unsigned int    p2_ch_ctrl:4;    /* port 2 channel control */
  1255. X    unsigned int    res7:4;        /* reserved */
  1256. X    unsigned int    p2_vol:8;    /* port 2 volume */
  1257. X    unsigned int    p3_ch_ctrl:4;    /* port 3 channel control */
  1258. X    unsigned int    res8:4;        /* reserved */
  1259. X    unsigned int    p3_vol:8;    /* port 3 volume */
  1260. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1261. X    unsigned int    res:2;        /* reserved */
  1262. X    unsigned int    pg_code:6;    /* page code */
  1263. X    unsigned int    pg_len:8;    /* page length */
  1264. X    unsigned int    res2:5;        /* reserved */
  1265. X    unsigned int    immed:1;    /* immediate */
  1266. X    unsigned int    sotc:1;        /* SOTC */
  1267. X    unsigned int    res1:1;        /* reserved */
  1268. X    unsigned int    res3:8;        /* reserved */
  1269. X
  1270. X    unsigned int    res4:16;    /* reserved */
  1271. X    unsigned int    audio_bps:16;    /* logical blocks per second */
  1272. X
  1273. X    unsigned int    res5:4;        /* reserved */
  1274. X    unsigned int    p0_ch_ctrl:4;    /* port 0 channel control */
  1275. X    unsigned int    p0_vol:8;    /* port 0 volume */
  1276. X    unsigned int    res6:4;        /* reserved */
  1277. X    unsigned int    p1_ch_ctrl:4;    /* port 1 channel control */
  1278. X    unsigned int    p1_vol:8;    /* port 1 volume */
  1279. X
  1280. X    unsigned int    res7:4;        /* reserved */
  1281. X    unsigned int    p2_ch_ctrl:4;    /* port 2 channel control */
  1282. X    unsigned int    p2_vol:8;    /* port 2 volume */
  1283. X    unsigned int    res8:4;        /* reserved */
  1284. X    unsigned int    p3_ch_ctrl:4;    /* port 3 channel control */
  1285. X    unsigned int    p3_vol:8;    /* port 3 volume */
  1286. X#endif    /* BYTE_ORDER */
  1287. X} audio_pg_t;
  1288. X
  1289. X/* Mode Sense/Mode Select data structure */
  1290. Xtypedef struct mode_sense_data {
  1291. X    /* mode header */
  1292. X    unsigned int    data_len:8;    /* data length */
  1293. X    unsigned int    medium:8;    /* medium */
  1294. X#if BYTE_ORDER == LITTLE_ENDIAN
  1295. X    unsigned int    speed:4;    /* speed */
  1296. X    unsigned int    buffered:3;    /* buffered */
  1297. X    unsigned int    wprot:1;    /* write protected */
  1298. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1299. X    unsigned int    wprot:1;    /* write protected */
  1300. X    unsigned int    buffered:3;    /* buffered */
  1301. X    unsigned int    speed:4;    /* speed */
  1302. X#endif    /* BYTE_ORDER */
  1303. X    unsigned int    bdescr_len:8;    /* block descriptor length */
  1304. X
  1305. X    byte_t        data[24];    /* block desc/page desc data */
  1306. X} mode_sense_data_t;
  1307. X
  1308. X
  1309. X/* Request Sense data structure */
  1310. Xtypedef struct req_sense_data {
  1311. X    unsigned int    pad:8;        /* pad byte for alignment */
  1312. X#if BYTE_ORDER == LITTLE_ENDIAN
  1313. X    unsigned int    errcode:7;    /* error code */
  1314. X    unsigned int    valid:1;    /* valid bit */
  1315. X    unsigned int    segno:8;    /* segment number */
  1316. X    unsigned int    key:4;        /* sense key */
  1317. X    unsigned int    res:1;        /* reserved */
  1318. X    unsigned int    ili:1;        /* ILI */
  1319. X    unsigned int    eom:1;        /* end-of-medium */
  1320. X    unsigned int    fm:1;        /* filemark */
  1321. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1322. X    unsigned int    valid:1;    /* valid bit */
  1323. X    unsigned int    errcode:7;    /* error code */
  1324. X    unsigned int    segno:8;    /* segment number */
  1325. X    unsigned int    fm:1;        /* filemark */
  1326. X    unsigned int    eom:1;        /* end-of-medium */
  1327. X    unsigned int    ili:1;        /* ILI */
  1328. X    unsigned int    res:1;        /* reserved */
  1329. X    unsigned int    key:4;        /* sense key */
  1330. X#endif    /* BYTE_ORDER */
  1331. X
  1332. X    byte_t        info[4];    /* information */
  1333. X
  1334. X    byte_t         addl_len;    /* additional sense length */
  1335. X    byte_t        cmd_spec[4];    /* command specific information */
  1336. X
  1337. X    byte_t        code;        /* additional sense code */
  1338. X    byte_t        qual;        /* additional sense code qualifier */
  1339. X
  1340. X    byte_t        fruc;        /* field replaceable unit code */
  1341. X    byte_t        key_spec[3];    /* sense-key specific */
  1342. X} req_sense_data_t;
  1343. X
  1344. X
  1345. X/* CD position MSF structure */
  1346. Xtypedef struct msf {
  1347. X    byte_t        res;        /* reserved */
  1348. X    byte_t        min;        /* minutes */
  1349. X    byte_t        sec;        /* seconds */
  1350. X    byte_t        frame;        /* frame */
  1351. X} msf_t;
  1352. X
  1353. X
  1354. X/* Combined MSF and logical address union */
  1355. Xtypedef union lmsf {
  1356. X    msf_t        msf;        /* MSF address */
  1357. X    word32_t    logical;    /* logical address */
  1358. X} lmsf_t;
  1359. X
  1360. X
  1361. X/* Read subchannel Q data header */
  1362. Xtypedef struct subq_hdr {
  1363. X    byte_t        reserved;    /* reserved */
  1364. X    byte_t        audio_status;    /* audio status */
  1365. X    word16_t    subch_len;    /* subchannel data length */
  1366. X} subq_hdr_t;
  1367. X
  1368. X
  1369. X/* Subchannel Q data - format 01 (CD-ROM Current Position) */
  1370. Xtypedef struct subq_01 {
  1371. X    unsigned int    fmt_code:8;    /* format code */
  1372. X#if BYTE_ORDER == LITTLE_ENDIAN
  1373. X    unsigned int    preemph:1;    /* preemphasis */
  1374. X    unsigned int    copyallow:1;    /* digital copy allow */
  1375. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  1376. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  1377. X    unsigned int    adr:4;        /* ADR */
  1378. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1379. X    unsigned int    adr:4;        /* ADR */
  1380. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  1381. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  1382. X    unsigned int    copyallow:1;    /* digital copy allow */
  1383. X    unsigned int    preemph:1;    /* preemphasis */
  1384. X#endif    /* BYTE_ORDER */
  1385. X    unsigned int    trkno:8;    /* track number */
  1386. X    unsigned int    idxno:8;    /* index number */
  1387. X
  1388. X    lmsf_t        abs_addr;    /* absolute address */
  1389. X    lmsf_t        rel_addr;    /* track-relative address */
  1390. X} subq_01_t;
  1391. X
  1392. X
  1393. X/* Read TOC command data header */
  1394. Xtypedef struct toc_hdr {
  1395. X    word16_t    data_len;    /* TOC data length */
  1396. X    byte_t        first_trk;    /* first track number */
  1397. X    byte_t        last_trk;    /* last track number */
  1398. X} toc_hdr_t;
  1399. X
  1400. X
  1401. X/* Read TOC command track descriptor */
  1402. Xtypedef struct toc_trk_descr {
  1403. X    unsigned int    res1:8;        /* reserved */
  1404. X#if BYTE_ORDER == LITTLE_ENDIAN
  1405. X    unsigned int    preemph:1;    /* preemphasis */
  1406. X    unsigned int    copyallow:1;    /* digital copy allow */
  1407. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  1408. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  1409. X    unsigned int    adr:4;        /* ADR */
  1410. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1411. X    unsigned int    adr:4;        /* ADR */
  1412. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  1413. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  1414. X    unsigned int    copyallow:1;    /* digital copy allow */
  1415. X    unsigned int    preemph:1;    /* preemphasis */
  1416. X#endif    /* BYTE_ORDER */
  1417. X    unsigned int    trkno:8;    /* track number */
  1418. X    unsigned int    res2:8;        /* reserved */
  1419. X
  1420. X    lmsf_t        abs_addr;    /* absolute address */
  1421. X} toc_trk_descr_t;
  1422. X
  1423. X
  1424. X/***** Additional include files *****/
  1425. X
  1426. X/* OS interface library headers */
  1427. X#include "lib_hpux.h"            /* HP-UX support header */
  1428. X#include "lib_odt.h"            /* SCO ODT support header */
  1429. X#include "lib_sun.h"            /* SunOS support header */
  1430. X#include "lib_svr4.h"            /* SVR4 support header */
  1431. X#include "lib_demo.h"            /* Demo-only support header -
  1432. X                     * This must be included last.
  1433. X                     */
  1434. X
  1435. X/* Vendor-unique library headers */
  1436. X#ifdef HITACHI
  1437. X#include "lib_hita.h"            /* Hitachi vendor-unique header */
  1438. X#endif
  1439. X#ifdef NEC
  1440. X#include "lib_nec.h"            /* NEC vendor-unique header */
  1441. X#endif
  1442. X#ifdef PIONEER
  1443. X#include "lib_pion.h"            /* Pioneer vendor-unique header */
  1444. X#endif
  1445. X#ifdef TOSHIBA
  1446. X#include "lib_tosh.h"            /* Toshiba vendor-unique header */
  1447. X#endif
  1448. X
  1449. X
  1450. X#endif    /* __LIB_SCSIPT_H__ */
  1451. X
  1452. END_OF_FILE
  1453. if test 13069 -ne `wc -c <'lib_scsipt.h'`; then
  1454.     echo shar: \"'lib_scsipt.h'\" unpacked with wrong size!
  1455. fi
  1456. # end of 'lib_scsipt.h'
  1457. fi
  1458. if test -f 'lib_sim.h' -a "${1}" != "-c" ; then 
  1459.   echo shar: Will not clobber existing file \"'lib_sim.h'\"
  1460. else
  1461. echo shar: Extracting \"'lib_sim.h'\" \(3425 characters\)
  1462. sed "s/^X//" >'lib_sim.h' <<'END_OF_FILE'
  1463. X/*
  1464. X *   xmcd - Motif(tm) CD Audio Player
  1465. X *
  1466. X *   Copyright (C) 1993  Ti Kan
  1467. X *   E-mail: ti@amb.org
  1468. X *
  1469. X *   This program is free software; you can redistribute it and/or modify
  1470. X *   it under the terms of the GNU General Public License as published by
  1471. X *   the Free Software Foundation; either version 2 of the License, or
  1472. X *   (at your option) any later version.
  1473. X *
  1474. X *   This program is distributed in the hope that it will be useful,
  1475. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1476. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1477. X *   GNU General Public License for more details.
  1478. X *
  1479. X *   You should have received a copy of the GNU General Public License
  1480. X *   along with this program; if not, write to the Free Software
  1481. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1482. X *
  1483. X */
  1484. X#ifndef __LIB_SIM_H__
  1485. X#define __LIB_SIM_H__
  1486. X
  1487. X#if !defined(OSI_MODULE) || defined(DEMO_ONLY)
  1488. X
  1489. X#ifndef LINT
  1490. Xstatic char *_lib_sim_h_ident_ = "@(#)lib_sim.h    1.10 93/09/28";
  1491. X#endif
  1492. X
  1493. X#define SIMULATED_CDROM            /* Use CD-ROM simulator */
  1494. X
  1495. X
  1496. X#define CDSIM_MAGIC    0x584d4344    /* Magic number */
  1497. X#define MAX_DATALEN    1000        /* Max I/O data length */
  1498. X
  1499. X/* Return status codes */
  1500. X#define CDSIM_COMPOK    0        /* Command completed OK */
  1501. X#define CDSIM_COMPERR    1        /* Command completed with error */
  1502. X#define CDSIM_NOTSUPP    2        /* Command not supported */
  1503. X#define CDSIM_PARMERR    3        /* Command parameter error */
  1504. X#define CDSIM_PKTERR    4        /* Command packet error */
  1505. X
  1506. X
  1507. X/* CD simulator IPC packet structure (1024 bytes in size) */
  1508. Xtypedef struct simpkt {
  1509. X    word32_t    magic;        /* Magic number */
  1510. X
  1511. X    byte_t        pktid;        /* Packet id */
  1512. X    byte_t        retcode;    /* Return code */
  1513. X    byte_t        dir;        /* Data direction: READ_OP/WRITE_OP */
  1514. X    byte_t        cdbsz;        /* CDB size */
  1515. X
  1516. X    word32_t    len;        /* Data length in bytes */
  1517. X
  1518. X    byte_t        cdb[12];    /* CDB data */
  1519. X
  1520. X    byte_t        data[MAX_DATALEN];
  1521. X                    /* I/O Data */
  1522. X} simpkt_t;
  1523. X
  1524. X
  1525. X#define CDSIM_NODISC    0x00        /* CD simulator no disc */
  1526. X#define CDSIM_STOPPED    0x01        /* CD simulator stopped */
  1527. X#define CDSIM_PAUSED    0x02        /* CD simulator paused */
  1528. X#define CDSIM_PLAYING    0x03        /* CD simulator playing audio */
  1529. X
  1530. X#define CDSIM_NTRKS    10        /* Number of tracks on simulated CD */
  1531. X#define CDSIM_NIDXS    4        /* Number of index/track on sim CD */
  1532. X#define CDSIM_TRKLEN    4500        /* Length of each simulated track */
  1533. X#define CDSIM_IDXLEN    1125        /* Length of each simulated track */
  1534. X
  1535. X/* CD simulator internal status structures */
  1536. X
  1537. Xtypedef struct trkstat {
  1538. X    word32_t    addr;        /* Starting absolute addr of track */
  1539. X    byte_t        nidxs;        /* Number of indices */
  1540. X    byte_t        rsvd[3];    /* Reserved */
  1541. X    word32_t    iaddr[CDSIM_NIDXS];
  1542. X                    /* Index absolute addresses */
  1543. X} trkstat_t;
  1544. X
  1545. Xtypedef struct simstat {
  1546. X    byte_t        status;        /* Current mode status flag */
  1547. X    byte_t        ntrks;        /* Number of tracks */
  1548. X    byte_t        trkno;        /* Current track */
  1549. X    byte_t        idxno;        /* Current index */
  1550. X
  1551. X    word32_t    absaddr;    /* Current absolute address */
  1552. X    word32_t    reladdr;    /* Current relative address */
  1553. X    trkstat_t    trk[MAXTRACK];    /* Per-track information */
  1554. X    word32_t    startaddr;    /* Start play address */
  1555. X    word32_t    endaddr;    /* End play address */
  1556. X
  1557. X    bool_t        caddylock;    /* Caddy locked */
  1558. X} simstat_t;
  1559. X
  1560. X
  1561. X#define CDSIM_PKTSZ    sizeof(simpkt_t)
  1562. X#define CDSIM_INQSZ    sizeof(inquiry_data_t)
  1563. X
  1564. X
  1565. X/* Public function prototypes */
  1566. Xbool_t    cdsim_sendpkt(char *, int, simpkt_t *);
  1567. Xbool_t    cdsim_getpkt(char *, int, simpkt_t *);
  1568. Xvoid    cdsim_main(void);
  1569. X
  1570. X#endif    /* !OSI_MODULE || DEMO_ONLY */
  1571. X
  1572. X#endif    /* __LIB_SIM_H__ */
  1573. X
  1574. END_OF_FILE
  1575. if test 3425 -ne `wc -c <'lib_sim.h'`; then
  1576.     echo shar: \"'lib_sim.h'\" unpacked with wrong size!
  1577. fi
  1578. # end of 'lib_sim.h'
  1579. fi
  1580. if test -f 'lib_sun.h' -a "${1}" != "-c" ; then 
  1581.   echo shar: Will not clobber existing file \"'lib_sun.h'\"
  1582. else
  1583. echo shar: Extracting \"'lib_sun.h'\" \(2185 characters\)
  1584. sed "s/^X//" >'lib_sun.h' <<'END_OF_FILE'
  1585. X/*
  1586. X *   xmcd - Motif(tm) CD Audio Player
  1587. X *
  1588. X *   Copyright (C) 1993  Ti Kan
  1589. X *   E-mail: ti@amb.org
  1590. X *
  1591. X *   This program is free software; you can redistribute it and/or modify
  1592. X *   it under the terms of the GNU General Public License as published by
  1593. X *   the Free Software Foundation; either version 2 of the License, or
  1594. X *   (at your option) any later version.
  1595. X *
  1596. X *   This program is distributed in the hope that it will be useful,
  1597. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1598. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1599. X *   GNU General Public License for more details.
  1600. X *
  1601. X *   You should have received a copy of the GNU General Public License
  1602. X *   along with this program; if not, write to the Free Software
  1603. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1604. X *
  1605. X *   This software module contains code that interfaces xmcd to
  1606. X *   the SunOS operating systems.  The name "Sun" and "SunOS"
  1607. X *   are used here for identification purposes.  This software and
  1608. X *   its author are not affiliated with Sun Microsystems.
  1609. X */
  1610. X#ifndef __LIB_SUN_H__
  1611. X#define __LIB_SUN_H__
  1612. X
  1613. X#if defined(sun) && !defined(DEMO_ONLY)
  1614. X
  1615. X#ifndef LINT
  1616. Xstatic char *_lib_sun_h_ident_ = "@(#)lib_sun.h    1.7 93/10/06";
  1617. X#endif
  1618. X
  1619. X#ifdef SVR4
  1620. X
  1621. X#include <sys/scsi/impl/uscsi.h>
  1622. X#define USCSI_STATUS_GOOD    0
  1623. X
  1624. X#else    /* !SVR4 */
  1625. X
  1626. X#include <scsi/impl/uscsi.h>
  1627. X#undef USCSI_WRITE
  1628. X#define USCSI_WRITE        0
  1629. X
  1630. X/* This is a hack to work around a bug in SunOS 4.x's _IOWR macro
  1631. X * in <sys/ioccom.h> which makes it incompatible with ANSI compilers.
  1632. X * If Sun ever changes the definition of USCSICMD or _IOWR then
  1633. X * this will have to change...
  1634. X */
  1635. X#undef _IOWR
  1636. X#undef USCSICMD
  1637. X
  1638. X#define _IOWR(x,y,t)    ( \
  1639. X                _IOC_INOUT | \
  1640. X                ((sizeof(t) & _IOCPARM_MASK) << 16) | \
  1641. X                ((x) << 8) | (y) \
  1642. X            )
  1643. X#define USCSICMD    _IOWR('u', 1, struct uscsi_cmd)
  1644. X
  1645. X#endif    /* SVR4 */
  1646. X
  1647. X
  1648. X#ifndef OSI_MODULE
  1649. X#define OSI_MODULE
  1650. X#endif
  1651. X
  1652. X
  1653. X/* Public function prototypes */
  1654. Xbool_t    pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,
  1655. X        byte_t, byte_t, byte_t);
  1656. Xbool_t    pthru_open(char *);
  1657. Xvoid    pthru_close(void);
  1658. Xchar    *pthru_vers(void);
  1659. X
  1660. X
  1661. X#endif    /* sun && !DEMO_ONLY */
  1662. X
  1663. X#endif    /* __LIB_SUN_H__ */
  1664. X
  1665. END_OF_FILE
  1666. if test 2185 -ne `wc -c <'lib_sun.h'`; then
  1667.     echo shar: \"'lib_sun.h'\" unpacked with wrong size!
  1668. fi
  1669. # end of 'lib_sun.h'
  1670. fi
  1671. if test -f 'lib_svr4.h' -a "${1}" != "-c" ; then 
  1672.   echo shar: Will not clobber existing file \"'lib_svr4.h'\"
  1673. else
  1674. echo shar: Extracting \"'lib_svr4.h'\" \(5120 characters\)
  1675. sed "s/^X//" >'lib_svr4.h' <<'END_OF_FILE'
  1676. X/*
  1677. X *   xmcd - Motif(tm) CD Audio Player
  1678. X *
  1679. X *   Copyright (C) 1993  Ti Kan
  1680. X *   E-mail: ti@amb.org
  1681. X *
  1682. X *   This program is free software; you can redistribute it and/or modify
  1683. X *   it under the terms of the GNU General Public License as published by
  1684. X *   the Free Software Foundation; either version 2 of the License, or
  1685. X *   (at your option) any later version.
  1686. X *
  1687. X *   This program is distributed in the hope that it will be useful,
  1688. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1689. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1690. X *   GNU General Public License for more details.
  1691. X *
  1692. X *   You should have received a copy of the GNU General Public License
  1693. X *   along with this program; if not, write to the Free Software
  1694. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1695. X */
  1696. X#ifndef __LIB_SVR4_H__
  1697. X#define __LIB_SVR4_H__
  1698. X
  1699. X#if defined(SVR4) && !defined(sun) && !defined(DEMO_ONLY)
  1700. X
  1701. X#ifndef LINT
  1702. Xstatic char *_lib_svr4_h_ident_ = "@(#)lib_svr4.h    1.31 93/10/06";
  1703. X#endif
  1704. X
  1705. X#ifdef i386
  1706. X/*
  1707. X *   Intel x86 UNIX SVR4 support
  1708. X *   Portable Device Interface/SCSI Device Interface
  1709. X *
  1710. X *   This software fragment contains code that interfaces xmcd to
  1711. X *   the UNIX System V Release 4 operating system for the Intel
  1712. X *   x86 hardware platforms from UNIX System Laboratories.
  1713. X *   The name "USL", "UNIX" and "Intel" are used here for
  1714. X *   identification purposes.  This software and its author are
  1715. X *   not affiliated with USL or Intel.
  1716. X */
  1717. X
  1718. X#include <sys/scsi.h>
  1719. X#include <sys/sdi_edt.h>
  1720. X#include <sys/sdi.h>
  1721. X
  1722. X#ifndef OSI_MODULE
  1723. X#define OSI_MODULE
  1724. X#endif
  1725. X
  1726. X
  1727. X/* Macros to update various fields of the SCSI CDB structures.
  1728. X * These are used to work around byte alignment restrictions and
  1729. X * padding with some compilers.  In general, define NO_ALIGN_LIMIT
  1730. X * if and only if you are sure that the compiler will not insert
  1731. X * pad bytes between any field of the SCSI CDB structure.
  1732. X */
  1733. X
  1734. X#ifdef NO_ALIGN_LIMIT
  1735. X
  1736. X#define CDB6_BLK(a,d)    (a)->ss_addr = (d)
  1737. X#define CDB6_LEN(a,d)    (a)->ss_len = (d)
  1738. X#define CDB6_CTL(a,d)    (a)->ss_cont = (d)
  1739. X#define CDB10_BLK(a,d)    (a)->sm_addr = (d)
  1740. X#define CDB10_LEN(a,d)    (a)->sm_len = (d)
  1741. X#define CDB10_RSV(a,d)    (a)->sm_res2 = (d)
  1742. X#define CDB10_CTL(a,d)    (a)->sm_cont = (d)
  1743. X#define CDB12_BLK(a,d)    (a)->sl_addr = (d)
  1744. X#define CDB12_LEN(a,d)    (a)->sl_len = (d)
  1745. X#define CDB12_RSV(a,d)    (a)->sl_res2 = (d)
  1746. X#define CDB12_CTL(a,d)    (a)->sl_cont = (d)
  1747. X
  1748. X#else    /* !NO_ALIGN_LIMIT */
  1749. X
  1750. X#if BYTE_ORDER == LITTLE_ENDIAN
  1751. X
  1752. X#define CDB6_BLK(a,d)    {                    \
  1753. X    register word16_t *p = (word16_t *)(void *) SCS_AD(a);    \
  1754. X    p[1] = (d);                        \
  1755. X}
  1756. X#define CDB6_LEN(a,d)    {                    \
  1757. X    register byte_t *p = (byte_t *) SCS_AD(a);        \
  1758. X    p[4] = (d);                        \
  1759. X}
  1760. X#define CDB6_CTL(a,d)    {                    \
  1761. X    register byte_t *p = (byte_t *) SCS_AD(a);        \
  1762. X    p[5] = (d);                        \
  1763. X}
  1764. X#define CDB10_BLK(a,d)    {                    \
  1765. X    register word16_t *p = (word16_t *)(void *) SCM_AD(a);    \
  1766. X    p[1] = (word16_t) (d);                    \
  1767. X    p[2] = (word16_t) ((d) >> 16);                \
  1768. X}
  1769. X#define CDB10_LEN(a,d)    {                    \
  1770. X    register byte_t *p = (byte_t *) SCM_AD(a);        \
  1771. X    p[7] = (byte_t) (d);                    \
  1772. X    p[8] = (byte_t) ((d) >> 8);                \
  1773. X}
  1774. X#define CDB10_RSV(a,d)    {                    \
  1775. X    register byte_t *p = (byte_t *) SCM_AD(a);        \
  1776. X    p[6] = (d);                        \
  1777. X}
  1778. X#define CDB10_CTL(a,d)    {                    \
  1779. X    register byte_t *p = (byte_t *) SCM_AD(a);        \
  1780. X    p[9] = (d);                        \
  1781. X}
  1782. X#define CDB12_BLK(a,d)    {                    \
  1783. X    register word16_t *p = (word16_t *)(void *) SCL_AD(a);    \
  1784. X    p[1] = (word16_t) (d);                    \
  1785. X    p[2] = (word16_t) ((d) >> 16);                \
  1786. X}
  1787. X#define CDB12_LEN(a,d)    {                    \
  1788. X    register word16_t *p = (word16_t *)(void *) SCL_AD(a);    \
  1789. X    p[3] = (word16_t) (d);                    \
  1790. X    p[4] = (word16_t) ((d) >> 16);                \
  1791. X}
  1792. X#define CDB12_RSV(a,d)    {                    \
  1793. X    register byte_t *p = (byte_t *) SCL_AD(a);        \
  1794. X    p[10] = (d);                        \
  1795. X}
  1796. X#define CDB12_CTL(a,d)    {                    \
  1797. X    register byte_t *p = (byte_t *) SCL_AD(a);        \
  1798. X    p[11] = (d);                        \
  1799. X}
  1800. X
  1801. X#endif    /* BYTE_ORDER == LITTLE_ENDIAN */
  1802. X
  1803. X#endif    /* !NO_ALIGN_LIMIT */
  1804. X
  1805. X
  1806. X#ifndef SCL_AD
  1807. X
  1808. X/* SCSI 12-byte CDB */
  1809. X#define SCL_AD(x)    ((byte_t *) (x) + 2)
  1810. X#define SCL_SZ        12
  1811. X
  1812. Xstruct scl {
  1813. X    unsigned int    sl_pad0:16;    /* pad for alignment */
  1814. X    unsigned int    sl_op:8;    /* Opcode */
  1815. X    unsigned int    sl_res1:5;    /* Reserved field */
  1816. X    unsigned int    sl_lun:3;    /* Logical unit number */
  1817. X
  1818. X    word32_t    sl_addr;    /* Block address */
  1819. X    word32_t    sl_len;        /* Transfer length */
  1820. X
  1821. X    byte_t        sl_res2;    /* Reserved field */
  1822. X    byte_t        sl_cont;    /* Control byte */
  1823. X};
  1824. X#endif    /* SCL_AD */
  1825. X
  1826. X
  1827. X/* SCSI Command Descriptor Block union */
  1828. Xunion scsi_cdb {
  1829. X    struct scs    scs;
  1830. X    struct scm    scm;
  1831. X    struct scl    scl;
  1832. X};
  1833. X
  1834. X#endif    /* i386 */
  1835. X
  1836. X#ifdef MOTOROLA
  1837. X/*
  1838. X *   Motorola 88k UNIX SVR4 support
  1839. X *
  1840. X *   This software fragment contains code that interfaces xmcd to
  1841. X *   the System V Release 4 operating system from Motorola.
  1842. X *   The name "Motorola" is used here for identification purposes.
  1843. X */
  1844. X
  1845. X#include <sys/param.h>
  1846. X#include <sys/dk.h>
  1847. X
  1848. X#ifndef OSI_MODULE
  1849. X#define OSI_MODULE
  1850. X#endif
  1851. X
  1852. X#endif    /* MOTOROLA */
  1853. X
  1854. X
  1855. X/* Public function prototypes */
  1856. Xbool_t    pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,
  1857. X        byte_t, byte_t, byte_t);
  1858. Xbool_t    pthru_open(char *);
  1859. Xvoid    pthru_close(void);
  1860. Xchar    *pthru_vers(void);
  1861. X
  1862. X#endif    /* SVR4 && !sun && !DEMO_ONLY */
  1863. X
  1864. X#endif    /* __LIB_SVR4_H__ */
  1865. X
  1866. END_OF_FILE
  1867. if test 5120 -ne `wc -c <'lib_svr4.h'`; then
  1868.     echo shar: \"'lib_svr4.h'\" unpacked with wrong size!
  1869. fi
  1870. # end of 'lib_svr4.h'
  1871. fi
  1872. if test -f 'lib_tosh.h' -a "${1}" != "-c" ; then 
  1873.   echo shar: Will not clobber existing file \"'lib_tosh.h'\"
  1874. else
  1875. echo shar: Extracting \"'lib_tosh.h'\" \(5199 characters\)
  1876. sed "s/^X//" >'lib_tosh.h' <<'END_OF_FILE'
  1877. X/*
  1878. X *   xmcd - Motif(tm) CD Audio Player
  1879. X *
  1880. X *   Copyright (C) 1993  Ti Kan
  1881. X *   E-mail: ti@amb.org
  1882. X *
  1883. X *   This program is free software; you can redistribute it and/or modify
  1884. X *   it under the terms of the GNU General Public License as published by
  1885. X *   the Free Software Foundation; either version 2 of the License, or
  1886. X *   (at your option) any later version.
  1887. X *
  1888. X *   This program is distributed in the hope that it will be useful,
  1889. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1890. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1891. X *   GNU General Public License for more details.
  1892. X *
  1893. X *   You should have received a copy of the GNU General Public License
  1894. X *   along with this program; if not, write to the Free Software
  1895. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1896. X *
  1897. X *   The name "Toshiba" is a trademark of Toshiba Corporation, and is
  1898. X *   used here for identification purposes.  This software and its
  1899. X *   author are not affiliated in any way with Toshiba.
  1900. X *
  1901. X */
  1902. X#ifndef __LIB_TOSH_H__
  1903. X#define __LIB_TOSH_H__
  1904. X
  1905. X#ifdef TOSHIBA
  1906. X
  1907. X#ifndef LINT
  1908. Xstatic char *_lib_tosh_h_ident_ = "@(#)lib_tosh.h    1.24 93/10/01";
  1909. X#endif
  1910. X
  1911. X#ifndef VUSUPPORT
  1912. X#define VUSUPPORT
  1913. X#endif
  1914. X
  1915. X
  1916. X/* Toshiba vendor-unique commands */
  1917. X#define OP_VT_AUDSRCH        0xc0    /* Toshiba audio track search */
  1918. X#define OP_VT_AUDPLAY        0xc1    /* Toshiba play audio */
  1919. X#define OP_VT_STILL        0xc2    /* Toshiba still */
  1920. X#define OP_VT_SETSTOP        0xc3    /* Toshiba set stop time */
  1921. X#define OP_VT_EJECT        0xc4    /* Toshiba caddy eject */
  1922. X#define OP_VT_RDSUBQ        0xc6    /* Toshiba read status */
  1923. X#define OP_VT_RDINFO        0xc7    /* Toshiba read disk info */
  1924. X#define OP_VT_RDMODE        0xc8    /* Toshiba read CDROM mode */
  1925. X
  1926. X
  1927. X/* Toshiba audio status codes */
  1928. X#define TAUD_PLAYING        0x00
  1929. X#define TAUD_PAUSED        0x01
  1930. X#define TAUD_SRCH_PAUSED    0x02
  1931. X#define TAUD_OTHER        0x03
  1932. X
  1933. X
  1934. X/* Return data lengths */
  1935. X#define SZ_VT_RDSUBQ        10    /* Toshiba read sub-code Q data size */
  1936. X#define SZ_VT_RDINFO        4    /* Toshiba read disc info data size */
  1937. X#define SZ_VT_RDMODE        1    /* Toshiba read cdrom mode data size */
  1938. X
  1939. X
  1940. X/* Toshiba read sub-code Q command data */
  1941. Xtypedef struct tsubq_data {
  1942. X    unsigned int    audio_status:8;    /* audio status */
  1943. X#if BYTE_ORDER == LITTLE_ENDIAN
  1944. X    unsigned int    preemph:1;    /* preemphasis */
  1945. X    unsigned int    copyallow:1;    /* digital copy allow */
  1946. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  1947. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  1948. X    unsigned int    reserved:4;    /* reserved */
  1949. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  1950. X    unsigned int    reserved:4;    /* reserved */
  1951. X    unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  1952. X    unsigned int    trktype:1;    /* 0=audio 1=data */
  1953. X    unsigned int    copyallow:1;    /* digital copy allow */
  1954. X    unsigned int    preemph:1;    /* preemphasis */
  1955. X#endif    /* BYTE_ORDER */
  1956. X    unsigned int    trkno:8;    /* track number (BCD) */
  1957. X    unsigned int    idxno:8;    /* index number (BCD) */
  1958. X
  1959. X    byte_t        rel_min;    /* trk relative minutes (BCD) */
  1960. X    byte_t        rel_sec;    /* trk relative seconds (BCD) */
  1961. X    byte_t        rel_frame;    /* trk relative frame (BCD) */
  1962. X    byte_t        abs_min;    /* absolute minutes (BCD) */
  1963. X
  1964. X    byte_t        abs_sec;    /* absolute seconds (BCD) */
  1965. X    byte_t        abs_frame;    /* absolute frame (BCD) */
  1966. X    byte_t        pad1[2];    /* pad for alignment */
  1967. X} tsubq_data_t;
  1968. X
  1969. X
  1970. X/* Toshiba read disc information command data */
  1971. Xtypedef struct tinfo_00 {        /* track information */
  1972. X    byte_t        first_trk;    /* first track (BCD) */
  1973. X    byte_t        last_trk;    /* last track (BCD) */
  1974. X    byte_t        reserved[2];    /* reserved */
  1975. X} tinfo_00_t;
  1976. X
  1977. Xtypedef struct tinfo_01 {        /* lead-out track starting time */
  1978. X    byte_t        min;        /* minutes (BCD) */
  1979. X    byte_t        sec;        /* seconds (BCD) */
  1980. X    byte_t        frame;        /* frame (BCD) */
  1981. X    byte_t        reserved;    /* reserved */
  1982. X} tinfo_01_t;
  1983. X
  1984. Xtypedef struct tinfo_02 {        /* specified track starting time */
  1985. X    byte_t        min;        /* minutes (BCD) */
  1986. X    byte_t        sec;        /* seconds (BCD) */
  1987. X    byte_t        frame;        /* frame (BCD) */
  1988. X    byte_t        reserved;    /* reserved */
  1989. X} tinfo_02_t;
  1990. X
  1991. X
  1992. X/* Argument of Toshiba audio search and play audio commands */
  1993. Xtypedef struct taudio_arg {
  1994. X    union {                /* address */
  1995. X        word32_t    tp_00;    /* absolute logical blk addr */
  1996. X#if BYTE_ORDER == LITTLE_ENDIAN
  1997. X        struct {
  1998. X            byte_t    res;    /* reserved */
  1999. X            byte_t    frame;    /* frame (BCD) */
  2000. X            byte_t    sec;    /* seconds (BCD) */
  2001. X            byte_t    min;    /* minutes (BCD) */
  2002. X        } tp_01;
  2003. X        struct {
  2004. X            byte_t    res[3];    /* reserved */
  2005. X            byte_t    track;    /* track number (BCD) */
  2006. X        } tp_10;
  2007. X#else    /* BYTE_ORDER == BIG_ENDIAN */
  2008. X        struct {
  2009. X            byte_t    min;    /* minutes (BCD) */
  2010. X            byte_t    sec;    /* seconds (BCD) */
  2011. X            byte_t    frame;    /* frame (BCD) */
  2012. X            byte_t    res;    /* reserved */
  2013. X        } tp_01;
  2014. X        struct {
  2015. X            byte_t    track;    /* track number (BCD) */
  2016. X            byte_t    res[3];    /* reserved */
  2017. X        } tp_10;
  2018. X#endif    /* BYTE_ORDER */
  2019. X    } _addr;
  2020. X} taudio_arg_t;
  2021. X
  2022. X#define    addr_logical    _addr.tp_00
  2023. X#define    addr_min    _addr.tp_01.min
  2024. X#define    addr_sec    _addr.tp_01.sec
  2025. X#define    addr_frame    _addr.tp_01.frame
  2026. X#define    addr_track    _addr.tp_10.track
  2027. X
  2028. X
  2029. X/* Public function prototypes */
  2030. Xbool_t    tosh_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  2031. X        byte_t, byte_t);
  2032. Xbool_t    tosh_pause_resume(bool_t);
  2033. Xbool_t    tosh_get_playstatus(curstat_t *, byte_t *);
  2034. Xbool_t    tosh_get_toc(curstat_t *);
  2035. Xbool_t    tosh_mute(bool_t);
  2036. Xbool_t    tosh_eject(void);
  2037. Xvoid    tosh_init(void);
  2038. Xvoid    tosh_halt(void);
  2039. X
  2040. X#endif    /* TOSHIBA */
  2041. X
  2042. X#endif    /* __LIB_TOSH_H__ */
  2043. X
  2044. END_OF_FILE
  2045. if test 5199 -ne `wc -c <'lib_tosh.h'`; then
  2046.     echo shar: \"'lib_tosh.h'\" unpacked with wrong size!
  2047. fi
  2048. # end of 'lib_tosh.h'
  2049. fi
  2050. echo shar: End of archive 3 \(of 13\).
  2051. cp /dev/null ark3isdone
  2052. MISSING=""
  2053. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  2054.     if test ! -f ark${I}isdone ; then
  2055.     MISSING="${MISSING} ${I}"
  2056.     fi
  2057. done
  2058. if test "${MISSING}" = "" ; then
  2059.     echo You have unpacked all 13 archives.
  2060.     echo "Now read the README and INSTALL files for further instructions."
  2061.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2062. else
  2063.     echo You still need to unpack the following archives:
  2064.     echo "        " ${MISSING}
  2065. fi
  2066. ##  End of shell archive.
  2067. exit 0
  2068. -- 
  2069.     ///  Ti Kan                vorsprung durch technik
  2070.    ///   AMB Research Laboratories, Sunnyvale, CA. USA
  2071.   ///    ti@amb.org
  2072.  //////  ...!{decwrl,synopsys,tandem,tsoft,ultra}!sgiblab!bazooka!ti
  2073. ///      ...!uunet!bazooka!ti
  2074.  
  2075.  
  2076.  
  2077. exit 0 # Just in case...
  2078. -- 
  2079.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  2080. \X/  Amiga: The only way to fly!  |    sources-x@sterling.com
  2081.        "It's intuitively obvious to the most casual observer..."
  2082.  GCS d++(--) -p+ c++ !l u++ e+ m+(-) s++/++ n h--- f+ g+++ w+ t++ r+ y+
  2083.