summaryrefslogtreecommitdiff
path: root/acme/bin/source/acd/toc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-04-14 17:27:24 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-04-14 17:27:24 +0000
commita150899221a5badff9740703b754f901b4f52762 (patch)
tree3d6911874b0ee763e40490d04f56fc09d89ccfa6 /acme/bin/source/acd/toc.c
parent71cfa9c637386ebe00fc6d1bf6215db6657559f4 (diff)
downloadplan9front-a150899221a5badff9740703b754f901b4f52762.tar.xz
fill /acme
Diffstat (limited to 'acme/bin/source/acd/toc.c')
-rw-r--r--acme/bin/source/acd/toc.c59
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);
+
+}