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.

35 lines
601B

  1. #pragma once
  2. #include <string.h>
  3. #include <algorithm>
  4. #include "rack.hpp"
  5. using namespace rack;
  6. namespace bogaudio {
  7. template <typename TModule, typename TModuleWidget, typename... Tags>
  8. Model* createModel(
  9. const char* slug,
  10. const char* name,
  11. const char* description,
  12. Tags... tags
  13. ) {
  14. const int n = 256;
  15. char buf[n];
  16. std::string uName = name;
  17. for (auto& c: uName) {
  18. c = toupper(c);
  19. }
  20. snprintf(buf, n, "%s - %s - %dHP", uName.c_str(), description, TModuleWidget::hp);
  21. return Model::create<TModule, TModuleWidget>(
  22. "Bogaudio",
  23. slug,
  24. buf,
  25. tags...
  26. );
  27. }
  28. } // namespace bogaudio