1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed a minor AU build error and removed some old macros.

This commit is contained in:
Julian Storer 2010-03-10 13:04:24 +00:00
parent 5419ebc520
commit 858a758aee
24 changed files with 1037 additions and 1172 deletions

View file

@ -138,7 +138,6 @@
#include "../src/text/juce_StringPairArray.cpp" #include "../src/text/juce_StringPairArray.cpp"
#include "../src/text/juce_XmlDocument.cpp" #include "../src/text/juce_XmlDocument.cpp"
#include "../src/text/juce_XmlElement.cpp" #include "../src/text/juce_XmlElement.cpp"
#include "../src/threads/juce_InterProcessLock.cpp"
#include "../src/threads/juce_ReadWriteLock.cpp" #include "../src/threads/juce_ReadWriteLock.cpp"
#include "../src/threads/juce_Thread.cpp" #include "../src/threads/juce_Thread.cpp"
#include "../src/threads/juce_ThreadPool.cpp" #include "../src/threads/juce_ThreadPool.cpp"

File diff suppressed because it is too large Load diff

View file

@ -465,7 +465,6 @@
8481700C10809E00008FEC33 /* juce_InputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9C5104036D6006A1807 /* juce_InputStream.cpp */; }; 8481700C10809E00008FEC33 /* juce_InputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9C5104036D6006A1807 /* juce_InputStream.cpp */; };
8481700D10809E00008FEC33 /* juce_InterprocessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E957104036B3006A1807 /* juce_InterprocessConnection.cpp */; }; 8481700D10809E00008FEC33 /* juce_InterprocessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E957104036B3006A1807 /* juce_InterprocessConnection.cpp */; };
8481700E10809E00008FEC33 /* juce_InterprocessConnectionServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E959104036B3006A1807 /* juce_InterprocessConnectionServer.cpp */; }; 8481700E10809E00008FEC33 /* juce_InterprocessConnectionServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E959104036B3006A1807 /* juce_InterprocessConnectionServer.cpp */; };
8481700F10809E00008FEC33 /* juce_InterProcessLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9DA104036D6006A1807 /* juce_InterProcessLock.cpp */; };
8481701010809E00008FEC33 /* juce_iphone_Audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84816E5110809D07008FEC33 /* juce_iphone_Audio.cpp */; }; 8481701010809E00008FEC33 /* juce_iphone_Audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84816E5110809D07008FEC33 /* juce_iphone_Audio.cpp */; };
8481701210809E00008FEC33 /* juce_iphone_MessageManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84816E5310809D07008FEC33 /* juce_iphone_MessageManager.mm */; }; 8481701210809E00008FEC33 /* juce_iphone_MessageManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84816E5310809D07008FEC33 /* juce_iphone_MessageManager.mm */; };
8481701310809E00008FEC33 /* juce_iphone_MiscUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84816E5410809D07008FEC33 /* juce_iphone_MiscUtilities.mm */; }; 8481701310809E00008FEC33 /* juce_iphone_MiscUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84816E5410809D07008FEC33 /* juce_iphone_MiscUtilities.mm */; };
@ -939,7 +938,6 @@
84F1EA31104036D6006A1807 /* juce_XmlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9D6104036D6006A1807 /* juce_XmlElement.cpp */; }; 84F1EA31104036D6006A1807 /* juce_XmlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9D6104036D6006A1807 /* juce_XmlElement.cpp */; };
84F1EA32104036D6006A1807 /* juce_XmlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9D7104036D6006A1807 /* juce_XmlElement.h */; }; 84F1EA32104036D6006A1807 /* juce_XmlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9D7104036D6006A1807 /* juce_XmlElement.h */; };
84F1EA33104036D6006A1807 /* juce_CriticalSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */; }; 84F1EA33104036D6006A1807 /* juce_CriticalSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */; };
84F1EA34104036D6006A1807 /* juce_InterProcessLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9DA104036D6006A1807 /* juce_InterProcessLock.cpp */; };
84F1EA35104036D6006A1807 /* juce_InterProcessLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */; }; 84F1EA35104036D6006A1807 /* juce_InterProcessLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */; };
84F1EA36104036D6006A1807 /* juce_Process.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9DC104036D6006A1807 /* juce_Process.h */; }; 84F1EA36104036D6006A1807 /* juce_Process.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E9DC104036D6006A1807 /* juce_Process.h */; };
84F1EA37104036D6006A1807 /* juce_ReadWriteLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */; }; 84F1EA37104036D6006A1807 /* juce_ReadWriteLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */; };
@ -1558,7 +1556,6 @@
84F1E9D6104036D6006A1807 /* juce_XmlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_XmlElement.cpp; path = ../../src/text/juce_XmlElement.cpp; sourceTree = SOURCE_ROOT; }; 84F1E9D6104036D6006A1807 /* juce_XmlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_XmlElement.cpp; path = ../../src/text/juce_XmlElement.cpp; sourceTree = SOURCE_ROOT; };
84F1E9D7104036D6006A1807 /* juce_XmlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_XmlElement.h; path = ../../src/text/juce_XmlElement.h; sourceTree = SOURCE_ROOT; }; 84F1E9D7104036D6006A1807 /* juce_XmlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_XmlElement.h; path = ../../src/text/juce_XmlElement.h; sourceTree = SOURCE_ROOT; };
84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_CriticalSection.h; path = ../../src/threads/juce_CriticalSection.h; sourceTree = SOURCE_ROOT; }; 84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_CriticalSection.h; path = ../../src/threads/juce_CriticalSection.h; sourceTree = SOURCE_ROOT; };
84F1E9DA104036D6006A1807 /* juce_InterProcessLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_InterProcessLock.cpp; path = ../../src/threads/juce_InterProcessLock.cpp; sourceTree = SOURCE_ROOT; };
84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_InterProcessLock.h; path = ../../src/threads/juce_InterProcessLock.h; sourceTree = SOURCE_ROOT; }; 84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_InterProcessLock.h; path = ../../src/threads/juce_InterProcessLock.h; sourceTree = SOURCE_ROOT; };
84F1E9DC104036D6006A1807 /* juce_Process.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_Process.h; path = ../../src/threads/juce_Process.h; sourceTree = SOURCE_ROOT; }; 84F1E9DC104036D6006A1807 /* juce_Process.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_Process.h; path = ../../src/threads/juce_Process.h; sourceTree = SOURCE_ROOT; };
84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ReadWriteLock.cpp; path = ../../src/threads/juce_ReadWriteLock.cpp; sourceTree = SOURCE_ROOT; }; 84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ReadWriteLock.cpp; path = ../../src/threads/juce_ReadWriteLock.cpp; sourceTree = SOURCE_ROOT; };
@ -2428,7 +2425,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */, 84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */,
84F1E9DA104036D6006A1807 /* juce_InterProcessLock.cpp */,
84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */, 84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */,
84F1E9DC104036D6006A1807 /* juce_Process.h */, 84F1E9DC104036D6006A1807 /* juce_Process.h */,
84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */, 84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */,
@ -3771,7 +3767,6 @@
8481700C10809E00008FEC33 /* juce_InputStream.cpp in Sources */, 8481700C10809E00008FEC33 /* juce_InputStream.cpp in Sources */,
8481700D10809E00008FEC33 /* juce_InterprocessConnection.cpp in Sources */, 8481700D10809E00008FEC33 /* juce_InterprocessConnection.cpp in Sources */,
8481700E10809E00008FEC33 /* juce_InterprocessConnectionServer.cpp in Sources */, 8481700E10809E00008FEC33 /* juce_InterprocessConnectionServer.cpp in Sources */,
8481700F10809E00008FEC33 /* juce_InterProcessLock.cpp in Sources */,
8481701010809E00008FEC33 /* juce_iphone_Audio.cpp in Sources */, 8481701010809E00008FEC33 /* juce_iphone_Audio.cpp in Sources */,
8481701210809E00008FEC33 /* juce_iphone_MessageManager.mm in Sources */, 8481701210809E00008FEC33 /* juce_iphone_MessageManager.mm in Sources */,
8481701310809E00008FEC33 /* juce_iphone_MiscUtilities.mm in Sources */, 8481701310809E00008FEC33 /* juce_iphone_MiscUtilities.mm in Sources */,
@ -4086,7 +4081,6 @@
84F1EA2D104036D6006A1807 /* juce_StringPairArray.cpp in Sources */, 84F1EA2D104036D6006A1807 /* juce_StringPairArray.cpp in Sources */,
84F1EA2F104036D6006A1807 /* juce_XmlDocument.cpp in Sources */, 84F1EA2F104036D6006A1807 /* juce_XmlDocument.cpp in Sources */,
84F1EA31104036D6006A1807 /* juce_XmlElement.cpp in Sources */, 84F1EA31104036D6006A1807 /* juce_XmlElement.cpp in Sources */,
84F1EA34104036D6006A1807 /* juce_InterProcessLock.cpp in Sources */,
84F1EA37104036D6006A1807 /* juce_ReadWriteLock.cpp in Sources */, 84F1EA37104036D6006A1807 /* juce_ReadWriteLock.cpp in Sources */,
84F1EA3D104036D6006A1807 /* juce_Thread.cpp in Sources */, 84F1EA3D104036D6006A1807 /* juce_Thread.cpp in Sources */,
84F1EA3F104036D6006A1807 /* juce_ThreadPool.cpp in Sources */, 84F1EA3F104036D6006A1807 /* juce_ThreadPool.cpp in Sources */,

