mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-07 04:10:08 +00:00
Added Value support to the Button's toggle state and TextEditor content. Refactored the atomic operation functions to live inside a class called Atomic, and the byte order functions into a class called ByteOrder.
This commit is contained in:
parent
3ddbc82f9f
commit
18ffeba9da
64 changed files with 3721 additions and 3609 deletions
|
|
@ -413,7 +413,7 @@ void juce_findFileClose (void* handle)
|
|||
bool juce_launchFile (const String& fileName,
|
||||
const String& parameters)
|
||||
{
|
||||
String cmdString (fileName);
|
||||
String cmdString (fileName.replace (T(" "), T("\\ "),false));
|
||||
cmdString << " " << parameters;
|
||||
|
||||
if (URL::isProbablyAWebsiteURL (fileName)
|
||||
|
|
|
|||
|
|
@ -28,32 +28,6 @@
|
|||
#if JUCE_INCLUDED_FILE
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/*static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatures) throw()
|
||||
{
|
||||
unsigned int cpu = 0;
|
||||
unsigned int ext = 0;
|
||||
unsigned int family = 0;
|
||||
unsigned int dummy = 0;
|
||||
|
||||
#if JUCE_64BIT
|
||||
__asm__ ("cpuid"
|
||||
: "=a" (family), "=b" (ext), "=c" (dummy), "=d" (cpu) : "a" (1));
|
||||
|
||||
#else
|
||||
__asm__ ("push %%ebx; cpuid; mov %%ebx, %%edi; pop %%ebx"
|
||||
: "=a" (family), "=D" (ext), "=c" (dummy), "=d" (cpu) : "a" (1));
|
||||
#endif
|
||||
|
||||
if (familyModel != 0)
|
||||
*familyModel = family;
|
||||
|
||||
if (extFeatures != 0)
|
||||
*extFeatures = ext;
|
||||
|
||||
return cpu;
|
||||
}*/
|
||||
|
||||
//==============================================================================
|
||||
void Logger::outputDebugString (const String& text) throw()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ void Process::terminate()
|
|||
exit (0);
|
||||
}
|
||||
|
||||
bool JUCE_CALLTYPE juce_isRunningUnderDebugger()
|
||||
bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger()
|
||||
{
|
||||
static char testResult = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ void Logger::outputDebugPrintf (const tchar* format, ...) throw()
|
|||
outputDebugString (text);
|
||||
}
|
||||
|
||||
bool JUCE_CALLTYPE juce_isRunningUnderDebugger()
|
||||
bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger()
|
||||
{
|
||||
static char testResult = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1466,7 +1466,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*dest++ = (float) (g * (short) littleEndianShort (src));
|
||||
*dest++ = (float) (g * (short) ByteOrder::littleEndianShort (src));
|
||||
src += srcStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1474,7 +1474,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*dest++ = (float) (g * (short) bigEndianShort (src));
|
||||
*dest++ = (float) (g * (short) ByteOrder::bigEndianShort (src));
|
||||
src += srcStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1492,7 +1492,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*(uint16*) dest = swapIfBigEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
*(uint16*) dest = ByteOrder::swapIfBigEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
dest += dstStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1500,7 +1500,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*(uint16*) dest = swapIfLittleEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
*(uint16*) dest = ByteOrder::swapIfLittleEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
dest += dstStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1518,7 +1518,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*dest++ = (float) (g * littleEndian24Bit (src));
|
||||
*dest++ = (float) (g * ByteOrder::littleEndian24Bit (src));
|
||||
src += srcStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1526,7 +1526,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*dest++ = (float) (g * bigEndian24Bit (src));
|
||||
*dest++ = (float) (g * ByteOrder::bigEndian24Bit (src));
|
||||
src += srcStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1544,7 +1544,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
littleEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest);
|
||||
ByteOrder::littleEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest);
|
||||
dest += dstStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1552,7 +1552,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
bigEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest);
|
||||
ByteOrder::bigEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest);
|
||||
dest += dstStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1570,7 +1570,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*dest++ = (float) (g * (int) littleEndianInt (src));
|
||||
*dest++ = (float) (g * (int) ByteOrder::littleEndianInt (src));
|
||||
src += srcStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1578,7 +1578,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*dest++ = (float) (g * (int) bigEndianInt (src));
|
||||
*dest++ = (float) (g * (int) ByteOrder::bigEndianInt (src));
|
||||
src += srcStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1596,7 +1596,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*(uint32*) dest = swapIfBigEndian ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
*(uint32*) dest = ByteOrder::swap ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
dest += dstStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1604,7 +1604,7 @@ private:
|
|||
{
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
*(uint32*) dest = swapIfLittleEndian ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
*(uint32*) dest = ByteOrder::swap ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)));
|
||||
dest += dstStrideBytes;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ static int getMACAddressViaGetAdaptersInfo (int64* addresses, int maxNum, const
|
|||
mac = (mac << 8) | adapter->Address[i];
|
||||
|
||||
if (littleEndian)
|
||||
mac = (int64) swapByteOrder ((uint64) mac);
|
||||
mac = (int64) ByteOrder::swap ((uint64) mac);
|
||||
|
||||
if (numFound < maxNum && mac != 0)
|
||||
addresses [numFound++] = mac;
|
||||
|
|
|
|||
|
|
@ -59,20 +59,6 @@ static double hiResTicksScaleFactor;
|
|||
#pragma intrinsic (__cpuid)
|
||||
#pragma intrinsic (__rdtsc)
|
||||
|
||||
/*static unsigned int getCPUIDWord (int* familyModel = 0, int* extFeatures = 0) throw()
|
||||
{
|
||||
int info [4];
|
||||
__cpuid (info, 1);
|
||||
|
||||
if (familyModel != 0)
|
||||
*familyModel = info [0];
|
||||
|
||||
if (extFeatures != 0)
|
||||
*extFeatures = info[1];
|
||||
|
||||
return info[3];
|
||||
}*/
|
||||
|
||||
const String SystemStats::getCpuVendor() throw()
|
||||
{
|
||||
int info [4];
|
||||
|
|
@ -91,50 +77,6 @@ const String SystemStats::getCpuVendor() throw()
|
|||
//==============================================================================
|
||||
// CPU info functions using old fashioned inline asm...
|
||||
|
||||
/*static juce_noinline unsigned int getCPUIDWord (int* familyModel = 0, int* extFeatures = 0)
|
||||
{
|
||||
unsigned int cpu = 0;
|
||||
unsigned int ext = 0;
|
||||
unsigned int family = 0;
|
||||
|
||||
#if JUCE_GCC
|
||||
unsigned int dummy = 0;
|
||||
#endif
|
||||
|
||||
#ifndef __MINGW32__
|
||||
__try
|
||||
#endif
|
||||
{
|
||||
#if JUCE_GCC
|
||||
__asm__ ("cpuid" : "=a" (family), "=b" (ext), "=c" (dummy),"=d" (cpu) : "a" (1));
|
||||
#else
|
||||
__asm
|
||||
{
|
||||
mov eax, 1
|
||||
cpuid
|
||||
mov cpu, edx
|
||||
mov family, eax
|
||||
mov ext, ebx
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (familyModel != 0)
|
||||
*familyModel = family;
|
||||
|
||||
if (extFeatures != 0)
|
||||
*extFeatures = ext;
|
||||
|
||||
return cpu;
|
||||
}*/
|
||||
|
||||
static void juce_getCpuVendor (char* const v)
|
||||
{
|
||||
int vendor[4];
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ void Process::setPriority (ProcessPriority prior)
|
|||
}
|
||||
}
|
||||
|
||||
bool JUCE_API JUCE_CALLTYPE juce_isRunningUnderDebugger()
|
||||
bool JUCE_PUBLIC_FUNCTION juce_isRunningUnderDebugger()
|
||||
{
|
||||
return IsDebuggerPresent() != FALSE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue