Sigrid Solveig Haflínudóttircompile stuff50243ce5 years agoHistory
50 lines · 978 B · C
RawDownload
/* This code is placed in the public domain. */ #include <stdlib.h>#include "soundpipe.h" int sp_count_create(sp_count **p){    *p = malloc(sizeof(sp_count));    return SP_OK;} int sp_count_destroy(sp_count **p){    free(*p);    return SP_OK;} int sp_count_init(sp_data *sp, sp_count *p){    USED(sp);     p->count = 4;    p->curcount = -1;    p->mode = 0;    return SP_OK;} int sp_count_compute(sp_data *sp, sp_count *p, SPFLOAT *in, SPFLOAT *out){    USED(sp);     if (*in){        if (p->mode == 0) {            p->curcount = (p->curcount + 1) % p->count;        } else {            if (p->curcount == -2) {                *out = -2;                return SP_OK;            }            if (p->curcount >= p->count - 1) {                p->curcount = -2;            } else {                if (p->curcount == -1) p->curcount = 0;                else p->curcount++;            }        }    }    *out = p->curcount;    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