Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2KB

  1. #pragma once
  2. #include <FL/Fl_Box.H>
  3. #include "../Params/EnvelopeParams.h"
  4. #include "Fl_Osc_Widget.H"
  5. //Define the types of envelope (TODO a properly located enum)
  6. //TODO check if ASR should be ASR *OR* ADR
  7. #define ENV_ADSR 1
  8. //#define ENV_ADSR 2
  9. #define ENV_ASR 3
  10. #define ENV_ADSR_FILTER 4
  11. #define ENV_ADSR_BW 5
  12. class EnvelopeFreeEdit : public Fl_Box, public Fl_Osc_Widget
  13. {
  14. public:
  15. EnvelopeFreeEdit(int x,int y, int w, int h, const char *label=0);
  16. void init(void);
  17. void setpair(Fl_Box *pair_);
  18. int handle(int event) override;
  19. void draw(void) override;
  20. void OSC_raw(const char *msg) override;
  21. void update(void) override;
  22. void rebase(std::string new_base) override;
  23. int lastpoint;
  24. //How many points
  25. char Penvpoints;
  26. private:
  27. int getpointx(int n) const;
  28. int getpointy(int n) const;
  29. int getnearest(int x,int y) const;
  30. float getdt(int i) const;
  31. Fl_Box *pair; //XXX what the heck is this?
  32. //cursor state
  33. int currentpoint, cpx, cpdt;
  34. //The Points
  35. char Penvdt[MAX_ENVELOPE_POINTS];
  36. char Penvval[MAX_ENVELOPE_POINTS];
  37. //The Sustain point
  38. char Penvsustain;
  39. };