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.

73 lines
2.4KB

  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. //Enable AutoSave Functionality
  19. void enableAutoSave(int interval_sec=60);
  20. //Check for old automatic saves which should only exist if multiple
  21. //instances are in use OR when there was a crash
  22. //
  23. //When an old save is found return the id of the save file
  24. int checkAutoSave(void);
  25. void removeAutoSave(void);
  26. //return UI interface
  27. class Fl_Osc_Interface *spawnUiApi(void);
  28. //Set callback to push UI events to
  29. void setUiCallback(void(*cb)(void*,const char *),void *ui);
  30. //Set callback to run while busy
  31. void setIdleCallback(void(*cb)(void*),void *ptr);
  32. //Handle events
  33. void tick(void);
  34. //Do A Readonly Operation (For Parameter Copy)
  35. void doReadOnlyOp(std::function<void()>);
  36. //Handle a rtosc Message uToB
  37. void transmitMsg(const char *);
  38. //Handle a rtosc Message uToB
  39. void transmitMsg(const char *, const char *args, ...);
  40. //Handle a rtosc Message uToB
  41. void transmitMsg_va(const char *, const char *args, va_list va);
  42. //Send a message to middleware from an arbitrary thread
  43. void messageAnywhere(const char *msg, const char *args, ...);
  44. //Indicate that a bank will be loaded
  45. //NOTE: Can only be called by realtime thread
  46. void pendingSetBank(int bank);
  47. //Indicate that a program will be loaded on a known part
  48. //NOTE: Can only be called by realtime thread
  49. void pendingSetProgram(int part, int program);
  50. //Get/Set the active bToU url
  51. std::string activeUrl(void);
  52. void activeUrl(std::string u);
  53. //View Synthesis Parameters
  54. const SYNTH_T &getSynth(void) const;
  55. //liblo stuff
  56. const char* getServerAddress(void) const;
  57. const PresetsStore& getPresetsStore() const;
  58. PresetsStore& getPresetsStore();
  59. private:
  60. class MiddleWareImpl *impl;
  61. };