ref: 8f830516042b115bc35b75432db0e3181f4f0db3
parent: ba18faf7a066bfceea07e5b03493536676fefd90
author: Sigrid Haflínudóttir <[email protected]>
date: Mon Dec 30 19:35:29 EST 2019
instance ctl: clear/reset/init commands
--- a/fs.c
+++ b/fs.c
@@ -214,7 +214,16 @@
st = o->ui->write != nil ? o->ui->write(o, o->ui, Xuictl, b) : -1;
respond(r, st == 0 ? nil : "write failed");
break;
- case Xctl: /* FIXME reset, changing sampling rate, etc */
+ case Xdspctl: /* FIXME changing sampling rate */
+ o = auxtype2obj(&a->type);
+ if (strncmp(b, "clear", 5) == 0)
+ dspf->clear(o->dsp.dsp);
+ else if (strncmp(b, "reset", 5) == 0)
+ dspf->reset_ui(o->dsp.dsp);
+ else if (strncmp(b, "init", 4) == 0)
+ dspf->init(o->dsp.dsp, rate);
+ respond(r, nil);
+ break;
case Xmetadata: /* FIXME should be possible to add new key/value */
default:
respond(r, "not implemented");