View file

@ -2813,10 +2813,6 @@
RelativePath="..\..\..\src\threads\juce_CriticalSection.h" RelativePath="..\..\..\src\threads\juce_CriticalSection.h"
> >
</File> </File>
<File
RelativePath="..\..\..\src\threads\juce_InterProcessLock.cpp"
>
</File>
<File <File
RelativePath="..\..\..\src\threads\juce_InterProcessLock.h" RelativePath="..\..\..\src\threads\juce_InterProcessLock.h"
> >

View file

@ -107,7 +107,7 @@
#endif #endif
#if (defined(__APPLE_CPP__) || defined(__APPLE_CC__)) && ! defined (JUCE_ObjCExtraSuffix) #if (defined(__APPLE_CPP__) || defined(__APPLE_CC__)) && ! defined (JUCE_ObjCExtraSuffix)
#error "To avoid objective-C name clashes with other plugins, you need to define the JUCE_ObjCExtraSuffix value in your JucePluginCharacteristics.h file!" #error "To avoid objective-C name clashes with other plugins, you need to define the JUCE_ObjCExtraSuffix value as a global definition for your project!"
#endif #endif
#endif // __JUCE_INCLUDECHARACTERISTICS_JUCEHEADER__ #endif // __JUCE_INCLUDECHARACTERISTICS_JUCEHEADER__

File diff suppressed because it is too large Load diff

View file

@ -26894,7 +26894,10 @@ private:
void createControlIfNeeded(); void createControlIfNeeded();
bool isControlCreated() const; bool isControlCreated() const;
void* internal;
class Pimpl;
friend class ScopedPointer <Pimpl>;
ScopedPointer <Pimpl> pimpl;
#else #else
void* movie; void* movie;
#endif #endif

View file

