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.

69 lines
2.1KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Fl_Osc_Widget.H - OSC Widget Superclass
  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 <string>
  12. #include <cstring>
  13. #include <cassert>
  14. #include <cmath>
  15. #include "Fl_Osc_Interface.h"
  16. #include <FL/Fl_Group.H>
  17. class Fl_Osc_Widget
  18. {
  19. public:
  20. Fl_Osc_Widget(void); //Deprecated
  21. Fl_Osc_Widget(Fl_Widget *self);
  22. Fl_Osc_Widget(std::string loc, Fl_Osc_Interface *osc);
  23. virtual ~Fl_Osc_Widget(void);
  24. //Callback methods
  25. virtual void OSC_value(float);
  26. virtual void OSC_value(bool);
  27. virtual void OSC_value(int);
  28. virtual void OSC_value(char);
  29. virtual void OSC_value(unsigned,void*);
  30. virtual void OSC_value(const char *);
  31. //labeled forwarding methods
  32. virtual void OSC_value(float x, const char *);
  33. virtual void OSC_value(bool x, const char *);
  34. virtual void OSC_value(int x, const char *);
  35. virtual void OSC_value(char x, const char *);
  36. virtual void OSC_value(unsigned x, void *v, const char *);
  37. virtual void OSC_value(const char *x, const char *);
  38. //Raw messages
  39. virtual void OSC_raw(const char *);
  40. //Widget methods
  41. void oscWrite(std::string path, const char *args, ...);
  42. void oscWrite(std::string path);
  43. void oscRegister(const char *path);
  44. //Forces an update of parameters as they have become stale somehow
  45. virtual void update(void);
  46. //Smoothly change the base path
  47. virtual void rebase(std::string new_base);
  48. void oscMove(std::string new_ext);
  49. //Explict version for weirdly routed controls
  50. void oscMove(std::string old_loc, std::string new_loc);
  51. //Base path
  52. std::string loc;
  53. //Extension
  54. std::string ext;
  55. Fl_Osc_Interface *osc;
  56. protected:
  57. class Fl_Osc_Pane *fetch_osc_pane(Fl_Widget *w);
  58. };