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.

67 lines
1.9KB

  1. #include "NauModular.hpp"
  2. RACK_PLUGIN_MODEL_DECLARE(NauModular, Tension);
  3. RACK_PLUGIN_MODEL_DECLARE(NauModular, Function);
  4. RACK_PLUGIN_MODEL_DECLARE(NauModular, Perlin);
  5. RACK_PLUGIN_MODEL_DECLARE(NauModular, S_h_it);
  6. RACK_PLUGIN_MODEL_DECLARE(NauModular, BitHammer);
  7. RACK_PLUGIN_MODEL_DECLARE(NauModular, Osc);
  8. RACK_PLUGIN_INIT(NauModular) {
  9. RACK_PLUGIN_INIT_ID();
  10. RACK_PLUGIN_INIT_WEBSITE("http://naus3a.github.io/NauModular");
  11. RACK_PLUGIN_INIT_MANUAL("http://naus3a.github.io/NauModular");
  12. // https://github.com/naus3a/NauModular
  13. RACK_PLUGIN_MODEL_ADD(NauModular, Tension);
  14. RACK_PLUGIN_MODEL_ADD(NauModular, Function);
  15. RACK_PLUGIN_MODEL_ADD(NauModular, Perlin);
  16. RACK_PLUGIN_MODEL_ADD(NauModular, S_h_it);
  17. RACK_PLUGIN_MODEL_ADD(NauModular, BitHammer);
  18. RACK_PLUGIN_MODEL_ADD(NauModular, Osc);
  19. }
  20. /*
  21. void NauModular::init(){
  22. #if defined(TARGET_OSX)
  23. host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &NauModular::cs);
  24. #endif
  25. }
  26. void NauModular::getMonotonicTime(uint64_t & seconds, uint64_t & nanos){
  27. #if defined(TARGET_OSX)
  28. mach_timespec_t now;
  29. clock_get_time(cs, &now);
  30. seconds = now.tv_sec;
  31. nanos = now.tv_nsec;
  32. #elif defined(TARGET_LINUX)
  33. struct timespec now;
  34. clock_gettime(CLOCK_MONOTONIC, &now);
  35. seconds = now.tv_sec;
  36. nanos = now.tv_nsec;
  37. #elif defined(TARGET_WINDOWS)
  38. LARGE_INTEGER freq;
  39. LARGE_INTEGER counter;
  40. QueryPerformanceFrequency(&freq);
  41. QueryPerformanceCounter(&counter);
  42. seconds = counter.QuadPart/freq.QuadPart;
  43. nanos = (counter.QuadPart % freq.QuadPart)*1000000000/freq.QuadPart;
  44. #else
  45. struct timeval now;
  46. gettimeofday( &now, nullptr );
  47. seconds = now.tv_sec;
  48. nanos = now.tv_usec * 1000;
  49. #endif
  50. }
  51. float NauModular::getTimef(){
  52. uint64_t seconds;
  53. uint64_t nanos;
  54. NauModular::getMonotonicTime(seconds, nanos);
  55. float timef = seconds + ((long long)(nanos))/1000000000.;
  56. return timef;
  57. }
  58. */