9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Stephen Parker <stephen.parker@pitechnology.com>
To: "'9fans@cse.psu.edu'" <9fans@cse.psu.edu>
Subject: RE: [9fans] questions about acd
Date: Tue, 18 Jun 2002 07:57:50 +0100	[thread overview]
Message-ID: <E562FCEE3A42D61192880002A5FB43330A6313@kite.pigroup.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

some changes to acd that i made to get it to work with my cd drive.
most of the diffs just replace threadprint with fprint to get it
to compile with 4th edition (this is based on an early 4th ed
version, maybe the sources have changed since).

the main change is around :58 in main.c where i play the next track
if the state is unknown (which is what my player reports when the
track finishes).

also cddb lookup can be turned off.  as i mentioned yesterday if
i don't do this then soon after the call to dial i get a broken
process.  i haven't tracked this down yet.

stephen

--
Stephen Parker.  Pi Technology.  +44 (0)1223 203438.

> -----Original Message-----
> From: Andrey S. Kukhar [mailto:plan9@kp.km.ua]
> Sent: 17 June 2002 15:01
> To: Stephen Parker
> Subject: Re: [9fans] questions about acd
>
>
> show me what you got (pretty obvious stuff)
>
> --
> regards,
> -ask
>
> > i've found that my cdrom reports "no status" after playing a track
> > and therefore acd stops.  i've fixed it at home and can
> send a patch,
> > but it is pretty obvious stuff.
>
> > less obvious is that if acd tries to connect to the cddb on
> my non-networked
> > pc i get a broken process soon after dial is called.  i
> haven't tracked that
> > down yet.
>
> > stephen
>
> > --
> > Stephen Parker.  Pi Technology.  +44 (0)1223 203438.
>
>


[-- Attachment #2: diffs --]
[-- Type: application/octet-stream, Size: 3158 bytes --]

diff /n/d/acme/bin/source/acd//acd.h ./acd.h
113c113
< extern int msfconv(va_list*, Fconv*);
---
> extern int msfconv(Fmt*);
157c157
< #define DPRINT if(debug)threadprint
---
> #define DPRINT if(debug)fprint
diff /n/d/acme/bin/source/acd//acme.c ./acme.c
178c178
< 	threadprint(w->data, "Title\n\n");
---
> 	fprint(w->data, "Title\n\n");
184,185c184,185
< 		threadprint(w->data, "%s%d/ Track %d\n", i==playing ? "> " : "", i+1, i+1);
< 	threadprint(w->data, "");
---
> 		fprint(w->data, "%s%d/ Track %d\n", i==playing ? "> " : "", i+1, i+1);
> 	fprint(w->data, "");
258c258
< 		threadprint(2, "unknown message %c%c\n", e->c1, e->c2);
---
> 		fprint(2, "unknown message %c%c\n", e->c1, e->c2);
diff /n/d/acme/bin/source/acd//cddb.c ./cddb.c
52c52
< 		fprint(2, "cannot dial: %r\n");
---
> 		fprint(2, "cannot dial: %%r\n");
Only in .: diffs
diff /n/d/acme/bin/source/acd//main.c ./main.c
3a4
> int nocddb;
8c9
< 	threadprint(2, "usage: acd dev\n");
---
> 	fprint(2, "usage: acd dev\n");
58c59
< 			if(s.state == Scompleted) {
---
> 			if(s.state == Scompleted || s.state == Sunknown) {
97a99
> 	char	*dev;
102a105,108
> 		break;
> 	case 'n':
> 		nocddb++;
> 		break;
105c111,119
< 	if(argc != 1)
---
> 	switch (argc){
> 	case 0:
> 		dev = strdup("/dev/sdD0");
> 		break;
> 	case 1:
> 		dev = strdup(argv[0]);
> 		break;
> 	default:
> 		dev = 0;
106a121,122
> 		break;
> 	}
110c126
< 	if((s = openscsi(argv[0])) == nil)
---
> 	if((s = openscsi(dev)) == nil)
126c142,143
< 	proccreate(cddbproc, d, STACK);
---
> 	if (!nocddb)
> 		proccreate(cddbproc, d, STACK);
129,130c146,147
< 	cleanname(argv[0]);
< 	snprint(buf, sizeof(buf), "%s/", argv[0]);
---
> 	cleanname(dev);
> 	snprint(buf, sizeof(buf), "-acd%s/", dev);
diff /n/d/acme/bin/source/acd//mmc.c ./mmc.c
4c4
< msfconv(va_list *va, Fconv *fp)
---
> msfconv(Fmt *f)
7d6
< 	char buf[40];
9,12c8,9
< 	m = va_arg(*va, Msf);
< 	sprint(buf, "%d.%d.%d", m.m, m.s, m.f);
< 	strconv(buf, fp);
< 	return 0;
---
> 	m = va_arg(f->args, Msf);
> 	return fmtprint(f, "%d.%d.%d", m.m, m.s, m.f);
194c191
< 		threadprint(2, "disk changed underfoot; repeating\n");
---
> 		fprint(2, "disk changed underfoot; repeating\n");
218c215
< 	threadprint(1, "%d tracks\n", t->ntrack);
---
> 	fprint(1, "%d tracks\n", t->ntrack);
268a266
> 	DPRINT(2, "playstatus: %d\n", resp[1]);
292c290
< 	//DPRINT(2, "d %d %d t %d %d\n", d->scsi->changetime, d->scsi->nchange, t.changetime, t.nchange);
---
> 		DPRINT(2, "d %ld %d t %d %d\n", d->scsi->changetime, d->scsi->nchange, t.changetime, t.nchange);
diff /n/d/acme/bin/source/acd//util.c ./util.c
68c68
< 	threadprint(2, "Mail: ");
---
> 	fprint(2, "Acd: ");
70c70
< 	n = doprint(buf, buf+sizeof buf, fmt, arg) - buf;
---
> 	n = vsnprint(buf, sizeof buf, fmt, arg);
85c85
< 	n = doprint(buf, buf+sizeof buf, fmt, arg) - buf;
---
> 	n = vsnprint(buf, sizeof buf, fmt, arg);
diff /n/d/acme/bin/source/acd//win.c ./win.c
182c182
< 	threadprint(w->event, "%c%c%d %d\n", e->c1, e->c2, e->q0, e->q1);
---
> 	fprint(w->event, "%c%c%d %d\n", e->c1, e->c2, e->q0, e->q1);

             reply	other threads:[~2002-06-18  6:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18  6:57 Stephen Parker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-19 15:43 Andrey S. Kukhar
2002-06-17 14:59 Stephen Parker
2002-06-17  7:55 Stephen Parker
2002-06-17 14:00 ` Andrey S. Kukhar
2002-06-15 16:03 Russ Cox
2002-06-15 14:51 Andrey S. Kukhar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E562FCEE3A42D61192880002A5FB43330A6313@kite.pigroup.co.uk \
    --to=stephen.parker@pitechnology.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).