Sigrid Solveig Haflínudóttircompile stuff50243ce5 years agoHistory
52 lines · 964 B · C
RawDownload
/* This code is placed in the public domain. */ #include <stdlib.h>#include "soundpipe.h" int sp_slice_create(sp_slice **p){    *p = malloc(sizeof(sp_slice));    return SP_OK;} int sp_slice_destroy(sp_slice **p){    free(*p);    return SP_OK;} int sp_slice_init(sp_data *sp, sp_slice *p, sp_ftbl *vals, sp_ftbl *buf){    USED(sp);     p->vals = vals;    p->buf = buf;    p->pos = 0;    p->nextpos = 0;    p->id = 0;    return SP_OK;} int sp_slice_compute(sp_data *sp, sp_slice *p, SPFLOAT *in, SPFLOAT *out){    USED(sp);     *out = 0;    if(*in != 0) {        if(p->id < p->vals->size) {            p->pos = p->vals->tbl[p->id];            if(p->id == p->vals->size - 1) {                p->nextpos = p->buf->size;            } else {                p->nextpos = p->vals->tbl[p->id + 1];            }        }    }     if(p->pos < p->nextpos) {        *out = p->buf->tbl[p->pos];        p->pos++;    }     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