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.

66 lines
1.8KB

  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. RACK_PLUGIN_MODEL_ADD(NauModular, Tension);
  13. RACK_PLUGIN_MODEL_ADD(NauModular, Function);
  14. RACK_PLUGIN_MODEL_ADD(NauModular, Perlin);
  15. RACK_PLUGIN_MODEL_ADD(NauModular, S_h_it);
  16. RACK_PLUGIN_MODEL_ADD(NauModular, BitHammer);
  17. RACK_PLUGIN_MODEL_ADD(NauModular, Osc);
  18. }
  19. /*
  20. void NauModular::init(){
  21. #if defined(TARGET_OSX)
  22. host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &NauModular::cs);
  23. #endif
  24. }
  25. void NauModular::getMonotonicTime(uint64_t & seconds, uint64_t & nanos){
  26. #if defined(TARGET_OSX)
  27. mach_timespec_t now;
  28. clock_get_time(cs, &now);
  29. seconds = now.tv_sec;
  30. nanos = now.tv_nsec;
  31. #elif defined(TARGET_LINUX)
  32. struct timespec now;
  33. clock_gettime(CLOCK_MONOTONIC, &now);
  34. seconds = now.tv_sec;
  35. nanos = now.tv_nsec;
  36. #elif defined(TARGET_WINDOWS)
  37. LARGE_INTEGER freq;
  38. LARGE_INTEGER counter;
  39. QueryPerformanceFrequency(&freq);
  40. QueryPerformanceCounter(&counter);
  41. seconds = counter.QuadPart/freq.QuadPart;
  42. nanos = (counter.QuadPart % freq.QuadPart)*1000000000/freq.QuadPart;
  43. #else
  44. struct timeval now;
  45. gettimeofday( &now, nullptr );
  46. seconds = now.tv_sec;
  47. nanos = now.tv_usec * 1000;
  48. #endif
  49. }
  50. float NauModular::getTimef(){
  51. uint64_t seconds;
  52. uint64_t nanos;
  53. NauModular::getMonotonicTime(seconds, nanos);
  54. float timef = seconds + ((long long)(nanos))/1000000000.;
  55. return timef;
  56. }
  57. */