mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-08 04:20:09 +00:00
Correction to String::copyToUTF8. Millisecond timer rollover fix. Added channel count to BufferingAudioSource. Hashmap speed-up. Added Identifier::isValidIdentifier.
This commit is contained in:
parent
f307045b92
commit
b820ec4567
21 changed files with 264 additions and 270 deletions
|
|
@ -142,7 +142,7 @@ int64 Time::getHighResolutionTicks() noexcept
|
|||
timespec t;
|
||||
clock_gettime (CLOCK_MONOTONIC, &t);
|
||||
|
||||
return (t.tv_sec * (int64) 1000000) + (t.tv_nsec / (int64) 1000);
|
||||
return (t.tv_sec * (int64) 1000000) + (t.tv_nsec / 1000);
|
||||
}
|
||||
|
||||
int64 Time::getHighResolutionTicksPerSecond() noexcept
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ int64 Time::getHighResolutionTicks() noexcept
|
|||
timespec t;
|
||||
clock_gettime (CLOCK_MONOTONIC, &t);
|
||||
|
||||
return (t.tv_sec * (int64) 1000000) + (t.tv_nsec / (int64) 1000);
|
||||
return (t.tv_sec * (int64) 1000000) + (t.tv_nsec / 1000);
|
||||
}
|
||||
|
||||
int64 Time::getHighResolutionTicksPerSecond() noexcept
|
||||
|
|
|
|||
|
|
@ -274,8 +274,6 @@ public:
|
|||
timerCallback();
|
||||
}
|
||||
|
||||
~ScreenSaverDefeater() {}
|
||||
|
||||
void timerCallback()
|
||||
{
|
||||
if (Process::isForegroundProcess())
|
||||
|
|
|
|||
|
|
@ -190,13 +190,15 @@ public:
|
|||
{
|
||||
mach_timebase_info_data_t timebase;
|
||||
(void) mach_timebase_info (&timebase);
|
||||
highResTimerFrequency = (int64) (1.0e9 * timebase.denom / timebase.numer);
|
||||
highResTimerToMillisecRatio = timebase.numer / (1.0e6 * timebase.denom);
|
||||
highResTimerFrequency = (timebase.denom * (int64) 1000000000) / timebase.numer;
|
||||
numerator = timebase.numer;
|
||||
denominator = timebase.denom * (int64) 1000000;
|
||||
highResTimerToMillisecRatio = numerator / (double) denominator;
|
||||
}
|
||||
|
||||
inline uint32 millisecondsSinceStartup() const noexcept
|
||||
{
|
||||
return (uint32) (mach_absolute_time() * highResTimerToMillisecRatio);
|
||||
return (uint32) ((mach_absolute_time() * numerator) / denominator);
|
||||
}
|
||||
|
||||
inline double getMillisecondCounterHiRes() const noexcept
|
||||
|
|
@ -205,6 +207,9 @@ public:
|
|||
}
|
||||
|
||||
int64 highResTimerFrequency;
|
||||
|
||||
private:
|
||||
int64 numerator, denominator;
|
||||
double highResTimerToMillisecRatio;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue