1
0

sps_common.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _SPS_COMMON_H_
  2. #define _SPS_COMMON_H_
  3. #if (_MSC_VER <= 1200)
  4. typedef int intptr_t;
  5. #endif
  6. #include "..\..\..\ns-eel2\ns-eel.h"
  7. #include "api__dsp_sps.h"
  8. #define MAX_CODE_LEN 32768
  9. #define MAX_LABEL_LEN 32
  10. char *SPSHELP_gethelptext(int sel);
  11. typedef struct
  12. {
  13. char code_text[3][MAX_CODE_LEN];
  14. char slider_labels[4][3][MAX_LABEL_LEN];
  15. int sliderpos[4];
  16. } SPSPresetConfig;
  17. // someday we'll have multiple of these, stackable like :)
  18. typedef struct
  19. {
  20. CRITICAL_SECTION code_cs;
  21. int code_needrecompile; // &1 = init, &2 = per sample, &4=slider
  22. NSEEL_VMCTX vm_ctx;
  23. NSEEL_CODEHANDLE code[3];
  24. void *sample_buffer;
  25. int sample_buffer_len;
  26. int last_nch, last_srate;
  27. struct
  28. {
  29. double *spl0, *spl1;
  30. double *skip;
  31. double *repeat;
  32. double *nch;
  33. double *srate;
  34. double *sliders1,*sliders2,*sliders3,*sliders4;
  35. double *trigger1,*trigger2,*trigger3,*trigger4;
  36. } vars;
  37. int triggers[4];
  38. int sliderchange;
  39. int bypass; // def1
  40. SPSPresetConfig curpreset;
  41. char curpreset_name[2048];
  42. }
  43. SPSEffectContext;
  44. void SPS_initapp();
  45. void SPS_quitapp();
  46. void SPS_initcontext(SPSEffectContext *ctx);
  47. void SPS_quitcontext(SPSEffectContext *ctx);
  48. int SPS_process_samples(SPSEffectContext *ctx, void *samples,
  49. int numsamples, int isfloat, int bps,
  50. int nch, int srate, int maxout, int minout);
  51. void SPS_load_preset(SPSEffectContext *ctx, char *filename, char *section);
  52. void SPS_save_preset(SPSEffectContext *ctx, char *filename, char *section);
  53. #endif