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.

50 lines
1.2KB

  1. #pragma once
  2. #include "common.hpp"
  3. #include "engine/Module.hpp"
  4. #include "engine/Cable.hpp"
  5. #include <vector>
  6. namespace rack {
  7. namespace engine {
  8. struct Engine {
  9. struct Internal;
  10. Internal *internal;
  11. Engine();
  12. ~Engine();
  13. /** Starts engine thread. */
  14. void start();
  15. /** Stops engine thread. */
  16. void stop();
  17. void setThreadCount(int threadCount);
  18. int getThreadCount();
  19. void setPaused(bool paused);
  20. bool isPaused();
  21. /** Does not transfer pointer ownership. */
  22. void addModule(Module *module);
  23. void removeModule(Module *module);
  24. void resetModule(Module *module);
  25. void randomizeModule(Module *module);
  26. void bypassModule(Module *module, bool bypass);
  27. /** Does not transfer pointer ownership. */
  28. void addCable(Cable *cable);
  29. void removeCable(Cable *cable);
  30. void setParam(Module *module, int paramId, float value);
  31. float getParam(Module *module, int paramId);
  32. void setSmoothParam(Module *module, int paramId, float value);
  33. float getSmoothParam(Module *module, int paramId);
  34. int getNextModuleId();
  35. void setSampleRate(float sampleRate);
  36. float getSampleRate();
  37. /** Returns the inverse of the current sample rate */
  38. float getSampleTime();
  39. };
  40. } // namespace engine
  41. } // namespace rack