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.

Fl_Osc_Slider.H 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Fl_Osc_Slider.H - OSC Based Slider
  4. Copyright (C) 2016 Mark McCurry
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. */
  10. #pragma once
  11. #include <FL/Fl_Slider.H>
  12. #include "Fl_Osc_Widget.H"
  13. #include <string>
  14. class Fl_Osc_Slider:public Fl_Slider, public Fl_Osc_Widget
  15. {
  16. public:
  17. Fl_Osc_Slider(int X, int Y, int W, int H, const char *label = NULL);
  18. // string name,
  19. // const char *metadata);
  20. virtual ~Fl_Osc_Slider(void);
  21. void OSC_value(int) override;
  22. void OSC_value(float) override;
  23. void OSC_value(char) override;
  24. void init(std::string, char type = 'f');
  25. //Refetch parameter information
  26. void update(void);
  27. void callback(Fl_Callback *cb, void *p = NULL);
  28. //MIDI Learn
  29. int handle(int ev, int X, int Y, int W, int H);
  30. int handle(int ev);
  31. virtual void cb(void);
  32. static void _cb(Fl_Widget *w, void *);
  33. float reset_value;
  34. protected:
  35. char osc_type;
  36. std::pair<Fl_Callback*, void*> cb_data;
  37. private:
  38. float old_value;
  39. int mod_state;
  40. int slow_state;
  41. int start_pos;
  42. bool just_pushed;
  43. float denominator;
  44. };