#ifndef SYNTHDESC_H_INCLUDED
#define SYNTHDESC_H_INCLUDED

#include "interact.h"

struct synthdesc {
  int size;
  const char* name;
  void (*init)(void* synth, float samplerate, float freq[128]);
  void (*finalize)(void* synth); // does not free memory
  void (*process)(void* synth, int length, float const * const restrict * restrict in, float * const restrict *restrict out);
  void (*keydown)(void* synth, int key, float velocity);
  void (*keyup)(void* synth, int key);
  void (*pitchbend)(void* synth, float cents);
  void (*mod)(void* synth, float value);
  void (*vol)(void* synth, float value);
  struct paramdesc* params;
  struct command* commands;
  void (*retune)(void* synth, float freq[128]);
};

struct paramdesc {
  const char* name;
  const char* unit;
  double min,def,max;
  int isEnum:1;
};

#endif
