AUDIO PLAYER : When I was playing some .wav files I have, I noticed something odd aboutthe File Open dialog box in the Audio Player, namely that it won't displayany file with multiple consecutive dots in its name.Thinking that the 2.1ga common file open dialog box might be broken, Itried this in other programs (ie. the system editor). Nope, no problemshere. The problem strictly occurs in the Audio player. If you load thefiles by double clicking on their icon, that works fine, too. It does not matter where in the name the multiple dots are, just that theyare consecutive (ie KnightsWhoSay...wav, or fred..tom.wav).The Audio player from the December beta MMPM recognises these files justfine. It is only the Audio player under 2.1ga that is broken. Has anyone else noticed this and reported it?Why on earth would the Audio player not use the system common file dialog? I've never met a programmer before who wanted to make their life _more_difficult! AUDIO PLAYER : Submitted-by: (Ti Kan)Posting-number: Volume 21, Issue 72Archive-name: xmcd/part10Environment: X11, OSF/Motif#! /bin/sh# This is a shell archive. Remove anything before this line, then unpack# it by saving it into a file and typing "sh file". To overwrite existing# files, type "sh file -c". You can also feed this as standard input via# unshar, or by typing "sh 'lib_svr4.c' X#include "xmcd.h"X#include "util.h"X#include "cdfunc.h"X#include "lib_scsipt.h"XX#if defined(SVR4) && !defined(sun) && !defined(SIMULATED_CDROM)XXXextern AppData app_data;Xextern bool_t notrom_error;XX#ifndef LINTXbool_t lib_svr4 = TRUE;X#endifXXSTATIC int fd = -1; /* Passthrough device file desc */XXX#ifdef i386X/*X * Intel x86 UNIX SVR4 supportX * Portable Device Interface/SCSI Device InterfaceX *X * This software fragment contains code that interfaces xmcd toX * the UNIX System V Release 4 operating system for the IntelX * x86 hardware platforms from UNIX System Laboratories.X * The name "USL", "UNIX" and "Intel" are used here forX * identification purposes. This software and its author areX * not affiliated with USL or Intel.X */XXXSTATIC char ptpath[FILE_PATH_SZ] = { '\0' };X /* Passthrough device path */XSTATIC req_sense_data_t sense_data; /* Request sense data buffer */XXX/*X * pthru_sendX * Build SCSI CDB and sent command to the device.X *X * Args:X * opcode - SCSI command opcodeX * addr - The "address" portion of the SCSI CDBX * buf - Pointer to data bufferX * size - Number of bytes to transferX * rsvd - The "reserved" portion of the SCSI CDBX * length - The "length" portion of the SCSI CDBX * param - The "param" portion of the SCSI CDBX * control - The "control" portion of the SCSI CDBX * rw - Data transfer direction flag (READ_OP or WRITE_OP)X *X * Return:X * TRUE - command completed successfullyX * FALSE - command failedX */Xbool_tXpthru_send(X byte_t opcode,X word32_t addr,X byte_t *buf,X word32_t size,X byte_t rsvd,X word32_t length,X byte_t param,X byte_t control,X byte_t rwX)X{X struct sb sb;X struct scb *scbp;X union scsi_cdb cdb;X X if (fd sc_cmdpt = (caddr_t) SCL_AD(&cdb);X scbp->sc_cmdsz = SCL_SZ;X break;XX case 0xc0:X case 0xd0:X case 0x20:X case 0x30:X case 0x40:X /* 10-byte commands */X cdb.scm.sm_op = opcode;X cdb.scm.sm_res1 = param;X cdb.scm.sm_lun = 0;X CDB10_BLK(&cdb.scm, bswap32(addr));X CDB10_LEN(&cdb.scm, bswap16((word16_t) length));X CDB10_RSV(&cdb.scm, rsvd);X CDB10_CTL(&cdb.scm, control);XX scbp->sc_cmdpt = (caddr_t) SCM_AD(&cdb);X scbp->sc_cmdsz = SCM_SZ;X break;XX case 0x00:X case 0x10:X /* 6-byte commands */X cdb.scs.ss_op = opcode;X cdb.scs.ss_addr1 = param;X cdb.scs.ss_lun = 0;X CDB6_BLK(&cdb.scs, bswap16((word16_t) addr));X CDB6_LEN(&cdb.scs, (byte_t) length);X CDB6_CTL(&cdb.scs, control);XX scbp->sc_cmdpt = (caddr_t) SCS_AD(&cdb);X scbp->sc_cmdsz = SCS_SZ;X break;XX default:X if (app_data.scsierr_msg)X fprintf(stderr, "0x%02x: Unknown SCSI opcode\n",X opcode);X return(FALSE);X }XX#ifdef DEBUGX {X byte_t *p = (byte_t *) scbp->sc_cmdpt;X int i;XX fprintf(stderr, "\nSCSI CDB bytes:");X for (i = 0; i sc_cmdsz; i++, p++)X fprintf(stderr, " %02x", i, *p);X fprintf(stderr, "\n");X }X#endifXX /* set up scsicmd */X scbp->sc_datapt = (caddr_t) buf;X scbp->sc_datasz = size;X scbp->sc_mode = (rw == READ_OP) ? SCB_READ : SCB_WRITE;XX /* Send the command down via the "pass-through" interface */X if (ioctl(fd, SDI_SEND, &sb) sc_comp_code != SDI_ASW) {X if (opcode != OP_S_TEST && app_data.scsierr_msg) {X fprintf(stderr, "%s: %s %s:\n%s=0x%x %s=0x%x %s=0x%x",X PROGNAME,X "SCSI command fault on",X app_data.device,X "Opcode",X opcode,X "Completion_code",X scbp->sc_comp_code,X "Target_status",X scbp->sc_status);X }XX /* Send Request Sense command */X cdb.scs.ss_op = OP_S_RSENSE;X cdb.scs.ss_addr1 = 0;X cdb.scs.ss_lun = 0;X CDB6_BLK(&cdb.scs, 0);X CDB6_LEN(&cdb.scs, SZ_RSENSE);X CDB6_CTL(&cdb.scs, 0);X scbp->sc_datapt = (caddr_t) AD_RSENSE(&sense_data);X scbp->sc_datasz = SZ_RSENSE;X scbp->sc_mode = SCB_READ;X scbp->sc_cmdpt = (caddr_t) SCS_AD(&cdb);X scbp->sc_cmdsz = SCS_SZ;XX if (ioctl(fd, SDI_SEND, &sb) = 0) {X close(fd);X fd = -1;X }XX if (ptpath[0] != '\0')X unlink(ptpath);X}XXX/*X * pthru_versX * Return OS Interface Module version stringX *X * Args:X * Nothing.X *X * Return:X * Module version text string.X */Xchar *Xpthru_vers(void)X{X static char vers[STR_BUF_SZ];XX sprintf(vers, "OS Interface module v%s (for UNIX SVR4-PDI/x86)\n",X OSI_VERS);X return(vers);X}XX#endif /* i386 */XX#ifdef MOTOROLAX/*X * Motorola 88k UNIX SVR4 supportX * Contributing author: Mark ScottX * E-mail: X *X * Note: Audio CDs sometimes produce "Blank check" warnings on the console, X * just ignore these.X *X * This software fragment contains code that interfaces xmcd toX * the System V Release 4 operating system from Motorola.X * The name "Motorola" is used here for identification purposes.X */XXX/*X * pthru_sendX * Build SCSI CDB and sent command to the device.X *X * Args:X * opcode - SCSI command opcodeX * addr - The "address" portion of the SCSI CDBX * buf - Pointer to data bufferX * size - Number of bytes to transferX * rsvd - The "reserved" portion of the SCSI CDBX * length - The "length" portion of the SCSI CDBX * param - The "param" portion of the SCSI CDBX * control - The "control" portion of the SCSI CDBX * rw - Data transfer direction flag (READ_OP or WRITE_OP)X *X * Return:X * TRUE - command completed successfullyX * FALSE - command failedX */Xbool_tXpthru_send(X byte_t opcode,X word32_t addr,X byte_t *buf,X word32_t size,X byte_t rsvd,X word32_t length,X byte_t param,X byte_t control,X byte_t rwX)X{X char scsistat = '\0',X *tmpbuf;X int cdb_l = 0,X i;X long residual = 0L;X unsigned long errinfo = 0L,X ccode = 0L;X struct scsi_pass spass,X *sp = &spass;X struct ext_sense sense,X *esp = &sense;XX if (fd resid = &residual;X sp->sense_data = esp;X sp->status = &scsistat;X sp->error_info = &errinfo;X sp->ctlr_code = &ccode;X sp->xfer_len = (unsigned long) size;XX /* Align on a page boundary */X tmpbuf = NULL;X if (sp->xfer_len > 0) {X tmpbuf = (char *) MEM_ALLOC(2 * NBPP);X sp->data = tmpbuf;X sp->data += NBPP - ((unsigned int) sp->data & (NBPP - 1));X }X elseX sp->data = tmpbuf;XXX if (rw == WRITE_OP && sp->xfer_len > 0) /* Write operation */X memcpy(sp->data, buf, sp->xfer_len);XX /* Set up SCSI CDB */X switch (opcode & SPT_CDB_LEN) {X case 0xa0:X case 0xe0:X /* 12-byte commands */X cdb_l = 0xc0;X sp->cdb[0] = opcode;X sp->cdb[1] = param;X sp->cdb[2] = (addr >> 24) & 0xff;X sp->cdb[3] = (addr >> 16) & 0xff;X sp->cdb[4] = (addr >> 8) & 0xff;X sp->cdb[5] = (addr & 0xff);X sp->cdb[6] = (length >> 24) & 0xff;X sp->cdb[7] = (length >> 16) & 0xff;X sp->cdb[8] = (length >> 8) & 0xff;X sp->cdb[9] = length & 0xff;X sp->cdb[10] = rsvd;X sp->cdb[11] = control;X break;XX case 0xc0:X case 0xd0:X case 0x20:X case 0x30:X case 0x40:X /* 10-byte commands */X cdb_l = 0xa0;X sp->cdb[0] = opcode;X sp->cdb[1] = param;X sp->cdb[2] = (addr >> 24) & 0xff;X sp->cdb[3] = (addr >> 16) & 0xff;X sp->cdb[4] = (addr >> 8) & 0xff;X sp->cdb[5] = addr & 0xff;X sp->cdb[6] = rsvd;X sp->cdb[7] = (length >> 8) & 0xff;X sp->cdb[8] = length & 0xff;X sp->cdb[9] = control;X break;XX case 0x00:X case 0x10:X /* 6-byte commands */X cdb_l = 0x60;X sp->cdb[0] = opcode;X sp->cdb[1] = param;X sp->cdb[2] = (addr >> 8) & 0xff;X sp->cdb[3] = addr & 0xff;X sp->cdb[4] = length & 0xff;X sp->cdb[5] = control;X break;XX default:X if (app_data.scsierr_msg)X fprintf(stderr, "0x%02x: Unknown SCSI opcode\n",X opcode);X if (tmpbuf != NULL)X MEM_FREE(tmpbuf);XX return(FALSE);X }XXX /* Check CDB length & flags */XX if (!SPT_CHK_CDB_LEN(cdb_l))X fprintf(stderr, "%d: invalid CDB length\n", cdb_l);XX sp->flags = cdb_l | SPT_ERROR_QUIET;X if (rw == READ_OP)X sp->flags |= SPT_READ;XX if (SPT_CHK_FLAGS(cdb_l))X fprintf(stderr, "0x%2x: bad CDB flags\n", sp->flags);XXX /* Send the command down via the "pass-through" interface */X if (ioctl(fd, DKPASSTHRU, sp) error_info != SPTERR_NONE) {X if (*sp->error_info != SPTERR_SCSI &&X *sp->status != 2 &&X opcode != OP_S_TEST) {X /* Request Sense is done automatically by the driver */XX fprintf(stderr, "%s %s\n",X "xmcd SCSI command fault on",X app_data.device);XX fprintf(stderr,X "00-01-02-03-04-05-06-07-08-09-10-1 1\n");X for (i = 0; i cdb[i]);XX fprintf(stderr,X "\nxfer_len=%d errinfo=%d ctlr_code=%d ",X sp->xfer_len,X *sp->error_info,X *sp->ctlr_code);X fprintf(stderr, "status=%d resid=%d\n",X *sp->status,X *sp->resid);X }X if (tmpbuf != NULL)X MEM_FREE(tmpbuf);XX return(FALSE);X }XX /* pass the data back to caller */X if (sp->xfer_len > 0 && rw == READ_OP) /* read operation */X memcpy(buf, sp->data, sp->xfer_len);XX if (tmpbuf != NULL)X MEM_FREE(tmpbuf);XX return(TRUE);X}XXX/*X * pthru_openX * Open SCSI passthrough deviceX *X * Args:X * path - device path name stringX *X * Return:X * TRUE - open successfulX * FALSE - open failedX */Xbool_tXpthru_open(char *path)X{X struct stat stbuf;X char errstr[STR_BUF_SZ];XX /* Check for validity of device node */X if (stat(path, &stbuf) = 0) {X close(fd);X fd = -1;X }X}XXX/*X * pthru_versX * Return OS Interface Module version stringX *X * Args:X * Nothing.X *X * Return:X * Module version text string.X */Xchar *Xpthru_vers(void)X{X static char vers[STR_BUF_SZ];XX sprintf(vers, "OS Interface module v%s (for UNIX SVR4-m88k)\n",X OSI_VERS);X return(vers);X}XX#endif /* MOTOROLA */XX#else /* !SVR4 || sun || SIMULATED_CDROM */XX#ifndef LINTXbool_t lib_svr4 = FALSE;X#endifXX#endif /* SVR4 sun SIMULATED_CDROM */XEND_OF_FILEif test 13997 -ne `wc -c 'lib_tosh.c' X#include "xmcd.h"X#include "util.h"X#include "cdfunc.h"X#include "lib_scsipt.h"XX#ifdef TOSHIBAXXX#ifndef LINTXbool_t lib_tosh = TRUE;X#endifXXSTATIC bool_t tosh_audio_muted = FALSE; /* Is audio muted? */XXX/*X * tosh_playaudioX * Play audio function: send vendor-unique play audio commandX * to the drive.X *X * Args:X * addr_fmt - Flags indicating which address formats are passed inX * If ADDR_BLK, then:X * start_addr - The logical block starting addressX * end_addr - The logical block ending addressX * If ADD_MSF, then:X * start_msf - Pointer to the starting MSF address structureX * end_msf - Pointer to the ending MSF address structureX * If ADDR_TRKIDX, then:X * trk - The starting track numberX * idx - The starting index numberX * If ADDR_OPTEND, then the ending address, if specified, can beX * ignored if possible.X *X * Return:X * TRUE - successX * FALSE - failureX */X/*ARGSUSED*/Xbool_tXtosh_playaudio(X byte_t addr_fmt,X word32_t start_addr,X word32_t end_addr,X msf_t *start_msf,X msf_t *end_msf,X byte_t trk,X byte_t idxX)X{X bool_t ret = FALSE;X word32_t addr = 0;X taudio_arg_t *p;XX p = (taudio_arg_t *) &addr;XX if (!ret && addr_fmt & ADDR_MSF) {X if (addr_fmt & ADDR_OPTEND) {X /* Position laser head at desired locationX * and start play.X */X p->addr_min = (byte_t) ltobcd(start_msf->min);X p->addr_sec = (byte_t) ltobcd(start_msf->sec);X p->addr_frame = (byte_t) ltobcd(start_msf->frame);XX ret = pthru_send(X OP_VT_AUDSRCH,X addr, NULL, 0, 0, 0,X 0x1, 0x1 addr_min = (byte_t) ltobcd(start_msf->min);X p->addr_sec = (byte_t) ltobcd(start_msf->sec);X p->addr_frame = (byte_t) ltobcd(start_msf->frame);XX if (!pthru_send(OP_VT_AUDSRCH,X addr, NULL, 0, 0, 0,X 0x0, 0x1 addr_min = (byte_t) ltobcd(end_msf->min);X p->addr_sec = (byte_t) ltobcd(end_msf->sec);X p->addr_frame = (byte_t) ltobcd(end_msf->frame);XX ret = pthru_send(X OP_VT_AUDPLAY,X addr, NULL, 0, 0, 0,X (byte_t) (tosh_audio_muted ? 0x0 : 0x3),X 0x1 addr_logical = start_addr;XX ret = pthru_send(X OP_VT_AUDSRCH,X addr, NULL, 0, 0, 0,X 0x1, 0x0, READ_OPX );X }X else {X /* Position laser head at desired location */X p->addr_logical = start_addr;XX if (!pthru_send(OP_VT_AUDSRCH,X addr, NULL, 0, 0, 0,X 0x0, 0x0, READ_OP))X return(FALSE);XX /* Specify end location, muting, and start play */X p->addr_logical = end_addr;XX ret = pthru_send(X OP_VT_AUDPLAY,X addr, NULL, 0, 0, 0,X (byte_t) (tosh_audio_muted ? 0x0 : 0x3),X 0x0, READ_OPX );X }X }XX return(ret);X}XXX/*X * tosh_pause_resumeX * Pause/resume function: send vendor-unique commands to implementX * the pause and resume capability.X *X * Args:X * resume - TRUE: resume, FALSE: pauseX *X * Return:X * TRUE - successX * FALSE - failureX */Xbool_tXtosh_pause_resume(bool_t resume)X{X if (resume) {X return(X pthru_send(X OP_VT_AUDPLAY, 0, NULL, 0, 0, 0,X (byte_t) (tosh_audio_muted ? 0x0 : 0x3),X 0x3 trkno);X if (s->cur_trk != trkno) {X s->cur_trk = trkno;X dpy_track(s);X }XX idxno = bcdtol((word32_t) d->idxno);X if (s->cur_idx != idxno) {X s->cur_idx = idxno;X s->sav_iaddr = s->cur_tot_addr;X dpy_index(s);X }XX if ((i = curtrk_pos(s)) >= 0)X s->trkinfo[i].type = (d->trktype == 0) ? TYP_AUDIO : TYP_DATA;XX s->cur_tot_min = (byte_t) bcdtol(d->abs_min);X s->cur_tot_sec = (byte_t) bcdtol(d->abs_sec);X s->cur_tot_frame = (byte_t) bcdtol(d->abs_frame);X s->cur_trk_min = (byte_t) bcdtol(d->rel_min);X s->cur_trk_sec = (byte_t) bcdtol(d->rel_sec);X s->cur_trk_frame = (byte_t) bcdtol(d->rel_frame);X msftoblk(X s->cur_tot_min, s->cur_tot_sec, s->cur_tot_frame,X &s->cur_tot_addr, MSF_OFFSET(s)X );X msftoblk(X s->cur_trk_min, s->cur_trk_sec, s->cur_trk_frame,X &s->cur_trk_addr, 0X );XX /* Translate Toshiba audio status to SCSI-2 audio status */X switch (d->audio_status) {X case TAUD_PLAYING:X *audio_status = AUDIO_PLAYING;X break;XX case TAUD_SRCH_PAUSED:X case TAUD_PAUSED:X *audio_status = AUDIO_PAUSED;X break;XX case TAUD_OTHER:X *audio_status = AUDIO_COMPLETED;X break;X }XX return(TRUE);X}XXX/*X * tosh_get_tocX * Send vendor-unique command to obtain the disc table-of-contentsX *X * Args:X * s - Pointer to the curstat_t structure, which contains the TOCX * table to be updated.X *X * Return:X * TRUE - successX * FALSE - failureX */Xbool_tXtosh_get_toc(curstat_t *s)X{X int i,X j;X byte_t buf[SZ_VT_RDINFO];X tinfo_00_t *t0;X tinfo_01_t *t1;X tinfo_02_t *t2;XXX memset(buf, (byte_t) 0, sizeof(buf));XX /* Find number of tracks */X if (!pthru_send(OP_VT_RDINFO, 0, buf, SZ_VT_RDINFO,X 0, 0, 0, 0, READ_OP))X return(FALSE);XX t0 = (tinfo_00_t *) buf;X s->first_trk = (byte_t) bcdtol(t0->first_trk);X s->last_trk = (byte_t) bcdtol(t0->last_trk);XX /* Get the starting position of each track */X for (i = 0, j = (int) s->first_trk; j last_trk; i++, j++) {X memset(buf, (byte_t) 0, sizeof(buf));XX if (!pthru_send(OP_VT_RDINFO, ltobcd(j) trkinfo[i].trkno = j;X s->trkinfo[i].min = (byte_t) bcdtol(t2->min);X s->trkinfo[i].sec = (byte_t) bcdtol(t2->sec);X s->trkinfo[i].frame = (byte_t) bcdtol(t2->frame);X msftoblk(X s->trkinfo[i].min,X s->trkinfo[i].sec,X s->trkinfo[i].frame,X &s->trkinfo[i].addr,X MSF_OFFSET(s)X );X }X s->tot_trks = (byte_t) i;XX memset(buf, (byte_t) 0, sizeof(buf));XX /* Get the lead out track position */X if (!pthru_send(OP_VT_RDINFO, 0,X buf, SZ_VT_RDINFO, 0, 0, 1,X 0, READ_OP))X return(FALSE);XX t1 = (tinfo_01_t *) buf;XX s->trkinfo[i].trkno = LEAD_OUT_TRACK;X s->tot_min = s->trkinfo[i].min = (byte_t) bcdtol(t1->min);X s->tot_sec = s->trkinfo[i].sec = (byte_t) bcdtol(t1->sec);X s->tot_frame = s->trkinfo[i].frame = (byte_t) bcdtol(t1->frame);X msftoblk(X s->trkinfo[i].min,X s->trkinfo[i].sec,X s->trkinfo[i].frame,X &s->trkinfo[i].addr,X MSF_OFFSET(s)X );X s->tot_addr = s->trkinfo[i].addr;XX return(TRUE);X}XXX/*X * tosh_muteX * Send vendor-unique command to mute/unmute the audioX *X * Args:X * mute - TRUE: mute audio, FALSE: unmute audioX *X * Return:X * TRUE - successX * FALSE - failureX */Xbool_tXtosh_mute(bool_t mute)X{X curstat_t *s = curstat_addr();XX if (tosh_audio_muted != mute) {X switch (s->mode) {X case M_NODISC:X case M_STOP:X case M_PAUSE:X break;XX default:X if (!pthru_send(OP_VT_AUDPLAY, 0, NULL, 0, 0, 0,X (byte_t) (mute ? 0x0 : 0x3),X 0x3 'main.c' X#include "xmcd.h"X#include "resource.h"X#include "util.h"X#include "widget.h"X#include "cdfunc.h"X#include "cdlib.h"XXX/* Global data */Xchar *progname; /* The path name we are invoked with */Xbool_t exit_flag; /* Flag indicating end of application */XAppData app_data; /* Options data */Xwidgets_t widgets; /* Holder of all widgets */Xpixmaps_t pixmaps; /* Holder of all pixmaps */XX/* Data global to this module only */XSTATIC curstat_t status; /* Current CD player status */XXX/*X * mainX * The main functionX */XvoidXmain(int argc, char **argv)X{X XtAppContext app;X XEvent ev;XX /* Initialize variables */X progname = argv[0];X exit_flag = FALSE;XX /* Handle some signals */X signal(SIGINT, onsig);X signal(SIGHUP, onsig);X signal(SIGTERM, onsig);XX /* Initialize X toolkit */X widgets.toplevel = XtVaAppInitialize(X &app,X "XMcd",X options, XtNumber(options),X &argc, argv,X fallbacks,X XmNmappedWhenManaged, False,X NULLX );XX /* Get application options */X XtVaGetApplicationResources(X widgets.toplevel,X (XtPointer) &app_data,X resources,X XtNumber(resources),X NULLX );X X /* Check command line for unknown arguments */X if (argc > 1) {X usage(argc, argv);X exit(1);X }XX /* Create all widgets */X create_widgets(&widgets);XX /* Configure resources before realizing widgets */X pre_realize_config(&widgets);XX /* Display widgets */X XtRealizeWidget(widgets.toplevel);XX /* Configure resources after realizing widgets */X post_realize_config(&widgets, &pixmaps);XX /* Register callback routines */X register_callbacks(&widgets, &status);XX /* Initialize and start various subsystems */X cd_init(&status);X cd_start(&status);XX /* Make the main window visible */X XtMapWidget(widgets.toplevel);XX /* Event processing loop */X while (!exit_flag) {X XtAppNextEvent(app, &ev);X XtDispatchEvent(&ev);X }XX exit(0);X}XXX/*X * curstat_addrX * Return the address of the curstat_t structure.X *X * Args:X * Nothing.X *X * Return:X * Nothing.X */Xcurstat_t *Xcurstat_addr(void)X{X return(&status);X}END_OF_FILEif test 2954 -ne `wc -c 'util.c' > 4) * 10));X}XXX/*X * stobX * String to boolean conversion routineX *X * Args:X * s - text string "True", "true", "False" or "false"X *X * Return:X * Boolean value representing the stringX */Xbool_tXstob(char *s)X{X if (strcmp(s, "True") == 0 || strcmp(s, "true") == 0 ||X strcmp(s, "TRUE") == 0)X return(TRUE);XX return(FALSE);X}XXX/*X * basenameX * Return the basename of a file pathX *X * Args:X * path - The file path stringX *X * Return:X * The basename stringX */Xchar *Xbasename(char *path)X{X char *p;XX if ((p = strrchr(path, '/')) == NULL)X return(path);X X return(p + 1);X}XXX/*X * dirnameX * Return the dirname of a file pathX *X * Args:X * path - The file path stringX *X * Return:X * The dirname stringX */Xchar *Xdirname(char *path)X{X char *p;X static char buf[FILE_PATH_SZ];XX if ((int) strlen(path) >= FILE_PATH_SZ)X /* Error: path name too long */X return(NULL);XX strcpy(buf, path);XX if ((p = strrchr(buf, '/')) == NULL)X return(buf);X X *p = '\0';X return(buf);X}XXX/*X * homedirX * Return the home directory path of a user given the uidX *X * Args:X * uid - The uid of the userX *X * Return:X * The home directory path name stringX */Xchar *Xhomedir(uid_t uid)X{X struct passwd *pw;X char *cp;XX /* Get home directory from the password file if possible */X if ((pw = getpwuid(uid)) != NULL)X return(pw->pw_dir);XX /* Try the HOME environment variable */X if ((cp = getenv("HOME")) != NULL)X return(cp);XX /* If we still can't get the home directory, just set it to theX * current directory (shrug).X */X return(".");X}XXX/*X * isqrtX * Fast integer-based square root routineX *X * Args:X * n - The integer value whose square-root is to be takenX *X * Return:X * Resultant square-root integer valueX */XintXisqrt(int n)X{X int a, b, c, as, bs;XX a = 1;X b = 1;X while (a 1 && n > 0) {X a = a >> 2;X b = b >> 1;X c = n - (as | a);X if (c >= 0) {X n = c;X as |= (a >= 1;X }XX return(bs);X}XXX/*X * blktomsfX * CD logical block to MSF conversion routineX *X * Args:X * blk - The logical block addressX * ret_min - Minute (return)X * ret_sec - Second (return)X * ret_frame - Frame (return)X * offset - Additional logical block address offsetX *X * Return:X * Nothing.X */XvoidXblktomsf(word32_t blk, byte_t *ret_min, byte_t *ret_sec, byte_t *ret_frame,X word32_t offset)X{X *ret_min = (blk + offset) / FRAME_PER_SEC / 60;X *ret_sec = ((blk + offset) / FRAME_PER_SEC) % 60;X *ret_frame = (blk + offset) % FRAME_PER_SEC;X}XXX/*X * msftoblkX * CD MSF to logical block conversion routineX *X * Args:X * min - MinuteX * sec - SecondX * frame - FrameX * ret_blk - The logical block address (return)X * offset - Additional logical block address offsetX *X * Return:X * Nothing.X */XvoidXmsftoblk(byte_t min, byte_t sec, byte_t frame, word32_t *ret_blk,X word32_t offset)X{X *ret_blk = FRAME_PER_SEC * (min * 60 + sec) + frame - offset;X}XXX/*X * bswap16X * 16-bit little-endian to big-endian byte-swap routine.X * On a big-endian system architecture this routines has no effect.X *X * Args:X * x - The data to be swappedX *X * Return:X * The swapped data.X */Xword16_tXbswap16(word16_t x)X{X#if BYTE_ORDER == LITTLE_ENDIANX word16_t ret;XX ret = (x & 0x00ff) > 8;X return(ret);X#elseX return(x);X#endifX}XXX/*X * bswap24X * 24-bit little-endian to big-endian byte-swap routine.X * On a big-endian system architecture this routines has no effect.X *X * Args:X * x - The data to be swappedX *X * Return:X * The swapped data.X */Xword32_tXbswap24(word32_t x)X{X#if BYTE_ORDER == LITTLE_ENDIANX word32_t ret;XX ret = (x & 0x0000ff) > 16;X return(ret);X#elseX return(x);X#endifX}XXX/*X * bswap32X * 32-bit little-endian to big-endian byte-swap routine.X * On a big-endian system architecture this routines has no effect.X *X * Args:X * x - The data to be swappedX *X * Return:X * The swapped data.X */Xword32_tXbswap32(word32_t x)X{X#if BYTE_ORDER == LITTLE_ENDIANX word32_t ret;XX ret = (x & 0x000000ff) > 8;X ret |= (x & 0xff000000) >> 24;X return(ret);X#elseX return(x);X#endifX}XXX/*X * lswap16X * 16-bit big-endian to little-endian byte-swap routine.X * On a little-endian system architecture this routines has no effect.X *X * Args:X * x - The data to be swappedX *X * Return:X * The swapped data.X */Xword16_tXlswap16(word16_t x)X{X#if BYTE_ORDER == LITTLE_ENDIANX return(x);X#elseX word16_t ret;XX ret = (x & 0x00ff) > 8;X return(ret);X#endifX}XXX/*X * lswap24X * 24-bit big-endian to little-endian byte-swap routine.X * On a little-endian system architecture this routines has no effect.X *X * Args:X * x - The data to be swappedX *X * Return:X * The swapped data.X */Xword32_tXlswap24(word32_t x)X{X#if BYTE_ORDER == LITTLE_ENDIANX return(x);X#elseX word32_t ret;XX ret = (x & 0x0000ff) > 16;X return(ret);X#endifX}XXX/*X * lswap32X * 32-bit big-endian to little-endian byte-swap routine.X * On a little-endian system architecture this routines has no effect.X *X * Args:X * x - The data to be swappedX *X * Return:X * The swapped data.X */Xword32_tXlswap32(word32_t x)X{X#if BYTE_ORDER == LITTLE_ENDIANX return(x);X#elseX word32_t ret;XX ret = (x & 0x000000ff) > 8;X ret |= (x & 0xff000000) >> 24;X return(ret);X#endifX}XXX/* Debugging routines */XX#ifdef DEBUGXXFILE *Xdbfile_open(char *path)X{X return(fopen(path, "w"));X}XXintXdbfile_close(FIL E *fp)X{X return(fclose(fp));X}XXvoidXdbfile_dump( FILE *fp, char *title, byte_t data[], int len)X{X int i;XX if (fp == NULL)X return;XX fprintf(fp, "\n%s", title);XX for (i = 0; i 'bitmaps/ab.xbm' 'bitmaps/btnlbl.xbm' 'bitmaps/dbprog.xbm' 'bitmaps/eject.xbm' 'bitmaps/ff.xbm' 'bitmaps/help.xbm' 'bitmaps/keypad.xbm' 'bitmaps/lock.xbm' 'bitmaps/logo.xbm' 'bitmaps/nextidx.xbm' 'bitmaps/nexttrk.xbm' 'bitmaps/playpaus.xbm' 'bitmaps/poweroff.xbm' 'bitmaps/previdx.xbm' 'bitmaps/prevtrk.xbm' 'bitmaps/repeat.xbm' 'bitmaps/rew.xbm' 'bitmaps/sample.xbm' 'bitmaps/shuffle.xbm' 'bitmaps/stop.xbm' 'bitmaps/time.xbm' 'bitmaps/xmcd.xbm' <<'END_OF_FILE'X/*X * xmcd - Motif(tm) CD Audio PlayerX *X * Copyright (C) 1993 Ti KanX * E-mail: X *X * This program is free software; you can redistribute it and/or modifyX * it under the terms of the GNU General Public License as published byX * the Free Software Foundation; either version 2 of the License, orX * (at your option) any later version.X *X * This program is distributed in the hope that it will be useful,X * but WITHOUT ANY WARRANTY; without even the implied warranty ofX * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theX * GNU General Public License for more details.X *X * You should have received a copy of the GNU General Public LicenseX * along with this program; if not, write to the Free SoftwareX * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.X *X */X#ifndef LINTXstatic char *_xmcd_xbm_ident_ = 1.6 93/09/28";X#endifXX#define xmcd_width 40X#define xmcd_height 40Xstatic unsigned char xmcd_bits[] = {X 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0x00, 0x18,X 0xff, 0x31, 0x00, 0x00, 0xe6, 0xff, 0xcf, 0x00, 0x00, 0xd9, 0xff, 0x3f,X 0x01, 0x80, 0xf4, 0xff, 0x7f, 0x02, 0x40, 0xea, 0xfd, 0xff, 0x04, 0x20,X 0x20, 0xf5, 0xff, 0x09, 0x10, 0xc8, 0xfb, 0xff, 0x13, 0x50, 0x54, 0xff,X 0xff, 0x17, 0x88, 0xc0, 0xf7, 0xff, 0x2b, 0x48, 0x02, 0xed, 0xff, 0x2f,X 0x54, 0x80, 0xfc, 0xff, 0x57, 0x04, 0x00, 0xfe, 0xff, 0x5f, 0x34, 0x00,X 0x83, 0xbf, 0x5d, 0x5a, 0x01, 0x00, 0x7e, 0xb7, 0x5a, 0x04, 0x38, 0x76,X 0xbf, 0xba, 0x51, 0x7c, 0xfc, 0xba, 0xda, 0x04, 0xfe, 0x94, 0xbd, 0xba,X 0x49, 0xfe, 0x84, 0xb7, 0x3a, 0x2d, 0xfe, 0xcc, 0xb8, 0xda, 0x76, 0x7c,X 0x40, 0xbc, 0x7a, 0xfd, 0x38, 0x22, 0xb1, 0x7a, 0xfd, 0x00, 0x40, 0xb1,X 0xf4, 0xff, 0x83, 0x00, 0x5c, 0xf4, 0xff, 0xff, 0x01, 0x58, 0xf4, 0xff,X 0x7f, 0x03, 0x50, 0xe8, 0xff, 0xeb, 0x04, 0x28, 0xe8, 0xff, 0xdf, 0x00,X 0x28, 0xd0, 0xff, 0xb7, 0x0a, 0x14, 0x90, 0xff, 0x7f, 0x49, 0x12, 0x20,X 0xff, 0x4f, 0x07, 0x09, 0x40, 0xfe, 0x37, 0x6d, 0x04, 0x80, 0xfc, 0xf7,X 0x58, 0x02, 0x00, 0xf9, 0xaf, 0x37, 0x01, 0x00, 0xe6, 0xff, 0xcf, 0x00,X 0x00, 0x18, 0xff, 0x31, 0x00, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0x00, 0x00,X 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00X};END_OF_FILEif test 2246 -ne `wc -c <'bitmaps/xmcd.xbm'`; then echo shar: \"'bitmaps/xmcd.xbm'\" unpacked with wrong size!fi# end of 'bitmaps/xmcd.xbm'fiecho shar: End of archive 10 \(of 13\).cp /dev/null ark10isdoneMISSING=""for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fidoneif test "${MISSING}" = "" ; then echo You have unpacked all 13 archives. echo "Now read the README and INSTALL files for further instructions." rm -f ark[1-9]isdone ark[1-9][0-9]isdoneelse echo You still need to unpack the following archives: echo " " ${MISSING}fi## End of shell archive.exit 0-- /// Ti Kan vorsprung durch technik /// AMB Research Laboratories, Sunnyvale, CA. USA /// ////// ...!{decwrl,synopsys,tandem,tsoft,ultra} !sgiblab!bazooka!ti/// ...!uunet!bazooka!ti AUDIO PLAYER : Submitted-by: (Ti Kan)Posting-number: Volume 21, Issue 74Archive-name: xmcd/part12Environment: X11, OSF/Motif#! /bin/sh# This is a shell archive. Remove anything before this line, then unpack# it by saving it into a file and typing "sh file". To overwrite existing# files, type "sh file -c". You can also feed this as standard input via# unshar, or by typing "sh 'helpfiles/Imakefile' 'helpfiles/AbBtn' B ButtonXXThis button is used to define a repeating playbackXsegment.XXDuring normal audio playback, select this button toXdefine the start of the segment, and select it aXsecond time to define the end of the segment. XmcdXwill then enter Segment Play mode, repeatedly playingXthe defined segment.XXDuring the Segment Play mode, the Play Mode IndicatorXin the lower right corner of the main indicatorXwindow shows the "a->b" symbol.XXTo cancel the Segment Play mode and resume normalXaudio playback, select the A->B button a third time,Xor select the Play/Pause button.XXYou can enter the Segment Play mode only if audioXplayback is already in progress, and is not in pausedXstate.END_OF_FILEif test 1520 -ne `wc -c 'helpfiles/DbProgBtn' 'helpfiles/DdCancelBtn' 'helpfiles/DdClrBtn' 'helpfiles/DdOkBtn' 'helpfiles/DpAboutBtn' 'helpfiles/DpAddPgmBtn' 'helpfiles/DpCancelBtn' 'helpfiles/DpClrPgmBtn' 'helpfiles/DpDExtBtn' 'helpfiles/DpLinkBtn' 'helpfiles/DpLoadBtn' 'helpfiles/DpPlayPgmBtn' 'helpfiles/DpSaveBtn' 'helpfiles/DpTExtBtn' 'helpfiles/DpTimeSelBtn' 'helpfiles/DsCancelBtn' 'helpfiles/DsOkBtn' 'helpfiles/DtCancelBtn' 'helpfiles/DtClrBtn' 'helpfiles/DtOkBtn' 'helpfiles/EjectBtn' 'helpfiles/FfBtn' 'helpfiles/HelpBtn' B function: Repeat from selectable point A and B.X- Eject inhibit function: To prevent someone from ejectingX the disc by pressing the button on the drive.X- Track Program function: Play tracks in custom order.X- CD database function: Allows you to store CD title/trackX titles in database, and associate each disc with aX play program. Displays the current playing disc title/X track information. In addition, you can enter and displayX arbitrary text associated with the disc or each track,X such as band information, lyrics, etc.X- Track/Index/Time display: Selectable to display elapsedX time, remaining track time, or remaining disc time.X- Status display: for current play status, A->B mode,X program mode, CD database.X- Main window button face labels can be configured toX display pictorial symbols, or text with hotkeyX mnemonics.X- The complete application can be operated via theX keyboard with full support for keyboard traversal andX hotkeys.X- All labels and messages can be customized to non-X English languages via X resources in the .XdefaultsX file.X- All colors and many other functionality are user-X customizable using X resource settings.X- On-line help information.X- Device-specific configuration files to make xmcdX adaptible to various brands of CD-ROM drives.XXXXmcd undergoes continuous development and is beingXported to new operating system environments. YourXsuggestions are appreciated. Please e-mail all feedbackXto the author at the following Internet e-mail address:XX END_OF_FILEif test 4047 -ne `wc -c 'helpfiles/KeypadBtn' 'helpfiles/KpCancelBtn' 'helpfiles/KpClearBtn' 'helpfiles/KpEnterBtn' 'helpfiles/KpNumBtn' 'helpfiles/LsCancelBtn' 'helpfiles/LsOkBtn' 'helpfiles/NextIdxBtn' 'helpfiles/NextTrkBtn' 'helpfiles/PlayPauseBtn' 'helpfiles/PowerBtn' 'helpfiles/PrevIdxBtn' 'helpfiles/PrevTrkBtn' 'helpfiles/RewBtn' 'helpfiles/SampleBtn' 'helpfiles/StopBtn' 'helpfiles/TimeBtn' 'helpfiles/CheckBox' <<'END_OF_FILE'X#X# @(#)CheckBox 1.3 93/09/28X#X# xmcd - Motif(tm) CD Audio PlayerX#X# Copyright (C) 1993 Ti KanX# E-mail: X#X# This program is free software; you can redistribute it and/or modifyX# it under the terms of the GNU General Public License as published byX# the Free Software Foundation; either version 2 of the License, orX# (at your option) any later version.X#X# This program is distributed in the hope that it will be useful,X# but WITHOUT ANY WARRANTY; without even the implied warranty ofX# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theX# GNU General Public License for more details.X#X# You should have received a copy of the GNU General Public LicenseX# along with this program; if not, write to the Free SoftwareX# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.X#X#XMode Selector Check BoxXXThere are four toggle buttons in the Mode SelectorXcheck box, described as follows:XX- Display Mode SelectorXX This button allows you to configure the Xmcd mainX window push-buttons to either display a pictorialX symbol on their button-faces representing theX function, or to display text titles.XX In Text Title mode, an underscore is shown below theX letter representing the short-cut key that can be usedX to select the push-button. If the specified short-cutX key does not work, try using the Shift, Ctrl, Alt orX Meta modifier keys in combination with the indicatedX key.XX- Caddy Lock SelectorXX This button allows you to lock and unlock the CD caddyX when a disc is loaded. When locked, a disc cannot beX ejected by pressing the Eject button on the CD-ROMX drive itself. This is useful to prevent someone fromX inadvertently ejecting the disc.XX The Eject button on the Xmcd main window will stillX function normally even when the caddy is locked.XX This feature may not function on certain CD-ROMX drives, notably those that do not use a motorizedX eject mechanism.XX- Repeat Mode SelectorXX This button allows you to enable or disable theX Repeat mode. When Repeat mode is enabled, Xmcd willX do the following:XX * If normal playback is finished, Repeat mode willX cause the playback to commence again.X * If Shuffle playback is finished, Repeat mode willX cause a new shuffle sequence to be generated andX played.X * If Program playback is finished, Repeat mode willX play the program again.XX The repeat operation will continue indefinitely untilX the Repeat mode is disabled by selecting this button.XX To repeat a single track, enter it as the only trackX in a play program and start program playback withX Repeat mode enabled.XX- Shuffle Mode SelectorXX This button allows you to enable or disable the ShuffleX mode. When Shuffle mode is enabled, Xmcd will play allX the tracks on the CD in non-repeating random order.XX You can enable and disable Shuffle mode only whenX audio playback is not already in progress. Also,X Shuffle mode will automatically disengage when youX enter Program Play mode or specify a track using theX Keypad window.XEND_OF_FILEif test 3075 -ne `wc -c <'helpfiles/CheckBox'`; then echo shar: \"'helpfiles/CheckBox'\" unpacked with wrong size!fi# end of 'helpfiles/CheckBox'fiecho shar: End of archive 12 \(of 13\).cp /dev/null ark12isdoneMISSING=""for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fidoneif test "${MISSING}" = "" ; then echo You have unpacked all 13 archives. echo "Now read the README and INSTALL files for further instructions." rm -f ark[1-9]isdone ark[1-9][0-9]isdoneelse echo You still need to unpack the following archives: echo " " ${MISSING}fi## End of shell archive.exit 0-- /// Ti Kan vorsprung durch technik /// AMB Research Laboratories, Sunnyvale, CA. USA /// ////// ...!{decwrl,synopsys,tandem,tsoft,ultra} !sgiblab!bazooka!ti/// ...!uunet!bazooka!ti AUDIO PLAYER : Submitted-by: (Ti Kan)Posting-number: Volume 21, Issue 66Archive-name: xmcd/part04Environment: X11, OSF/Motif#! /bin/sh# This is a shell archive. Remove anything before this line, then unpack# it by saving it into a file and typing "sh file". To overwrite existing# files, type "sh file -c". You can also feed this as standard input via# unshar, or by typing "sh 'patchlevel.h' 'resource.h' b",X "*sampleButton.labelString: samp",X "*keypadButton.labelString: kpad",X "*playPauseButton.labelString: play / pause",X "*stopButton.labelString: stop",X "*prevTrackButton.labelString: ",X "*prevIndexButton.labelString: ",X "*rewButton.labelString: >",X "*keypadLabel.labelString: Direct track access",X "*keypadNumButton0.labelString: 0",X "*keypadNumButton1.labelString: 1",X "*keypadNumButton2.labelString: 2",X "*keypadNumButton3.labelString: 3",X "*keypadNumButton4.labelString: 4",X "*keypadNumButton5.labelString: 5",X "*keypadNumButton6.labelString: 6",X "*keypadNumButton7.labelString: 7",X "*keypadNumButton8.labelString: 8",X "*keypadNumButton9.labelString: 9",X "*keypadEnterButton.labelString: Enter",X "*keypadCancelButton.labelString: Cancel",X "*keypadClearButton.labelString: Clear",X "*aboutButton.labelString: About...",X "*discTitleLabel.labelString: Disc artist / Title",X "*discLabel.labelString: Disc",X "*extDiscInfoButton.labelString: Ext Info",X "*trackListLabel.labelString: Track / Time / Title",X "*timeSelectLabel.labelString: Time",X "*timeSelectBox*button_0.labelStrin g: total",X "*timeSelectBox*button_1.labelStrin g: track",X "*trackTitleLabel.labelString: Track title edit",X "*trackLabel.labelString: Track",X "*extTrackInfoButton.labelString: Ext Info",X "*programLabel.labelString: Trk Prog",X "*addProgramButton.labelString: Add to",X "*clearProgramButton.labelString: Clear",X "*playProgramButton.labelString: Play",X "*programSequenceLabel.labelString: Program sequence",X "*saveDatabaseButton.labelString: Save",X "*loadDatabaseButton.labelString: Load",X "*linkDatabaseButton.labelString: Link",X "*dbprogCancelButton.labelString: Cancel",X "*helpButton.labelString: Help",X "*extDiscInfoOkButton.labelString: OK",X "*extDiscInfoClearButton.labelStrin g: Clear",X "*extDiscInfoCancelButton.labelStri ng: Cancel",X "*extTrackInfoOkButton.labelString: OK",X "*extTrackInfoClearButton.labelStri ng: Clear",X "*extTrackInfoCancelButton.labelStr ing: Cancel",X "*helpOkButton.labelString: OK",X "*dirSelectLabel.labelString: Database Directory Selection",X "*dirSelectOkButton.labelString: OK",X "*dirSelectCancelButton.labelString : Cancel",X "*trackIndicator.foreground: white",X "*trackIndicator.background: black",X "*indexIndicator.foreground: white",X "*indexIndicator.background: black",X "*timeIndicator.foreground: white",X "*timeIndicator.background: black",X "*dbModeIndicator.foreground: white",X "*dbModeIndicator.background: black",X "*progModeIndicator.foreground: white",X "*progModeIndicator.background: black",X "*timeModeIndicator.foreground: white",X "*timeModeIndicator.background: black",X "*playModeIndicator.foreground: white",X "*playModeIndicator.background: black",X "*keypadIndicator.foreground: white",X "*keypadIndicator.background: black",X "*XmLabel.foreground: black",X "*XmLabel.background: white",X "*XmLabel.borderWidth: 0",X "*foreground: black",X "*background: white",X "*title: xmcd - Can't access X defaults file",X NULL,X};XX#endif /* __RESOURCE_H__ */XEND_OF_FILEif test 32884 -ne `wc -c 'util.h' 'widget.h' B mode button */X Widget sample_btn; /* Sample mode button */X Widget keypad_btn; /* Keypad button */X Widget help_btn; /* Help button */X Widget level_scale; /* Volume control slider */X Widget playpause_btn; /* Play/Pause button */X Widget stop_btn; /* Stop button */X Widget prevtrk_btn; /* Prev Track button */X Widget nexttrk_btn; /* Next Track button */X Widget previdx_btn; /* Prev Index button */X Widget nextidx_btn; /* Next Index button */X Widget rew_btn; /* Search REW button */X Widget ff_btn; /* Search FF button */X } main;X struct {X Widget form; /* Form container */X Widget keypad_lbl; /* Keypad label */X Widget keypad_ind; /* Keypad indicator */X Widget num_btn[10]; /* Number keys */X Widget enter_btn; /* Enter key */X Widget keypad_sep; /* Separator bar */X Widget cancel_btn; /* Cancel_btn */X Widget clear_btn; /* Clear */X } keypad;X struct {X Widget form; /* Form container */X Widget logo_lbl; /* Logo label */X Widget about_btn; /* About button */X Widget dtitle_lbl; /* Disc title label */X Widget dtitle_txt; /* Disc title text */X Widget extd_lbl; /* Disc ext descr label */X Widget extd_btn; /* Disc ext descr button */X Widget dbprog_sep1; /* Separator bar */X Widget trklist_lbl; /* Track list label */X Widget trk_list; /* Track list */X Widget radio_lbl; /* Time dpy radio box label */X Widget radio_frm; /* Time dpy radio box Frame */X Widget radio_box; /* Time dpy radio box */X Widget tottime_btn; /* Total time button */X Widget trktime_btn; /* Track time button */X Widget ttitle_lbl; /* Track title label */X Widget ttitle_txt; /* Track title text */X Widget extt_lbl; /* Track ext descr label */X Widget extt_btn; /* Track ext descr button */X Widget pgm_lbl; /* program label */X Widget addpgm_btn; /* Add to button */X Widget clrpgm_btn; /* Clear button */X Widget playpgm_btn; /* Play program button */X Widget pgmseq_lbl; /* Program sequence label */X Widget pgmseq_txt; /* Program sequence text */X Widget dbprog_sep2; /* Separator bar */X Widget savedb_btn; /* Save to database button */X Widget loaddb_btn; /* Load from database button */X Widget linkdb_btn; /* Link database entry button */X Widget cancel_btn; /* Cancel button */X } dbprog;X struct {X Widget form; /* Form container */X Widget disc_lbl; /* Disc ext descr label */X Widget disc_txt; /* Disc ext descr text */X Widget dbextd_sep; /* Separator bar */X Widget ok_btn; /* OK button */X Widget clear_btn; /* Clear button */X Widget cancel_btn; /* Cancel button */X } dbextd;X struct {X Widget form; /* Form container */X Widget trk_lbl; /* Track ext descr label */X Widget trk_txt; /* Track ext descr text */X Widget dbextt_sep; /* Separator bar */X Widget ok_btn; /* OK button */X Widget clear_btn; /* Clear button */X Widget cancel_btn; /* Cancel button */X } dbextt;X struct {X Widget form; /* Form container */X Widget dir_lbl; /* Directory list label */X Widget dir_list; /* Directory list */X Widget dirsel_sep; /* Separator bar */X Widget ok_btn; /* OK button */X Widget cancel_btn; /* Cancel button */X } dirsel;X struct {X Widget form; /* Form container */X Widget link_lbl; /* Directory list label */X Widget link_list; /* Directory list */X Widget linksel_sep; /* Separator bar */X Widget ok_btn; /* OK button */X Widget cancel_btn; /* Cancel button */X } linksel;X struct {X Widget form; /* Form container */X Widget help_txt; /* Help text */X Widget help_sep; /* Separator bar */X Widget ok_btn; /* OK button */X } help;X struct {X Widget info; /* Info popup */X Widget warning; /* Warning popup */X Widget fatal; /* Fatal error popup */X Widget confirm; /* Confirm popup */X Widget about; /* About popup */X } dialog;X} widgets_t;XXX/* Holder for all button-face pixmaps */Xtypedef struct {X struct {X Pixmap icon_pixmap; /* Icon logo */X Pixmap btnlbl_pixmap; /* Button label mode */X Pixmap lock_pixmap; /* Prevent caddy removal */X Pixmap repeat_pixmap; /* Repeat */X Pixmap shuffle_pixmap; /* Shuffle */X Pixmap eject_pixmap; /* Eject */X Pixmap eject_hlpixmap; /* Eject */X Pixmap poweroff_pixmap; /* Power off */X Pixmap poweroff_hlpixmap; /* Power off */X Pixmap dbprog_pixmap; /* Logo */X Pixmap dbprog_hlpixmap; /* Logo */X Pixmap time_pixmap; /* Time */X Pixmap time_hlpixmap; /* Time */X Pixmap ab_pixmap; /* A->B */X Pixmap ab_hlpixmap; /* A->B */X Pixmap sample_pixmap; /* Sample */X Pixmap sample_hlpixmap; /* Sample */X Pixmap keypad_pixmap; /* Keypad */X Pixmap keypad_hlpixmap; /* Keypad */X Pixmap help_pixmap; /* Help */X Pixmap help_hlpixmap; /* Help */X Pixmap playpause_pixmap; /* Play/Pause */X Pixmap playpause_hlpixmap; /* Play/Pause */X Pixmap stop_pixmap; /* Stop */X Pixmap stop_hlpixmap; /* Stop */X Pixmap prevtrk_pixmap; /* Prev Track */X Pixmap prevtrk_hlpixmap; /* Prev Track */X Pixmap nexttrk_pixmap; /* Next Track */X Pixmap nexttrk_hlpixmap; /* Next Track */X Pixmap previdx_pixmap; /* Prev Index */X Pixmap previdx_hlpixmap; /* Prev Index */X Pixmap nextidx_pixmap; /* Next Index */X Pixmap nextidx_hlpixmap; /* Next Index */X Pixmap rew_pixmap; /* Search REW */X Pixmap rew_hlpixmap; /* Search REW */X Pixmap ff_pixmap; /* Search FF */X Pixmap ff_hlpixmap; /* Search FF */X } main;X struct {X Pixmap logo_pixmap; /* CD Logo */X } dbprog;X struct {X Pixmap xmcd_pixmap; /* Program logo */X } dialog;X} pixmaps_t;XXX/* Mode flags for bm_to_px(): used to set foreground/background colors */X#define BM_PX_NORMAL 0 /* normal/normal */X#define BM_PX_HIGHLIGHT 1 /* highlight/normal */X#define BM_PX_WHITE 2 /* white/normal */X#define BM_PX_BLACK 3 /* black/normal */X#define BM_PX_BW 4 /* black/white */X#define BM_PX_BWREV 5 /* white/black */XXX/* Public function prototypes */Xvoid create_widgets(widgets_t *);Xvoid pre_realize_config(widgets_t *);Xvoid post_realize_config(widgets_t *, pixmaps_t *);Xvoid register_callbacks(widgets_t *, curstat_t *);XX#endif /* __WIDGET_H__ */XEND_OF_FILEif test 8032 -ne `wc -c 'xmcd.h' X#include X#include X#include X#ifndef NO_STDLIB_HX#include X#endifX#include X#include X#include X#include X#include X#include X#include X#include X#ifdef BSDCOMPATX#include X#elseX#include X#endifXXX/* Memory allocator defines */X#define MEM_ALLOC XtMallocX#define MEM_REALLOC XtReallocX#define MEM_CALLOC XtCallocX#define MEM_FREE XtFreeXXX/* Program name string */X#define PROGNAME "xmcd"XXX/* Backup values for application resources/options */X#define DEVNUM 0X#define DEVICE "/dev/rcdrom"X#define CDLIBDIR "/usr/lib/X11/xmcd"X#define CDDBDIR "rock:jazz:newage:classical:soundtr ack:data"X#define MAX_DBDIRS 10X#define DBFILE_MODE "0664"X#define CADDY_LOCK TRUEX#define STATUS_INTERVAL 260X#define INSERT_INTERVAL 2000X#define PREV_THRESHOLD 100X#define SKIP_BLKS 90X#define SKIP_PAUSE 45X#define SKIP_SPDUP 15X#define SKIP_VOL 35X#define SKIP_MINVOL 2X#define SAMPLE_BLKS 750X#define MIN_PLAYBLKS 25X#define BLINKON_INTERVAL 850X#define BLINKOFF_INTERVAL 150X#define BASE_SCSIVOL 0X#define VOL_TAPER 0X#define VENDOR_CODE 0 /* SCSI-2 (see lib_scsipt.h) */X#define PLAY10_SUPP TRUEX#define PLAY12_SUPP FALSEX#define PLAYMSF_SUPP TRUEX#define PLAYTI_SUPP TRUEX#define LOAD_SUPP FALSEX#define EJECT_SUPP TRUEX#define MSELVOL_SUPP TRUEX#define MSELVOL_DBD FALSEX#define PAUSE_SUPP TRUEX#define CADDYLOCK_SUPP TRUEX#define LOAD_SPINDOWN FALSEX#define EXIT_EJECT FALSEX#define EXIT_STOP TRUEX#define SCSIERR_MSG TRUEX#define MAIN_SHOWFOCUS FALSEXX/* Backup message strings */X#define MAIN_TITLE "Motif CD Audio Player"X#define STR_DBMODE "cddb"X#define STR_PROGMODE "prog"X#define STR_ELAPSE "elapse"X#define STR_REMAIN_TRK "r-trac"X#define STR_REMAIN_DISC "r-disc"X#define STR_PLAY "play"X#define STR_PAUSE "pause"X#define STR_READY "ready"X#define STR_SAMPLE "sample"X#define STR_USAGE "Usage:"X#define STR_BADOPTS "The following options are unrecognized:"X#define STR_NODISC "no disc"X#define STR_BUSY "cd busy"X#define STR_DATA "data"X#define STR_WARNING "Warning"X#define STR_FATAL "Fatal Error"X#define STR_CONFIRM "Confirm"X#define STR_INFO "Information"X#define STR_ABOUT "About"X#define STR_QUIT "Really Quit?"X#define STR_NOMEMORY "Out of virtual memory!"X#define STR_NOHELP "Help is not available on this item."X#define STR_NOLINK "There is no likely CDDB entry to link to."X#define STR_NODB "No CD database directory."X#define STR_NOTROM "Device is not a CD-ROM!"X#define STR_NOTSCSI2 "Device is not SCSI-II compliant."X#define STR_MODERR "Xmcd binary permissions error."X#define STR_STATERR "Cannot stat device \"%s\"."X#define STR_NODERR "\"%s\" is not a character device!"X#define STR_SEQFMTERR "Program sequence string format error."X#define STR_DBDIRSERR "XMcd.maxDbdirs resource error."X#define STR_RECOVERR "Recovering from audio playback error..."X#define STR_MAXERR "Too many errors."X#define STR_SAVERR_FORK "File not saved:\nCannot fork. (errno %d)"X#define STR_SAVERR_SUID "File not saved:\nCannot setuid to %d."X#define STR_SAVERR_OPEN "File not saved:\nCannot open file for writing."X#define STR_SAVERR_KILLED "File not saved:\nChild killed. (signal %d)"X#define STR_LNKERR_FORK "File not linked:\nCannot fork. (errno %d)"X#define STR_LNKERR_SUID "File not linked:\nCannot setuid to %d."X#define STR_LNKERR_LINK "File not linked:\nLink failed."X#define STR_LNKERR_KILLED "File not linked:\nChild killed. (signal %d)"XX/* Backup short-cut keys */X#define BTNLBL_KEY ""X#define LOCK_KEY ""X#define REPEAT_KEY ""X#define SHUFFLE_KEY ""X#define EJECT_KEY ""X#define POWEROFF_KEY ""X#define DBPROG_KEY ""X#define HELP_KEY ""X#define TIME_KEY ""X#define AB_KEY ""X#define SAMPLE_KEY ""X#define KEYPAD_KEY ""X#define PLAYPAUSE_KEY ""X#define STOP_KEY ""X#define PREVTRK_KEY ""X#define NEXTTRK_KEY ""X#define PREVIDX_KEY ""X#define NEXTIDX_KEY ""X#define REW_KEY ""X#define FF_KEY ""X#define KEYPAD0_KEY ""X#define KEYPAD1_KEY ""X#define KEYPAD2_KEY ""X#define KEYPAD3_KEY ""X#define KEYPAD4_KEY ""X#define KEYPAD5_KEY ""X#define KEYPAD6_KEY ""X#define KEYPAD7_KEY ""X#define KEYPAD8_KEY ""X#define KEYPAD9_KEY ""X#define KEYPADENTER_KEY ""X#define KEYPADCLEAR_KEY ""X#define KEYPADCANCEL_KEY ""XX/* Application resource/option data */Xtypedef struct {X /* Device and file paths */X int devnum; /* Logical device number */X char *device; /* CD-ROM Device path */X char *libdir; /* Library path */X char *dbdir; /* Database paths */X int max_dbdirs; /* Max number of db dirs */X char *dbfile_mode; /* Database file permissions */XX /* CD operation parameters */X bool_t caddy_lock; /* Lock caddy on startup */X int stat_interval; /* Status poll interval (ms) */X int ins_interval; /* Insert poll interval (ms) */X int prev_threshold; /* Previous track/indexX * threshold (blocks)X */X int skip_blks; /* FF/REW skip blocks */X int skip_pause; /* FF/REW pause (msec) */X int skip_spdup; /* FF/REW speedup count */X int skip_vol; /* FF/REW percent volume */X int skip_minvol; /* FF/REW minimum volume */X int sample_blks; /* Sample play blocks */X int min_playblks; /* Minimum play blocks */X int blinkon_interval; /* Display blink on (ms) */X int blinkoff_interval; /* Display blink off (ms) */X int base_scsivol; /* SCSI volume value base */X int vol_taper; /* Volume control taper */X int vendor_code; /* Vendor command set code */X bool_t play10_supp; /* Play Audio (10) supported */X bool_t play12_supp; /* Play Audio (12) supported */X bool_t playmsf_supp; /* Play Audio MSF supported */X bool_t playti_supp; /* Play Audio T/I supported */X bool_t load_supp; /* Motorized load supported */X bool_t eject_supp; /* Motorized eject supported */X bool_t mselvol_supp; /* Audio vol chg supported */X bool_t mselvol_dbd; /* Set DBD bit for msen/msel */X bool_t pause_supp; /* Pause/Resume supported */X bool_t caddylock_supp; /* Caddy lock supported */X bool_t load_spindown; /* Spin down disc at CD load */X bool_t exit_eject; /* Eject disc on exit? */X bool_t exit_stop; /* Stop disc on exit? */X bool_t scsierr_msg; /* Print SCSI error msg? */X bool_t main_showfocus; /* Highlight kbd focus? */XX /* Various application message strings */X char *main_title; /* Main window title */X char *str_dbmode; /* cddb */X char *str_progmode; /* prog */X char *str_elapse; /* elapse */X char *str_remaintrk; /* r-trac */X char *str_remaindisc; /* r-disc */X char *str_play; /* play */X char *str_pause; /* pause */X char *str_ready; /* ready */X char *str_sample; /* sample */X char *str_usage; /* Usage */X char *str_badopts; /* Bad command-line options */X char *str_nodisc; /* No disc */X char *str_busy; /* Device busy */X char *str_data; /* Data */X char *str_warning; /* Warning */X char *str_fatal; /* Fatal error */X char *str_confirm; /* Confirm */X char *str_info; /* Information */X char *str_about; /* About */X char *str_quit; /* Really Quit? */X char *str_nomemory; /* Out of memory */X char *str_nohelp; /* No help available on item */X char *str_nolink; /* No likely CDDB link */X char *str_nodb; /* No CDDB directory */X char *str_notrom; /* Not a CD-ROM device */X char *str_notscsi2; /* Not SCSI-II compliant */X char *str_moderr; /* xmcd binary perms error */X char *str_staterr; /* Can't stat device */X char *str_noderr; /* Not a character device */X char *str_seqfmterr; /* Pgm sequence format err */X char *str_dbdirserr; /* XMcd.maxDbdirs error */X char *str_recoverr; /* Recovering audio play err */X char *str_maxerr; /* Too many errors */X char *str_saverr_fork; /* File save err: fork */X char *str_saverr_suid; /* File save err: setuid */X char *str_saverr_open; /* File save err: open */X char *str_saverr_killed; /* File save err: child kill */X char *str_lnkerr_fork; /* File link err: fork */X char *str_lnkerr_suid; /* File link err: setuid */X char *str_lnkerr_link; /* File link err: link */X char *str_lnkerr_killed; /* File link err: child kill */XX /* Short-cut key definitions */X char *btnlbl_key; /* Button label */X char *lock_key; /* Lock */X char *repeat_key; /* Repeat */X char *shuffle_key; /* Shuffle */X char *eject_key; /* Eject */X char *poweroff_key; /* Quit */X char *dbprog_key; /* Database/Program popup */X char *help_key; /* Help popup */X char *time_key; /* Time */X char *ab_key; /* A->B */X char *sample_key; /* Sample */X char *keypad_key; /* Keypad popup */X char *playpause_key; /* Play/Pause */X char *stop_key; /* Stop */X char *prevtrk_key; /* Prev track */X char *nexttrk_key; /* Next track */X char *previdx_key; /* Prev index */X char *nextidx_key; /* Next index */X char *rew_key; /* REW */X char *ff_key; /* FF */X char *keypad0_key; /* Keypad 0 */X char *keypad1_key; /* Keypad 1 */X char *keypad2_key; /* Keypad 2 */X char *keypad3_key; /* Keypad 3 */X char *keypad4_key; /* Keypad 4 */X char *keypad5_key; /* Keypad 5 */X char *keypad6_key; /* Keypad 6 */X char *keypad7_key; /* Keypad 7 */X char *keypad8_key; /* Keypad 8 */X char *keypad9_key; /* Keypad 9 */X char *keypadenter_key; /* Keypad Enter */X char *keypadclear_key; /* Keypad clear */X char *keypadcancel_key; /* Keypad cancel */X} AppData;XXX/* Constant definitions */X#define STR_BUF_SZ 64 /* Generic string buffer size */X#define FILE_PATH_SZ 72 /* Max file path length */X#define MAXTRACK 100 /* Max number of tracks */X#define LEAD_OUT_TRACK 0xaa /* Lead-out track number */X#define FRAME_PER_SEC 75 /* Frames per second */X#define MAX_VOL 100 /* Max logical audio volume */XX/* Macros */X#define MSF_OFFSET(s) ((s)->trkinfo[0].frame + \X (((s)->trkinfo[0].min * 60 + (s)->trkinfo[0].sec) * FRAME_PER_SEC))X /* Starting MSF offset */XX/* Character set/font */X#define CHSET1 "chset1"X#define CHSET2 "chset2"X#define CHSET3 "chset3"X#define CHSET4 "chset4"XXX/* Defines for the type field in trkinfo_t */X#define TYP_AUDIO 1 /* Audio track */X#define TYP_DATA 2 /* Data track */XX/* Defines for the mode field in curstat_t */X#define M_NODISC 0 /* No disc loaded */X#define M_PLAY 1 /* Play mode */X#define M_PAUSE 2 /* Pause mode */X#define M_STOP 3 /* Stop mode */X#define M_A 4 /* First half of A->B mode */X#define M_AB 5 /* Running A->B mode */X#define M_SAMPLE 6 /* Sample mode */XX/* Defines for the time_dpy field in curstat_t */X#define T_ELAPSED 0 /* Per-track elapsed time */X#define T_REMAIN_TRACK 1 /* Per-track remaining time */X#define T_REMAIN_DISC 2 /* Whole-disc remaining time */XXX/* CD per-track information */Xtypedef struct {X sword32_t trkno; /* Track number */X word32_t addr; /* Absolute offset block */X byte_t min; /* Absolute offset minutes */X byte_t sec; /* Absolute offset seconds */X byte_t frame; /* Absolute offset frame */X byte_t type; /* track type */X} trkinfo_t;XXX/* Structure containing current status information */Xtypedef struct {X byte_t mode; /* Player mode */X byte_t time_dpy; /* Time display mode */X byte_t reserved[2]; /* reserved */X sword32_t first_trk; /* First track */X sword32_t last_trk; /* Last track */X byte_t tot_trks; /* Total number of tracks */X byte_t tot_min; /* Total minutes */X byte_t tot_sec; /* Total seconds */X byte_t tot_frame; /* Total frame */X word32_t tot_addr; /* Total block length */X sword32_t cur_trk; /* Current track */X sword32_t cur_idx; /* Current index */X byte_t cur_tot_min; /* Current absolute minutes */X byte_t cur_tot_sec; /* Current absolute seconds */X byte_t cur_tot_frame; /* Current absolute frame */X byte_t cur_trk_min; /* Current relative minutes */X byte_t cur_trk_sec; /* Current relative seconds */X byte_t cur_trk_frame; /* Current relative frame */X byte_t reserved2[2]; /* reserved */X word32_t cur_tot_addr; /* Current absolute block */X word32_t cur_trk_addr; /* Current relative block */X word32_t sav_iaddr; /* Saved index abs block */X trkinfo_t trkinfo[MAXTRACK]; /* Per-track information */X sword32_t playorder[MAXTRACK]; /* Prog/Shuf sequence */X bool_t repeat; /* Repeat mode */X bool_t shuffle; /* Shuffle mode */X bool_t program; /* Program mode */X bool_t cddb; /* CD Database entry */X bool_t caddy_lock; /* Caddy lock */X byte_t prog_tot; /* Prog/Shuf total tracks */X byte_t prog_cnt; /* Prog/Shuf track counter */X byte_t level; /* Current volume level */X char vendor[9]; /* CD-ROM drive vendor */X char prod[17]; /* CD-ROM drive model */X char revnum[5]; /* CD-ROM firmware revision */X} curstat_t;XXX/* Public function prototypes */Xcurstat_t *curstat_addr(void);XX#endif /* __XMCD_H__ */END_OF_FILEif test 14843 -ne `wc -c <'xmcd.h'`; then echo shar: \"'xmcd.h'\" unpacked with wrong size!fi# end of 'xmcd.h'fiecho shar: End of archive 4 \(of 13\).cp /dev/null ark4isdoneMISSING=""for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fidoneif test "${MISSING}" = "" ; then echo You have unpacked all 13 archives. echo "Now read the README and INSTALL files for further instructions." rm -f ark[1-9]isdone ark[1-9][0-9]isdoneelse echo You still need to unpack the following archives: echo " " ${MISSING}fi## End of shell archive.exit 0-- /// Ti Kan vorsprung durch technik /// AMB Research Laboratories, Sunnyvale, CA. USA /// ////// ...!{decwrl,synopsys,tandem,tsoft,ultra} !sgiblab!bazooka!ti/// ...!uunet!bazooka!ti AUDIO PLAYER : Submitted-by: (Ti Kan)Posting-number: Volume 21, Issue 65Archive-name: xmcd/part03Environment: X11, OSF/Motif#! /bin/sh# This is a shell archive. Remove anything before this line, then unpack# it by saving it into a file and typing "sh file". To overwrite existing# files, type "sh file -c". You can also feed this as standard input via# unshar, or by typing "sh 'help.h' 'hotkey.h' 'lib_demo.h' 'lib_hita.h' 'lib_hpux.h' XX#ifndef OSI_MODULEX#define OSI_MODULEX#endifXXX/* Public function prototypes */Xbool_t pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,X byte_t, byte_t, byte_t);Xbool_t pthru_open(char *);Xvoid pthru_close(void);Xchar *pthru_vers(void);XXX#endif /* hpux && !DEMO_ONLY */XX#endif /* __LIB_HPUX_H__ */XEND_OF_FILEif test 1618 -ne `wc -c 'lib_nec.h' 'lib_odt.h' X#include XX#ifndef OSI_MODULEX#define OSI_MODULEX#endifXXX/* Macros to update various fields of the SCSI CDB structures.X * These are used to work around byte alignment restrictions andX * padding with some compilers. In general, define NO_ALIGN_LIMITX * if and only if you are sure that the compiler will not insertX * pad bytes between any field of the SCSI CDB structure.X */XX#ifdef NO_ALIGN_LIMITXX#define CDB6_BLK(a,d) (a)->data[0] = (byte_t) (d); \X (a)->data[1] = (byte_t) ((d) >> 8);X#define CDB6_LEN(a,d) (a)->data[2] = (d)X#define CDB6_CTL(a,d) (a)->control = (d)X#define CDB10_BLK(a,d) (a)->block = (d)X#define CDB10_LEN(a,d) (a)->length = (d)X#define CDB10_RSV(a,d) (a)->reserved = (d)X#define CDB10_CTL(a,d) (a)->control = (d)X#define CDB12_BLK(a,d) (a)->block = (d)X#define CDB12_LEN(a,d) (a)->length = (d)X#define CDB12_RSV(a,d) (a)->reserved = (d)X#define CDB12_CTL(a,d) (a)->control = (d)XX#else /* !NO_ALIGN_LIMIT */XX#if BYTE_ORDER == LITTLE_ENDIANXX#define CDB6_BLK(a,d) { \X register word16_t *p = (word16_t *)(void *) (a); \X p[1] = (d); \X}X#define CDB6_LEN(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[4] = (d); \X}X#define CDB6_CTL(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[5] = (d); \X}X#define CDB10_BLK(a,d) { \X register word16_t *p = (word16_t *)(void *) (a); \X p[1] = (word16_t) (d); \X p[2] = (word16_t) ((d) >> 16); \X}X#define CDB10_LEN(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[7] = (byte_t) (d); \X p[8] = (byte_t) ((d) >> 8); \X}X#define CDB10_RSV(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[6] = (d); \X}X#define CDB10_CTL(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[9] = (d); \X}X#define CDB12_BLK(a,d) { \X register word16_t *p = (word16_t *)(void *) (a); \X p[1] = (word16_t) (d); \X p[2] = (word16_t) ((d) >> 16); \X}X#define CDB12_LEN(a,d) { \X register word16_t *p = (word16_t *)(void *) (a); \X p[3] = (word16_t) (d); \X p[4] = (word16_t) ((d) >> 16); \X}X#define CDB12_RSV(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[10] = (d); \X}X#define CDB12_CTL(a,d) { \X register byte_t *p = (byte_t *) (a); \X p[11] = (d); \X}XX#endif /* BYTE_ORDER == LITTLE_ENDIAN */XX#endif /* !NO_ALIGN_LIMIT */XXX/* Public function prototypes */Xbool_t pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,X byte_t, byte_t, byte_t);Xbool_t pthru_open(char *);Xvoid pthru_close(void);Xchar *pthru_vers(void);XXX#endif /* sco && !DEMO_ONLY */XX#endif /* __LIB_ODT_H__ */XEND_OF_FILEif test 3895 -ne `wc -c 'lib_pion.h' 'lib_scsipt.h' 'lib_sim.h' 'lib_sun.h' X#define USCSI_STATUS_GOOD 0XX#else /* !SVR4 */XX#include X#undef USCSI_WRITEX#define USCSI_WRITE 0XX/* This is a hack to work around a bug in SunOS 4.x's _IOWR macroX * in which makes it incompatible with ANSI compilers.X * If Sun ever changes the definition of USCSICMD or _IOWR thenX * this will have to change...X */X#undef _IOWRX#undef USCSICMDXX#define _IOWR(x,y,t) ( \X _IOC_INOUT | \X ((sizeof(t) & _IOCPARM_MASK) 'lib_svr4.h' X#include X#include XX#ifndef OSI_MODULEX#define OSI_MODULEX#endifXXX/* Macros to update various fields of the SCSI CDB structures.X * These are used to work around byte alignment restrictions andX * padding with some compilers. In general, define NO_ALIGN_LIMITX * if and only if you are sure that the compiler will not insertX * pad bytes between any field of the SCSI CDB structure.X */XX#ifdef NO_ALIGN_LIMITXX#define CDB6_BLK(a,d) (a)->ss_addr = (d)X#define CDB6_LEN(a,d) (a)->ss_len = (d)X#define CDB6_CTL(a,d) (a)->ss_cont = (d)X#define CDB10_BLK(a,d) (a)->sm_addr = (d)X#define CDB10_LEN(a,d) (a)->sm_len = (d)X#define CDB10_RSV(a,d) (a)->sm_res2 = (d)X#define CDB10_CTL(a,d) (a)->sm_cont = (d)X#define CDB12_BLK(a,d) (a)->sl_addr = (d)X#define CDB12_LEN(a,d) (a)->sl_len = (d)X#define CDB12_RSV(a,d) (a)->sl_res2 = (d)X#define CDB12_CTL(a,d) (a)->sl_cont = (d)XX#else /* !NO_ALIGN_LIMIT */XX#if BYTE_ORDER == LITTLE_ENDIANXX#define CDB6_BLK(a,d) { \X register word16_t *p = (word16_t *)(void *) SCS_AD(a); \X p[1] = (d); \X}X#define CDB6_LEN(a,d) { \X register byte_t *p = (byte_t *) SCS_AD(a); \X p[4] = (d); \X}X#define CDB6_CTL(a,d) { \X register byte_t *p = (byte_t *) SCS_AD(a); \X p[5] = (d); \X}X#define CDB10_BLK(a,d) { \X register word16_t *p = (word16_t *)(void *) SCM_AD(a); \X p[1] = (word16_t) (d); \X p[2] = (word16_t) ((d) >> 16); \X}X#define CDB10_LEN(a,d) { \X register byte_t *p = (byte_t *) SCM_AD(a); \X p[7] = (byte_t) (d); \X p[8] = (byte_t) ((d) >> 8); \X}X#define CDB10_RSV(a,d) { \X register byte_t *p = (byte_t *) SCM_AD(a); \X p[6] = (d); \X}X#define CDB10_CTL(a,d) { \X register byte_t *p = (byte_t *) SCM_AD(a); \X p[9] = (d); \X}X#define CDB12_BLK(a,d) { \X register word16_t *p = (word16_t *)(void *) SCL_AD(a); \X p[1] = (word16_t) (d); \X p[2] = (word16_t) ((d) >> 16); \X}X#define CDB12_LEN(a,d) { \X register word16_t *p = (word16_t *)(void *) SCL_AD(a); \X p[3] = (word16_t) (d); \X p[4] = (word16_t) ((d) >> 16); \X}X#define CDB12_RSV(a,d) { \X register byte_t *p = (byte_t *) SCL_AD(a); \X p[10] = (d); \X}X#define CDB12_CTL(a,d) { \X register byte_t *p = (byte_t *) SCL_AD(a); \X p[11] = (d); \X}XX#endif /* BYTE_ORDER == LITTLE_ENDIAN */XX#endif /* !NO_ALIGN_LIMIT */XXX#ifndef SCL_ADXX/* SCSI 12-byte CDB */X#define SCL_AD(x) ((byte_t *) (x) + 2)X#define SCL_SZ 12XXstruct scl {X unsigned int sl_pad0:16; /* pad for alignment */X unsigned int sl_op:8; /* Opcode */X unsigned int sl_res1:5; /* Reserved field */X unsigned int sl_lun:3; /* Logical unit number */XX word32_t sl_addr; /* Block address */X word32_t sl_len; /* Transfer length */XX byte_t sl_res2; /* Reserved field */X byte_t sl_cont; /* Control byte */X};X X#endif /* SCL_AD */XXX/* SCSI Command Descriptor Block union */Xunion scsi_cdb {X struct scs scs;X struct scm scm;X struct scl scl;X};XX#endif /* i386 */XX#ifdef MOTOROLAX/*X * Motorola 88k UNIX SVR4 supportX *X * This software fragment contains code that interfaces xmcd toX * the System V Release 4 operating system from Motorola.X * The name "Motorola" is used here for identification purposes.X */XX#include X#include XX#ifndef OSI_MODULEX#define OSI_MODULEX#endifXX#endif /* MOTOROLA */XXX/* Public function prototypes */Xbool_t pthru_send(byte_t, word32_t, byte_t *, word32_t, byte_t, word32_t,X byte_t, byte_t, byte_t);Xbool_t pthru_open(char *);Xvoid pthru_close(void);Xchar *pthru_vers(void);XX#endif /* SVR4 && !sun && !DEMO_ONLY */XX#endif /* __LIB_SVR4_H__ */XEND_OF_FILEif test 5120 -ne `wc -c 'lib_tosh.h' <<'END_OF_FILE'X/*X * xmcd - Motif(tm) CD Audio PlayerX *X * Copyright (C) 1993 Ti KanX * E-mail: X *X * This program is free software; you can redistribute it and/or modifyX * it under the terms of the GNU General Public License as published byX * the Free Software Foundation; either version 2 of the License, orX * (at your option) any later version.X *X * This program is distributed in the hope that it will be useful,X * but WITHOUT ANY WARRANTY; without even the implied warranty ofX * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theX * GNU General Public License for more details.X *X * You should have received a copy of the GNU General Public LicenseX * along with this program; if not, write to the Free SoftwareX * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.X *X * The name "Toshiba" is a trademark of Toshiba Corporation, and isX * used here for identification purposes. This software and itsX * author are not affiliated in any way with Toshiba.X *X */X#ifndef __LIB_TOSH_H__X#define __LIB_TOSH_H__XX#ifdef TOSHIBAXX#ifndef LINTXstatic char *_lib_tosh_h_ident_ = 1.24 93/10/01";X#endifXX#ifndef VUSUPPORTX#define VUSUPPORTX#endifXXX/* Toshiba vendor-unique commands */X#define OP_VT_AUDSRCH 0xc0 /* Toshiba audio track search */X#define OP_VT_AUDPLAY 0xc1 /* Toshiba play audio */X#define OP_VT_STILL 0xc2 /* Toshiba still */X#define OP_VT_SETSTOP 0xc3 /* Toshiba set stop time */X#define OP_VT_EJECT 0xc4 /* Toshiba caddy eject */X#define OP_VT_RDSUBQ 0xc6 /* Toshiba read status */X#define OP_VT_RDINFO 0xc7 /* Toshiba read disk info */X#define OP_VT_RDMODE 0xc8 /* Toshiba read CDROM mode */XXX/* Toshiba audio status codes */X#define TAUD_PLAYING 0x00X#define TAUD_PAUSED 0x01X#define TAUD_SRCH_PAUSED 0x02X#define TAUD_OTHER 0x03XXX/* Return data lengths */X#define SZ_VT_RDSUBQ 10 /* Toshiba read sub-code Q data size */X#define SZ_VT_RDINFO 4 /* Toshiba read disc info data size */X#define SZ_VT_RDMODE 1 /* Toshiba read cdrom mode data size */XXX/* Toshiba read sub-code Q command data */Xtypedef struct tsubq_data {X unsigned int audio_status:8; /* audio status */X#if BYTE_ORDER == LITTLE_ENDIANX unsigned int preemph:1; /* preemphasis */X unsigned int copyallow:1; /* digital copy allow */X unsigned int trktype:1; /* 0=audio 1=data */X unsigned int audioch:1; /* 0=2ch 1=4ch */X unsigned int reserved:4; /* reserved */X#else /* BYTE_ORDER == BIG_ENDIAN */X unsigned int reserved:4; /* reserved */X unsigned int audioch:1; /* 0=2ch 1=4ch */X unsigned int trktype:1; /* 0=audio 1=data */X unsigned int copyallow:1; /* digital copy allow */X unsigned int preemph:1; /* preemphasis */X#endif /* BYTE_ORDER */X unsigned int trkno:8; /* track number (BCD) */X unsigned int idxno:8; /* index number (BCD) */XX byte_t rel_min; /* trk relative minutes (BCD) */X byte_t rel_sec; /* trk relative seconds (BCD) */X byte_t rel_frame; /* trk relative frame (BCD) */X byte_t abs_min; /* absolute minutes (BCD) */XX byte_t abs_sec; /* absolute seconds (BCD) */X byte_t abs_frame; /* absolute frame (BCD) */X byte_t pad1[2]; /* pad for alignment */X} tsubq_data_t;XXX/* Toshiba read disc information command data */Xtypedef struct tinfo_00 { /* track information */X byte_t first_trk; /* first track (BCD) */X byte_t last_trk; /* last track (BCD) */X byte_t reserved[2]; /* reserved */X} tinfo_00_t;XXtypedef struct tinfo_01 { /* lead-out track starting time */X byte_t min; /* minutes (BCD) */X byte_t sec; /* seconds (BCD) */X byte_t frame; /* frame (BCD) */X byte_t reserved; /* reserved */X} tinfo_01_t;XXtypedef struct tinfo_02 { /* specified track starting time */X byte_t min; /* minutes (BCD) */X byte_t sec; /* seconds (BCD) */X byte_t frame; /* frame (BCD) */X byte_t reserved; /* reserved */X} tinfo_02_t;XXX/* Argument of Toshiba audio search and play audio commands */Xtypedef struct taudio_arg {X union { /* address */X word32_t tp_00; /* absolute logical blk addr */X#if BYTE_ORDER == LITTLE_ENDIANX struct {X byte_t res; /* reserved */X byte_t frame; /* frame (BCD) */X byte_t sec; /* seconds (BCD) */X byte_t min; /* minutes (BCD) */X } tp_01;X struct {X byte_t res[3]; /* reserved */X byte_t track; /* track number (BCD) */X } tp_10;X#else /* BYTE_ORDER == BIG_ENDIAN */X struct {X byte_t min; /* minutes (BCD) */X byte_t sec; /* seconds (BCD) */X byte_t frame; /* frame (BCD) */X byte_t res; /* reserved */X } tp_01;X struct {X byte_t track; /* track number (BCD) */X byte_t res[3]; /* reserved */X } tp_10;X#endif /* BYTE_ORDER */X } _addr;X} taudio_arg_t;XX#define addr_logical _addr.tp_00X#define addr_min _addr.tp_01.minX#define addr_sec _addr.tp_01.secX#define addr_frame _addr.tp_01.frameX#define addr_track _addr.tp_10.trackXXX/* Public function prototypes */Xbool_t tosh_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,X byte_t, byte_t);Xbool_t tosh_pause_resume(bool_t);Xbool_t tosh_get_playstatus(curstat_t *, byte_t *);Xbool_t tosh_get_toc(curstat_t *);Xbool_t tosh_mute(bool_t);Xbool_t tosh_eject(void);Xvoid tosh_init(void);Xvoid tosh_halt(void);XX#endif /* TOSHIBA */XX#endif /* __LIB_TOSH_H__ */XEND_OF_FILEif test 5199 -ne `wc -c <'lib_tosh.h'`; then echo shar: \"'lib_tosh.h'\" unpacked with wrong size!fi# end of 'lib_tosh.h'fiecho shar: End of archive 3 \(of 13\).cp /dev/null ark3isdoneMISSING=""for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fidoneif test "${MISSING}" = "" ; then echo You have unpacked all 13 archives. echo "Now read the README and INSTALL files for further instructions." rm -f ark[1-9]isdone ark[1-9][0-9]isdoneelse echo You still need to unpack the following archives: echo " " ${MISSING}fi## End of shell archive.exit 0-- /// Ti Kan vorsprung durch technik /// AMB Research Laboratories, Sunnyvale, CA. USA /// ////// ...!{decwrl,synopsys,tandem,tsoft,ultra} !sgiblab!bazooka!ti/// ...!uunet!bazooka!ti
| ||
|
players guide, windows media player 6.4, real audio player, media player free, flash player 6, real player 8, windows media player codecs, mp3 player download, dvd players, xbox media player, mpg player, media player skins, player skins, real player linux, windows media player 7, windows media player 8, video cd player, mpeg2 player, xing player, codec for windows media player, media player 6.4, media player codecs, windows media player update, asf player, player 7, ati dvd player, single player demo, xing mpeg player, disc players, media player 7, windows media player 7.1, player codec, media player 8, player skin, divix player, player 9, real player basic, vivo player, media player mac, player downloads, player dvd, media player 7.1, player 6.4, media player update, player plus, player 7.1, avi player, download flash player, download real player, dvd player, free media player, free real player, media player download, mp3 cd player, player divx, player mp3, player one, player video, real player one, windows media player codec, windows media player download |