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:
parent
5419ebc520
commit
858a758aee
24 changed files with 1037 additions and 1172 deletions
|
|
@ -138,7 +138,6 @@
|
|||
#include "../src/text/juce_StringPairArray.cpp"
|
||||
#include "../src/text/juce_XmlDocument.cpp"
|
||||
#include "../src/text/juce_XmlElement.cpp"
|
||||
#include "../src/threads/juce_InterProcessLock.cpp"
|
||||
#include "../src/threads/juce_ReadWriteLock.cpp"
|
||||
#include "../src/threads/juce_Thread.cpp"
|
||||
#include "../src/threads/juce_ThreadPool.cpp"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -465,7 +465,6 @@
|
|||
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 */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
|
|
@ -939,7 +938,6 @@
|
|||
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 */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
|
|
@ -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; };
|
||||
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; };
|
||||
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; };
|
||||
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; };
|
||||
|
|
@ -2428,7 +2425,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
84F1E9D9104036D6006A1807 /* juce_CriticalSection.h */,
|
||||
84F1E9DA104036D6006A1807 /* juce_InterProcessLock.cpp */,
|
||||
84F1E9DB104036D6006A1807 /* juce_InterProcessLock.h */,
|
||||
84F1E9DC104036D6006A1807 /* juce_Process.h */,
|
||||
84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */,
|
||||
|
|
@ -3771,7 +3767,6 @@
|
|||
8481700C10809E00008FEC33 /* juce_InputStream.cpp in Sources */,
|
||||
8481700D10809E00008FEC33 /* juce_InterprocessConnection.cpp in Sources */,
|
||||
8481700E10809E00008FEC33 /* juce_InterprocessConnectionServer.cpp in Sources */,
|
||||
8481700F10809E00008FEC33 /* juce_InterProcessLock.cpp in Sources */,
|
||||
8481701010809E00008FEC33 /* juce_iphone_Audio.cpp in Sources */,
|
||||
8481701210809E00008FEC33 /* juce_iphone_MessageManager.mm in Sources */,
|
||||
8481701310809E00008FEC33 /* juce_iphone_MiscUtilities.mm in Sources */,
|
||||
|
|
@ -4086,7 +4081,6 @@
|
|||
84F1EA2D104036D6006A1807 /* juce_StringPairArray.cpp in Sources */,
|
||||
84F1EA2F104036D6006A1807 /* juce_XmlDocument.cpp in Sources */,
|
||||
84F1EA31104036D6006A1807 /* juce_XmlElement.cpp in Sources */,
|
||||
84F1EA34104036D6006A1807 /* juce_InterProcessLock.cpp in Sources */,
|
||||
84F1EA37104036D6006A1807 /* juce_ReadWriteLock.cpp in Sources */,
|
||||
84F1EA3D104036D6006A1807 /* juce_Thread.cpp in Sources */,
|
||||
84F1EA3F104036D6006A1807 /* juce_ThreadPool.cpp in Sources */,
|
||||
|
|
|
|||
|
|
@ -2813,10 +2813,6 @@
|
|||
RelativePath="..\..\..\src\threads\juce_CriticalSection.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\threads\juce_InterProcessLock.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\threads\juce_InterProcessLock.h"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
#endif
|
||||
|
||||
#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 // __JUCE_INCLUDECHARACTERISTICS_JUCEHEADER__
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -26894,7 +26894,10 @@ private:
|
|||
|
||||
void createControlIfNeeded();
|
||||
bool isControlCreated() const;
|
||||
void* internal;
|
||||
|
||||
class Pimpl;
|
||||
friend class ScopedPointer <Pimpl>;
|
||||
ScopedPointer <Pimpl> pimpl;
|
||||
#else
|
||||
void* movie;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1095,7 +1095,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
|
|||
{
|
||||
ScopedPointer <AudioProcessorEditor> w (new AudioUnitPluginWindowCocoa (*this, false));
|
||||
|
||||
if (! ((AudioUnitPluginWindowCocoa*) w)->isValid())
|
||||
if (! static_cast <AudioUnitPluginWindowCocoa*> (static_cast <AudioProcessorEditor> (w))->isValid())
|
||||
w = 0;
|
||||
|
||||
#if JUCE_SUPPORT_CARBON
|
||||
|
|
@ -1103,7 +1103,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
|
|||
{
|
||||
w = new AudioUnitPluginWindowCarbon (*this);
|
||||
|
||||
if (! ((AudioUnitPluginWindowCarbon*) w)->isValid())
|
||||
if (! static_cast <AudioUnitPluginWindowCocoa*> (static_cast <AudioProcessorEditor> (w))->isValid())
|
||||
w = 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ BEGIN_JUCE_NAMESPACE
|
|||
#include "juce_VSTMidiEventList.h"
|
||||
|
||||
#if ! JUCE_WIN32
|
||||
#define _fpreset()
|
||||
#define _clearfp()
|
||||
static void _fpreset() {}
|
||||
static void _clearfp() {}
|
||||
#endif
|
||||
|
||||
extern void juce_callAnyTimersSynchronously();
|
||||
|
|
|
|||
|
|
@ -209,14 +209,15 @@ private:
|
|||
bool movieLoaded, controllerVisible, looping;
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
/** @internal */
|
||||
void parentHierarchyChanged();
|
||||
/** @internal */
|
||||
void visibilityChanged();
|
||||
|
||||
void createControlIfNeeded();
|
||||
bool isControlCreated() const;
|
||||
void* internal;
|
||||
|
||||
class Pimpl;
|
||||
friend class ScopedPointer <Pimpl>;
|
||||
ScopedPointer <Pimpl> pimpl;
|
||||
#else
|
||||
void* movie;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,10 +30,15 @@
|
|||
the rest of the codebase.
|
||||
*/
|
||||
|
||||
#include "../core/juce_TargetPlatform.h"
|
||||
|
||||
#if JUCE_LINUX
|
||||
|
||||
#include "linux/juce_linux_NativeIncludes.h"
|
||||
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
//==============================================================================
|
||||
#include "../io/files/juce_FileInputStream.h"
|
||||
#include "../io/files/juce_FileOutputStream.h"
|
||||
#include "../core/juce_SystemStats.h"
|
||||
|
|
@ -115,3 +120,5 @@ BEGIN_JUCE_NAMESPACE
|
|||
#endif
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@
|
|||
the rest of the codebase.
|
||||
*/
|
||||
|
||||
#include "../core/juce_TargetPlatform.h"
|
||||
|
||||
#if JUCE_MAC || JUCE_IPHONE
|
||||
|
||||
#include "mac/juce_mac_NativeIncludes.h"
|
||||
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
|
@ -131,3 +135,5 @@ BEGIN_JUCE_NAMESPACE
|
|||
#endif
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
//==============================================================================
|
||||
/*
|
||||
This file wraps together all the win32-specific code, so that
|
||||
we can include all the native headers just once, and compile all our
|
||||
|
|
@ -31,9 +30,11 @@
|
|||
the rest of the codebase.
|
||||
*/
|
||||
|
||||
//==============================================================================
|
||||
#include "windows/juce_win32_NativeIncludes.h"
|
||||
#include "../core/juce_TargetPlatform.h"
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
|
||||
#include "windows/juce_win32_NativeIncludes.h"
|
||||
#include "../core/juce_StandardHeader.h"
|
||||
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
|
@ -118,3 +119,5 @@ BEGIN_JUCE_NAMESPACE
|
|||
#endif
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@
|
|||
// compiled on its own).
|
||||
#if JUCE_INCLUDED_FILE
|
||||
|
||||
#define U_ISOFS_SUPER_MAGIC (short) 0x9660 // linux/iso_fs.h
|
||||
#define U_MSDOS_SUPER_MAGIC (short) 0x4d44 // linux/msdos_fs.h
|
||||
#define U_NFS_SUPER_MAGIC (short) 0x6969 // linux/nfs_fs.h
|
||||
#define U_SMB_SUPER_MAGIC (short) 0x517B // linux/smb_fs.h
|
||||
|
||||
static const short U_ISOFS_SUPER_MAGIC = 0x9660; // linux/iso_fs.h
|
||||
static const short U_MSDOS_SUPER_MAGIC = 0x4d44; // linux/msdos_fs.h
|
||||
static const short U_NFS_SUPER_MAGIC = 0x6969; // linux/nfs_fs.h
|
||||
static const short U_SMB_SUPER_MAGIC = 0x517B; // linux/smb_fs.h
|
||||
|
||||
//==============================================================================
|
||||
void juce_getFileTimes (const String& fileName,
|
||||
|
|
|
|||
|
|
@ -296,9 +296,6 @@ public:
|
|||
const float scaleY = -1.0f / height;
|
||||
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
|
||||
|| face->glyph->format != ft_glyph_format_outline)
|
||||
{
|
||||
|
|
@ -317,15 +314,15 @@ public:
|
|||
|
||||
for (int p = startPoint; p <= endPoint; p++)
|
||||
{
|
||||
const float x = CONVERTX (points[p]);
|
||||
const float y = CONVERTY (points[p]);
|
||||
const float x = scaleX * points[p].x;
|
||||
const float y = scaleY * points[p].y;
|
||||
|
||||
if (p == startPoint)
|
||||
{
|
||||
if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic)
|
||||
{
|
||||
float x2 = CONVERTX (points [endPoint]);
|
||||
float y2 = CONVERTY (points [endPoint]);
|
||||
float x2 = scaleX * points [endPoint].x;
|
||||
float y2 = scaleY * points [endPoint].y;
|
||||
|
||||
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)
|
||||
{
|
||||
const int nextIndex = (p == endPoint) ? startPoint : p + 1;
|
||||
float x2 = CONVERTX (points [nextIndex]);
|
||||
float y2 = CONVERTY (points [nextIndex]);
|
||||
float x2 = scaleX * points [nextIndex].x;
|
||||
float y2 = scaleY * points [nextIndex].y;
|
||||
|
||||
if (FT_CURVE_TAG (tags [nextIndex]) == FT_Curve_Tag_Conic)
|
||||
{
|
||||
|
|
@ -372,10 +369,10 @@ public:
|
|||
const int next1 = p + 1;
|
||||
const int next2 = (p == (endPoint - 1)) ? startPoint : p + 2;
|
||||
|
||||
const float x2 = CONVERTX (points [next1]);
|
||||
const float y2 = CONVERTY (points [next1]);
|
||||
const float x3 = CONVERTX (points [next2]);
|
||||
const float y3 = CONVERTY (points [next2]);
|
||||
const float x2 = scaleX * points [next1].x;
|
||||
const float y2 = scaleY * points [next1].y;
|
||||
const float x3 = scaleX * points [next2].x;
|
||||
const float y3 = scaleY * points [next2].y;
|
||||
|
||||
if (FT_CURVE_TAG (tags[next1]) != FT_Curve_Tag_Cubic
|
||||
|| FT_CURVE_TAG (tags[next2]) != FT_Curve_Tag_On)
|
||||
|
|
|
|||
|
|
@ -35,22 +35,10 @@
|
|||
Display* display = 0; // This is also referenced from WindowDriver.cpp
|
||||
Window juce_messageWindowHandle = None;
|
||||
|
||||
#define SpecialAtom "JUCESpecialAtom"
|
||||
#define BroadcastAtom "JUCEBroadcastAtom"
|
||||
#define SpecialCallbackAtom "JUCESpecialCallbackAtom"
|
||||
XContext improbableNumber; // This is referenced from Windowing.cpp
|
||||
|
||||
static Atom specialId;
|
||||
static Atom broadcastId;
|
||||
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);
|
||||
extern void juce_windowMessageReceive (XEvent* event); // Defined in Windowing.cpp
|
||||
extern void juce_handleSelectionRequest (XSelectionRequestEvent &evt); // Defined in Clipboard.cpp
|
||||
|
||||
//==============================================================================
|
||||
ScopedXLock::ScopedXLock() { XLockDisplay (display); }
|
||||
|
|
@ -290,11 +278,6 @@ void MessageManager::doPlatformSpecificInitialisation()
|
|||
Window root = RootWindow (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 in WindowDriver
|
||||
improbableNumber = XUniqueContext();
|
||||
|
|
@ -340,29 +323,6 @@ bool juce_postMessageToSystemQueue (void* message)
|
|||
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()
|
||||
{
|
||||
/* TODO */
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ END_JUCE_NAMESPACE
|
|||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
//==============================================================================
|
||||
#define theMovie ((QTMovie*) movie)
|
||||
#define theMovie (static_cast <QTMovie*> (movie))
|
||||
|
||||
//==============================================================================
|
||||
QuickTimeMovieComponent::QuickTimeMovieComponent()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
|
||||
#if JUCE_USE_CDREADER
|
||||
|
||||
namespace CDReaderHelpers
|
||||
{
|
||||
|
||||
//***************************************************************************
|
||||
// %%% TARGET STATUS VALUES %%%
|
||||
//***************************************************************************
|
||||
|
|
@ -528,12 +531,12 @@ public:
|
|||
wantsIndex (false)
|
||||
{
|
||||
bufferSize = 2352 * numberOfFrames;
|
||||
buffer = (BYTE*) malloc (bufferSize);
|
||||
buffer = (BYTE*) juce_malloc (bufferSize);
|
||||
}
|
||||
|
||||
~CDReadBuffer()
|
||||
{
|
||||
free (buffer);
|
||||
juce_free (buffer);
|
||||
}
|
||||
|
||||
bool isZero() const
|
||||
|
|
@ -627,7 +630,7 @@ public:
|
|||
if (controller != 0)
|
||||
{
|
||||
controller->shutDown();
|
||||
delete controller;
|
||||
controller = 0;
|
||||
}
|
||||
|
||||
if (scsiHandle != 0)
|
||||
|
|
@ -643,7 +646,7 @@ public:
|
|||
BYTE readType;
|
||||
|
||||
private:
|
||||
CDController* controller;
|
||||
ScopedPointer<CDController> controller;
|
||||
|
||||
bool testController (const int readType,
|
||||
CDController* const newController,
|
||||
|
|
@ -713,14 +716,7 @@ static void DeinitialiseCDRipper()
|
|||
//==============================================================================
|
||||
static HANDLE CreateSCSIDeviceHandle (char driveLetter)
|
||||
{
|
||||
TCHAR devicePath[8];
|
||||
devicePath[0] = '\\';
|
||||
devicePath[1] = '\\';
|
||||
devicePath[2] = '.';
|
||||
devicePath[3] = '\\';
|
||||
devicePath[4] = driveLetter;
|
||||
devicePath[5] = ':';
|
||||
devicePath[6] = 0;
|
||||
TCHAR devicePath[] = { '\\', '\\', '.', '\\', driveLetter, ':', 0, 0 };
|
||||
|
||||
OSVERSIONINFO info;
|
||||
info.dwOSVersionInfoSize = sizeof (info);
|
||||
|
|
@ -1283,7 +1279,6 @@ void CDDeviceHandle::openDrawer (bool shouldBeOpen)
|
|||
if (controller != 0)
|
||||
{
|
||||
controller->shutDown();
|
||||
delete controller;
|
||||
controller = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1365,7 +1360,6 @@ bool CDDeviceHandle::testController (const int type,
|
|||
if (! passed)
|
||||
{
|
||||
controller->shutDown();
|
||||
delete controller;
|
||||
controller = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1595,8 +1589,8 @@ static void decUserCount()
|
|||
//==============================================================================
|
||||
struct CDDeviceWrapper
|
||||
{
|
||||
CDDeviceHandle* cdH;
|
||||
CDReadBuffer* overlapBuffer;
|
||||
ScopedPointer<CDDeviceHandle> cdH;
|
||||
ScopedPointer<CDReadBuffer> overlapBuffer;
|
||||
bool jitter;
|
||||
};
|
||||
|
||||
|
|
@ -1615,38 +1609,6 @@ static int getMSFAddressOf (const TOCTRACK* const t)
|
|||
static const int samplesPerFrame = 44100 / 75;
|
||||
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)
|
||||
{
|
||||
SRB_GDEVBlock s;
|
||||
|
|
@ -1680,8 +1642,43 @@ static CDDeviceHandle* openHandle (const CDDeviceInfo* const device)
|
|||
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)
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
incUserCount();
|
||||
|
||||
if (initialisedOk)
|
||||
|
|
@ -1716,6 +1713,7 @@ AudioCDReader::AudioCDReader (void* handle_)
|
|||
firstFrameInBuffer (0),
|
||||
samplesInBuffer (0)
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
jassert (handle_ != 0);
|
||||
|
||||
refreshTrackLengths();
|
||||
|
|
@ -1731,10 +1729,8 @@ AudioCDReader::AudioCDReader (void* handle_)
|
|||
|
||||
AudioCDReader::~AudioCDReader()
|
||||
{
|
||||
CDDeviceWrapper* const device = (CDDeviceWrapper*)handle;
|
||||
|
||||
delete device->cdH;
|
||||
delete device->overlapBuffer;
|
||||
using namespace CDReaderHelpers;
|
||||
CDDeviceWrapper* const device = (CDDeviceWrapper*) handle;
|
||||
delete device;
|
||||
|
||||
decUserCount();
|
||||
|
|
@ -1743,6 +1739,7 @@ AudioCDReader::~AudioCDReader()
|
|||
bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
|
||||
int64 startSampleInFile, int numSamples)
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
CDDeviceWrapper* const device = (CDDeviceWrapper*) handle;
|
||||
|
||||
bool ok = true;
|
||||
|
|
@ -1840,10 +1837,11 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta
|
|||
|
||||
bool AudioCDReader::isCDStillPresent() const
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
TOC toc;
|
||||
zerostruct (toc);
|
||||
|
||||
return ((CDDeviceWrapper*)handle)->cdH->readTOC (&toc, false);
|
||||
return ((CDDeviceWrapper*) handle)->cdH->readTOC (&toc, false);
|
||||
}
|
||||
|
||||
int AudioCDReader::getNumTracks() const
|
||||
|
|
@ -1853,12 +1851,14 @@ int AudioCDReader::getNumTracks() const
|
|||
|
||||
int AudioCDReader::getPositionOfTrackStart (int trackNum) const
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
return (trackNum >= 0 && trackNum <= numTracks) ? trackStarts [trackNum] * samplesPerFrame
|
||||
: 0;
|
||||
}
|
||||
|
||||
void AudioCDReader::refreshTrackLengths()
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
zeromem (trackStarts, sizeof (trackStarts));
|
||||
zeromem (audioTracks, sizeof (audioTracks));
|
||||
|
||||
|
|
@ -1901,6 +1901,7 @@ const int framesPerIndexRead = 4;
|
|||
|
||||
int AudioCDReader::getIndexAt (int samplePos)
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
CDDeviceWrapper* const device = (CDDeviceWrapper*) handle;
|
||||
|
||||
const int frameNeeded = samplePos / samplesPerFrame;
|
||||
|
|
@ -1934,6 +1935,7 @@ int AudioCDReader::getIndexAt (int samplePos)
|
|||
|
||||
const Array <int> AudioCDReader::findIndexesInTrack (const int trackNumber)
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
Array <int> indexes;
|
||||
|
||||
const int trackStart = getPositionOfTrackStart (trackNumber);
|
||||
|
|
@ -2030,6 +2032,7 @@ const Array <int> AudioCDReader::findIndexesInTrack (const int trackNumber)
|
|||
|
||||
int AudioCDReader::getCDDBId()
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
refreshTrackLengths();
|
||||
|
||||
if (numTracks > 0)
|
||||
|
|
@ -2067,6 +2070,7 @@ int AudioCDReader::getCDDBId()
|
|||
|
||||
void AudioCDReader::ejectDisk()
|
||||
{
|
||||
using namespace CDReaderHelpers;
|
||||
((CDDeviceWrapper*) handle)->cdH->openDrawer (true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -429,11 +429,9 @@ bool File::isOnRemovableDrive() const
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
#define MAX_PATH_CHARS (MAX_PATH + 256)
|
||||
|
||||
static const File juce_getSpecialFolderPath (int type)
|
||||
{
|
||||
WCHAR path [MAX_PATH_CHARS];
|
||||
WCHAR path [MAX_PATH + 256];
|
||||
|
||||
if (SHGetSpecialFolderPath (0, path, type, 0))
|
||||
return File (String (path));
|
||||
|
|
@ -493,9 +491,9 @@ const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType typ
|
|||
{
|
||||
HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle();
|
||||
|
||||
WCHAR dest [MAX_PATH_CHARS];
|
||||
WCHAR dest [MAX_PATH + 256];
|
||||
dest[0] = 0;
|
||||
GetModuleFileName (moduleHandle, dest, MAX_PATH_CHARS);
|
||||
GetModuleFileName (moduleHandle, dest, numElementsInArray (dest));
|
||||
return File (String (dest));
|
||||
}
|
||||
break;
|
||||
|
|
@ -511,9 +509,9 @@ const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType typ
|
|||
//==============================================================================
|
||||
const File File::getCurrentWorkingDirectory()
|
||||
{
|
||||
WCHAR dest [MAX_PATH_CHARS];
|
||||
WCHAR dest [MAX_PATH + 256];
|
||||
dest[0] = 0;
|
||||
GetCurrentDirectory (MAX_PATH_CHARS, dest);
|
||||
GetCurrentDirectory (numElementsInArray (dest), dest);
|
||||
return File (String (dest));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -314,11 +314,8 @@ public:
|
|||
|
||||
while ((char*) pheader < data + bufSize)
|
||||
{
|
||||
#define remapX(v) (scaleX * (v).x.value)
|
||||
#define remapY(v) (scaleY * (v).y.value)
|
||||
|
||||
float x = remapX (pheader->pfxStart);
|
||||
float y = remapY (pheader->pfxStart);
|
||||
float x = scaleX * pheader->pfxStart.x.value;
|
||||
float y = scaleY * pheader->pfxStart.y.value;
|
||||
|
||||
glyphPath.startNewSubPath (x, y);
|
||||
|
||||
|
|
@ -331,8 +328,8 @@ public:
|
|||
{
|
||||
for (int i = 0; i < curve->cpfx; ++i)
|
||||
{
|
||||
x = remapX (curve->apfx [i]);
|
||||
y = remapY (curve->apfx [i]);
|
||||
x = scaleX * curve->apfx[i].x.value;
|
||||
y = scaleY * curve->apfx[i].y.value;
|
||||
|
||||
glyphPath.lineTo (x, y);
|
||||
}
|
||||
|
|
@ -341,19 +338,19 @@ public:
|
|||
{
|
||||
for (int i = 0; i < curve->cpfx - 1; ++i)
|
||||
{
|
||||
const float x2 = remapX (curve->apfx [i]);
|
||||
const float y2 = remapY (curve->apfx [i]);
|
||||
const float x2 = scaleX * curve->apfx[i].x.value;
|
||||
const float y2 = scaleY * curve->apfx[i].y.value;
|
||||
float x3, y3;
|
||||
|
||||
if (i < curve->cpfx - 2)
|
||||
{
|
||||
x3 = 0.5f * (x2 + remapX (curve->apfx [i + 1]));
|
||||
y3 = 0.5f * (y2 + remapY (curve->apfx [i + 1]));
|
||||
x3 = 0.5f * (x2 + scaleX * curve->apfx[i + 1].x.value);
|
||||
y3 = 0.5f * (y2 + scaleY * curve->apfx[i + 1].y.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
x3 = remapX (curve->apfx [i + 1]);
|
||||
y3 = remapY (curve->apfx [i + 1]);
|
||||
x3 = scaleX * curve->apfx[i + 1].x.value;
|
||||
y3 = scaleY * curve->apfx[i + 1].y.value;
|
||||
}
|
||||
|
||||
glyphPath.quadraticTo (x2, y2, x3, y3);
|
||||
|
|
|
|||
|
|
@ -28,13 +28,15 @@
|
|||
#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;
|
||||
|
||||
namespace MidiConstants
|
||||
{
|
||||
static const int midiBufferSize = 1024 * 10;
|
||||
static const int numInHeaders = 32;
|
||||
static const int inBufferSize = 256;
|
||||
}
|
||||
|
||||
class MidiInThread : public Thread
|
||||
{
|
||||
public:
|
||||
|
|
@ -49,11 +51,11 @@ public:
|
|||
startTime (0),
|
||||
pendingLength(0)
|
||||
{
|
||||
for (int i = numInHeaders; --i >= 0;)
|
||||
for (int i = MidiConstants::numInHeaders; --i >= 0;)
|
||||
{
|
||||
zeromem (&hdr[i], sizeof (MIDIHDR));
|
||||
hdr[i].lpData = inData[i];
|
||||
hdr[i].dwBufferLength = inBufferSize;
|
||||
hdr[i].dwBufferLength = MidiConstants::inBufferSize;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -87,7 +89,7 @@ public:
|
|||
{
|
||||
const ScopedLock sl (lock);
|
||||
|
||||
if (pendingLength < midiBufferSize - 12)
|
||||
if (pendingLength < MidiConstants::midiBufferSize - 12)
|
||||
{
|
||||
char* const p = pending + pendingLength;
|
||||
*(double*) p = time;
|
||||
|
|
@ -115,7 +117,7 @@ public:
|
|||
{
|
||||
const ScopedLock sl (lock);
|
||||
|
||||
if (pendingLength < midiBufferSize - (8 + num))
|
||||
if (pendingLength < MidiConstants::midiBufferSize - (8 + num))
|
||||
{
|
||||
char* const p = pending + pendingLength;
|
||||
*(double*) p = time;
|
||||
|
|
@ -148,7 +150,7 @@ public:
|
|||
|
||||
while (! threadShouldExit())
|
||||
{
|
||||
for (int i = 0; i < numInHeaders; ++i)
|
||||
for (int i = 0; i < MidiConstants::numInHeaders; ++i)
|
||||
{
|
||||
if ((hdr[i].dwFlags & WHDR_DONE) != 0)
|
||||
{
|
||||
|
|
@ -210,7 +212,7 @@ public:
|
|||
activeMidiThreads.addIfNotAlreadyThere (this);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < numInHeaders; ++i)
|
||||
for (i = 0; i < MidiConstants::numInHeaders; ++i)
|
||||
writeBlock (i);
|
||||
|
||||
startTime = Time::getMillisecondCounter();
|
||||
|
|
@ -240,7 +242,7 @@ public:
|
|||
|
||||
{ const ScopedLock sl (lock); }
|
||||
|
||||
for (int i = numInHeaders; --i >= 0;)
|
||||
for (int i = MidiConstants::numInHeaders; --i >= 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
|
||||
|
||||
HMIDIIN hIn;
|
||||
|
||||
private:
|
||||
static Array <void*, CriticalSection> activeMidiThreads;
|
||||
|
||||
MidiInput* input;
|
||||
MidiInputCallback* callback;
|
||||
bool isStarted;
|
||||
uint32 startTime;
|
||||
CriticalSection lock;
|
||||
|
||||
MIDIHDR hdr [numInHeaders];
|
||||
char inData [numInHeaders] [inBufferSize];
|
||||
MIDIHDR hdr [MidiConstants::numInHeaders];
|
||||
char inData [MidiConstants::numInHeaders] [MidiConstants::inBufferSize];
|
||||
|
||||
int pendingLength;
|
||||
char pending [midiBufferSize];
|
||||
char pending [MidiConstants::midiBufferSize];
|
||||
|
||||
double timeStampToTime (uint32 timeStamp) throw()
|
||||
{
|
||||
|
|
@ -294,22 +311,8 @@ private:
|
|||
MidiInThread& operator= (const MidiInThread&);
|
||||
};
|
||||
|
||||
static void CALLBACK midiInCallback (HMIDIIN,
|
||||
UINT uMsg,
|
||||
DWORD_PTR dwInstance,
|
||||
DWORD_PTR midiMessage,
|
||||
DWORD_PTR timeStamp)
|
||||
{
|
||||
MidiInThread* const thread = (MidiInThread*) dwInstance;
|
||||
Array <void*, CriticalSection> MidiInThread::activeMidiThreads;
|
||||
|
||||
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()
|
||||
|
|
@ -368,7 +371,7 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call
|
|||
|
||||
HMIDIIN h;
|
||||
HRESULT err = midiInOpen (&h, deviceId,
|
||||
(DWORD_PTR) &midiInCallback,
|
||||
(DWORD_PTR) &MidiInThread::midiInCallback,
|
||||
(DWORD_PTR) (MidiInThread*) thread,
|
||||
CALLBACK_FUNCTION);
|
||||
|
||||
|
|
@ -390,21 +393,17 @@ MidiInput::MidiInput (const String& name_)
|
|||
|
||||
MidiInput::~MidiInput()
|
||||
{
|
||||
if (internal != 0)
|
||||
{
|
||||
MidiInThread* const thread = (MidiInThread*) internal;
|
||||
delete thread;
|
||||
}
|
||||
delete static_cast <MidiInThread*> (internal);
|
||||
}
|
||||
|
||||
void MidiInput::start()
|
||||
{
|
||||
((MidiInThread*) internal)->start();
|
||||
static_cast <MidiInThread*> (internal)->start();
|
||||
}
|
||||
|
||||
void MidiInput::stop()
|
||||
{
|
||||
((MidiInThread*) internal)->stop();
|
||||
static_cast <MidiInThread*> (internal)->stop();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -415,10 +414,12 @@ struct MidiOutHandle
|
|||
UINT deviceId;
|
||||
HMIDIOUT handle;
|
||||
|
||||
static Array<MidiOutHandle*> activeHandles;
|
||||
|
||||
juce_UseDebuggingNewOperator
|
||||
};
|
||||
|
||||
static Array <MidiOutHandle*> midiOutputHandles;
|
||||
Array<MidiOutHandle*> MidiOutHandle::activeHandles;
|
||||
|
||||
//==============================================================================
|
||||
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)
|
||||
{
|
||||
|
|
@ -513,7 +514,7 @@ MidiOutput* MidiOutput::openDevice (int index)
|
|||
han->deviceId = deviceId;
|
||||
han->refCount = 1;
|
||||
han->handle = h;
|
||||
midiOutputHandles.add (han);
|
||||
MidiOutHandle::activeHandles.add (han);
|
||||
|
||||
MidiOutput* const out = new MidiOutput();
|
||||
out->internal = (void*) han;
|
||||
|
|
@ -534,26 +535,26 @@ MidiOutput* MidiOutput::openDevice (int index)
|
|||
|
||||
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);
|
||||
midiOutputHandles.removeValue (h);
|
||||
MidiOutHandle::activeHandles.removeValue (h);
|
||||
delete h;
|
||||
}
|
||||
}
|
||||
|
||||
void MidiOutput::reset()
|
||||
{
|
||||
const MidiOutHandle* const h = (MidiOutHandle*) internal;
|
||||
const MidiOutHandle* const h = static_cast <const MidiOutHandle*> (internal);
|
||||
midiOutReset (h->handle);
|
||||
}
|
||||
|
||||
bool MidiOutput::getVolume (float& leftVol,
|
||||
float& rightVol)
|
||||
{
|
||||
const MidiOutHandle* const handle = (const MidiOutHandle*) internal;
|
||||
const MidiOutHandle* const handle = static_cast <const MidiOutHandle*> (internal);
|
||||
|
||||
DWORD n;
|
||||
if (midiOutGetVolume (handle->handle, &n) == MMSYSERR_NOERROR)
|
||||
|
|
@ -573,18 +574,18 @@ bool MidiOutput::getVolume (float& leftVol,
|
|||
void MidiOutput::setVolume (float leftVol,
|
||||
float rightVol)
|
||||
{
|
||||
const MidiOutHandle* const handle = (MidiOutHandle*) internal;
|
||||
const MidiOutHandle* const handle = static_cast <MidiOutHandle*> (internal);
|
||||
|
||||
DWORD n;
|
||||
unsigned short* const nn = (unsigned short*) &n;
|
||||
nn[0] = (unsigned short) jlimit (0, 0xffff, (int)(rightVol * 0xffff));
|
||||
nn[1] = (unsigned short) jlimit (0, 0xffff, (int)(leftVol * 0xffff));
|
||||
nn[0] = (unsigned short) jlimit (0, 0xffff, (int) (rightVol * 0xffff));
|
||||
nn[1] = (unsigned short) jlimit (0, 0xffff, (int) (leftVol * 0xffff));
|
||||
midiOutSetVolume (handle->handle, n);
|
||||
}
|
||||
|
||||
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
|
||||
|| message.isSysEx())
|
||||
|
|
|
|||
|
|
@ -36,23 +36,18 @@ static bool isQTAvailable = false;
|
|||
|
||||
|
||||
//==============================================================================
|
||||
struct QTMovieCompInternal
|
||||
class QuickTimeMovieComponent::Pimpl
|
||||
{
|
||||
QTMovieCompInternal()
|
||||
: dataHandle (0)
|
||||
public:
|
||||
Pimpl() : dataHandle (0)
|
||||
{
|
||||
}
|
||||
|
||||
~QTMovieCompInternal()
|
||||
~Pimpl()
|
||||
{
|
||||
clearHandle();
|
||||
}
|
||||
|
||||
IQTControlPtr qtControlInternal;
|
||||
IQTMoviePtr qtMovieInternal;
|
||||
|
||||
Handle dataHandle;
|
||||
|
||||
void clearHandle()
|
||||
{
|
||||
if (dataHandle != 0)
|
||||
|
|
@ -61,38 +56,33 @@ struct QTMovieCompInternal
|
|||
dataHandle = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#define qtControl (((QTMovieCompInternal*) internal)->qtControlInternal)
|
||||
#define qtMovie (((QTMovieCompInternal*) internal)->qtMovieInternal)
|
||||
IQTControlPtr qtControl;
|
||||
IQTMoviePtr qtMovie;
|
||||
Handle dataHandle;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
QuickTimeMovieComponent::QuickTimeMovieComponent()
|
||||
: movieLoaded (false),
|
||||
controllerVisible (true)
|
||||
{
|
||||
internal = new QTMovieCompInternal();
|
||||
pimpl = new Pimpl();
|
||||
setMouseEventsAllowed (false);
|
||||
}
|
||||
|
||||
QuickTimeMovieComponent::~QuickTimeMovieComponent()
|
||||
{
|
||||
closeMovie();
|
||||
qtControl = 0;
|
||||
|
||||
pimpl->qtControl = 0;
|
||||
deleteControl();
|
||||
|
||||
delete internal;
|
||||
internal = 0;
|
||||
pimpl = 0;
|
||||
}
|
||||
|
||||
bool QuickTimeMovieComponent::isQuickTimeAvailable() throw()
|
||||
{
|
||||
if (! isQTAvailable)
|
||||
{
|
||||
isQTAvailable = (InitializeQTML (0) == noErr)
|
||||
&& (EnterMovies() == noErr);
|
||||
}
|
||||
isQTAvailable = (InitializeQTML (0) == noErr) && (EnterMovies() == noErr);
|
||||
|
||||
return isQTAvailable;
|
||||
}
|
||||
|
|
@ -107,14 +97,14 @@ void QuickTimeMovieComponent::createControlIfNeeded()
|
|||
if (createControl (&qtIID))
|
||||
{
|
||||
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();
|
||||
qtControl->PutSizing (qtMovieFitsControl);
|
||||
pimpl->qtControl->QuickTimeInitialize();
|
||||
pimpl->qtControl->PutSizing (qtMovieFitsControl);
|
||||
|
||||
if (movieFile != File::nonexistent)
|
||||
loadMovie (movieFile, controllerVisible);
|
||||
|
|
@ -131,36 +121,38 @@ bool QuickTimeMovieComponent::isControlCreated() const
|
|||
bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream,
|
||||
const bool isControllerVisible)
|
||||
{
|
||||
const ScopedPointer<InputStream> movieStreamDeleter (movieStream);
|
||||
|
||||
movieFile = File::nonexistent;
|
||||
movieLoaded = false;
|
||||
qtMovie = 0;
|
||||
pimpl->qtMovie = 0;
|
||||
controllerVisible = isControllerVisible;
|
||||
createControlIfNeeded();
|
||||
|
||||
if (isControlCreated())
|
||||
{
|
||||
if (qtControl != 0)
|
||||
if (pimpl->qtControl != 0)
|
||||
{
|
||||
qtControl->Put_MovieHandle (0);
|
||||
((QTMovieCompInternal*) internal)->clearHandle();
|
||||
pimpl->qtControl->Put_MovieHandle (0);
|
||||
pimpl->clearHandle();
|
||||
|
||||
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)
|
||||
qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard
|
||||
: qtMovieControllerTypeNone);
|
||||
if (pimpl->qtMovie != 0)
|
||||
pimpl->qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard
|
||||
: qtMovieControllerTypeNone);
|
||||
}
|
||||
|
||||
if (movie == 0)
|
||||
((QTMovieCompInternal*) internal)->clearHandle();
|
||||
pimpl->clearHandle();
|
||||
}
|
||||
|
||||
movieLoaded = (qtMovie != 0);
|
||||
movieLoaded = (pimpl->qtMovie != 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -169,7 +161,6 @@ bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream,
|
|||
jassertfalse
|
||||
}
|
||||
|
||||
delete movieStream;
|
||||
return movieLoaded;
|
||||
}
|
||||
|
||||
|
|
@ -178,12 +169,12 @@ void QuickTimeMovieComponent::closeMovie()
|
|||
stop();
|
||||
movieFile = File::nonexistent;
|
||||
movieLoaded = false;
|
||||
qtMovie = 0;
|
||||
pimpl->qtMovie = 0;
|
||||
|
||||
if (qtControl != 0)
|
||||
qtControl->Put_MovieHandle (0);
|
||||
if (pimpl->qtControl != 0)
|
||||
pimpl->qtControl->Put_MovieHandle (0);
|
||||
|
||||
((QTMovieCompInternal*) internal)->clearHandle();
|
||||
pimpl->clearHandle();
|
||||
}
|
||||
|
||||
const File QuickTimeMovieComponent::getCurrentMovieFile() const
|
||||
|
|
@ -198,17 +189,17 @@ bool QuickTimeMovieComponent::isMovieOpen() const
|
|||
|
||||
double QuickTimeMovieComponent::getMovieDuration() const
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
return qtMovie->GetDuration() / (double) qtMovie->GetTimeScale();
|
||||
if (pimpl->qtMovie != 0)
|
||||
return pimpl->qtMovie->GetDuration() / (double) pimpl->qtMovie->GetTimeScale();
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
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;
|
||||
height = r.bottom - r.top;
|
||||
|
|
@ -221,67 +212,67 @@ void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const
|
|||
|
||||
void QuickTimeMovieComponent::play()
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
qtMovie->Play();
|
||||
if (pimpl->qtMovie != 0)
|
||||
pimpl->qtMovie->Play();
|
||||
}
|
||||
|
||||
void QuickTimeMovieComponent::stop()
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
qtMovie->Stop();
|
||||
if (pimpl->qtMovie != 0)
|
||||
pimpl->qtMovie->Stop();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
qtMovie->PutTime ((long) (seconds * qtMovie->GetTimeScale()));
|
||||
if (pimpl->qtMovie != 0)
|
||||
pimpl->qtMovie->PutTime ((long) (seconds * pimpl->qtMovie->GetTimeScale()));
|
||||
}
|
||||
|
||||
double QuickTimeMovieComponent::getPosition() const
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
return qtMovie->GetTime() / (double) qtMovie->GetTimeScale();
|
||||
if (pimpl->qtMovie != 0)
|
||||
return pimpl->qtMovie->GetTime() / (double) pimpl->qtMovie->GetTimeScale();
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void QuickTimeMovieComponent::setSpeed (const float newSpeed)
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
qtMovie->PutRate (newSpeed);
|
||||
if (pimpl->qtMovie != 0)
|
||||
pimpl->qtMovie->PutRate (newSpeed);
|
||||
}
|
||||
|
||||
void QuickTimeMovieComponent::setMovieVolume (const float newVolume)
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
if (pimpl->qtMovie != 0)
|
||||
{
|
||||
qtMovie->PutAudioVolume (newVolume);
|
||||
qtMovie->PutAudioMute (newVolume <= 0);
|
||||
pimpl->qtMovie->PutAudioVolume (newVolume);
|
||||
pimpl->qtMovie->PutAudioMute (newVolume <= 0);
|
||||
}
|
||||
}
|
||||
|
||||
float QuickTimeMovieComponent::getMovieVolume() const
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
return qtMovie->GetAudioVolume();
|
||||
if (pimpl->qtMovie != 0)
|
||||
return pimpl->qtMovie->GetAudioVolume();
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void QuickTimeMovieComponent::setLooping (const bool shouldLoop)
|
||||
{
|
||||
if (qtMovie != 0)
|
||||
qtMovie->PutLoop (shouldLoop);
|
||||
if (pimpl->qtMovie != 0)
|
||||
pimpl->qtMovie->PutLoop (shouldLoop);
|
||||
}
|
||||
|
||||
bool QuickTimeMovieComponent::isLooping() const
|
||||
{
|
||||
return qtMovie != 0 && qtMovie->GetLoop();
|
||||
return pimpl->qtMovie != 0 && pimpl->qtMovie->GetLoop();
|
||||
}
|
||||
|
||||
bool QuickTimeMovieComponent::isControllerVisible() const
|
||||
|
|
@ -465,7 +456,7 @@ bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle
|
|||
bool QuickTimeMovieComponent::loadMovie (const File& movieFile_,
|
||||
const bool isControllerVisible)
|
||||
{
|
||||
const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible);
|
||||
const bool ok = loadMovie (static_cast <InputStream*> (movieFile_.createInputStream()), isControllerVisible);
|
||||
movieFile = movieFile_;
|
||||
return ok;
|
||||
}
|
||||
|
|
@ -473,7 +464,7 @@ bool QuickTimeMovieComponent::loadMovie (const File& movieFile_,
|
|||
bool QuickTimeMovieComponent::loadMovie (const URL& movieURL,
|
||||
const bool isControllerVisible)
|
||||
{
|
||||
return loadMovie ((InputStream*) movieURL.createInputStream (false), isControllerVisible);
|
||||
return loadMovie (static_cast <InputStream*> (movieURL.createInputStream (false)), isControllerVisible);
|
||||
}
|
||||
|
||||
void QuickTimeMovieComponent::goToStart()
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@ extern bool juce_IsRunningInWine();
|
|||
#define AC_SRC_ALPHA 0x01
|
||||
#endif
|
||||
|
||||
#define DEBUG_REPAINT_TIMES 0
|
||||
|
||||
static HPALETTE palette = 0;
|
||||
static bool createPaletteIfNeeded = true;
|
||||
static bool shouldDeactivateTitleBar = true;
|
||||
|
|
@ -83,10 +81,6 @@ bool Desktop::canUseSemiTransparentWindows() throw()
|
|||
return updateLayeredWindow != 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
#undef DefWindowProc
|
||||
#define DefWindowProc DefWindowProcW
|
||||
|
||||
//==============================================================================
|
||||
const int extendedKeyModifier = 0x10000;
|
||||
|
||||
|
|
@ -1094,9 +1088,6 @@ private:
|
|||
//==============================================================================
|
||||
void handlePaintMessage()
|
||||
{
|
||||
#if DEBUG_REPAINT_TIMES
|
||||
const double paintStart = Time::getMillisecondCounterHiRes();
|
||||
#endif
|
||||
HRGN rgn = CreateRectRgn (0, 0, 0, 0);
|
||||
const int regionType = GetUpdateRgn (hwnd, rgn, false);
|
||||
|
||||
|
|
@ -1233,11 +1224,6 @@ private:
|
|||
#endif
|
||||
|
||||
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)
|
||||
return peer->peerWindowProc (h, message, wParam, lParam);
|
||||
|
||||
return DefWindowProc (h, message, wParam, lParam);
|
||||
return DefWindowProcW (h, message, wParam, lParam);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
@ -2103,7 +2089,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
return DefWindowProc (h, message, wParam, lParam);
|
||||
return DefWindowProcW (h, message, wParam, lParam);
|
||||
}
|
||||
|
||||
bool sendInputAttemptWhenModalMessage()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue