diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-14 17:27:24 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-14 17:27:24 +0000 |
commit | a150899221a5badff9740703b754f901b4f52762 (patch) | |
tree | 3d6911874b0ee763e40490d04f56fc09d89ccfa6 /acme/bin/source/acd/toc.c | |
parent | 71cfa9c637386ebe00fc6d1bf6215db6657559f4 (diff) | |
download | plan9front-a150899221a5badff9740703b754f901b4f52762.tar.xz |
fill /acme
Diffstat (limited to 'acme/bin/source/acd/toc.c')
-rw-r--r-- | acme/bin/source/acd/toc.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/acme/bin/source/acd/toc.c b/acme/bin/source/acd/toc.c new file mode 100644 index 000000000..c447949e6 --- /dev/null +++ b/acme/bin/source/acd/toc.c @@ -0,0 +1,59 @@ +#include "acd.h" + +Toc thetoc; + +void +tocthread(void *v) +{ + Drive *d; + + threadsetname("tocthread"); + d = v; + DPRINT(2, "recv ctocdisp?..."); + while(recv(d->ctocdisp, &thetoc) == 1) { + DPRINT(2, "recv ctocdisp!..."); + drawtoc(d->w, &thetoc); + DPRINT(2, "send dbreq...\n"); + send(d->ctocdbreq, &thetoc); + } +} + +void +freetoc(Toc *t) +{ + int i; + + free(t->title); + for(i=0; i<t->ntrack; i++) + free(t->track[i].title); +} + +void +cddbthread(void *v) +{ + Drive *d; + Toc t; + + threadsetname("cddbthread"); + d = v; + while(recv(d->ctocdbreply, &t) == 1) { + if(thetoc.nchange == t.nchange) { + freetoc(&thetoc); + thetoc = t; + redrawtoc(d->w, &thetoc); + } + } +} + +void +cdstatusthread(void *v) +{ + Drive *d; + Cdstatus s; + + d = v; + + for(;;) + recv(d->cstat, &s); + +} |