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_Interface.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma once
  2. #include <stdio.h>
  3. #include <string>
  4. using std::string;
  5. #ifdef NO_UI
  6. class Fl_Osc_Widget
  7. {
  8. public:
  9. //Callback methods
  10. virtual void OSC_value(float){};
  11. virtual void OSC_value(bool){};
  12. virtual void OSC_value(int){};
  13. virtual void OSC_value(char){};
  14. virtual void OSC_value(unsigned,void*){};
  15. virtual void OSC_value(const char *){};
  16. //labeled forwarding methods
  17. virtual void OSC_value(float x, const char *){};
  18. virtual void OSC_value(bool x, const char *){};
  19. virtual void OSC_value(int x, const char *){};
  20. virtual void OSC_value(char x, const char *){};
  21. virtual void OSC_value(unsigned x, void *v, const char *){};
  22. virtual void OSC_value(const char *x, const char *){};
  23. //Raw messages
  24. virtual void OSC_raw(const char *){};
  25. //Widget methods
  26. void oscWrite(std::string path, const char *args, ...){};
  27. void oscWrite(std::string path){};
  28. void oscRegister(const char *path){};
  29. //Forces an update of parameters as they have become stale somehow
  30. virtual void update(void){};
  31. //Smoothly change the base path
  32. virtual void rebase(std::string new_base){};
  33. void oscMove(std::string new_ext){};
  34. //Explict version for weirdly routed controls
  35. void oscMove(std::string old_loc, std::string new_loc){};
  36. };
  37. #endif
  38. class Fl_Osc_Interface
  39. {
  40. public:
  41. virtual ~Fl_Osc_Interface(void){};
  42. //It is assumed that you want to have a registry for all of these
  43. //elements
  44. virtual void createLink(string, class Fl_Osc_Widget *) {};
  45. virtual void renameLink(string,string,class Fl_Osc_Widget*){};
  46. virtual void removeLink(string,class Fl_Osc_Widget*){};
  47. virtual void removeLink(class Fl_Osc_Widget*){};
  48. //and to be able to give them events
  49. virtual void tryLink(const char *){};
  50. //Damage the values of a collection of widgets
  51. virtual void damage(const char*){};
  52. //Communication link
  53. virtual void requestValue(string s) { printf("request: '%s'...\n", s.c_str()); };
  54. virtual void writeValue(string s, float f){printf("%s -> %f\n",s.c_str(), f); };
  55. virtual void writeValue(string s, char c){printf("%s->%d\n", s.c_str(), c);};
  56. virtual void writeValue(string, int){};
  57. virtual void writeValue(string, bool){};
  58. virtual void writeValue(string, string){};
  59. virtual void write(string s) {write(s, "");};//{printf("write: '%s'\n", s.c_str());};
  60. virtual void write(string, const char *, ...) {};//{printf("write: '%s'\n", s.c_str());};
  61. virtual void writeRaw(const char *) {}
  62. };