@ -1095,7 +1095,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
{ {
ScopedPointer <AudioProcessorEditor> w (new AudioUnitPluginWindowCocoa (*this, false)); ScopedPointer <AudioProcessorEditor> w (new AudioUnitPluginWindowCocoa (*this, false));
if (! ((AudioUnitPluginWindowCocoa*) w)->isValid()) if (! static_cast <AudioUnitPluginWindowCocoa*> (static_cast <AudioProcessorEditor> (w))->isValid())
w = 0; w = 0;
#if JUCE_SUPPORT_CARBON #if JUCE_SUPPORT_CARBON
@ -1103,7 +1103,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
{ {
w = new AudioUnitPluginWindowCarbon (*this); w = new AudioUnitPluginWindowCarbon (*this);
if (! ((AudioUnitPluginWindowCarbon*) w)->isValid()) if (! static_cast <AudioUnitPluginWindowCocoa*> (static_cast <AudioProcessorEditor> (w))->isValid())
w = 0; w = 0;
} }
#endif #endif

View file

@ -112,8 +112,8 @@ BEGIN_JUCE_NAMESPACE
#include "juce_VSTMidiEventList.h" #include "juce_VSTMidiEventList.h"
#if ! JUCE_WIN32 #if ! JUCE_WIN32
#define _fpreset() static void _fpreset() {}
#define _clearfp() static void _clearfp() {}
#endif #endif
extern void juce_callAnyTimersSynchronously(); extern void juce_callAnyTimersSynchronously();

View file

@ -209,14 +209,15 @@ private:
bool movieLoaded, controllerVisible, looping; bool movieLoaded, controllerVisible, looping;
#if JUCE_WINDOWS #if JUCE_WINDOWS
/** @internal */
void parentHierarchyChanged(); void parentHierarchyChanged();
/** @internal */
void visibilityChanged(); void visibilityChanged();
void createControlIfNeeded(); void createControlIfNeeded();
bool isControlCreated() const; bool isControlCreated() const;
void* internal;
class Pimpl;
friend class ScopedPointer <Pimpl>;
ScopedPointer <Pimpl> pimpl;
#else #else
void* movie; void* movie;
#endif #endif

View file

@ -30,10 +30,15 @@
the rest of the codebase. the rest of the codebase.
*/ */
#include "../core/juce_TargetPlatform.h"
#if JUCE_LINUX
#include "linux/juce_linux_NativeIncludes.h" #include "linux/juce_linux_NativeIncludes.h"
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
//==============================================================================
#include "../io/files/juce_FileInputStream.h" #include "../io/files/juce_FileInputStream.h"
#include "../io/files/juce_FileOutputStream.h" #include "../io/files/juce_FileOutputStream.h"
#include "../core/juce_SystemStats.h" #include "../core/juce_SystemStats.h"
@ -115,3 +120,5 @@ BEGIN_JUCE_NAMESPACE
#endif #endif
END_JUCE_NAMESPACE END_JUCE_NAMESPACE
#endif

View file

@ -30,6 +30,10 @@
the rest of the codebase. the rest of the codebase.
*/ */
#include "../core/juce_TargetPlatform.h"
#if JUCE_MAC || JUCE_IPHONE
#include "mac/juce_mac_NativeIncludes.h" #include "mac/juce_mac_NativeIncludes.h"
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
@ -131,3 +135,5 @@ BEGIN_JUCE_NAMESPACE
#endif #endif
END_JUCE_NAMESPACE END_JUCE_NAMESPACE
#endif

View file

@ -23,7 +23,6 @@
============================================================================== ==============================================================================
*/ */
//==============================================================================
/* /*
This file wraps together all the win32-specific code, so that This file wraps together all the win32-specific code, so that
we can include all the native headers just once, and compile all our we can include all the native headers just once, and compile all our
@ -31,9 +30,11 @@
the rest of the codebase. the rest of the codebase.
*/ */
//============================================================================== #include "../core/juce_TargetPlatform.h"
#include "windows/juce_win32_NativeIncludes.h"
#if JUCE_WINDOWS
#include "windows/juce_win32_NativeIncludes.h"
#include "../core/juce_StandardHeader.h" #include "../core/juce_StandardHeader.h"
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
@ -118,3 +119,5 @@ BEGIN_JUCE_NAMESPACE
#endif #endif
END_JUCE_NAMESPACE END_JUCE_NAMESPACE
#endif

View file

@ -27,11 +27,10 @@
// compiled on its own). // compiled on its own).
#if JUCE_INCLUDED_FILE #if JUCE_INCLUDED_FILE
#define U_ISOFS_SUPER_MAGIC (short) 0x9660 // linux/iso_fs.h static const short U_ISOFS_SUPER_MAGIC = 0x9660; // linux/iso_fs.h
#define U_MSDOS_SUPER_MAGIC (short) 0x4d44 // linux/msdos_fs.h static const short U_MSDOS_SUPER_MAGIC = 0x4d44; // linux/msdos_fs.h
#define U_NFS_SUPER_MAGIC (short) 0x6969 // linux/nfs_fs.h static const short U_NFS_SUPER_MAGIC = 0x6969; // linux/nfs_fs.h
#define U_SMB_SUPER_MAGIC (short) 0x517B // linux/smb_fs.h static const short U_SMB_SUPER_MAGIC = 0x517B; // linux/smb_fs.h
//============================================================================== //==============================================================================
void juce_getFileTimes (const String& fileName, void juce_getFileTimes (const String& fileName,

View file

@ -296,9 +296,6 @@ public:
const float scaleY = -1.0f / height; const float scaleY = -1.0f / height;
Path destShape; Path destShape;
#define CONVERTX(val) (scaleX * (val).x)
#define CONVERTY(val) (scaleY * (val).y)
if (FT_Load_Glyph (face, glyphIndex, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM) != 0 if (FT_Load_Glyph (face, glyphIndex, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM) != 0
|| face->glyph->format != ft_glyph_format_outline) || face->glyph->format != ft_glyph_format_outline)
{ {
@ -317,15 +314,15 @@ public:
for (int p = startPoint; p <= endPoint; p++) for (int p = startPoint; p <= endPoint; p++)
{ {
const float x = CONVERTX (points[p]); const float x = scaleX * points[p].x;
const float y = CONVERTY (points[p]); const float y = scaleY * points[p].y;
if (p == startPoint) if (p == startPoint)
{ {
if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic) if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic)
{ {
float x2 = CONVERTX (points [endPoint]); float x2 = scaleX * points [endPoint].x;
float y2 = CONVERTY (points [endPoint]); float y2 = scaleY * points [endPoint].y;
if (FT_CURVE_TAG (tags[endPoint]) != FT_Curve_Tag_On) if (FT_CURVE_TAG (tags[endPoint]) != FT_Curve_Tag_On)
{ {
@ -349,8 +346,8 @@ public:
else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic) else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic)
{ {
const int nextIndex = (p == endPoint) ? startPoint : p + 1; const int nextIndex = (p == endPoint) ? startPoint : p + 1;
float x2 = CONVERTX (points [nextIndex]); float x2 = scaleX * points [nextIndex].x;
float y2 = CONVERTY (points [nextIndex]); float y2 = scaleY * points [nextIndex].y;
if (FT_CURVE_TAG (tags [nextIndex]) == FT_Curve_Tag_Conic) if (FT_CURVE_TAG (tags [nextIndex]) == FT_Curve_Tag_Conic)
{ {
@ -372,10 +369,10 @@ public:
const int next1 = p + 1; const int next1 = p + 1;
const int next2 = (p == (endPoint - 1)) ? startPoint : p + 2; const int next2 = (p == (endPoint - 1)) ? startPoint : p + 2;
const float x2 = CONVERTX (points [next1]); const float x2 = scaleX * points [next1].x;
const float y2 = CONVERTY (points [next1]); const float y2 = scaleY * points [next1].y;
const float x3 = CONVERTX (points [next2]); const float x3 = scaleX * points [next2].x;
const float y3 = CONVERTY (points [next2]); const float y3 = scaleY * points [next2].y;
if (FT_CURVE_TAG (tags[next1]) != FT_Curve_Tag_Cubic if (FT_CURVE_TAG (tags[next1]) != FT_Curve_Tag_Cubic
|| FT_CURVE_TAG (tags[next2]) != FT_Curve_Tag_On) || FT_CURVE_TAG (tags[next2]) != FT_Curve_Tag_On)

View file

@ -35,22 +35,10 @@
Display* display = 0; // This is also referenced from WindowDriver.cpp Display* display = 0; // This is also referenced from WindowDriver.cpp
Window juce_messageWindowHandle = None; Window juce_messageWindowHandle = None;
#define SpecialAtom "JUCESpecialAtom" XContext improbableNumber; // This is referenced from Windowing.cpp
#define BroadcastAtom "JUCEBroadcastAtom"
#define SpecialCallbackAtom "JUCESpecialCallbackAtom"
static Atom specialId; extern void juce_windowMessageReceive (XEvent* event); // Defined in Windowing.cpp
static Atom broadcastId; extern void juce_handleSelectionRequest (XSelectionRequestEvent &evt); // Defined in Clipboard.cpp
static Atom specialCallbackId;
// This is referenced from Windowing.cpp
XContext improbableNumber;
// Defined in Windowing.cpp
extern void juce_windowMessageReceive (XEvent* event);
// Defined in Clipboard.cpp
extern void juce_handleSelectionRequest (XSelectionRequestEvent &evt);
//============================================================================== //==============================================================================
ScopedXLock::ScopedXLock() { XLockDisplay (display); } ScopedXLock::ScopedXLock() { XLockDisplay (display); }
@ -290,11 +278,6 @@ void MessageManager::doPlatformSpecificInitialisation()
Window root = RootWindow (display, screen); Window root = RootWindow (display, screen);
Visual* visual = DefaultVisual (display, screen); Visual* visual = DefaultVisual (display, screen);
// Create atoms for our ClientMessages (these cannot be deleted)
specialId = XInternAtom (display, SpecialAtom, false);
broadcastId = XInternAtom (display, BroadcastAtom, false);
specialCallbackId = XInternAtom (display, SpecialCallbackAtom, false);
// Create a context to store user data associated with Windows we // Create a context to store user data associated with Windows we
// create in WindowDriver // create in WindowDriver
improbableNumber = XUniqueContext(); improbableNumber = XUniqueContext();
@ -340,29 +323,6 @@ bool juce_postMessageToSystemQueue (void* message)
return true; return true;
} }
/*bool juce_postMessageToX11Queue (void *message)
{
XClientMessageEvent clientMsg;
clientMsg.display = display;
clientMsg.window = juce_messageWindowHandle;
clientMsg.type = ClientMessage;
clientMsg.format = 32;
clientMsg.message_type = specialId;
#if JUCE_64BIT
clientMsg.data.l[0] = (long) (0x00000000ffffffff & (((uint64) message) >> 32));
clientMsg.data.l[1] = (long) (0x00000000ffffffff & (long) message);
#else
clientMsg.data.l[0] = (long) message;
#endif
XSendEvent (display, juce_messageWindowHandle, false,
NoEventMask, (XEvent*) &clientMsg);
XFlush (display); // This is necessary to ensure the event is delivered
return true;
}*/
void MessageManager::broadcastMessage (const String& value) throw() void MessageManager::broadcastMessage (const String& value) throw()
{ {
/* TODO */ /* TODO */

View file

@ -71,7 +71,7 @@ END_JUCE_NAMESPACE
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
//============================================================================== //==============================================================================
#define theMovie ((QTMovie*) movie) #define theMovie (static_cast <QTMovie*> (movie))
//============================================================================== //==============================================================================
QuickTimeMovieComponent::QuickTimeMovieComponent() QuickTimeMovieComponent::QuickTimeMovieComponent()

View file

@ -29,6 +29,9 @@
#if JUCE_USE_CDREADER #if JUCE_USE_CDREADER
namespace CDReaderHelpers
{
//*************************************************************************** //***************************************************************************
// %%% TARGET STATUS VALUES %%% // %%% TARGET STATUS VALUES %%%
//*************************************************************************** //***************************************************************************
@ -528,12 +531,12 @@ public:
wantsIndex (false) wantsIndex (false)
{ {
bufferSize = 2352 * numberOfFrames; bufferSize = 2352 * numberOfFrames;
buffer = (BYTE*) malloc (bufferSize); buffer = (BYTE*) juce_malloc (bufferSize);
} }
~CDReadBuffer() ~CDReadBuffer()
{ {
free (buffer); juce_free (buffer);
} }
bool isZero() const bool isZero() const
@ -627,7 +630,7 @@ public:
if (controller != 0) if (controller != 0)
{ {
controller->shutDown(); controller->shutDown();
delete controller; controller = 0;
} }
if (scsiHandle != 0) if (scsiHandle != 0)
@ -643,7 +646,7 @@ public:
BYTE readType; BYTE readType;
private: private:
CDController* controller; ScopedPointer<CDController> controller;
bool testController (const int readType, bool testController (const int readType,
CDController* const newController, CDController* const newController,
@ -713,14 +716,7 @@ static void DeinitialiseCDRipper()
//============================================================================== //==============================================================================
static HANDLE CreateSCSIDeviceHandle (char driveLetter) static HANDLE CreateSCSIDeviceHandle (char driveLetter)
{ {
TCHAR devicePath[8]; TCHAR devicePath[] = { '\\', '\\', '.', '\\', driveLetter, ':', 0, 0 };
devicePath[0] = '\\';
devicePath[1] = '\\';
devicePath[2] = '.';
devicePath[3] = '\\';
devicePath[4] = driveLetter;
devicePath[5] = ':';
devicePath[6] = 0;
OSVERSIONINFO info; OSVERSIONINFO info;
info.dwOSVersionInfoSize = sizeof (info); info.dwOSVersionInfoSize = sizeof (info);
@ -1283,7 +1279,6 @@ void CDDeviceHandle::openDrawer (bool shouldBeOpen)
if (controller != 0) if (controller != 0)
{ {
controller->shutDown(); controller->shutDown();
delete controller;
controller = 0; controller = 0;
} }
@ -1365,7 +1360,6 @@ bool CDDeviceHandle::testController (const int type,
if (! passed) if (! passed)
{ {
controller->shutDown(); controller->shutDown();
delete controller;
controller = 0; controller = 0;
} }
@ -1595,8 +1589,8 @@ static void decUserCount()
//============================================================================== //==============================================================================
struct CDDeviceWrapper struct CDDeviceWrapper
{ {
CDDeviceHandle* cdH; ScopedPointer<CDDeviceHandle> cdH;
CDReadBuffer* overlapBuffer; ScopedPointer<CDReadBuffer> overlapBuffer;
bool jitter; bool jitter;
}; };
@ -1615,38 +1609,6 @@ static int getMSFAddressOf (const TOCTRACK* const t)
static const int samplesPerFrame = 44100 / 75; static const int samplesPerFrame = 44100 / 75;
static const int bytesPerFrame = samplesPerFrame * 4; static const int bytesPerFrame = samplesPerFrame * 4;
//==============================================================================
const StringArray AudioCDReader::getAvailableCDNames()
{
StringArray results;
incUserCount();
if (initialisedOk)
{
CDDeviceInfo list[8];
const int num = FindCDDevices (list, 8);
decUserCount();
for (int i = 0; i < num; ++i)
{
String s;
if (list[i].scsiDriveLetter > 0)
s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << T(": ");
s << String (list[i].vendor).trim()
<< T(" ") << String (list[i].productId).trim()
<< T(" ") << String (list[i].rev).trim();
results.add (s);
}
}
return results;
}
static CDDeviceHandle* openHandle (const CDDeviceInfo* const device) static CDDeviceHandle* openHandle (const CDDeviceInfo* const device)
{ {
SRB_GDEVBlock s; SRB_GDEVBlock s;
@ -1680,8 +1642,43 @@ static CDDeviceHandle* openHandle (const CDDeviceInfo* const device)
return 0; return 0;
} }
}
//==============================================================================
const StringArray AudioCDReader::getAvailableCDNames()
{
using namespace CDReaderHelpers;
StringArray results;
incUserCount();
if (initialisedOk)
{
CDDeviceInfo list[8];
const int num = FindCDDevices (list, 8);
decUserCount();
for (int i = 0; i < num; ++i)
{
String s;
if (list[i].scsiDriveLetter > 0)
s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << T(": ");
s << String (list[i].vendor).trim()
<< T(" ") << String (list[i].productId).trim()
<< T(" ") << String (list[i].rev).trim();
results.add (s);
}
}
return results;
}
AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex)
{ {
using namespace CDReaderHelpers;
incUserCount(); incUserCount();
if (initialisedOk) if (initialisedOk)
@ -1716,6 +1713,7 @@ AudioCDReader::AudioCDReader (void* handle_)
firstFrameInBuffer (0), firstFrameInBuffer (0),
samplesInBuffer (0) samplesInBuffer (0)
{ {
using namespace CDReaderHelpers;
jassert (handle_ != 0); jassert (handle_ != 0);
refreshTrackLengths(); refreshTrackLengths();
@ -1731,10 +1729,8 @@ AudioCDReader::AudioCDReader (void* handle_)
AudioCDReader::~AudioCDReader() AudioCDReader::~AudioCDReader()
{ {
CDDeviceWrapper* const device = (CDDeviceWrapper*)handle; using namespace CDReaderHelpers;
CDDeviceWrapper* const device = (CDDeviceWrapper*) handle;
delete device->cdH;
delete device->overlapBuffer;
delete device; delete device;
decUserCount(); decUserCount();
@ -1743,6 +1739,7 @@ AudioCDReader::~AudioCDReader()
bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer, bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples) int64 startSampleInFile, int numSamples)
{ {
using namespace CDReaderHelpers;
CDDeviceWrapper* const device = (CDDeviceWrapper*) handle; CDDeviceWrapper* const device = (CDDeviceWrapper*) handle;
bool ok = true; bool ok = true;
@ -1840,10 +1837,11 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta
bool AudioCDReader::isCDStillPresent() const bool AudioCDReader::isCDStillPresent() const
{ {
using namespace CDReaderHelpers;
TOC toc; TOC toc;
zerostruct (toc); zerostruct (toc);
return ((CDDeviceWrapper*)handle)->cdH->readTOC (&toc, false); return ((CDDeviceWrapper*) handle)->cdH->readTOC (&toc, false);
} }
int AudioCDReader::getNumTracks() const int AudioCDReader::getNumTracks() const
@ -1853,12 +1851,14 @@ int AudioCDReader::getNumTracks() const
int AudioCDReader::getPositionOfTrackStart (int trackNum) const int AudioCDReader::getPositionOfTrackStart (int trackNum) const
{ {
using namespace CDReaderHelpers;
return (trackNum >= 0 && trackNum <= numTracks) ? trackStarts [trackNum] * samplesPerFrame return (trackNum >= 0 && trackNum <= numTracks) ? trackStarts [trackNum] * samplesPerFrame
: 0; : 0;
} }
void AudioCDReader::refreshTrackLengths() void AudioCDReader::refreshTrackLengths()
{ {
using namespace CDReaderHelpers;
zeromem (trackStarts, sizeof (trackStarts)); zeromem (trackStarts, sizeof (trackStarts));
zeromem (audioTracks, sizeof (audioTracks)); zeromem (audioTracks, sizeof (audioTracks));
@ -1901,6 +1901,7 @@ const int framesPerIndexRead = 4;
int AudioCDReader::getIndexAt (int samplePos) int AudioCDReader::getIndexAt (int samplePos)
{ {
using namespace CDReaderHelpers;
CDDeviceWrapper* const device = (CDDeviceWrapper*) handle; CDDeviceWrapper* const device = (CDDeviceWrapper*) handle;
const int frameNeeded = samplePos / samplesPerFrame; const int frameNeeded = samplePos / samplesPerFrame;
@ -1934,6 +1935,7 @@ int AudioCDReader::getIndexAt (int samplePos)
const Array <int> AudioCDReader::findIndexesInTrack (const int trackNumber) const Array <int> AudioCDReader::findIndexesInTrack (const int trackNumber)
{ {
using namespace CDReaderHelpers;
Array <int> indexes; Array <int> indexes;
const int trackStart = getPositionOfTrackStart (trackNumber); const int trackStart = getPositionOfTrackStart (trackNumber);
@ -2030,6 +2032,7 @@ const Array <int> AudioCDReader::findIndexesInTrack (const int trackNumber)
int AudioCDReader::getCDDBId() int AudioCDReader::getCDDBId()
{ {
using namespace CDReaderHelpers;
refreshTrackLengths(); refreshTrackLengths();
if (numTracks > 0) if (numTracks > 0)
@ -2067,6 +2070,7 @@ int AudioCDReader::getCDDBId()
void AudioCDReader::ejectDisk() void AudioCDReader::ejectDisk()
{ {
using namespace CDReaderHelpers;
((CDDeviceWrapper*) handle)->cdH->openDrawer (true); ((CDDeviceWrapper*) handle)->cdH->openDrawer (true);
} }

View file

@ -429,11 +429,9 @@ bool File::isOnRemovableDrive() const
} }
//============================================================================== //==============================================================================
#define MAX_PATH_CHARS (MAX_PATH + 256)
static const File juce_getSpecialFolderPath (int type) static const File juce_getSpecialFolderPath (int type)
{ {
WCHAR path [MAX_PATH_CHARS]; WCHAR path [MAX_PATH + 256];
if (SHGetSpecialFolderPath (0, path, type, 0)) if (SHGetSpecialFolderPath (0, path, type, 0))
return File (String (path)); return File (String (path));
@ -493,9 +491,9 @@ const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType typ
{ {
HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(); HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle();
WCHAR dest [MAX_PATH_CHARS]; WCHAR dest [MAX_PATH + 256];
dest[0] = 0; dest[0] = 0;
GetModuleFileName (moduleHandle, dest, MAX_PATH_CHARS); GetModuleFileName (moduleHandle, dest, numElementsInArray (dest));
return File (String (dest)); return File (String (dest));
} }
break; break;
@ -511,9 +509,9 @@ const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType typ
//============================================================================== //==============================================================================
const File File::getCurrentWorkingDirectory() const File File::getCurrentWorkingDirectory()
{ {
WCHAR dest [MAX_PATH_CHARS]; WCHAR dest [MAX_PATH + 256];
dest[0] = 0; dest[0] = 0;
GetCurrentDirectory (MAX_PATH_CHARS, dest); GetCurrentDirectory (numElementsInArray (dest), dest);
return File (String (dest)); return File (String (dest));
} }

View file

@ -314,11 +314,8 @@ public:
while ((char*) pheader < data + bufSize) while ((char*) pheader < data + bufSize)
{ {
#define remapX(v) (scaleX * (v).x.value) float x = scaleX * pheader->pfxStart.x.value;
#define remapY(v) (scaleY * (v).y.value) float y = scaleY * pheader->pfxStart.y.value;
float x = remapX (pheader->pfxStart);
float y = remapY (pheader->pfxStart);
glyphPath.startNewSubPath (x, y); glyphPath.startNewSubPath (x, y);
@ -331,8 +328,8 @@ public:
{ {
for (int i = 0; i < curve->cpfx; ++i) for (int i = 0; i < curve->cpfx; ++i)
{ {
x = remapX (curve->apfx [i]); x = scaleX * curve->apfx[i].x.value;
y = remapY (curve->apfx [i]); y = scaleY * curve->apfx[i].y.value;
glyphPath.lineTo (x, y); glyphPath.lineTo (x, y);
} }
@ -341,19 +338,19 @@ public:
{ {
for (int i = 0; i < curve->cpfx - 1; ++i) for (int i = 0; i < curve->cpfx - 1; ++i)
{ {
const float x2 = remapX (curve->apfx [i]); const float x2 = scaleX * curve->apfx[i].x.value;
const float y2 = remapY (curve->apfx [i]); const float y2 = scaleY * curve->apfx[i].y.value;
float x3, y3; float x3, y3;
if (i < curve->cpfx - 2) if (i < curve->cpfx - 2)
{ {
x3 = 0.5f * (x2 + remapX (curve->apfx [i + 1])); x3 = 0.5f * (x2 + scaleX * curve->apfx[i + 1].x.value);
y3 = 0.5f * (y2 + remapY (curve->apfx [i + 1])); y3 = 0.5f * (y2 + scaleY * curve->apfx[i + 1].y.value);
} }
else else
{ {
x3 = remapX (curve->apfx [i + 1]); x3 = scaleX * curve->apfx[i + 1].x.value;
y3 = remapY (curve->apfx [i + 1]); y3 = scaleY * curve->apfx[i + 1].y.value;
} }
glyphPath.quadraticTo (x2, y2, x3, y3); glyphPath.quadraticTo (x2, y2, x3, y3);

View file

@ -28,13 +28,15 @@
#if JUCE_INCLUDED_FILE #if JUCE_INCLUDED_FILE
//============================================================================== //==============================================================================
static const int midiBufferSize = 1024 * 10;
static const int numInHeaders = 32;
static const int inBufferSize = 256;
static Array <void*, CriticalSection> activeMidiThreads;
using ::free; using ::free;
namespace MidiConstants
{
static const int midiBufferSize = 1024 * 10;
static const int numInHeaders = 32;
static const int inBufferSize = 256;
}
class MidiInThread : public Thread class MidiInThread : public Thread
{ {
public: public:
@ -49,11 +51,11 @@ public:
startTime (0), startTime (0),
pendingLength(0) pendingLength(0)
{ {
for (int i = numInHeaders; --i >= 0;) for (int i = MidiConstants::numInHeaders; --i >= 0;)
{ {
zeromem (&hdr[i], sizeof (MIDIHDR)); zeromem (&hdr[i], sizeof (MIDIHDR));
hdr[i].lpData = inData[i]; hdr[i].lpData = inData[i];
hdr[i].dwBufferLength = inBufferSize; hdr[i].dwBufferLength = MidiConstants::inBufferSize;
} }
}; };
@ -87,7 +89,7 @@ public:
{ {
const ScopedLock sl (lock); const ScopedLock sl (lock);
if (pendingLength < midiBufferSize - 12) if (pendingLength < MidiConstants::midiBufferSize - 12)
{ {
char* const p = pending + pendingLength; char* const p = pending + pendingLength;
*(double*) p = time; *(double*) p = time;
@ -115,7 +117,7 @@ public:
{ {
const ScopedLock sl (lock); const ScopedLock sl (lock);
if (pendingLength < midiBufferSize - (8 + num)) if (pendingLength < MidiConstants::midiBufferSize - (8 + num))
{ {
char* const p = pending + pendingLength; char* const p = pending + pendingLength;
*(double*) p = time; *(double*) p = time;
@ -148,7 +150,7 @@ public:
while (! threadShouldExit()) while (! threadShouldExit())
{ {
for (int i = 0; i < numInHeaders; ++i) for (int i = 0; i < MidiConstants::numInHeaders; ++i)
{ {
if ((hdr[i].dwFlags & WHDR_DONE) != 0) if ((hdr[i].dwFlags & WHDR_DONE) != 0)
{ {
@ -210,7 +212,7 @@ public:
activeMidiThreads.addIfNotAlreadyThere (this); activeMidiThreads.addIfNotAlreadyThere (this);
int i; int i;
for (i = 0; i < numInHeaders; ++i) for (i = 0; i < MidiConstants::numInHeaders; ++i)
writeBlock (i); writeBlock (i);
startTime = Time::getMillisecondCounter(); startTime = Time::getMillisecondCounter();
@ -240,7 +242,7 @@ public:
{ const ScopedLock sl (lock); } { const ScopedLock sl (lock); }
for (int i = numInHeaders; --i >= 0;) for (int i = MidiConstants::numInHeaders; --i >= 0;)
{ {
if ((hdr[i].dwFlags & WHDR_DONE) != 0) if ((hdr[i].dwFlags & WHDR_DONE) != 0)
{ {
@ -257,22 +259,37 @@ public:
} }
} }
static void CALLBACK midiInCallback (HMIDIIN, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR midiMessage, DWORD_PTR timeStamp)
{
MidiInThread* const thread = reinterpret_cast <MidiInThread*> (dwInstance);
if (thread != 0 && activeMidiThreads.contains (thread))
{
if (uMsg == MIM_DATA)
thread->handle ((uint32) midiMessage, (uint32) timeStamp);
else if (uMsg == MIM_LONGDATA)
thread->handleSysEx ((MIDIHDR*) midiMessage, (uint32) timeStamp);
}
}
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
HMIDIIN hIn; HMIDIIN hIn;
private: private:
static Array <void*, CriticalSection> activeMidiThreads;
MidiInput* input; MidiInput* input;
MidiInputCallback* callback; MidiInputCallback* callback;
bool isStarted; bool isStarted;
uint32 startTime; uint32 startTime;
CriticalSection lock; CriticalSection lock;
MIDIHDR hdr [numInHeaders]; MIDIHDR hdr [MidiConstants::numInHeaders];
char inData [numInHeaders] [inBufferSize]; char inData [MidiConstants::numInHeaders] [MidiConstants::inBufferSize];
int pendingLength; int pendingLength;
char pending [midiBufferSize]; char pending [MidiConstants::midiBufferSize];
double timeStampToTime (uint32 timeStamp) throw() double timeStampToTime (uint32 timeStamp) throw()
{ {
@ -294,22 +311,8 @@ private:
MidiInThread& operator= (const MidiInThread&); MidiInThread& operator= (const MidiInThread&);
}; };
static void CALLBACK midiInCallback (HMIDIIN, Array <void*, CriticalSection> MidiInThread::activeMidiThreads;
UINT uMsg,
DWORD_PTR dwInstance,
DWORD_PTR midiMessage,
DWORD_PTR timeStamp)
{
MidiInThread* const thread = (MidiInThread*) dwInstance;
if (thread != 0 && activeMidiThreads.contains (thread))
{
if (uMsg == MIM_DATA)
thread->handle ((uint32) midiMessage, (uint32) timeStamp);
else if (uMsg == MIM_LONGDATA)
thread->handleSysEx ((MIDIHDR*) midiMessage, (uint32) timeStamp);
}
}
//============================================================================== //==============================================================================
const StringArray MidiInput::getDevices() const StringArray MidiInput::getDevices()
@ -368,7 +371,7 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call
HMIDIIN h; HMIDIIN h;
HRESULT err = midiInOpen (&h, deviceId, HRESULT err = midiInOpen (&h, deviceId,
(DWORD_PTR) &midiInCallback, (DWORD_PTR) &MidiInThread::midiInCallback,
(DWORD_PTR) (MidiInThread*) thread, (DWORD_PTR) (MidiInThread*) thread,
CALLBACK_FUNCTION); CALLBACK_FUNCTION);
@ -390,21 +393,17 @@ MidiInput::MidiInput (const String& name_)
MidiInput::~MidiInput() MidiInput::~MidiInput()
{ {
if (internal != 0) delete static_cast <MidiInThread*> (internal);
{
MidiInThread* const thread = (MidiInThread*) internal;
delete thread;
}
} }
void MidiInput::start() void MidiInput::start()
{ {
((MidiInThread*) internal)->start(); static_cast <MidiInThread*> (internal)->start();
} }
void MidiInput::stop() void MidiInput::stop()
{ {
((MidiInThread*) internal)->stop(); static_cast <MidiInThread*> (internal)->stop();
} }
@ -415,10 +414,12 @@ struct MidiOutHandle
UINT deviceId; UINT deviceId;
HMIDIOUT handle; HMIDIOUT handle;
static Array<MidiOutHandle*> activeHandles;
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
}; };
static Array <MidiOutHandle*> midiOutputHandles; Array<MidiOutHandle*> MidiOutHandle::activeHandles;
//============================================================================== //==============================================================================
const StringArray MidiOutput::getDevices() const StringArray MidiOutput::getDevices()
@ -488,9 +489,9 @@ MidiOutput* MidiOutput::openDevice (int index)
} }
} }
for (i = midiOutputHandles.size(); --i >= 0;) for (i = MidiOutHandle::activeHandles.size(); --i >= 0;)
{ {
MidiOutHandle* const han = midiOutputHandles.getUnchecked(i); MidiOutHandle* const han = MidiOutHandle::activeHandles.getUnchecked(i);
if (han != 0 && han->deviceId == deviceId) if (han != 0 && han->deviceId == deviceId)
{ {
@ -513,7 +514,7 @@ MidiOutput* MidiOutput::openDevice (int index)
han->deviceId = deviceId; han->deviceId = deviceId;
han->refCount = 1; han->refCount = 1;
han->handle = h; han->handle = h;
midiOutputHandles.add (han); MidiOutHandle::activeHandles.add (han);
MidiOutput* const out = new MidiOutput(); MidiOutput* const out = new MidiOutput();
out->internal = (void*) han; out->internal = (void*) han;
@ -534,26 +535,26 @@ MidiOutput* MidiOutput::openDevice (int index)
MidiOutput::~MidiOutput() MidiOutput::~MidiOutput()
{ {
MidiOutHandle* const h = (MidiOutHandle*) internal; MidiOutHandle* const h = static_cast <MidiOutHandle*> (internal);
if (midiOutputHandles.contains (h) && --(h->refCount) == 0) if (MidiOutHandle::activeHandles.contains (h) && --(h->refCount) == 0)
{ {
midiOutClose (h->handle); midiOutClose (h->handle);
midiOutputHandles.removeValue (h); MidiOutHandle::activeHandles.removeValue (h);
delete h; delete h;
} }
} }
void MidiOutput::reset() void MidiOutput::reset()
{ {
const MidiOutHandle* const h = (MidiOutHandle*) internal; const MidiOutHandle* const h = static_cast <const MidiOutHandle*> (internal);
midiOutReset (h->handle); midiOutReset (h->handle);
} }
bool MidiOutput::getVolume (float& leftVol, bool MidiOutput::getVolume (float& leftVol,
float& rightVol) float& rightVol)
{ {
const MidiOutHandle* const handle = (const MidiOutHandle*) internal; const MidiOutHandle* const handle = static_cast <const MidiOutHandle*> (internal);
DWORD n; DWORD n;
if (midiOutGetVolume (handle->handle, &n) == MMSYSERR_NOERROR) if (midiOutGetVolume (handle->handle, &n) == MMSYSERR_NOERROR)
@ -573,18 +574,18 @@ bool MidiOutput::getVolume (float& leftVol,
void MidiOutput::setVolume (float leftVol, void MidiOutput::setVolume (float leftVol,
float rightVol) float rightVol)
{ {
const MidiOutHandle* const handle = (MidiOutHandle*) internal; const MidiOutHandle* const handle = static_cast <MidiOutHandle*> (internal);
DWORD n; DWORD n;
unsigned short* const nn = (unsigned short*) &n; unsigned short* const nn = (unsigned short*) &n;
nn[0] = (unsigned short) jlimit (0, 0xffff, (int)(rightVol * 0xffff)); nn[0] = (unsigned short) jlimit (0, 0xffff, (int) (rightVol * 0xffff));
nn[1] = (unsigned short) jlimit (0, 0xffff, (int)(leftVol * 0xffff)); nn[1] = (unsigned short) jlimit (0, 0xffff, (int) (leftVol * 0xffff));
midiOutSetVolume (handle->handle, n); midiOutSetVolume (handle->handle, n);
} }
void MidiOutput::sendMessageNow (const MidiMessage& message) void MidiOutput::sendMessageNow (const MidiMessage& message)
{ {
const MidiOutHandle* const handle = (const MidiOutHandle*) internal; const MidiOutHandle* const handle = static_cast <const MidiOutHandle*> (internal);
if (message.getRawDataSize() > 3 if (message.getRawDataSize() > 3
|| message.isSysEx()) || message.isSysEx())

View file

@ -36,23 +36,18 @@ static bool isQTAvailable = false;
//============================================================================== //==============================================================================
struct QTMovieCompInternal class QuickTimeMovieComponent::Pimpl
{ {
QTMovieCompInternal() public:
: dataHandle (0) Pimpl() : dataHandle (0)
{ {
} }
~QTMovieCompInternal() ~Pimpl()
{ {
clearHandle(); clearHandle();
} }
IQTControlPtr qtControlInternal;
IQTMoviePtr qtMovieInternal;
Handle dataHandle;
void clearHandle() void clearHandle()
{ {
if (dataHandle != 0) if (dataHandle != 0)
@ -61,38 +56,33 @@ struct QTMovieCompInternal
dataHandle = 0; dataHandle = 0;
} }
} }
};
#define qtControl (((QTMovieCompInternal*) internal)->qtControlInternal) IQTControlPtr qtControl;
#define qtMovie (((QTMovieCompInternal*) internal)->qtMovieInternal) IQTMoviePtr qtMovie;
Handle dataHandle;
};
//============================================================================== //==============================================================================
QuickTimeMovieComponent::QuickTimeMovieComponent() QuickTimeMovieComponent::QuickTimeMovieComponent()
: movieLoaded (false), : movieLoaded (false),
controllerVisible (true) controllerVisible (true)
{ {
internal = new QTMovieCompInternal(); pimpl = new Pimpl();
setMouseEventsAllowed (false); setMouseEventsAllowed (false);
} }
QuickTimeMovieComponent::~QuickTimeMovieComponent() QuickTimeMovieComponent::~QuickTimeMovieComponent()
{ {
closeMovie(); closeMovie();
qtControl = 0; pimpl->qtControl = 0;
deleteControl(); deleteControl();
pimpl = 0;
delete internal;
internal = 0;
} }
bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() bool QuickTimeMovieComponent::isQuickTimeAvailable() throw()
{ {
if (! isQTAvailable) if (! isQTAvailable)
{ isQTAvailable = (InitializeQTML (0) == noErr) && (EnterMovies() == noErr);
isQTAvailable = (InitializeQTML (0) == noErr)
&& (EnterMovies() == noErr);
}
return isQTAvailable; return isQTAvailable;
} }
@ -107,14 +97,14 @@ void QuickTimeMovieComponent::createControlIfNeeded()
if (createControl (&qtIID)) if (createControl (&qtIID))
{ {
const IID qtInterfaceIID = __uuidof (IQTControl); const IID qtInterfaceIID = __uuidof (IQTControl);
qtControl = (IQTControl*) queryInterface (&qtInterfaceIID); pimpl->qtControl = (IQTControl*) queryInterface (&qtInterfaceIID);
if (qtControl != 0) if (pimpl->qtControl != 0)
{ {
qtControl->Release(); // it has one ref too many at this point pimpl->qtControl->Release(); // it has one ref too many at this point
qtControl->QuickTimeInitialize(); pimpl->qtControl->QuickTimeInitialize();
qtControl->PutSizing (qtMovieFitsControl); pimpl->qtControl->PutSizing (qtMovieFitsControl);
if (movieFile != File::nonexistent) if (movieFile != File::nonexistent)
loadMovie (movieFile, controllerVisible); loadMovie (movieFile, controllerVisible);
@ -131,36 +121,38 @@ bool QuickTimeMovieComponent::isControlCreated() const
bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream,
const bool isControllerVisible) const bool isControllerVisible)
{ {
const ScopedPointer<InputStream> movieStreamDeleter (movieStream);
movieFile = File::nonexistent; movieFile = File::nonexistent;
movieLoaded = false; movieLoaded = false;
qtMovie = 0; pimpl->qtMovie = 0;
controllerVisible = isControllerVisible; controllerVisible = isControllerVisible;
createControlIfNeeded(); createControlIfNeeded();
if (isControlCreated()) if (isControlCreated())
{ {
if (qtControl != 0) if (pimpl->qtControl != 0)
{ {
qtControl->Put_MovieHandle (0); pimpl->qtControl->Put_MovieHandle (0);
((QTMovieCompInternal*) internal)->clearHandle(); pimpl->clearHandle();
Movie movie; Movie movie;
if (juce_OpenQuickTimeMovieFromStream (movieStream, movie, ((QTMovieCompInternal*) internal)->dataHandle)) if (juce_OpenQuickTimeMovieFromStream (movieStream, movie, pimpl->dataHandle))
{ {
qtControl->Put_MovieHandle ((long) (pointer_sized_int) movie); pimpl->qtControl->Put_MovieHandle ((long) (pointer_sized_int) movie);
qtMovie = qtControl->GetMovie(); pimpl->qtMovie = pimpl->qtControl->GetMovie();
if (qtMovie != 0) if (pimpl->qtMovie != 0)
qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard pimpl->qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard
: qtMovieControllerTypeNone); : qtMovieControllerTypeNone);
} }
if (movie == 0) if (movie == 0)
((QTMovieCompInternal*) internal)->clearHandle(); pimpl->clearHandle();
} }
movieLoaded = (qtMovie != 0); movieLoaded = (pimpl->qtMovie != 0);
} }
else else
{ {
@ -169,7 +161,6 @@ bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream,
jassertfalse jassertfalse
} }
delete movieStream;
return movieLoaded; return movieLoaded;
} }
@ -178,12 +169,12 @@ void QuickTimeMovieComponent::closeMovie()
stop(); stop();
movieFile = File::nonexistent; movieFile = File::nonexistent;
movieLoaded = false; movieLoaded = false;
qtMovie = 0; pimpl->qtMovie = 0;
if (qtControl != 0) if (pimpl->qtControl != 0)
qtControl->Put_MovieHandle (0); pimpl->qtControl->Put_MovieHandle (0);
((QTMovieCompInternal*) internal)->clearHandle(); pimpl->clearHandle();
} }
const File QuickTimeMovieComponent::getCurrentMovieFile() const const File QuickTimeMovieComponent::getCurrentMovieFile() const
@ -198,17 +189,17 @@ bool QuickTimeMovieComponent::isMovieOpen() const
double QuickTimeMovieComponent::getMovieDuration() const double QuickTimeMovieComponent::getMovieDuration() const
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
return qtMovie->GetDuration() / (double) qtMovie->GetTimeScale(); return pimpl->qtMovie->GetDuration() / (double) pimpl->qtMovie->GetTimeScale();
return 0.0; return 0.0;
} }
void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
{ {
struct QTRECT r = qtMovie->GetNaturalRect(); struct QTRECT r = pimpl->qtMovie->GetNaturalRect();
width = r.right - r.left; width = r.right - r.left;
height = r.bottom - r.top; height = r.bottom - r.top;
@ -221,67 +212,67 @@ void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const
void QuickTimeMovieComponent::play() void QuickTimeMovieComponent::play()
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
qtMovie->Play(); pimpl->qtMovie->Play();
} }
void QuickTimeMovieComponent::stop() void QuickTimeMovieComponent::stop()
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
qtMovie->Stop(); pimpl->qtMovie->Stop();
} }
bool QuickTimeMovieComponent::isPlaying() const bool QuickTimeMovieComponent::isPlaying() const
{ {
return qtMovie != 0 && qtMovie->GetRate() != 0.0f; return pimpl->qtMovie != 0 && pimpl->qtMovie->GetRate() != 0.0f;
} }
void QuickTimeMovieComponent::setPosition (const double seconds) void QuickTimeMovieComponent::setPosition (const double seconds)
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
qtMovie->PutTime ((long) (seconds * qtMovie->GetTimeScale())); pimpl->qtMovie->PutTime ((long) (seconds * pimpl->qtMovie->GetTimeScale()));
} }
double QuickTimeMovieComponent::getPosition() const double QuickTimeMovieComponent::getPosition() const
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
return qtMovie->GetTime() / (double) qtMovie->GetTimeScale(); return pimpl->qtMovie->GetTime() / (double) pimpl->qtMovie->GetTimeScale();
return 0.0; return 0.0;
} }
void QuickTimeMovieComponent::setSpeed (const float newSpeed) void QuickTimeMovieComponent::setSpeed (const float newSpeed)
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
qtMovie->PutRate (newSpeed); pimpl->qtMovie->PutRate (newSpeed);
} }
void QuickTimeMovieComponent::setMovieVolume (const float newVolume) void QuickTimeMovieComponent::setMovieVolume (const float newVolume)
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
{ {
qtMovie->PutAudioVolume (newVolume); pimpl->qtMovie->PutAudioVolume (newVolume);
qtMovie->PutAudioMute (newVolume <= 0); pimpl->qtMovie->PutAudioMute (newVolume <= 0);
} }
} }
float QuickTimeMovieComponent::getMovieVolume() const float QuickTimeMovieComponent::getMovieVolume() const
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
return qtMovie->GetAudioVolume(); return pimpl->qtMovie->GetAudioVolume();
return 0.0f; return 0.0f;
} }
void QuickTimeMovieComponent::setLooping (const bool shouldLoop) void QuickTimeMovieComponent::setLooping (const bool shouldLoop)
{ {
if (qtMovie != 0) if (pimpl->qtMovie != 0)
qtMovie->PutLoop (shouldLoop); pimpl->qtMovie->PutLoop (shouldLoop);
} }
bool QuickTimeMovieComponent::isLooping() const bool QuickTimeMovieComponent::isLooping() const
{ {
return qtMovie != 0 && qtMovie->GetLoop(); return pimpl->qtMovie != 0 && pimpl->qtMovie->GetLoop();
} }
bool QuickTimeMovieComponent::isControllerVisible() const bool QuickTimeMovieComponent::isControllerVisible() const
@ -465,7 +456,7 @@ bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle
bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, bool QuickTimeMovieComponent::loadMovie (const File& movieFile_,
const bool isControllerVisible) const bool isControllerVisible)
{ {
const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); const bool ok = loadMovie (static_cast <InputStream*> (movieFile_.createInputStream()), isControllerVisible);
movieFile = movieFile_; movieFile = movieFile_;
return ok; return ok;
} }
@ -473,7 +464,7 @@ bool QuickTimeMovieComponent::loadMovie (const File& movieFile_,
bool QuickTimeMovieComponent::loadMovie (const URL& movieURL, bool QuickTimeMovieComponent::loadMovie (const URL& movieURL,
const bool isControllerVisible) const bool isControllerVisible)
{ {
return loadMovie ((InputStream*) movieURL.createInputStream (false), isControllerVisible); return loadMovie (static_cast <InputStream*> (movieURL.createInputStream (false)), isControllerVisible);
} }
void QuickTimeMovieComponent::goToStart() void QuickTimeMovieComponent::goToStart()

View file

@ -54,8 +54,6 @@ extern bool juce_IsRunningInWine();
#define AC_SRC_ALPHA 0x01 #define AC_SRC_ALPHA 0x01
#endif #endif
#define DEBUG_REPAINT_TIMES 0
static HPALETTE palette = 0; static HPALETTE palette = 0;
static bool createPaletteIfNeeded = true; static bool createPaletteIfNeeded = true;
static bool shouldDeactivateTitleBar = true; static bool shouldDeactivateTitleBar = true;
@ -83,10 +81,6 @@ bool Desktop::canUseSemiTransparentWindows() throw()
return updateLayeredWindow != 0; return updateLayeredWindow != 0;
} }
//==============================================================================
#undef DefWindowProc
#define DefWindowProc DefWindowProcW
//============================================================================== //==============================================================================
const int extendedKeyModifier = 0x10000; const int extendedKeyModifier = 0x10000;
@ -1094,9 +1088,6 @@ private:
//============================================================================== //==============================================================================
void handlePaintMessage() void handlePaintMessage()
{ {
#if DEBUG_REPAINT_TIMES
const double paintStart = Time::getMillisecondCounterHiRes();
#endif
HRGN rgn = CreateRectRgn (0, 0, 0, 0); HRGN rgn = CreateRectRgn (0, 0, 0, 0);
const int regionType = GetUpdateRgn (hwnd, rgn, false); const int regionType = GetUpdateRgn (hwnd, rgn, false);
@ -1233,11 +1224,6 @@ private:
#endif #endif
lastPaintTime = Time::getMillisecondCounter(); lastPaintTime = Time::getMillisecondCounter();
#if DEBUG_REPAINT_TIMES
const double elapsed = Time::getMillisecondCounterHiRes() - paintStart;
Logger::outputDebugString (T("repaint time: ") + String (elapsed, 2));
#endif
} }
//============================================================================== //==============================================================================
@ -1674,7 +1660,7 @@ public:
if (peer != 0) if (peer != 0)
return peer->peerWindowProc (h, message, wParam, lParam); return peer->peerWindowProc (h, message, wParam, lParam);
return DefWindowProc (h, message, wParam, lParam); return DefWindowProcW (h, message, wParam, lParam);
} }
private: private:
@ -2103,7 +2089,7 @@ private:
} }
} }
return DefWindowProc (h, message, wParam, lParam); return DefWindowProcW (h, message, wParam, lParam);
} }
bool sendInputAttemptWhenModalMessage() bool sendInputAttemptWhenModalMessage()

View file

@ -1,38 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-9 by Raw Material Software Ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the GNU General
Public License (Version 2), as published by the Free Software Foundation.
A copy of the license is included in the JUCE distribution, or can be found
online at www.gnu.org/licenses.
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.rawmaterialsoftware.com/juce for more information.
==============================================================================
*/
#include "../core/juce_StandardHeader.h"
BEGIN_JUCE_NAMESPACE
#include "juce_InterProcessLock.h"
//==============================================================================
// (implemented in the platform-specific code files)
END_JUCE_NAMESPACE