25 |
float RTMathBase::CentsToFreqTable[MAX_PITCH * 1200 * 2 + 1]; // +-1200 cents per octave |
float RTMathBase::CentsToFreqTable[MAX_PITCH * 1200 * 2 + 1]; // +-1200 cents per octave |
26 |
float* RTMathBase::pCentsToFreqTable(InitCentsToFreqTable()); |
float* RTMathBase::pCentsToFreqTable(InitCentsToFreqTable()); |
27 |
|
|
28 |
|
#if defined(__APPLE__) |
29 |
|
#include <mach/mach_time.h> |
30 |
|
typedef uint64_t time_stamp_t; |
31 |
|
static inline time_stamp_t GetMachTime() { |
32 |
|
return (time_stamp_t) mach_absolute_time(); |
33 |
|
} |
34 |
|
#endif |
35 |
|
|
36 |
/* |
/* |
37 |
* Creates a real time stamp for the current moment. Out of efficiency this |
* Creates a real time stamp for the current moment. Out of efficiency this |
38 |
* is implemented in inline assembly for each CPU independently; we currently |
* is implemented in inline assembly for each CPU independently; we currently |
67 |
time_stamp_t t; |
time_stamp_t t; |
68 |
__asm__ __volatile__ ("rpcc %0" : "=r"(t)); |
__asm__ __volatile__ ("rpcc %0" : "=r"(t)); |
69 |
return t; |
return t; |
70 |
|
#elif defined(__APPLE__) |
71 |
|
return GetMachTime(); |
72 |
#else // we don't want to use a slow generic solution |
#else // we don't want to use a slow generic solution |
73 |
# error "Sorry, LinuxSampler lacks time stamp code for your system." |
# error "Sorry, LinuxSampler lacks time stamp code for your system." |
74 |
# error "Please report this error and the CPU you are using to the LinuxSampler developers mailing list!" |
# error "Please report this error and the CPU you are using to the LinuxSampler developers mailing list!" |