mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-08 04:20:09 +00:00
couple of small fixes to Timers, mac file searching and linux build macros
This commit is contained in:
parent
d74275a9e9
commit
97ef44e1e6
6 changed files with 18 additions and 10 deletions
|
|
@ -799,7 +799,7 @@ void Random::setSeed (const int64 newSeed) throw()
|
|||
|
||||
void Random::setSeedRandomly()
|
||||
{
|
||||
Random r1 (SystemStats::getClockCycleCounter());
|
||||
Random r1 (Time::getMillisecondCounter());
|
||||
Random r2 (Time::getHighResolutionTicks());
|
||||
Random r3 (Time::getHighResolutionTicksPerSecond());
|
||||
Random r4 (Time::currentTimeMillis());
|
||||
|
|
@ -6510,7 +6510,7 @@ END_JUCE_NAMESPACE
|
|||
#endif
|
||||
|
||||
#else
|
||||
#ifdef LINUX
|
||||
#if defined (LINUX) || defined (__linux__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/errno.h>
|
||||
|
|
@ -36848,13 +36848,17 @@ public:
|
|||
if (instance == 0)
|
||||
instance = new InternalTimerThread();
|
||||
|
||||
const ScopedLock sl (instance->lock);
|
||||
instance->addTimer (tim);
|
||||
}
|
||||
|
||||
static inline void remove (Timer* const tim) throw()
|
||||
{
|
||||
if (instance != 0)
|
||||
{
|
||||
const ScopedLock sl (instance->lock);
|
||||
instance->removeTimer (tim);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void resetCounter (Timer* const tim,
|
||||
|
|
@ -36868,6 +36872,7 @@ public:
|
|||
if ((tim->next != 0 && tim->next->countdownMs < tim->countdownMs)
|
||||
|| (tim->previous != 0 && tim->previous->countdownMs > tim->countdownMs))
|
||||
{
|
||||
const ScopedLock sl (instance->lock);
|
||||
instance->removeTimer (tim);
|
||||
instance->addTimer (tim);
|
||||
}
|
||||
|
|
@ -262856,8 +262861,7 @@ int64 Time::getHighResolutionTicksPerSecond() throw()
|
|||
|
||||
int64 SystemStats::getClockCycleCounter() throw()
|
||||
{
|
||||
jassertfalse
|
||||
return 0;
|
||||
return (int64) AudioGetCurrentHostTime();
|
||||
}
|
||||
|
||||
bool Time::setSystemTimeToThisTime() const throw()
|
||||
|
|
@ -264133,7 +264137,7 @@ struct FindFileStruct
|
|||
|
||||
if (fnmatch (wildCardUTF8, de->d_name, 0) == 0)
|
||||
{
|
||||
result = PlatformUtilities::convertToPrecomposedUnicode (String::fromUTF8 ((const uint8*) de->d_name));
|
||||
result = String::fromUTF8 ((const uint8*) de->d_name);
|
||||
|
||||
const String path (parentDir + result);
|
||||
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@
|
|||
#if (defined (_WIN32) || defined (_WIN64))
|
||||
#define JUCE_WIN32 1
|
||||
#else
|
||||
#ifdef LINUX
|
||||
#if defined (LINUX) || defined (__linux__)
|
||||
#define JUCE_LINUX 1
|
||||
#else
|
||||
#define JUCE_MAC 1
|
||||
|
|
|
|||
|
|
@ -273,13 +273,17 @@ public:
|
|||
if (instance == 0)
|
||||
instance = new InternalTimerThread();
|
||||
|
||||
const ScopedLock sl (instance->lock);
|
||||
instance->addTimer (tim);
|
||||
}
|
||||
|
||||
static inline void remove (Timer* const tim) throw()
|
||||
{
|
||||
if (instance != 0)
|
||||
{
|
||||
const ScopedLock sl (instance->lock);
|
||||
instance->removeTimer (tim);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void resetCounter (Timer* const tim,
|
||||
|
|
@ -293,6 +297,7 @@ public:
|
|||
if ((tim->next != 0 && tim->next->countdownMs < tim->countdownMs)
|
||||
|| (tim->previous != 0 && tim->previous->countdownMs > tim->countdownMs))
|
||||
{
|
||||
const ScopedLock sl (instance->lock);
|
||||
instance->removeTimer (tim);
|
||||
instance->addTimer (tim);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
#if (defined (_WIN32) || defined (_WIN64))
|
||||
#define JUCE_WIN32 1
|
||||
#else
|
||||
#ifdef LINUX
|
||||
#if defined (LINUX) || defined (__linux__)
|
||||
#define JUCE_LINUX 1
|
||||
#else
|
||||
#define JUCE_MAC 1
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ BEGIN_JUCE_NAMESPACE
|
|||
|
||||
#include "juce_Random.h"
|
||||
#include "juce_Time.h"
|
||||
#include "juce_SystemStats.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -55,7 +54,7 @@ void Random::setSeed (const int64 newSeed) throw()
|
|||
|
||||
void Random::setSeedRandomly()
|
||||
{
|
||||
Random r1 (SystemStats::getClockCycleCounter());
|
||||
Random r1 (Time::getMillisecondCounter());
|
||||
Random r2 (Time::getHighResolutionTicks());
|
||||
Random r3 (Time::getHighResolutionTicksPerSecond());
|
||||
Random r4 (Time::currentTimeMillis());
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#endif
|
||||
|
||||
#else
|
||||
#ifdef LINUX
|
||||
#if defined (LINUX) || defined (__linux__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/errno.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue