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.

51 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. Module *getModule(int moduleId);
  25. void resetModule(Module *module);
  26. void randomizeModule(Module *module);
  27. void bypassModule(Module *module, bool bypass);
  28. /** Does not transfer pointer ownership. */
  29. void addCable(Cable *cable);
  30. void removeCable(Cable *cable);
  31. void setParam(Module *module, int paramId, float value);
  32. float getParam(Module *module, int paramId);
  33. void setSmoothParam(Module *module, int paramId, float value);
  34. float getSmoothParam(Module *module, int paramId);
  35. int getNextModuleId();
  36. void setSampleRate(float sampleRate);
  37. float getSampleRate();
  38. /** Returns the inverse of the current sample rate */
  39. float getSampleTime();
  40. };
  41. } // namespace engine
  42. } // namespace rack