+ XFillRectangle (st->dpy, st->window, st->gc,
+ x, 0, st->scale, st->xgwa.height);
+ }
+
+ if (st->debug_p)
+ {
+ int wh = (st->xgwa.height / (st->nwaves + 1)) * 0.9;
+ int i;
+ XSetLineAttributes (st->dpy, st->gc, 2, LineSolid, CapRound, JoinRound);
+ XSetForeground (st->dpy, st->gc, BlackPixelOfScreen (st->xgwa.screen));
+ for (i = 0; i < st->nwaves; i++)
+ {
+ int y = st->xgwa.height * i / (st->nwaves + 1);
+ int ox = -1, oy = -1;
+
+ for (x = 0; x < st->xgwa.width; x += st->scale)
+ {
+ int yy;
+ double v = 0;
+ v = cos ((x * st->waves[i].scale) - st->waves[i].offset);
+ v /= 2;
+
+ yy = y + wh/2 + (wh * v);
+ if (ox == -1)
+ ox = x, oy = yy;
+ XDrawLine (st->dpy, st->window, st->gc, ox, oy, x, yy);
+ ox = x;
+ oy = yy;
+ }
+ }
+
+ {
+ int y = st->xgwa.height * i / (st->nwaves + 1);
+ int ox = -1, oy = -1;
+
+ for (x = 0; x < st->xgwa.width; x += st->scale)
+ {
+ int yy;
+ double v = 0;
+ for (i = 0; i < st->nwaves; i++)
+ v += cos ((x * st->waves[i].scale) - st->waves[i].offset);
+ v /= st->nwaves;
+ v /= 2;
+
+ yy = y + wh/2 + (wh * v);
+ if (ox == -1)
+ ox = x, oy = yy;
+ XDrawLine (st->dpy, st->window, st->gc, ox, oy, x, yy);
+ ox = x;
+ oy = yy;
+ }
+ }