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.

60 lines
2.0KB

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