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.

44 lines
840B

  1. #pragma once
  2. /**
  3. * Base class for composites embeddable in a VCV Widget
  4. * This is used for "real" implementations
  5. */
  6. class WidgetComposite
  7. {
  8. public:
  9. WidgetComposite(Module * parent) :
  10. inputs(parent->inputs),
  11. outputs(parent->outputs),
  12. params(parent->params),
  13. lights(parent->lights)
  14. {
  15. }
  16. virtual void step()
  17. {
  18. };
  19. float engineGetSampleRate()
  20. {
  21. #ifdef __V1
  22. return APP->engine->getSampleRate();
  23. #else
  24. return ::engineGetSampleRate();
  25. #endif
  26. }
  27. float engineGetSampleTime()
  28. {
  29. #ifdef __V1
  30. return APP->engine->getSampleTime();
  31. #else
  32. return ::engineGetSampleTime();
  33. #endif
  34. }
  35. protected:
  36. std::vector<Input>& inputs;
  37. std::vector<Output>& outputs;
  38. std::vector<Param>& params;
  39. std::vector<Light>& lights;
  40. private:
  41. };