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.

46 lines
1.6KB

  1. #pragma once
  2. #include <functional>
  3. #include <cstdarg>
  4. #include <string>
  5. struct SYNTH_T;
  6. //Link between realtime and non-realtime layers
  7. class MiddleWare
  8. {
  9. public:
  10. MiddleWare(SYNTH_T synth, int prefered_port = -1);
  11. ~MiddleWare(void);
  12. void updateResources(Master *m);
  13. //returns internal master pointer
  14. class Master *spawnMaster(void);
  15. //return UI interface
  16. class Fl_Osc_Interface *spawnUiApi(void);
  17. //Set callback to push UI events to
  18. void setUiCallback(void(*cb)(void*,const char *),void *ui);
  19. //Set callback to run while busy
  20. void setIdleCallback(void(*cb)(void*),void *ptr);
  21. //Set callback to run when master changed
  22. void setMasterChangedCallback(void(*cb)(void*,Master*),void *ptr);
  23. //Handle events
  24. void tick(void);
  25. //Do A Readonly Operation (For Parameter Copy)
  26. void doReadOnlyOp(std::function<void()>);
  27. //Handle a rtosc Message uToB
  28. void transmitMsg(const char *);
  29. //Handle a rtosc Message uToB
  30. void transmitMsg(const char *, const char *args, ...);
  31. //Handle a rtosc Message uToB
  32. void transmitMsg(const char *, const char *args, va_list va);
  33. //Indicate that a program will be loaded on a known part
  34. void pendingSetProgram(int part, int program);
  35. //Get/Set the active bToU url
  36. std::string activeUrl(void);
  37. void activeUrl(std::string u);
  38. //View Synthesis Parameters
  39. const SYNTH_T &getSynth(void) const;
  40. //liblo stuff
  41. const char* getServerAddress(void) const;
  42. private:
  43. class MiddleWareImpl *impl;
  44. };