blob: c447949e6a1f7e840b90a4612eefbf682c9aee80 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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);
}
|