Sigrid Solveig Haflínudóttircompile stuff50243ce5 years agoHistory
42 lines · 659 B · C
RawDownload
/* This code is placed in the public domain. */ #include <stdlib.h>#include "soundpipe.h" int sp_switch_create(sp_switch **p){    *p = malloc(sizeof(sp_switch));    return SP_OK;} int sp_switch_destroy(sp_switch **p){    free(*p);    return SP_OK;} int sp_switch_init(sp_data *sp, sp_switch *p){    USED(sp);     p->mode = 0;    return SP_OK;} int sp_switch_compute(sp_data *sp, sp_switch *p, SPFLOAT *trig,    SPFLOAT *in1, SPFLOAT *in2, SPFLOAT *out){    USED(sp);     if (*trig) {        p->mode = p->mode == 0 ? 1 : 0;    }     if(p->mode == 0) {        *out = *in1;    } else {        *out = *in2;    }     return SP_OK;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t