History

added mtof. also generic pointer stack operations

Paul Batchelor committed 5 years ago

Commit f84a13e1 parent e501bf12 files · +45 −0Browse files

Unified · Split

2 files
  1. core.org +44 −0
  2. mkdb.janet +1 −0
core.org+44−0
@@ -677,6 +677,50 @@ int sk_param_out(sk_core *core, · 676 unmodified lines
677=sk_param_out= will take an output cable of a node677=sk_param_out= will take an output cable of a node
678(referenced by index), and push it onto the sndkit stack.678(referenced by index), and push it onto the sndkit stack.
679It will also push the cable's buffer onto the stack.679It will also push the cable's buffer onto the stack.
680** Pushing/Popping Generic Pointers
681#+NAME: funcdefs
682#+BEGIN_SRC c
683int sk_core_generic_push(sk_core *core, void *ptr);
684int sk_core_generic_pop(sk_core *core, void **ptr);
685#+END_SRC
686
687#+NAME: funcs
688#+BEGIN_SRC c
689int sk_core_generic_push(sk_core *core, void *ptr)
690{
691 int rc;
692 sk_stacklet *s;
693
694 rc = sk_stack_push(&core->stack, &s);
695 SK_ERROR_CHECK(rc);
696
697 s->type = SK_TYPE_GENERIC;
698 s->ptr = ptr;
699
700 return rc;
701}
702#+END_SRC
703
704#+NAME: funcs
705#+BEGIN_SRC c
706int sk_core_generic_pop(sk_core *core, void **ptr)
707{
708 int rc;
709 sk_stacklet *s;
710
711 rc = sk_stack_pop(&core->stack, &s);
712
713 SK_ERROR_CHECK(rc);
714
715 if (s->type != SK_TYPE_GENERIC) {
716 return 1;
717 }
718
719 if (ptr != NULL) *ptr = s->ptr;
720
721 return rc;
722}
723#+END_SRC
680* Registers724* Registers
681A register interface is used alongside the stack725A register interface is used alongside the stack
682interface to store and retrieve data. A value stored726interface to store and retrieve data. A value stored
mkdb.janet+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
39(ww-add-link "siren" "doc/siren.org")39(ww-add-link "siren" "doc/siren.org")
40(ww-add-link "smoother" "dsp/smoother.org")40(ww-add-link "smoother" "dsp/smoother.org")
41(ww-add-link "metro" "dsp/metro.org")41(ww-add-link "metro" "dsp/metro.org")
42(ww-add-link "mtof" "dsp/mtof.org")
42 43
43# sync and close44# sync and close
44 45

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