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.

52 lines
1.7KB

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