| @@ -643,6 +643,7 @@ | |||
| 8484E9D8103C95A6008B7C6C /* juce_posix_SharedCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8484E9D6103C95A6008B7C6C /* juce_posix_SharedCode.h */; }; | |||
| 8484E9D9103C95A6008B7C6C /* juce_posix_NamedPipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8484E9D7103C95A6008B7C6C /* juce_posix_NamedPipe.cpp */; }; | |||
| 84A63C02107DF286000326FD /* juce_mac_ObjCSuffix.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A63C01107DF286000326FD /* juce_mac_ObjCSuffix.h */; }; | |||
| 84AB6F6E10EF948B00117E64 /* juce_HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 84DEDD9E10EE496500909D01 /* juce_HeapBlock.h */; }; | |||
| 84AB91FB10A078190048FC39 /* juce_CodeDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84AB91F510A078190048FC39 /* juce_CodeDocument.cpp */; }; | |||
| 84AB91FC10A078190048FC39 /* juce_CodeDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AB91F610A078190048FC39 /* juce_CodeDocument.h */; }; | |||
| 84AB91FD10A078190048FC39 /* juce_CodeEditorComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84AB91F710A078190048FC39 /* juce_CodeEditorComponent.cpp */; }; | |||
| @@ -653,6 +654,7 @@ | |||
| 84B2053E10D535EC008B4A79 /* juce_ValueTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 843D4A3A10D3C54500624BA6 /* juce_ValueTree.h */; }; | |||
| 84B2053F10D535EC008B4A79 /* juce_ValueTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 843D4A3910D3C54500624BA6 /* juce_ValueTree.cpp */; }; | |||
| 84D0F00C109B1546007F73A3 /* juce_mac_CoreGraphicsContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D0F00B109B1546007F73A3 /* juce_mac_CoreGraphicsContext.mm */; }; | |||
| 84DEDD9F10EE496500909D01 /* juce_HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 84DEDD9E10EE496500909D01 /* juce_HeapBlock.h */; }; | |||
| 84F1E6E710403605006A1807 /* juce_Application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E6DC10403605006A1807 /* juce_Application.cpp */; }; | |||
| 84F1E6E810403605006A1807 /* juce_Application.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E6DD10403605006A1807 /* juce_Application.h */; }; | |||
| 84F1E6E910403605006A1807 /* juce_ApplicationCommandID.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1E6DE10403605006A1807 /* juce_ApplicationCommandID.h */; }; | |||
| @@ -1260,6 +1262,7 @@ | |||
| 84AB91FA10A078190048FC39 /* juce_CPlusPlusCodeTokeniser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_CPlusPlusCodeTokeniser.h; path = components/code_editor/juce_CPlusPlusCodeTokeniser.h; sourceTree = "<group>"; }; | |||
| 84AB927110A082E30048FC39 /* juce_CodeTokeniser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_CodeTokeniser.h; path = components/code_editor/juce_CodeTokeniser.h; sourceTree = "<group>"; }; | |||
| 84D0F00B109B1546007F73A3 /* juce_mac_CoreGraphicsContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_CoreGraphicsContext.mm; sourceTree = "<group>"; }; | |||
| 84DEDD9E10EE496500909D01 /* juce_HeapBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_HeapBlock.h; sourceTree = "<group>"; }; | |||
| 84F1E6DC10403605006A1807 /* juce_Application.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Application.cpp; path = ../../src/application/juce_Application.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 84F1E6DD10403605006A1807 /* juce_Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_Application.h; path = ../../src/application/juce_Application.h; sourceTree = SOURCE_ROOT; }; | |||
| 84F1E6DE10403605006A1807 /* juce_ApplicationCommandID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_ApplicationCommandID.h; path = ../../src/application/juce_ApplicationCommandID.h; sourceTree = SOURCE_ROOT; }; | |||
| @@ -2162,6 +2165,7 @@ | |||
| 84F1E8D510403671006A1807 /* juce_MemoryBlock.cpp */, | |||
| 84F1E8D610403671006A1807 /* juce_MemoryBlock.h */, | |||
| 84F1E8D710403671006A1807 /* juce_OwnedArray.h */, | |||
| 84DEDD9E10EE496500909D01 /* juce_HeapBlock.h */, | |||
| 84F1E8D810403671006A1807 /* juce_PropertySet.cpp */, | |||
| 84F1E8D910403671006A1807 /* juce_PropertySet.h */, | |||
| 84F1E8DA10403671006A1807 /* juce_ReferenceCountedArray.h */, | |||
| @@ -3206,6 +3210,7 @@ | |||
| 844BB95D10C5579B00DF5536 /* juce_FillType.h in Headers */, | |||
| 844BB95F10C557A800DF5536 /* juce_Config.h in Headers */, | |||
| 84B2053E10D535EC008B4A79 /* juce_ValueTree.h in Headers */, | |||
| 84AB6F6E10EF948B00117E64 /* juce_HeapBlock.h in Headers */, | |||
| ); | |||
| runOnlyForDeploymentPostprocessing = 0; | |||
| }; | |||
| @@ -3530,6 +3535,7 @@ | |||
| 84AB927210A082E30048FC39 /* juce_CodeTokeniser.h in Headers */, | |||
| 84F29AA010C2EFA5005014DF /* juce_FillType.h in Headers */, | |||
| 843D4A3C10D3C54500624BA6 /* juce_ValueTree.h in Headers */, | |||
| 84DEDD9F10EE496500909D01 /* juce_HeapBlock.h in Headers */, | |||
| ); | |||
| runOnlyForDeploymentPostprocessing = 0; | |||
| }; | |||
| @@ -1085,6 +1085,10 @@ | |||
| RelativePath="..\..\..\src\containers\juce_ElementComparator.h" | |||
| > | |||
| </File> | |||
| <File | |||
| RelativePath="..\..\..\src\containers\juce_HeapBlock.h" | |||
| > | |||
| </File> | |||
| <File | |||
| RelativePath="..\..\..\src\containers\juce_MemoryBlock.cpp" | |||
| > | |||
| @@ -127,7 +127,6 @@ public: | |||
| #endif | |||
| juceFilter (0), | |||
| bufferSpace (2, 16), | |||
| channels (0), | |||
| prepared (false) | |||
| { | |||
| if (activePlugins.size() + activeUIs.size() == 0) | |||
| @@ -162,9 +161,6 @@ public: | |||
| delete juceFilter; | |||
| juceFilter = 0; | |||
| juce_free (channels); | |||
| channels = 0; | |||
| jassert (activePlugins.contains (this)); | |||
| activePlugins.removeValue (this); | |||
| @@ -659,9 +655,8 @@ public: | |||
| midiEvents.clear(); | |||
| incomingEvents.clear(); | |||
| juce_free (channels); | |||
| channels = (float**) juce_calloc (sizeof (float*) * jmax (juceFilter->getNumInputChannels(), | |||
| juceFilter->getNumOutputChannels()) + 4); | |||
| channels.calloc (jmax (juceFilter->getNumInputChannels(), | |||
| juceFilter->getNumOutputChannels()) + 4); | |||
| prepared = true; | |||
| } | |||
| @@ -940,7 +935,7 @@ protected: | |||
| private: | |||
| AudioProcessor* juceFilter; | |||
| AudioSampleBuffer bufferSpace; | |||
| float** channels; | |||
| HeapBlock <float*> channels; | |||
| MidiBuffer midiEvents, incomingEvents; | |||
| bool prepared; | |||
| SMPTETime lastSMPTETime; | |||
| @@ -159,7 +159,6 @@ public: | |||
| JucePlugInProcess() | |||
| : midiBufferNode (0), | |||
| midiTransport (0), | |||
| channels (0), | |||
| prepared (false), | |||
| sampleRate (44100.0) | |||
| { | |||
| @@ -183,7 +182,6 @@ public: | |||
| juceFilter->releaseResources(); | |||
| delete juceFilter; | |||
| juce_free (channels); | |||
| if (--numInstances == 0) | |||
| shutdownJuce_GUI(); | |||
| @@ -509,9 +507,8 @@ protected: | |||
| sampleRate = gProcessGroup->GetSampleRate(); | |||
| jassert (sampleRate > 0); | |||
| juce_free (channels); | |||
| channels = (float**) juce_calloc (sizeof (float*) * jmax (juceFilter->getNumInputChannels(), | |||
| juceFilter->getNumOutputChannels())); | |||
| channels.calloc (jmax (juceFilter->getNumInputChannels(), | |||
| juceFilter->getNumOutputChannels())); | |||
| juceFilter->setPlayConfigDetails (fNumInputs, fNumOutputs, | |||
| sampleRate, mRTGlobals->mHWBufferSizeInSamples); | |||
| @@ -807,7 +804,7 @@ private: | |||
| DirectMidiPacket midiBuffer [midiBufferSize]; | |||
| JUCE_NAMESPACE::MemoryBlock tempFilterData; | |||
| float** channels; | |||
| HeapBlock <float*> channels; | |||
| bool prepared; | |||
| double sampleRate; | |||
| @@ -383,7 +383,6 @@ public: | |||
| hasShutdown = false; | |||
| firstProcessCallback = true; | |||
| shouldDeleteEditor = false; | |||
| channels = 0; | |||
| speakerIn = kSpeakerArrEmpty; | |||
| speakerOut = kSpeakerArrEmpty; | |||
| speakerInChans = 0; | |||
| @@ -439,8 +438,7 @@ public: | |||
| jassert (editorComp == 0); | |||
| juce_free (channels); | |||
| channels = 0; | |||
| channels.free(); | |||
| deleteTempChannels(); | |||
| jassert (activePlugins.contains (this)); | |||
| @@ -766,8 +764,7 @@ public: | |||
| return; | |||
| isProcessing = true; | |||
| juce_free (channels); | |||
| channels = (float**) juce_calloc (sizeof (float*) * (numInChans + numOutChans)); | |||
| channels.calloc (numInChans + numOutChans); | |||
| double rate = getSampleRate(); | |||
| jassert (rate > 0); | |||
| @@ -813,8 +810,7 @@ public: | |||
| outgoingEvents.freeEvents(); | |||
| isProcessing = false; | |||
| juce_free (channels); | |||
| channels = 0; | |||
| channels.free(); | |||
| deleteTempChannels(); | |||
| } | |||
| @@ -1398,15 +1394,14 @@ private: | |||
| VstSpeakerArrangementType speakerIn, speakerOut; | |||
| int speakerInChans, speakerOutChans; | |||
| int numInChans, numOutChans; | |||
| float** channels; | |||
| HeapBlock <float*> channels; | |||
| VoidArray tempChannels; // see note in processReplacing() | |||
| bool hasCreatedTempChannels; | |||
| bool shouldDeleteEditor; | |||
| void deleteTempChannels() | |||
| { | |||
| int i; | |||
| for (i = tempChannels.size(); --i >= 0;) | |||
| for (int i = tempChannels.size(); --i >= 0;) | |||
| juce_free (tempChannels.getUnchecked(i)); | |||
| tempChannels.clear(); | |||
| @@ -124,7 +124,9 @@ public: | |||
| } | |||
| else | |||
| { | |||
| var* args = (var*) juce_calloc (sizeof (var) * numArgs); | |||
| HeapBlock <var> args; | |||
| args.calloc (numArgs); | |||
| for (int j = 0; j < numArgs; ++j) | |||
| args[(numArgs - 1) - j] = variantTojuceVar (pDispParams->rgvarg[j]); | |||
| @@ -132,8 +134,6 @@ public: | |||
| for (int j = 0; j < numArgs; ++j) | |||
| args[j] = var(); | |||
| juce_free (args); | |||
| } | |||
| if (pVarResult != 0) | |||
| @@ -329,7 +329,8 @@ public: | |||
| DISPID id = 0; | |||
| if (source->GetIDsOfNames (IID_NULL, (LPOLESTR*)&name, 1, 0, &id) == S_OK) | |||
| { | |||
| VARIANT* params = (VARIANT*) juce_calloc (sizeof (VARIANT) * (numParameters + 1)); | |||
| HeapBlock <VARIANT> params; | |||
| params.calloc (numParameters + 1); | |||
| for (int i = 0; i < numParameters; ++i) | |||
| juceVarToVariant (parameters[(numParameters - 1) - i], params[i]); | |||
| @@ -352,8 +353,6 @@ public: | |||
| returnValue = variantTojuceVar (result); | |||
| VariantClear (&result); | |||
| } | |||
| juce_free (params); | |||
| } | |||
| return returnValue; | |||
| @@ -558,7 +557,8 @@ static const String getExeVersion (const String& exeFileName, const String& fiel | |||
| if (size > 0) | |||
| { | |||
| void* const exeInfo = juce_calloc (size); | |||
| HeapBlock <char> exeInfo; | |||
| exeInfo.calloc (size); | |||
| if (GetFileVersionInfo (exeFileName, 0, size, exeInfo)) | |||
| { | |||
| @@ -577,8 +577,6 @@ static const String getExeVersion (const String& exeFileName, const String& fiel | |||
| resultString = String (result, resultLen); | |||
| } | |||
| juce_free (exeInfo); | |||
| } | |||
| return resultString; | |||
| @@ -621,7 +621,7 @@ public: | |||
| if (numParameters > 0) | |||
| { | |||
| NPVariant* const params = (NPVariant*) juce_malloc (sizeof (NPVariant) * numParameters); | |||
| HeapBlock <NPVariant> params (numParameters); | |||
| int i; | |||
| for (i = 0; i < numParameters; ++i) | |||
| @@ -636,8 +636,6 @@ public: | |||
| for (i = 0; i < numParameters; ++i) | |||
| browser.releasevariantvalue (¶ms[i]); | |||
| juce_free (params); | |||
| } | |||
| else | |||
| { | |||
| @@ -688,7 +686,9 @@ private: | |||
| if (o == 0 || ! o->hasMethod (methodName)) | |||
| return false; | |||
| var* params = (var*) juce_calloc (sizeof (var) * argCount); | |||
| HeapBlock <var> params; | |||
| params.calloc (argCount); | |||
| for (uint32_t i = 0; i < argCount; ++i) | |||
| params[i] = createValueFromNPVariant (npp, args[i]); | |||
| @@ -697,8 +697,6 @@ private: | |||
| for (int i = argCount; --i >= 0;) | |||
| params[i] = var(); | |||
| juce_free (params); | |||
| if (out != 0) | |||
| createNPVariantFromValue (npp, *out, result); | |||
| @@ -46,12 +46,13 @@ | |||
| /> | |||
| <Tool | |||
| Name="VCCLCompilerTool" | |||
| Optimization="2" | |||
| Optimization="3" | |||
| InlineFunctionExpansion="1" | |||
| PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" | |||
| StringPooling="true" | |||
| RuntimeLibrary="0" | |||
| EnableFunctionLevelLinking="true" | |||
| FloatingPointModel="2" | |||
| RuntimeTypeInfo="true" | |||
| UsePrecompiledHeader="0" | |||
| PrecompiledHeaderFile=".\Release/jucedemo.pch" | |||
| @@ -29,6 +29,7 @@ | |||
| #if JUCE_USE_CDREADER | |||
| #include "juce_AudioFormatReader.h" | |||
| #include "../../containers/juce_Array.h" | |||
| #include "../../text/juce_StringArray.h" | |||
| #if JUCE_MAC | |||
| #include "../../io/files/juce_File.h" | |||
| @@ -28,6 +28,7 @@ | |||
| #include "juce_AudioFormatReader.h" | |||
| #include "juce_AudioFormatWriter.h" | |||
| #include "../../containers/juce_Array.h" | |||
| //============================================================================== | |||
| @@ -28,6 +28,7 @@ | |||
| #include "juce_AudioFormat.h" | |||
| #include "../../core/juce_Singleton.h" | |||
| #include "../../containers/juce_VoidArray.h" | |||
| //============================================================================== | |||
| @@ -85,7 +85,7 @@ public: | |||
| lastThreadId (0), | |||
| dataHandle (0) | |||
| { | |||
| bufferList = (AudioBufferList*) juce_calloc (256); | |||
| bufferList.calloc (256, 1); | |||
| #ifdef WIN32 | |||
| if (InitializeQTML (0) != noErr) | |||
| @@ -143,24 +143,22 @@ public: | |||
| if (err != noErr) | |||
| return; | |||
| AudioChannelLayout* const qt_audio_channel_layout | |||
| = (AudioChannelLayout*) juce_calloc (output_layout_size); | |||
| HeapBlock <AudioChannelLayout> qt_audio_channel_layout; | |||
| qt_audio_channel_layout.calloc (output_layout_size, 1); | |||
| err = MovieAudioExtractionGetProperty (extractor, | |||
| kQTPropertyClass_MovieAudioExtraction_Audio, | |||
| kQTMovieAudioExtractionAudioPropertyID_AudioChannelLayout, | |||
| output_layout_size, qt_audio_channel_layout, 0); | |||
| qt_audio_channel_layout->mChannelLayoutTag = kAudioChannelLayoutTag_Stereo; | |||
| qt_audio_channel_layout[0].mChannelLayoutTag = kAudioChannelLayoutTag_Stereo; | |||
| err = MovieAudioExtractionSetProperty (extractor, | |||
| kQTPropertyClass_MovieAudioExtraction_Audio, | |||
| kQTMovieAudioExtractionAudioPropertyID_AudioChannelLayout, | |||
| sizeof (qt_audio_channel_layout), | |||
| output_layout_size, | |||
| qt_audio_channel_layout); | |||
| juce_free (qt_audio_channel_layout); | |||
| err = MovieAudioExtractionGetProperty (extractor, | |||
| kQTPropertyClass_MovieAudioExtraction_Audio, | |||
| kQTMovieAudioExtractionAudioPropertyID_AudioStreamBasicDescription, | |||
| @@ -223,7 +221,6 @@ public: | |||
| DisposeMovie (movie); | |||
| juce_free (bufferList->mBuffers[0].mData); | |||
| juce_free (bufferList); | |||
| #if JUCE_MAC | |||
| ExitMoviesOnThread (); | |||
| @@ -308,7 +305,7 @@ private: | |||
| Thread::ThreadID lastThreadId; | |||
| MovieAudioExtractionRef extractor; | |||
| AudioStreamBasicDescription inputStreamDesc; | |||
| AudioBufferList* bufferList; | |||
| HeapBlock <AudioBufferList> bufferList; | |||
| Handle dataHandle; | |||
| /*OSErr readMovieStream (long offset, long size, void* dataPtr) | |||
| @@ -276,17 +276,17 @@ public: | |||
| bwavSize = length; | |||
| // Broadcast-wav extension chunk.. | |||
| BWAVChunk* const bwav = (BWAVChunk*) juce_calloc (jmax (length + 1, (int) sizeof (BWAVChunk))); | |||
| HeapBlock <BWAVChunk> bwav; | |||
| bwav.calloc (jmax (length + 1, (int) sizeof (BWAVChunk)), 1); | |||
| input->read (bwav, length); | |||
| bwav->copyTo (metadataValues); | |||
| juce_free (bwav); | |||
| } | |||
| else if (chunkType == chunkName ("smpl")) | |||
| { | |||
| SMPLChunk* const smpl = (SMPLChunk*) juce_calloc (jmax (length + 1, (int) sizeof (SMPLChunk))); | |||
| HeapBlock <SMPLChunk> smpl; | |||
| smpl.calloc (jmax (length + 1, (int) sizeof (SMPLChunk)), 1); | |||
| input->read (smpl, length); | |||
| smpl->copyTo (metadataValues, length); | |||
| juce_free (smpl); | |||
| } | |||
| else if (chunkEnd <= input->getPosition()) | |||
| { | |||
| @@ -28,6 +28,7 @@ | |||
| #include "juce_AudioSource.h" | |||
| #include "../../text/juce_XmlElement.h" | |||
| #include "../../containers/juce_Array.h" | |||
| //============================================================================== | |||
| @@ -41,18 +41,35 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_, | |||
| jassert (numSamples >= 0); | |||
| jassert (numChannels_ > 0); | |||
| allocatedBytes = numChannels * numSamples * sizeof (float) + 32; | |||
| allocatedData = (float*) juce_malloc (allocatedBytes); | |||
| channels = (float**) juce_malloc ((numChannels_ + 1) * sizeof (float*)); | |||
| allocateData(); | |||
| } | |||
| AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw() | |||
| : numChannels (other.numChannels), | |||
| size (other.size) | |||
| { | |||
| allocateData(); | |||
| const int numBytes = size * sizeof (float); | |||
| for (int i = 0; i < numChannels; ++i) | |||
| memcpy (channels[i], other.channels[i], numBytes); | |||
| } | |||
| float* chan = allocatedData; | |||
| for (int i = 0; i < numChannels_; ++i) | |||
| void AudioSampleBuffer::allocateData() | |||
| { | |||
| const int channelListSize = (numChannels + 1) * sizeof (float*); | |||
| allocatedBytes = numChannels * size * sizeof (float) + channelListSize + 32; | |||
| allocatedData.malloc (allocatedBytes); | |||
| channels = (float**) allocatedData; | |||
| float* chan = (float*) (allocatedData + channelListSize); | |||
| for (int i = 0; i < numChannels; ++i) | |||
| { | |||
| channels[i] = chan; | |||
| chan += numSamples; | |||
| chan += size; | |||
| } | |||
| channels [numChannels_] = 0; | |||
| channels [numChannels] = 0; | |||
| } | |||
| AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | |||
| @@ -60,84 +77,49 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | |||
| const int numSamples) throw() | |||
| : numChannels (numChannels_), | |||
| size (numSamples), | |||
| allocatedBytes (0), | |||
| allocatedData (0) | |||
| allocatedBytes (0) | |||
| { | |||
| jassert (numChannels_ > 0); | |||
| // (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools) | |||
| if (numChannels_ < numElementsInArray (preallocatedChannelSpace)) | |||
| channels = (float**) preallocatedChannelSpace; | |||
| else | |||
| channels = (float**) juce_malloc ((numChannels_ + 1) * sizeof (float*)); | |||
| for (int i = 0; i < numChannels_; ++i) | |||
| { | |||
| // you have to pass in the same number of valid pointers as numChannels | |||
| jassert (dataToReferTo[i] != 0); | |||
| channels[i] = dataToReferTo[i]; | |||
| } | |||
| channels [numChannels_] = 0; | |||
| allocateChannels (dataToReferTo); | |||
| } | |||
| void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo, | |||
| const int numChannels_, | |||
| const int numSamples) throw() | |||
| const int newNumChannels, | |||
| const int newNumSamples) throw() | |||
| { | |||
| jassert (numChannels_ > 0); | |||
| jassert (newNumChannels > 0); | |||
| juce_free (allocatedData); | |||
| allocatedData = 0; | |||
| allocatedBytes = 0; | |||
| allocatedData.free(); | |||
| if (numChannels_ > numChannels) | |||
| channels = (float**) juce_realloc (channels, (numChannels_ + 1) * sizeof (float*)); | |||
| numChannels = numChannels_; | |||
| size = numSamples; | |||
| numChannels = newNumChannels; | |||
| size = newNumSamples; | |||
| for (int i = 0; i < numChannels_; ++i) | |||
| { | |||
| // you have to pass in the same number of valid pointers as numChannels | |||
| jassert (dataToReferTo[i] != 0); | |||
| channels[i] = dataToReferTo[i]; | |||
| } | |||
| channels [numChannels_] = 0; | |||
| allocateChannels (dataToReferTo); | |||
| } | |||
| AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw() | |||
| : numChannels (other.numChannels), | |||
| size (other.size) | |||
| void AudioSampleBuffer::allocateChannels (float** const dataToReferTo) | |||
| { | |||
| channels = (float**) juce_malloc ((other.numChannels + 1) * sizeof (float*)); | |||
| if (other.allocatedData != 0) | |||
| // (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools) | |||
| if (numChannels < numElementsInArray (preallocatedChannelSpace)) | |||
| { | |||
| allocatedBytes = numChannels * size * sizeof (float) + 32; | |||
| allocatedData = (float*) juce_malloc (allocatedBytes); | |||
| memcpy (allocatedData, other.allocatedData, allocatedBytes); | |||
| float* chan = allocatedData; | |||
| for (int i = 0; i < numChannels; ++i) | |||
| { | |||
| channels[i] = chan; | |||
| chan += size; | |||
| } | |||
| channels [numChannels] = 0; | |||
| channels = (float**) preallocatedChannelSpace; | |||
| } | |||
| else | |||
| { | |||
| allocatedData = 0; | |||
| allocatedBytes = 0; | |||
| allocatedData.malloc (numChannels + 1, sizeof (float*)); | |||
| channels = (float**) allocatedData; | |||
| } | |||
| for (int i = 0; i < numChannels; ++i) | |||
| { | |||
| // you have to pass in the same number of valid pointers as numChannels | |||
| jassert (dataToReferTo[i] != 0); | |||
| memcpy (channels, other.channels, sizeof (channels)); | |||
| channels[i] = dataToReferTo[i]; | |||
| } | |||
| channels [numChannels] = 0; | |||
| } | |||
| const AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) throw() | |||
| @@ -157,10 +139,6 @@ const AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& | |||
| AudioSampleBuffer::~AudioSampleBuffer() throw() | |||
| { | |||
| juce_free (allocatedData); | |||
| if (channels != (float**) preallocatedChannelSpace) | |||
| juce_free (channels); | |||
| } | |||
| void AudioSampleBuffer::setSize (const int newNumChannels, | |||
| @@ -173,26 +151,29 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||
| if (newNumSamples != size || newNumChannels != numChannels) | |||
| { | |||
| const int newTotalBytes = newNumChannels * newNumSamples * sizeof (float) + 32; | |||
| const int channelListSize = (newNumChannels + 1) * sizeof (float*); | |||
| const int newTotalBytes = (newNumChannels * newNumSamples * sizeof (float)) + channelListSize + 32; | |||
| if (keepExistingContent) | |||
| { | |||
| float* const newData = (clearExtraSpace) ? (float*) juce_calloc (newTotalBytes) | |||
| : (float*) juce_malloc (newTotalBytes); | |||
| HeapBlock <char> newData; | |||
| newData.allocate (newTotalBytes, clearExtraSpace); | |||
| const int sizeToCopy = sizeof (float) * jmin (newNumSamples, size); | |||
| const int numChansToCopy = jmin (numChannels, newNumChannels); | |||
| const int numBytesToCopy = sizeof (float) * jmin (newNumSamples, size); | |||
| for (int i = jmin (newNumChannels, numChannels); --i >= 0;) | |||
| float** const newChannels = (float**) newData; | |||
| float* newChan = (float*) (newData + channelListSize); | |||
| for (int i = 0; i < numChansToCopy; ++i) | |||
| { | |||
| memcpy (newData + i * newNumSamples, | |||
| channels[i], | |||
| sizeToCopy); | |||
| memcpy (newChan, channels[i], numBytesToCopy); | |||
| newChannels[i] = newChan; | |||
| newChan += newNumSamples; | |||
| } | |||
| juce_free (allocatedData); | |||
| allocatedData = newData; | |||
| allocatedData.swapWith (newData); | |||
| allocatedBytes = newTotalBytes; | |||
| channels = (float**) allocatedData; | |||
| } | |||
| else | |||
| { | |||
| @@ -203,29 +184,22 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||
| } | |||
| else | |||
| { | |||
| juce_free (allocatedData); | |||
| allocatedData = (clearExtraSpace) ? (float*) juce_calloc (newTotalBytes) | |||
| : (float*) juce_malloc (newTotalBytes); | |||
| allocatedBytes = newTotalBytes; | |||
| allocatedData.allocate (newTotalBytes, clearExtraSpace); | |||
| channels = (float**) allocatedData; | |||
| } | |||
| } | |||
| size = newNumSamples; | |||
| if (newNumChannels > numChannels) | |||
| channels = (float**) juce_realloc (channels, (newNumChannels + 1) * sizeof (float*)); | |||
| numChannels = newNumChannels; | |||
| float* chan = allocatedData; | |||
| for (int i = 0; i < newNumChannels; ++i) | |||
| { | |||
| channels[i] = chan; | |||
| chan += size; | |||
| float* chan = (float*) (allocatedData + channelListSize); | |||
| for (int i = 0; i < newNumChannels; ++i) | |||
| { | |||
| channels[i] = chan; | |||
| chan += newNumSamples; | |||
| } | |||
| } | |||
| channels [newNumChannels] = 0; | |||
| size = newNumSamples; | |||
| numChannels = newNumChannels; | |||
| } | |||
| } | |||
| @@ -679,7 +653,8 @@ void AudioSampleBuffer::writeToAudioWriter (AudioFormatWriter* writer, | |||
| } | |||
| else | |||
| { | |||
| chans[0] = (int*) juce_malloc (sizeof (int) * numSamples * 2); | |||
| HeapBlock <int> tempBuffer (numSamples * 2); | |||
| chans[0] = tempBuffer; | |||
| if (numChannels > 1) | |||
| chans[1] = chans[0] + numSamples; | |||
| @@ -711,8 +686,6 @@ void AudioSampleBuffer::writeToAudioWriter (AudioFormatWriter* writer, | |||
| } | |||
| writer->write ((const int**) chans, numSamples); | |||
| juce_free (chans[0]); | |||
| } | |||
| } | |||
| } | |||
| @@ -26,6 +26,7 @@ | |||
| #ifndef __JUCE_AUDIOSAMPLEBUFFER_JUCEHEADER__ | |||
| #define __JUCE_AUDIOSAMPLEBUFFER_JUCEHEADER__ | |||
| #include "../../containers/juce_HeapBlock.h" | |||
| class AudioFormatReader; | |||
| class AudioFormatWriter; | |||
| @@ -425,8 +426,11 @@ public: | |||
| private: | |||
| int numChannels, size, allocatedBytes; | |||
| float** channels; | |||
| float* allocatedData; | |||
| HeapBlock <char> allocatedData; | |||
| float* preallocatedChannelSpace [32]; | |||
| void allocateData(); | |||
| void allocateChannels (float** const dataToReferTo); | |||
| }; | |||
| @@ -276,7 +276,7 @@ private: | |||
| CriticalSection lock; | |||
| bool initialised, wantsMidiMessages, wasPlaying; | |||
| AudioBufferList* outputBufferList; | |||
| HeapBlock <AudioBufferList> outputBufferList; | |||
| AudioTimeStamp timeStamp; | |||
| AudioSampleBuffer* currentBuffer; | |||
| @@ -375,7 +375,6 @@ AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier | |||
| initialised (false), | |||
| wantsMidiMessages (false), | |||
| audioUnit (0), | |||
| outputBufferList (0), | |||
| currentBuffer (0) | |||
| { | |||
| try | |||
| @@ -419,8 +418,6 @@ AudioUnitPluginInstance::~AudioUnitPluginInstance() | |||
| audioUnit = 0; | |||
| } | |||
| } | |||
| juce_free (outputBufferList); | |||
| } | |||
| bool AudioUnitPluginInstance::getComponentDescFromFile (const String& fileOrIdentifier) | |||
| @@ -602,8 +599,7 @@ void AudioUnitPluginInstance::prepareToPlay (double sampleRate_, | |||
| kAudioUnitScope_Output, | |||
| 0, &stream, sizeof (stream)); | |||
| juce_free (outputBufferList); | |||
| outputBufferList = (AudioBufferList*) juce_calloc (sizeof (AudioBufferList) + sizeof (AudioBuffer) * (numOuts + 1)); | |||
| outputBufferList.calloc (sizeof (AudioBufferList) + sizeof (AudioBuffer) * (numOuts + 1), 1); | |||
| outputBufferList->mNumberBuffers = numOuts; | |||
| for (int i = numOuts; --i >= 0;) | |||
| @@ -627,8 +623,7 @@ void AudioUnitPluginInstance::releaseResources() | |||
| AudioUnitReset (audioUnit, kAudioUnitScope_Output, 0); | |||
| AudioUnitReset (audioUnit, kAudioUnitScope_Global, 0); | |||
| juce_free (outputBufferList); | |||
| outputBufferList = 0; | |||
| outputBufferList.free(); | |||
| currentBuffer = 0; | |||
| } | |||
| } | |||
| @@ -901,7 +896,8 @@ private: | |||
| && AudioUnitGetPropertyInfo (plugin.audioUnit, kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global, | |||
| 0, &dataSize, &isWritable) == noErr) | |||
| { | |||
| AudioUnitCocoaViewInfo* info = (AudioUnitCocoaViewInfo*) juce_calloc (dataSize); | |||
| HeapBlock <AudioUnitCocoaViewInfo> info; | |||
| info.calloc (dataSize, 1); | |||
| if (AudioUnitGetProperty (plugin.audioUnit, kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global, | |||
| 0, info, &dataSize) == noErr) | |||
| @@ -926,8 +922,6 @@ private: | |||
| CFRelease (info->mCocoaAUViewBundleLocation); | |||
| } | |||
| } | |||
| juce_free (info); | |||
| } | |||
| if (createGenericViewIfNeeded && (pluginView == 0)) | |||
| @@ -40,7 +40,7 @@ class VSTMidiEventList | |||
| public: | |||
| //============================================================================== | |||
| VSTMidiEventList() | |||
| : events (0), numEventsUsed (0), numEventsAllocated (0) | |||
| : numEventsUsed (0), numEventsAllocated (0) | |||
| { | |||
| } | |||
| @@ -138,9 +138,9 @@ public: | |||
| const int size = 20 + sizeof (VstEvent*) * numEventsNeeded; | |||
| if (events == 0) | |||
| events = (VstEvents*) juce_calloc (size); | |||
| events.calloc (size, 1); | |||
| else | |||
| events = (VstEvents*) juce_realloc (events, size); | |||
| events.realloc (size, 1); | |||
| for (int i = numEventsAllocated; i < numEventsNeeded; ++i) | |||
| { | |||
| @@ -170,15 +170,14 @@ public: | |||
| juce_free (e); | |||
| } | |||
| juce_free (events); | |||
| events = 0; | |||
| events.free(); | |||
| numEventsUsed = 0; | |||
| numEventsAllocated = 0; | |||
| } | |||
| } | |||
| //============================================================================== | |||
| VstEvents* events; | |||
| HeapBlock <VstEvents> events; | |||
| private: | |||
| int numEventsUsed, numEventsAllocated; | |||
| @@ -769,7 +769,7 @@ private: | |||
| MidiBuffer incomingMidi; | |||
| VSTMidiEventList midiEventsToSend; | |||
| VstTimeInfo vstHostTime; | |||
| float** channels; | |||
| HeapBlock <float*> channels; | |||
| ReferenceCountedObjectPtr <ModuleHandle> module; | |||
| @@ -808,7 +808,6 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan | |||
| initialised (false), | |||
| isPowerOn (false), | |||
| tempBuffer (1, 1), | |||
| channels (0), | |||
| module (module_) | |||
| { | |||
| try | |||
| @@ -894,9 +893,6 @@ VSTPluginInstance::~VSTPluginInstance() | |||
| module = 0; | |||
| effect = 0; | |||
| } | |||
| juce_free (channels); | |||
| channels = 0; | |||
| } | |||
| //============================================================================== | |||
| @@ -964,8 +960,7 @@ void VSTPluginInstance::prepareToPlay (double sampleRate_, | |||
| setLatencySamples (effect->initialDelay); | |||
| juce_free (channels); | |||
| channels = (float**) juce_calloc (sizeof (float*) * jmax (16, getNumOutputChannels() + 2, getNumInputChannels() + 2)); | |||
| channels.calloc (jmax (16, getNumOutputChannels(), getNumInputChannels()) + 2); | |||
| vstHostTime.tempo = 120.0; | |||
| vstHostTime.timeSigNumerator = 4; | |||
| @@ -1020,8 +1015,7 @@ void VSTPluginInstance::releaseResources() | |||
| incomingMidi.clear(); | |||
| midiEventsToSend.freeEvents(); | |||
| juce_free (channels); | |||
| channels = 0; | |||
| channels.free(); | |||
| } | |||
| void VSTPluginInstance::processBlock (AudioSampleBuffer& buffer, | |||
| @@ -508,7 +508,7 @@ public: | |||
| totalChans (jmax (1, totalChans_)), | |||
| midiBufferToUse (midiBufferToUse_) | |||
| { | |||
| channels = (float**) juce_calloc (sizeof (float*) * totalChans); | |||
| channels.calloc (totalChans); | |||
| while (audioChannelsToUse.size() < totalChans) | |||
| audioChannelsToUse.add (0); | |||
| @@ -516,7 +516,6 @@ public: | |||
| ~ProcessBufferOp() throw() | |||
| { | |||
| juce_free (channels); | |||
| } | |||
| void perform (AudioSampleBuffer& sharedBufferChans, const OwnedArray <MidiBuffer>& sharedMidiBuffers, const int numSamples) throw() | |||
| @@ -534,7 +533,7 @@ public: | |||
| private: | |||
| Array <int> audioChannelsToUse; | |||
| float** channels; | |||
| HeapBlock <float*> channels; | |||
| int totalChans; | |||
| int midiBufferToUse; | |||
| @@ -39,7 +39,7 @@ BitArray::BitArray() throw() | |||
| highestBit (-1), | |||
| negative (false) | |||
| { | |||
| values = (unsigned int*) juce_calloc (sizeof (unsigned int) * (numValues + 1)); | |||
| values.calloc (numValues + 1); | |||
| } | |||
| BitArray::BitArray (const int value) throw() | |||
| @@ -47,7 +47,7 @@ BitArray::BitArray (const int value) throw() | |||
| highestBit (31), | |||
| negative (value < 0) | |||
| { | |||
| values = (unsigned int*) juce_calloc (sizeof (unsigned int) * (numValues + 1)); | |||
| values.calloc (numValues + 1); | |||
| values[0] = abs (value); | |||
| highestBit = getHighestBit(); | |||
| } | |||
| @@ -57,7 +57,7 @@ BitArray::BitArray (int64 value) throw() | |||
| highestBit (63), | |||
| negative (value < 0) | |||
| { | |||
| values = (unsigned int*) juce_calloc (sizeof (unsigned int) * (numValues + 1)); | |||
| values.calloc (numValues + 1); | |||
| if (value < 0) | |||
| value = -value; | |||
| @@ -72,7 +72,7 @@ BitArray::BitArray (const unsigned int value) throw() | |||
| highestBit (31), | |||
| negative (false) | |||
| { | |||
| values = (unsigned int*) juce_calloc (sizeof (unsigned int) * (numValues + 1)); | |||
| values.calloc (numValues + 1); | |||
| values[0] = value; | |||
| highestBit = getHighestBit(); | |||
| } | |||
| @@ -82,28 +82,23 @@ BitArray::BitArray (const BitArray& other) throw() | |||
| highestBit (other.getHighestBit()), | |||
| negative (other.negative) | |||
| { | |||
| const int bytes = sizeof (unsigned int) * (numValues + 1); | |||
| values = (unsigned int*) juce_malloc (bytes); | |||
| memcpy (values, other.values, bytes); | |||
| values.malloc (numValues + 1); | |||
| memcpy (values, other.values, sizeof (unsigned int) * (numValues + 1)); | |||
| } | |||
| BitArray::~BitArray() throw() | |||
| { | |||
| juce_free (values); | |||
| } | |||
| const BitArray& BitArray::operator= (const BitArray& other) throw() | |||
| { | |||
| if (this != &other) | |||
| { | |||
| juce_free (values); | |||
| highestBit = other.getHighestBit(); | |||
| numValues = jmax (4, (highestBit >> 5) + 1); | |||
| negative = other.negative; | |||
| const int memSize = sizeof (unsigned int) * (numValues + 1); | |||
| values = (unsigned int*)juce_malloc (memSize); | |||
| memcpy (values, other.values, memSize); | |||
| values.malloc (numValues + 1); | |||
| memcpy (values, other.values, sizeof (unsigned int) * (numValues + 1)); | |||
| } | |||
| return *this; | |||
| @@ -167,9 +162,8 @@ void BitArray::clear() throw() | |||
| { | |||
| if (numValues > 16) | |||
| { | |||
| juce_free (values); | |||
| numValues = 4; | |||
| values = (unsigned int*) juce_calloc (sizeof (unsigned int) * (numValues + 1)); | |||
| values.calloc (numValues + 1); | |||
| } | |||
| else | |||
| { | |||
| @@ -821,7 +815,7 @@ void BitArray::ensureSize (const int numVals) throw() | |||
| { | |||
| int oldSize = numValues; | |||
| numValues = ((numVals + 2) * 3) / 2; | |||
| values = (unsigned int*) juce_realloc (values, sizeof (unsigned int) * numValues + 4); | |||
| values.realloc (numValues + 1); | |||
| while (oldSize < numValues) | |||
| values [oldSize++] = 0; | |||
| @@ -28,6 +28,7 @@ | |||
| #include "../text/juce_String.h" | |||
| #include "juce_Array.h" | |||
| #include "juce_HeapBlock.h" | |||
| class MemoryBlock; | |||
| @@ -334,7 +335,7 @@ public: | |||
| private: | |||
| void ensureSize (const int numVals) throw(); | |||
| unsigned int* values; | |||
| HeapBlock <unsigned int> values; | |||
| int numValues, highestBit; | |||
| bool negative; | |||
| }; | |||
| @@ -0,0 +1,240 @@ | |||
| /* | |||
| ============================================================================== | |||
| 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. | |||
| ============================================================================== | |||
| */ | |||
| #ifndef __JUCE_HEAPBLOCK_JUCEHEADER__ | |||
| #define __JUCE_HEAPBLOCK_JUCEHEADER__ | |||
| //============================================================================== | |||
| /** | |||
| Very simple container class to hold a pointer to some data on the heap. | |||
| When you need to allocate some heap storage for something, always try to use | |||
| this class instead of allocating the memory directly using malloc/free. | |||
| A HeapBlock<char> object can be treated in pretty much exactly the same way | |||
| as an char*, but as long as you allocate it on the stack or as a class member, | |||
| it's almost impossible for it to leak memory. | |||
| It also makes your code much more concise and readable than doing the same thing | |||
| using direct allocations, | |||
| E.g. instead of this: | |||
| @code | |||
| int* temp = (int*) juce_malloc (1024 * sizeof (int)); | |||
| memcpy (temp, xyz, 1024 * sizeof (int)); | |||
| juce_free (temp); | |||
| temp = (int*) juce_calloc (2048 * sizeof (int)); | |||
| temp[0] = 1234; | |||
| memcpy (foobar, temp, 2048 * sizeof (int)); | |||
| juce_free (temp); | |||
| @endcode | |||
| ..you could just write this: | |||
| @code | |||
| HeapBlock <int> temp (1024); | |||
| memcpy (temp, xyz, 1024 * sizeof (int)); | |||
| temp.calloc (2048); | |||
| temp[0] = 1234; | |||
| memcpy (foobar, temp, 2048 * sizeof (int)); | |||
| @endcode | |||
| The class is extremely lightweight, containing only a pointer to the | |||
| data, and exposes malloc/realloc/calloc/free methods that do the same jobs | |||
| as their less object-oriented counterparts. Despite adding safety, you probably | |||
| won't sacrifice any performance by using this in place of normal pointers. | |||
| @see Array, OwnedArray, MemoryBlock | |||
| */ | |||
| template <class ElementType> | |||
| class HeapBlock | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| /** Creates a HeapBlock which is initially just a null pointer. | |||
| After creation, you can resize the array using the malloc(), calloc(), | |||
| or realloc() methods. | |||
| */ | |||
| HeapBlock() : data (0) | |||
| { | |||
| } | |||
| /** Creates a HeapBlock containing a number of elements. | |||
| The contents of the block are undefined, as it will have been created by a | |||
| malloc call. | |||
| If you want an array of zero values, you can use the calloc() method instead. | |||
| */ | |||
| HeapBlock (const int numElements) | |||
| : data ((ElementType*) ::juce_malloc (numElements * sizeof (ElementType))) | |||
| { | |||
| } | |||
| /** Destructor. | |||
| This will free the data, if any has been allocated. | |||
| */ | |||
| ~HeapBlock() | |||
| { | |||
| ::juce_free (data); | |||
| } | |||
| //============================================================================== | |||
| /** Returns a raw pointer to the allocated data. | |||
| This may be a null pointer if the data hasn't yet been allocated, or if it has been | |||
| freed by calling the free() method. | |||
| */ | |||
| inline operator ElementType*() const { return data; } | |||
| /** Returns a void pointer to the allocated data. | |||
| This may be a null pointer if the data hasn't yet been allocated, or if it has been | |||
| freed by calling the free() method. | |||
| */ | |||
| inline operator void*() const { return (void*) data; } | |||
| /** Lets you use indirect calls to the first element in the array. | |||
| Obviously this will cause problems if the array hasn't been initialised, because it'll | |||
| be referencing a null pointer. | |||
| */ | |||
| inline ElementType* operator->() const { return data; } | |||
| /** Returns a pointer to the data by casting it to any type you need. | |||
| */ | |||
| template <class CastType> | |||
| inline operator CastType*() const { return (CastType*) data; } | |||
| /** Returns a reference to one of the data elements. | |||
| Obviously there's no bounds-checking here, as this object is just a dumb pointer and | |||
| has no idea of the size it currently has allocated. | |||
| */ | |||
| inline ElementType& operator[] (const pointer_sized_int index) const { return data [index]; } | |||
| /** Returns a pointer to a data element at an offset from the start of the array. | |||
| This is the same as doing pointer arithmetic on the raw pointer itself. | |||
| */ | |||
| inline ElementType* operator+ (const pointer_sized_int index) const { return data + index; } | |||
| /** Returns a reference to the raw data pointer. | |||
| Beware that the pointer returned here will become invalid as soon as you call | |||
| any of the allocator methods on this object! | |||
| */ | |||
| inline ElementType** operator&() const { return (ElementType**) &data; } | |||
| //============================================================================== | |||
| /** Compares the pointer with another pointer. | |||
| This can be handy for checking whether this is a null pointer. | |||
| */ | |||
| inline bool operator== (const ElementType* const otherPointer) const { return otherPointer == data; } | |||
| /** Compares the pointer with another pointer. | |||
| This can be handy for checking whether this is a null pointer. | |||
| */ | |||
| inline bool operator!= (const ElementType* const otherPointer) const { return otherPointer != data; } | |||
| //============================================================================== | |||
| /** Allocates a specified amount of memory. | |||
| This uses the normal malloc to allocate an amount of memory for this object. | |||
| Any previously allocated memory will be freed by this method. | |||
| The number of bytes allocated will be (newNumElements * elementSize). Normally | |||
| you wouldn't need to specify the second parameter, but it can be handy if you need | |||
| to allocate a size in bytes rather than in terms of the number of elements. | |||
| The data that is allocated will be freed when this object is deleted, or when you | |||
| call free() or any of the allocation methods. | |||
| */ | |||
| void malloc (const int newNumElements, const unsigned int elementSize = sizeof (ElementType)) | |||
| { | |||
| ::juce_free (data); | |||
| data = (ElementType*) ::juce_malloc (newNumElements * elementSize); | |||
| } | |||
| /** Allocates a specified amount of memory and clears it. | |||
| This does the same job as the malloc() method, but clears the memory that it allocates. | |||
| */ | |||
| void calloc (const int newNumElements, const unsigned int elementSize = sizeof (ElementType)) | |||
| { | |||
| ::juce_free (data); | |||
| data = (ElementType*) ::juce_calloc (newNumElements * elementSize); | |||
| } | |||
| /** Allocates a specified amount of memory and optionally clears it. | |||
| This does the same job as either malloc() or calloc(), depending on the | |||
| initialiseToZero parameter. | |||
| */ | |||
| void allocate (const int newNumElements, const bool initialiseToZero) | |||
| { | |||
| ::juce_free (data); | |||
| if (initialiseToZero) | |||
| data = (ElementType*) ::juce_calloc (newNumElements * sizeof (ElementType)); | |||
| else | |||
| data = (ElementType*) ::juce_malloc (newNumElements * sizeof (ElementType)); | |||
| } | |||
| /** Re-allocates a specified amount of memory. | |||
| The semantics of this method are the same as malloc() and calloc(), but it | |||
| uses realloc() to keep as much of the existing data as possible. | |||
| */ | |||
| void realloc (const int newNumElements, const unsigned int elementSize = sizeof (ElementType)) | |||
| { | |||
| if (data == 0) | |||
| data = (ElementType*) ::juce_malloc (newNumElements * elementSize); | |||
| else | |||
| data = (ElementType*) ::juce_realloc (data, newNumElements * elementSize); | |||
| } | |||
| /** Frees any currently-allocated data. | |||
| This will free the data and reset this object to be a null pointer. | |||
| */ | |||
| void free() | |||
| { | |||
| ::juce_free (data); | |||
| data = 0; | |||
| } | |||
| /** Swaps this object's data with the data of another HeapBlock. | |||
| The two objects simply exchange their data pointers. | |||
| */ | |||
| void swapWith (HeapBlock <ElementType>& other) | |||
| { | |||
| swapVariables (data, other.data); | |||
| } | |||
| private: | |||
| //============================================================================== | |||
| ElementType* data; | |||
| HeapBlock (const HeapBlock&); | |||
| const HeapBlock& operator= (const HeapBlock&); | |||
| }; | |||
| #endif // __JUCE_HEAPBLOCK_JUCEHEADER__ | |||
| @@ -32,8 +32,7 @@ BEGIN_JUCE_NAMESPACE | |||
| //============================================================================== | |||
| MemoryBlock::MemoryBlock() throw() | |||
| : data (0), | |||
| size (0) | |||
| : size (0) | |||
| { | |||
| } | |||
| @@ -43,35 +42,28 @@ MemoryBlock::MemoryBlock (const int initialSize, | |||
| if (initialSize > 0) | |||
| { | |||
| size = initialSize; | |||
| if (initialiseToZero) | |||
| data = (char*) juce_calloc (initialSize); | |||
| else | |||
| data = (char*) juce_malloc (initialSize); | |||
| data.allocate (initialSize, initialiseToZero); | |||
| } | |||
| else | |||
| { | |||
| data = 0; | |||
| size = 0; | |||
| } | |||
| } | |||
| MemoryBlock::MemoryBlock (const MemoryBlock& other) throw() | |||
| : data (0), | |||
| size (other.size) | |||
| : size (other.size) | |||
| { | |||
| if (size > 0) | |||
| { | |||
| jassert (other.data != 0); | |||
| data = (char*) juce_malloc (size); | |||
| data.malloc (size); | |||
| memcpy (data, other.data, size); | |||
| } | |||
| } | |||
| MemoryBlock::MemoryBlock (const void* const dataToInitialiseFrom, | |||
| const int sizeInBytes) throw() | |||
| : data (0), | |||
| size (jmax (0, sizeInBytes)) | |||
| : size (jmax (0, sizeInBytes)) | |||
| { | |||
| jassert (sizeInBytes >= 0); | |||
| @@ -79,7 +71,7 @@ MemoryBlock::MemoryBlock (const void* const dataToInitialiseFrom, | |||
| { | |||
| jassert (dataToInitialiseFrom != 0); // non-zero size, but a zero pointer passed-in? | |||
| data = (char*) juce_malloc (size); | |||
| data.malloc (size); | |||
| if (dataToInitialiseFrom != 0) | |||
| memcpy (data, dataToInitialiseFrom, size); | |||
| @@ -90,8 +82,6 @@ MemoryBlock::~MemoryBlock() throw() | |||
| { | |||
| jassert (size >= 0); // should never happen | |||
| jassert (size == 0 || data != 0); // non-zero size but no data allocated? | |||
| juce_free (data); | |||
| } | |||
| const MemoryBlock& MemoryBlock::operator= (const MemoryBlock& other) throw() | |||
| @@ -126,25 +116,21 @@ void MemoryBlock::setSize (const int newSize, | |||
| { | |||
| if (newSize <= 0) | |||
| { | |||
| juce_free (data); | |||
| data = 0; | |||
| data.free(); | |||
| size = 0; | |||
| } | |||
| else | |||
| { | |||
| if (data != 0) | |||
| { | |||
| data = (char*) juce_realloc (data, newSize); | |||
| data.realloc (newSize); | |||
| if (initialiseToZero && (newSize > size)) | |||
| zeromem (data + size, newSize - size); | |||
| } | |||
| else | |||
| { | |||
| if (initialiseToZero) | |||
| data = (char*) juce_calloc (newSize); | |||
| else | |||
| data = (char*) juce_malloc (newSize); | |||
| data.allocate (newSize, initialiseToZero); | |||
| } | |||
| size = newSize; | |||
| @@ -242,7 +228,7 @@ void MemoryBlock::removeSection (int startByte, int numBytesToRemove) throw() | |||
| const String MemoryBlock::toString() const throw() | |||
| { | |||
| return String (data, size); | |||
| return String ((const char*) data, size); | |||
| } | |||
| //============================================================================== | |||
| @@ -27,6 +27,7 @@ | |||
| #define __JUCE_MEMORYBLOCK_JUCEHEADER__ | |||
| #include "../text/juce_String.h" | |||
| #include "juce_HeapBlock.h" | |||
| //============================================================================== | |||
| @@ -232,7 +233,7 @@ public: | |||
| private: | |||
| //============================================================================== | |||
| char* data; | |||
| HeapBlock <char> data; | |||
| int size; | |||
| }; | |||
| @@ -318,10 +318,9 @@ void var::writeToStream (OutputStream& output) const throw() | |||
| const int len = value.stringValue->copyToUTF8 (0); | |||
| output.writeCompressedInt (len + 1); | |||
| output.writeByte (5); | |||
| uint8* const temp = (uint8*) juce_malloc (len); | |||
| HeapBlock <uint8> temp (len); | |||
| value.stringValue->copyToUTF8 (temp); | |||
| output.write (temp, len); | |||
| juce_free (temp); | |||
| break; | |||
| } | |||
| case objectType: output.writeCompressedInt (0); jassertfalse; break; // Can't write an object to a stream! | |||
| @@ -29,6 +29,7 @@ | |||
| #include "juce_ReferenceCountedObject.h" | |||
| #include "juce_OwnedArray.h" | |||
| #include "../text/juce_StringArray.h" | |||
| #include "../containers/juce_Array.h" | |||
| #include "../io/streams/juce_OutputStream.h" | |||
| #include "../io/streams/juce_InputStream.h" | |||
| @@ -37,13 +37,24 @@ | |||
| //============================================================================== | |||
| // Win32 debug non-DLL versions.. | |||
| /** This should be used instead of calling malloc directly. */ | |||
| /** This should be used instead of calling malloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_malloc(numBytes) _malloc_dbg (numBytes, _NORMAL_BLOCK, __FILE__, __LINE__) | |||
| /** This should be used instead of calling calloc directly. */ | |||
| /** This should be used instead of calling calloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_calloc(numBytes) _calloc_dbg (1, numBytes, _NORMAL_BLOCK, __FILE__, __LINE__) | |||
| /** This should be used instead of calling realloc directly. */ | |||
| /** This should be used instead of calling realloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_realloc(location, numBytes) _realloc_dbg (location, numBytes, _NORMAL_BLOCK, __FILE__, __LINE__) | |||
| /** This should be used instead of calling free directly. */ | |||
| /** This should be used instead of calling free directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_free(location) _free_dbg (location, _NORMAL_BLOCK) | |||
| #else | |||
| @@ -57,13 +68,24 @@ | |||
| extern JUCE_API void* juce_DebugRealloc (void* const block, const int size, const char* file, const int line); | |||
| extern JUCE_API void juce_DebugFree (void* const block); | |||
| /** This should be used instead of calling malloc directly. */ | |||
| /** This should be used instead of calling malloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_malloc(numBytes) JUCE_NAMESPACE::juce_DebugMalloc (numBytes, __FILE__, __LINE__) | |||
| /** This should be used instead of calling calloc directly. */ | |||
| /** This should be used instead of calling calloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_calloc(numBytes) JUCE_NAMESPACE::juce_DebugCalloc (numBytes, __FILE__, __LINE__) | |||
| /** This should be used instead of calling realloc directly. */ | |||
| /** This should be used instead of calling realloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_DebugRealloc (location, numBytes, __FILE__, __LINE__) | |||
| /** This should be used instead of calling free directly. */ | |||
| /** This should be used instead of calling free directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_free(location) JUCE_NAMESPACE::juce_DebugFree (location) | |||
| #endif | |||
| @@ -89,13 +111,24 @@ | |||
| extern JUCE_API void* juce_Realloc (void* const block, const int size); | |||
| extern JUCE_API void juce_Free (void* const block); | |||
| /** This should be used instead of calling malloc directly. */ | |||
| /** This should be used instead of calling malloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_malloc(numBytes) JUCE_NAMESPACE::juce_Malloc (numBytes) | |||
| /** This should be used instead of calling calloc directly. */ | |||
| /** This should be used instead of calling calloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_calloc(numBytes) JUCE_NAMESPACE::juce_Calloc (numBytes) | |||
| /** This should be used instead of calling realloc directly. */ | |||
| /** This should be used instead of calling realloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_Realloc (location, numBytes) | |||
| /** This should be used instead of calling free directly. */ | |||
| /** This should be used instead of calling free directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_free(location) JUCE_NAMESPACE::juce_Free (location) | |||
| #define juce_UseDebuggingNewOperator \ | |||
| @@ -108,13 +141,24 @@ | |||
| //============================================================================== | |||
| // Mac, Linux and Win32 (release) versions.. | |||
| /** This should be used instead of calling malloc directly. */ | |||
| /** This should be used instead of calling malloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_malloc(numBytes) malloc (numBytes) | |||
| /** This should be used instead of calling calloc directly. */ | |||
| /** This should be used instead of calling calloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_calloc(numBytes) calloc (1, numBytes) | |||
| /** This should be used instead of calling realloc directly. */ | |||
| /** This should be used instead of calling realloc directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_realloc(location, numBytes) realloc (location, numBytes) | |||
| /** This should be used instead of calling free directly. */ | |||
| /** This should be used instead of calling free directly. | |||
| Only use direct memory allocation if there's really no way to use a HeapBlock object instead! | |||
| */ | |||
| #define juce_free(location) free (location) | |||
| #endif | |||
| @@ -309,7 +309,7 @@ BlowFish::BlowFish (const uint8* keyData, int keyBytes) | |||
| int i, j; | |||
| for (i = 4; --i >= 0;) | |||
| { | |||
| s[i] = (uint32*) juce_malloc (256 * sizeof (uint32)); | |||
| s[i].malloc (256); | |||
| memcpy (s[i], initialSValues + i * 256, 256 * sizeof (uint32)); | |||
| } | |||
| @@ -355,7 +355,7 @@ BlowFish::BlowFish (const uint8* keyData, int keyBytes) | |||
| BlowFish::BlowFish (const BlowFish& other) | |||
| { | |||
| for (int i = 4; --i >= 0;) | |||
| s[i] = (uint32*) juce_malloc (256 * sizeof (uint32)); | |||
| s[i].malloc (256); | |||
| operator= (other); | |||
| } | |||
| @@ -372,8 +372,6 @@ const BlowFish& BlowFish::operator= (const BlowFish& other) | |||
| BlowFish::~BlowFish() | |||
| { | |||
| for (int i = 4; --i >= 0;) | |||
| juce_free (s[i]); | |||
| } | |||
| uint32 BlowFish::F (uint32 x) const | |||
| @@ -26,6 +26,8 @@ | |||
| #ifndef __JUCE_BLOWFISH_JUCEHEADER__ | |||
| #define __JUCE_BLOWFISH_JUCEHEADER__ | |||
| #include "../containers/juce_HeapBlock.h" | |||
| //============================================================================== | |||
| /** | |||
| @@ -64,7 +66,7 @@ public: | |||
| private: | |||
| uint32 p[18]; | |||
| uint32* s[4]; | |||
| HeapBlock <uint32> s[4]; | |||
| uint32 F (uint32 x) const; | |||
| }; | |||
| @@ -28,6 +28,7 @@ | |||
| #include "../../../utilities/juce_UndoManager.h" | |||
| #include "../../graphics/colour/juce_Colour.h" | |||
| #include "../../../containers/juce_VoidArray.h" | |||
| class CodeDocumentLine; | |||
| @@ -702,7 +702,7 @@ void MidiKeyboardComponent::resetAnyKeysInUse() | |||
| void MidiKeyboardComponent::updateNoteUnderMouse (int x, int y) | |||
| { | |||
| float mousePositionVelocity; | |||
| float mousePositionVelocity = 0.0f; | |||
| const int newNote = (mouseDragging || isMouseOver()) | |||
| ? xyToNote (x, y, mousePositionVelocity) : -1; | |||
| @@ -138,7 +138,7 @@ const Colour ColourGradient::getColourAtPosition (const float position) const th | |||
| } | |||
| //============================================================================== | |||
| PixelARGB* ColourGradient::createLookupTable (const AffineTransform& transform, int& numEntries) const throw() | |||
| int ColourGradient::createLookupTable (const AffineTransform& transform, HeapBlock <PixelARGB>& lookupTable) const throw() | |||
| { | |||
| #ifdef JUCE_DEBUG | |||
| // trying to use the object without setting its co-ordinates? Have a careful read of | |||
| @@ -153,9 +153,8 @@ PixelARGB* ColourGradient::createLookupTable (const AffineTransform& transform, | |||
| transform.transformPoint (tx2, ty2); | |||
| const double distance = juce_hypot (tx1 - tx2, ty1 - ty2); | |||
| numEntries = jlimit (1, (numColours - 1) << 8, 3 * (int) distance); | |||
| PixelARGB* const lookupTable = (PixelARGB*) juce_calloc (numEntries * sizeof (PixelARGB)); | |||
| const int numEntries = jlimit (1, (numColours - 1) << 8, 3 * (int) distance); | |||
| lookupTable.malloc (numEntries); | |||
| if (numColours >= 2) | |||
| { | |||
| @@ -191,7 +190,7 @@ PixelARGB* ColourGradient::createLookupTable (const AffineTransform& transform, | |||
| jassertfalse // no colours specified! | |||
| } | |||
| return lookupTable; | |||
| return numEntries; | |||
| } | |||
| bool ColourGradient::isOpaque() const throw() | |||
| @@ -29,6 +29,7 @@ | |||
| #include "juce_Colour.h" | |||
| #include "../geometry/juce_AffineTransform.h" | |||
| #include "../../../containers/juce_Array.h" | |||
| #include "../../../containers/juce_HeapBlock.h" | |||
| //============================================================================== | |||
| @@ -123,10 +124,10 @@ public: | |||
| //============================================================================== | |||
| /** Creates a set of interpolated premultiplied ARGB values. | |||
| The caller must delete the array that is returned using juce_free(). | |||
| This will resize the HeapBlock, fill it with the colours, and will return the number of | |||
| colours that it added. | |||
| */ | |||
| PixelARGB* createLookupTable (const AffineTransform& transform, int& numEntries) const throw(); | |||
| int createLookupTable (const AffineTransform& transform, HeapBlock <PixelARGB>& resultLookupTable) const throw(); | |||
| /** Returns true if all colours are opaque. */ | |||
| bool isOpaque() const throw(); | |||
| @@ -53,7 +53,7 @@ EdgeTable::EdgeTable (const Rectangle& bounds_, | |||
| lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), | |||
| needToCheckEmptinesss (true) | |||
| { | |||
| table = (int*) juce_malloc ((bounds.getHeight() + 1) * lineStrideElements * sizeof (int)); | |||
| table.malloc ((bounds.getHeight() + 1) * lineStrideElements); | |||
| int* t = table; | |||
| for (int i = bounds.getHeight(); --i >= 0;) | |||
| @@ -127,8 +127,8 @@ EdgeTable::EdgeTable (const Rectangle& rectangleToAdd) throw() | |||
| lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), | |||
| needToCheckEmptinesss (true) | |||
| { | |||
| table = (int*) juce_malloc (jmax (1, bounds.getHeight()) * lineStrideElements * sizeof (int)); | |||
| *table = 0; | |||
| table.malloc (jmax (1, bounds.getHeight()) * lineStrideElements); | |||
| table[0] = 0; | |||
| const int x1 = rectangleToAdd.getX() << 8; | |||
| const int x2 = rectangleToAdd.getRight() << 8; | |||
| @@ -151,7 +151,7 @@ EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd) throw() | |||
| lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), | |||
| needToCheckEmptinesss (true) | |||
| { | |||
| table = (int*) juce_malloc (jmax (1, bounds.getHeight()) * lineStrideElements * sizeof (int)); | |||
| table.malloc (jmax (1, bounds.getHeight()) * lineStrideElements); | |||
| int* t = table; | |||
| for (int i = bounds.getHeight(); --i >= 0;) | |||
| @@ -186,8 +186,8 @@ EdgeTable::EdgeTable (const float x, const float y, const float w, const float h | |||
| needToCheckEmptinesss (true) | |||
| { | |||
| jassert (w > 0 && h > 0); | |||
| table = (int*) juce_malloc (jmax (1, bounds.getHeight()) * lineStrideElements * sizeof (int)); | |||
| *table = 0; | |||
| table.malloc (jmax (1, bounds.getHeight()) * lineStrideElements); | |||
| table[0] = 0; | |||
| const int x1 = roundFloatToInt (x * 256.0f); | |||
| const int x2 = roundFloatToInt ((x + w) * 256.0f); | |||
| @@ -262,22 +262,18 @@ EdgeTable::EdgeTable (const EdgeTable& other) throw() | |||
| const EdgeTable& EdgeTable::operator= (const EdgeTable& other) throw() | |||
| { | |||
| juce_free (table); | |||
| bounds = other.bounds; | |||
| maxEdgesPerLine = other.maxEdgesPerLine; | |||
| lineStrideElements = other.lineStrideElements; | |||
| needToCheckEmptinesss = other.needToCheckEmptinesss; | |||
| const int tableSize = jmax (1, bounds.getHeight()) * lineStrideElements * sizeof (int); | |||
| table = (int*) juce_malloc (tableSize); | |||
| table.malloc (jmax (1, bounds.getHeight()) * lineStrideElements); | |||
| copyEdgeTableData (table, lineStrideElements, other.table, lineStrideElements, bounds.getHeight()); | |||
| return *this; | |||
| } | |||
| EdgeTable::~EdgeTable() throw() | |||
| { | |||
| juce_free (table); | |||
| } | |||
| //============================================================================== | |||
| @@ -340,12 +336,12 @@ void EdgeTable::remapTableForNumEdges (const int newNumEdgesPerLine) throw() | |||
| jassert (bounds.getHeight() > 0); | |||
| const int newLineStrideElements = maxEdgesPerLine * 2 + 1; | |||
| int* const newTable = (int*) juce_malloc (bounds.getHeight() * newLineStrideElements * sizeof (int)); | |||
| HeapBlock <int> newTable (bounds.getHeight() * newLineStrideElements); | |||
| copyEdgeTableData (newTable, newLineStrideElements, table, lineStrideElements, bounds.getHeight()); | |||
| juce_free (table); | |||
| table = newTable; | |||
| table.swapWith (newTable); | |||
| lineStrideElements = newLineStrideElements; | |||
| } | |||
| } | |||
| @@ -195,7 +195,7 @@ public: | |||
| private: | |||
| // table line format: number of points; point0 x, point0 levelDelta, point1 x, point1 levelDelta, etc | |||
| int* table; | |||
| HeapBlock <int> table; | |||
| Rectangle bounds; | |||
| int maxEdgesPerLine, lineStrideElements; | |||
| bool needToCheckEmptinesss; | |||
| @@ -41,13 +41,13 @@ BEGIN_JUCE_NAMESPACE | |||
| #define JUCE_USE_SSE_INSTRUCTIONS 1 | |||
| #endif | |||
| #if JUCE_MSVC && JUCE_DEBUG | |||
| #pragma warning (disable: 4714) // warning about forcedinline methods not being inlined | |||
| #endif | |||
| #if JUCE_MSVC | |||
| #pragma warning (push) | |||
| #pragma warning (disable: 4127) // "expression is constant" warning | |||
| #if JUCE_DEBUG | |||
| #pragma warning (disable: 4714) // warning about forcedinline methods not being inlined | |||
| #endif | |||
| #endif | |||
| //============================================================================== | |||
| @@ -520,12 +520,11 @@ public: | |||
| maxY (srcData_.height - 1), | |||
| scratchSize (2048) | |||
| { | |||
| scratchBuffer = (SrcPixelType*) juce_malloc (scratchSize * sizeof (SrcPixelType)); | |||
| scratchBuffer.malloc (scratchSize); | |||
| } | |||
| ~TransformedImageFillEdgeTableRenderer() throw() | |||
| { | |||
| juce_free (scratchBuffer); | |||
| } | |||
| forcedinline void setEdgeTableYPos (const int newY) throw() | |||
| @@ -550,8 +549,7 @@ public: | |||
| if (width > scratchSize) | |||
| { | |||
| scratchSize = width; | |||
| juce_free (scratchBuffer); | |||
| scratchBuffer = (SrcPixelType*) juce_malloc (scratchSize * sizeof (SrcPixelType)); | |||
| scratchBuffer.malloc (scratchSize); | |||
| } | |||
| SrcPixelType* span = scratchBuffer; | |||
| @@ -582,8 +580,7 @@ public: | |||
| if (width > scratchSize) | |||
| { | |||
| scratchSize = width; | |||
| juce_free (scratchBuffer); | |||
| scratchBuffer = (SrcPixelType*) juce_malloc (scratchSize * sizeof (SrcPixelType)); | |||
| scratchBuffer.malloc (scratchSize); | |||
| } | |||
| uint8* mask = (uint8*) scratchBuffer; | |||
| @@ -893,7 +890,7 @@ private: | |||
| const int pixelOffsetInt, maxX, maxY; | |||
| int y; | |||
| DestPixelType* linePixels; | |||
| SrcPixelType* scratchBuffer; | |||
| HeapBlock <SrcPixelType> scratchBuffer; | |||
| int scratchSize; | |||
| TransformedImageFillEdgeTableRenderer (const TransformedImageFillEdgeTableRenderer&); | |||
| @@ -983,8 +980,8 @@ public: | |||
| transform = AffineTransform::identity; | |||
| } | |||
| int numLookupEntries; | |||
| PixelARGB* const lookupTable = g2.createLookupTable (transform, numLookupEntries); | |||
| HeapBlock <PixelARGB> lookupTable; | |||
| const int numLookupEntries = g2.createLookupTable (transform, lookupTable); | |||
| jassert (numLookupEntries > 0); | |||
| switch (image.getFormat()) | |||
| @@ -993,8 +990,6 @@ public: | |||
| case Image::RGB: renderGradient (et, destData, g2, transform, lookupTable, numLookupEntries, isIdentity, (PixelRGB*) 0); break; | |||
| default: renderGradient (et, destData, g2, transform, lookupTable, numLookupEntries, isIdentity, (PixelAlpha*) 0); break; | |||
| } | |||
| juce_free (lookupTable); | |||
| } | |||
| else if (fillType.isTiledImage()) | |||
| { | |||
| @@ -28,6 +28,7 @@ | |||
| #include "juce_Font.h" | |||
| #include "../contexts/juce_Justification.h" | |||
| #include "../../../containers/juce_VoidArray.h" | |||
| class Graphics; | |||
| @@ -48,17 +48,16 @@ PathFlatteningIterator::PathFlatteningIterator (const Path& path_, | |||
| tolerence (tolerence_ * tolerence_), | |||
| subPathCloseX (0), | |||
| subPathCloseY (0), | |||
| stackBase (32), | |||
| index (0), | |||
| stackSize (32) | |||
| { | |||
| stackBase = (float*) juce_malloc (stackSize * sizeof (float)); | |||
| isIdentityTransform = transform.isIdentity(); | |||
| stackPos = stackBase; | |||
| } | |||
| PathFlatteningIterator::~PathFlatteningIterator() throw() | |||
| { | |||
| juce_free (stackBase); | |||
| } | |||
| bool PathFlatteningIterator::next() throw() | |||
| @@ -159,7 +158,7 @@ bool PathFlatteningIterator::next() throw() | |||
| if (offset >= stackSize - 10) | |||
| { | |||
| stackSize <<= 1; | |||
| stackBase = (float*) juce_realloc (stackBase, stackSize * sizeof (float)); | |||
| stackBase.realloc (stackSize); | |||
| stackPos = stackBase + offset; | |||
| } | |||
| @@ -209,7 +208,7 @@ bool PathFlatteningIterator::next() throw() | |||
| if (offset >= stackSize - 16) | |||
| { | |||
| stackSize <<= 1; | |||
| stackBase = (float*) juce_realloc (stackBase, stackSize * sizeof (float)); | |||
| stackBase.realloc (stackSize); | |||
| stackPos = stackBase + offset; | |||
| } | |||
| @@ -110,7 +110,7 @@ private: | |||
| float tolerence, subPathCloseX, subPathCloseY; | |||
| bool isIdentityTransform; | |||
| float* stackBase; | |||
| HeapBlock <float> stackBase; | |||
| float* stackPos; | |||
| int index, stackSize; | |||
| @@ -30,7 +30,6 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "juce_PathStrokeType.h" | |||
| #include "juce_PathIterator.h" | |||
| #include "../../../containers/juce_VoidArray.h" | |||
| //============================================================================== | |||
| @@ -326,7 +326,8 @@ bool juce_writeJPEGImageToStream (const Image& image, | |||
| jpegCompStruct.dest = &dest; | |||
| dest.output = &out; | |||
| dest.buffer = (char*) juce_malloc (bufferSize); | |||
| HeapBlock <char> tempBuffer (bufferSize); | |||
| dest.buffer = (char*) tempBuffer; | |||
| dest.next_output_byte = (JOCTET*) dest.buffer; | |||
| dest.free_in_buffer = bufferSize; | |||
| dest.init_destination = jpegWriteInit; | |||
| @@ -382,8 +383,6 @@ bool juce_writeJPEGImageToStream (const Image& image, | |||
| jpeg_finish_compress (&jpegCompStruct); | |||
| jpeg_destroy_compress (&jpegCompStruct); | |||
| juce_free (dest.buffer); | |||
| out.flush(); | |||
| return true; | |||
| @@ -178,17 +178,17 @@ Image* juce_loadPNGImageFromStream (InputStream& in) throw() | |||
| || pngInfoStruct->num_trans > 0; | |||
| // Load the image into a temp buffer in the pnglib format.. | |||
| uint8* const tempBuffer = (uint8*) juce_malloc (height * (width << 2)); | |||
| HeapBlock <uint8> tempBuffer (height * (width << 2)); | |||
| png_bytepp rows = (png_bytepp) juce_malloc (sizeof (png_bytep) * height); | |||
| int y; | |||
| for (y = (int) height; --y >= 0;) | |||
| rows[y] = (png_bytep) (tempBuffer + (width << 2) * y); | |||
| { | |||
| HeapBlock <png_bytep> rows (height); | |||
| for (int y = (int) height; --y >= 0;) | |||
| rows[y] = (png_bytep) (tempBuffer + (width << 2) * y); | |||
| png_read_image (pngReadStruct, rows); | |||
| png_read_end (pngReadStruct, pngInfoStruct); | |||
| png_read_image (pngReadStruct, rows); | |||
| png_read_end (pngReadStruct, pngInfoStruct); | |||
| } | |||
| juce_free (rows); | |||
| png_destroy_read_struct (&pngReadStruct, &pngInfoStruct, 0); | |||
| // now convert the data to a juce image format.. | |||
| @@ -201,7 +201,7 @@ Image* juce_loadPNGImageFromStream (InputStream& in) throw() | |||
| uint8* srcRow = tempBuffer; | |||
| uint8* destRow = destData.data; | |||
| for (y = 0; y < (int) height; ++y) | |||
| for (int y = 0; y < (int) height; ++y) | |||
| { | |||
| const uint8* src = srcRow; | |||
| srcRow += (width << 2); | |||
| @@ -228,8 +228,6 @@ Image* juce_loadPNGImageFromStream (InputStream& in) throw() | |||
| } | |||
| } | |||
| } | |||
| juce_free (tempBuffer); | |||
| } | |||
| return image; | |||
| @@ -273,7 +271,7 @@ bool juce_writePNGImageToStream (const Image& image, OutputStream& out) throw() | |||
| PNG_COMPRESSION_TYPE_BASE, | |||
| PNG_FILTER_TYPE_BASE); | |||
| png_bytep rowData = (png_bytep) juce_malloc (width * 4 * sizeof (png_byte)); | |||
| HeapBlock <png_byte> rowData (width * 4); | |||
| png_color_8 sig_bit; | |||
| sig_bit.red = 8; | |||
| @@ -322,8 +320,6 @@ bool juce_writePNGImageToStream (const Image& image, OutputStream& out) throw() | |||
| png_write_rows (pngWriteStruct, &rowData, 1); | |||
| } | |||
| juce_free (rowData); | |||
| png_write_end (pngWriteStruct, pngInfoStruct); | |||
| png_destroy_write_struct (&pngWriteStruct, &pngInfoStruct); | |||
| @@ -65,10 +65,9 @@ Image::Image (const PixelFormat format_, | |||
| pixelStride = (format == RGB) ? 3 : ((format == ARGB) ? 4 : 1); | |||
| lineStride = (pixelStride * jmax (1, imageWidth_) + 3) & ~3; | |||
| const int dataSize = lineStride * jmax (1, imageHeight_); | |||
| imageData = (uint8*) (clearImage ? juce_calloc (dataSize) | |||
| : juce_malloc (dataSize)); | |||
| imageDataAllocated.allocate (lineStride * jmax (1, imageHeight_), clearImage); | |||
| imageData = imageDataAllocated; | |||
| } | |||
| Image::Image (const Image& other) | |||
| @@ -78,9 +77,9 @@ Image::Image (const Image& other) | |||
| { | |||
| pixelStride = (format == RGB) ? 3 : ((format == ARGB) ? 4 : 1); | |||
| lineStride = (pixelStride * jmax (1, imageWidth) + 3) & ~3; | |||
| const int dataSize = lineStride * jmax (1, imageHeight); | |||
| imageData = (uint8*) juce_malloc (dataSize); | |||
| imageDataAllocated.malloc (lineStride * jmax (1, imageHeight)); | |||
| imageData = imageDataAllocated; | |||
| BitmapData srcData (other, 0, 0, imageWidth, imageHeight); | |||
| setPixelData (0, 0, imageWidth, imageHeight, srcData.data, srcData.lineStride); | |||
| @@ -88,7 +87,6 @@ Image::Image (const Image& other) | |||
| Image::~Image() | |||
| { | |||
| juce_free (imageData); | |||
| } | |||
| //============================================================================== | |||
| @@ -291,9 +291,9 @@ protected: | |||
| const int imageHeight); | |||
| int pixelStride, lineStride; | |||
| HeapBlock <uint8> imageDataAllocated; | |||
| uint8* imageData; | |||
| private: | |||
| //============================================================================== | |||
| const Image& operator= (const Image&); | |||
| @@ -30,6 +30,7 @@ | |||
| #include "../../../io/files/juce_File.h" | |||
| #include "../../../events/juce_Timer.h" | |||
| #include "../../../utilities/juce_DeletedAtShutdown.h" | |||
| #include "../../../containers/juce_VoidArray.h" | |||
| //============================================================================== | |||
| @@ -32,22 +32,14 @@ BEGIN_JUCE_NAMESPACE | |||
| //============================================================================== | |||
| ImageConvolutionKernel::ImageConvolutionKernel (const int size_) throw() | |||
| : size (size_) | |||
| : values (size_ * size_), | |||
| size (size_) | |||
| { | |||
| values = new float* [size]; | |||
| for (int i = size; --i >= 0;) | |||
| values[i] = new float [size]; | |||
| clear(); | |||
| } | |||
| ImageConvolutionKernel::~ImageConvolutionKernel() throw() | |||
| { | |||
| for (int i = size; --i >= 0;) | |||
| delete[] values[i]; | |||
| delete[] values; | |||
| } | |||
| //============================================================================== | |||
| @@ -58,7 +50,7 @@ void ImageConvolutionKernel::setKernelValue (const int x, | |||
| if (((unsigned int) x) < (unsigned int) size | |||
| && ((unsigned int) y) < (unsigned int) size) | |||
| { | |||
| values[x][y] = value; | |||
| values [x + y * size] = value; | |||
| } | |||
| else | |||
| { | |||
| @@ -68,27 +60,24 @@ void ImageConvolutionKernel::setKernelValue (const int x, | |||
| void ImageConvolutionKernel::clear() throw() | |||
| { | |||
| for (int y = size; --y >= 0;) | |||
| for (int x = size; --x >= 0;) | |||
| values[x][y] = 0; | |||
| for (int i = size * size; --i >= 0;) | |||
| values[i] = 0; | |||
| } | |||
| void ImageConvolutionKernel::setOverallSum (const float desiredTotalSum) throw() | |||
| { | |||
| double currentTotal = 0.0; | |||
| for (int y = size; --y >= 0;) | |||
| for (int x = size; --x >= 0;) | |||
| currentTotal += values[x][y]; | |||
| for (int i = size * size; --i >= 0;) | |||
| currentTotal += values[i]; | |||
| rescaleAllValues ((float) (desiredTotalSum / currentTotal)); | |||
| } | |||
| void ImageConvolutionKernel::rescaleAllValues (const float multiplier) throw() | |||
| { | |||
| for (int y = size; --y >= 0;) | |||
| for (int x = size; --x >= 0;) | |||
| values[x][y] *= multiplier; | |||
| for (int i = size * size; --i >= 0;) | |||
| values[i] *= multiplier; | |||
| } | |||
| //============================================================================== | |||
| @@ -104,7 +93,7 @@ void ImageConvolutionKernel::createGaussianBlur (const float radius) throw() | |||
| const int cx = x - centre; | |||
| const int cy = y - centre; | |||
| values[x][y] = (float) exp (radiusFactor * (cx * cx + cy * cy)); | |||
| values [x + y * size] = (float) exp (radiusFactor * (cx * cx + cy * cy)); | |||
| } | |||
| } | |||
| @@ -190,7 +179,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, | |||
| if (sx >= 0) | |||
| { | |||
| const float kernelMult = values[xx][yy]; | |||
| const float kernelMult = values [xx + yy * size]; | |||
| c1 += kernelMult * *src++; | |||
| c2 += kernelMult * *src++; | |||
| c3 += kernelMult * *src++; | |||
| @@ -245,7 +234,7 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, | |||
| if (sx >= 0) | |||
| { | |||
| const float kernelMult = values[xx][yy]; | |||
| const float kernelMult = values [xx + yy * size]; | |||
| c1 += kernelMult * *src++; | |||
| c2 += kernelMult * *src++; | |||
| c3 += kernelMult * *src++; | |||
| @@ -119,8 +119,8 @@ public: | |||
| juce_UseDebuggingNewOperator | |||
| private: | |||
| float** values; | |||
| int size; | |||
| HeapBlock <float> values; | |||
| const int size; | |||
| // no reason not to implement these one day.. | |||
| ImageConvolutionKernel (const ImageConvolutionKernel&); | |||
| @@ -58,7 +58,7 @@ FileOutputStream::FileOutputStream (const File& f, | |||
| } | |||
| } | |||
| buffer = (char*) juce_malloc (jmax (bufferSize_, 16)); | |||
| buffer.malloc (jmax (bufferSize_, 16)); | |||
| } | |||
| FileOutputStream::~FileOutputStream() | |||
| @@ -66,7 +66,6 @@ FileOutputStream::~FileOutputStream() | |||
| flush(); | |||
| juce_fileClose (fileHandle); | |||
| juce_free (buffer); | |||
| } | |||
| int64 FileOutputStream::getPosition() | |||
| @@ -84,7 +84,7 @@ private: | |||
| void* fileHandle; | |||
| int64 currentPosition; | |||
| int bufferSize, bytesInBuffer; | |||
| char* buffer; | |||
| HeapBlock <char> buffer; | |||
| }; | |||
| #endif // __JUCE_FILEOUTPUTSTREAM_JUCEHEADER__ | |||
| @@ -30,6 +30,7 @@ | |||
| #include "../streams/juce_InputStream.h" | |||
| #include "../streams/juce_InputSource.h" | |||
| #include "../../threads/juce_CriticalSection.h" | |||
| #include "../../containers/juce_VoidArray.h" | |||
| //============================================================================== | |||
| @@ -550,7 +550,7 @@ const StringPairArray& URL::getMimeTypesOfUploadFiles() const throw() | |||
| const String URL::removeEscapeChars (const String& s) | |||
| { | |||
| const int len = s.length(); | |||
| uint8* const resultUTF8 = (uint8*) juce_calloc (len * 4); | |||
| HeapBlock <uint8> resultUTF8 (len * 4); | |||
| uint8* r = resultUTF8; | |||
| for (int i = 0; i < len; ++i) | |||
| @@ -572,9 +572,7 @@ const String URL::removeEscapeChars (const String& s) | |||
| *r++ = c; | |||
| } | |||
| const String stringResult (String::fromUTF8 (resultUTF8)); | |||
| juce_free (resultUTF8); | |||
| return stringResult; | |||
| return String::fromUTF8 (resultUTF8); | |||
| } | |||
| const String URL::addEscapeChars (const String& s, const bool isParameter) | |||
| @@ -47,15 +47,13 @@ BufferedInputStream::BufferedInputStream (InputStream* const source_, | |||
| bufferSize = jmin (jmax (32, sourceSize), bufferSize); | |||
| bufferStart = position; | |||
| buffer = (char*) juce_malloc (bufferSize); | |||
| buffer.malloc (bufferSize); | |||
| } | |||
| BufferedInputStream::~BufferedInputStream() throw() | |||
| { | |||
| if (deleteSourceWhenDestroyed) | |||
| delete source; | |||
| juce_free (buffer); | |||
| } | |||
| //============================================================================== | |||
| @@ -94,7 +92,7 @@ void BufferedInputStream::ensureBuffered() | |||
| && position >= bufferStart) | |||
| { | |||
| const int bytesToKeep = (int) (lastReadPos - position); | |||
| memmove (buffer, buffer + position - bufferStart, bytesToKeep); | |||
| memmove (buffer, buffer + (int) (position - bufferStart), bytesToKeep); | |||
| bufferStart = position; | |||
| @@ -122,7 +120,7 @@ int BufferedInputStream::read (void* destBuffer, int maxBytesToRead) | |||
| if (position >= bufferStart | |||
| && position + maxBytesToRead <= lastReadPos) | |||
| { | |||
| memcpy (destBuffer, buffer + (position - bufferStart), maxBytesToRead); | |||
| memcpy (destBuffer, buffer + (int) (position - bufferStart), maxBytesToRead); | |||
| position += maxBytesToRead; | |||
| return maxBytesToRead; | |||
| @@ -140,7 +138,7 @@ int BufferedInputStream::read (void* destBuffer, int maxBytesToRead) | |||
| if (bytesAvailable > 0) | |||
| { | |||
| memcpy (destBuffer, buffer + (position - bufferStart), bytesAvailable); | |||
| memcpy (destBuffer, buffer + (int) (position - bufferStart), bytesAvailable); | |||
| maxBytesToRead -= bytesAvailable; | |||
| bytesRead += bytesAvailable; | |||
| position += bytesAvailable; | |||
| @@ -168,7 +166,7 @@ const String BufferedInputStream::readString() | |||
| { | |||
| const int maxChars = (int) (lastReadPos - position); | |||
| const char* const src = buffer + (position - bufferStart); | |||
| const char* const src = buffer + (int) (position - bufferStart); | |||
| for (int i = 0; i < maxChars; ++i) | |||
| { | |||
| @@ -77,7 +77,7 @@ private: | |||
| const bool deleteSourceWhenDestroyed; | |||
| int bufferSize; | |||
| int64 position, lastReadPos, bufferStart, bufferOverlap; | |||
| char* buffer; | |||
| HeapBlock <char> buffer; | |||
| void ensureBuffered(); | |||
| BufferedInputStream (const BufferedInputStream&); | |||
| @@ -49,7 +49,7 @@ using namespace zlibNamespace; | |||
| class GZIPCompressorHelper | |||
| { | |||
| private: | |||
| z_stream* stream; | |||
| HeapBlock <z_stream> stream; | |||
| uint8* data; | |||
| int dataSize, compLevel, strategy; | |||
| bool setParams; | |||
| @@ -66,7 +66,7 @@ public: | |||
| finished (false), | |||
| shouldFinish (false) | |||
| { | |||
| stream = (z_stream*) juce_calloc (sizeof (z_stream)); | |||
| stream.calloc (1); | |||
| if (deflateInit2 (stream, | |||
| compLevel, | |||
| @@ -75,18 +75,14 @@ public: | |||
| 8, | |||
| strategy) != Z_OK) | |||
| { | |||
| juce_free (stream); | |||
| stream = 0; | |||
| stream.free(); | |||
| } | |||
| } | |||
| ~GZIPCompressorHelper() | |||
| { | |||
| if (stream != 0) | |||
| { | |||
| deflateEnd (stream); | |||
| juce_free (stream); | |||
| } | |||
| } | |||
| bool needsInput() const throw() | |||
| @@ -143,14 +139,14 @@ GZIPCompressorOutputStream::GZIPCompressorOutputStream (OutputStream* const dest | |||
| const bool deleteDestStream_, | |||
| const bool noWrap) | |||
| : destStream (destStream_), | |||
| deleteDestStream (deleteDestStream_) | |||
| deleteDestStream (deleteDestStream_), | |||
| buffer (gzipCompBufferSize) | |||
| { | |||
| if (compressionLevel < 1 || compressionLevel > 9) | |||
| compressionLevel = -1; | |||
| helper = new GZIPCompressorHelper (compressionLevel, noWrap); | |||
| buffer = (uint8*) juce_malloc (gzipCompBufferSize); | |||
| } | |||
| GZIPCompressorOutputStream::~GZIPCompressorOutputStream() | |||
| @@ -160,8 +156,6 @@ GZIPCompressorOutputStream::~GZIPCompressorOutputStream() | |||
| GZIPCompressorHelper* const h = (GZIPCompressorHelper*) helper; | |||
| delete h; | |||
| juce_free (buffer); | |||
| if (deleteDestStream) | |||
| delete destStream; | |||
| } | |||
| @@ -73,7 +73,7 @@ public: | |||
| private: | |||
| OutputStream* const destStream; | |||
| const bool deleteDestStream; | |||
| uint8* buffer; | |||
| HeapBlock <uint8> buffer; | |||
| void* helper; | |||
| bool doNextBlock(); | |||
| @@ -81,7 +81,7 @@ using namespace zlibNamespace; | |||
| class GZIPDecompressHelper | |||
| { | |||
| private: | |||
| z_stream* stream; | |||
| HeapBlock <z_stream> stream; | |||
| uint8* data; | |||
| int dataSize; | |||
| @@ -95,13 +95,12 @@ public: | |||
| needsDictionary (false), | |||
| error (false) | |||
| { | |||
| stream = (z_stream*) juce_calloc (sizeof (z_stream)); | |||
| stream.calloc (1); | |||
| if (inflateInit2 (stream, (noWrap) ? -MAX_WBITS | |||
| : MAX_WBITS) != Z_OK) | |||
| { | |||
| juce_free (stream); | |||
| stream = 0; | |||
| stream.free(); | |||
| error = true; | |||
| finished = true; | |||
| } | |||
| @@ -110,10 +109,7 @@ public: | |||
| ~GZIPDecompressHelper() throw() | |||
| { | |||
| if (stream != 0) | |||
| { | |||
| inflateEnd (stream); | |||
| juce_free (stream); | |||
| } | |||
| } | |||
| bool needsInput() const throw() { return dataSize <= 0; } | |||
| @@ -177,16 +173,14 @@ GZIPDecompressorInputStream::GZIPDecompressorInputStream (InputStream* const sou | |||
| isEof (false), | |||
| activeBufferSize (0), | |||
| originalSourcePos (sourceStream_->getPosition()), | |||
| currentPos (0) | |||
| currentPos (0), | |||
| buffer (gzipDecompBufferSize) | |||
| { | |||
| buffer = (uint8*) juce_malloc (gzipDecompBufferSize); | |||
| helper = new GZIPDecompressHelper (noWrap_); | |||
| } | |||
| GZIPDecompressorInputStream::~GZIPDecompressorInputStream() | |||
| { | |||
| juce_free (buffer); | |||
| if (deleteSourceWhenDestroyed) | |||
| delete sourceStream; | |||
| @@ -80,7 +80,7 @@ private: | |||
| bool isEof; | |||
| int activeBufferSize; | |||
| int64 originalSourcePos, currentPos; | |||
| uint8* buffer; | |||
| HeapBlock <uint8> buffer; | |||
| void* helper; | |||
| GZIPDecompressorInputStream (const GZIPDecompressorInputStream&); | |||
| @@ -170,18 +170,16 @@ void OutputStream::writeDoubleBigEndian (double value) | |||
| void OutputStream::writeString (const String& text) | |||
| { | |||
| const int numBytes = text.copyToUTF8 (0); | |||
| uint8* const temp = (uint8*) juce_malloc (numBytes); | |||
| HeapBlock <uint8> temp (numBytes); | |||
| text.copyToUTF8 (temp); | |||
| write (temp, numBytes); // (numBytes includes the terminating null). | |||
| juce_free (temp); | |||
| } | |||
| void OutputStream::printf (const char* pf, ...) | |||
| { | |||
| unsigned int bufSize = 256; | |||
| char* buf = (char*) juce_malloc (bufSize); | |||
| HeapBlock <char> buf (bufSize); | |||
| for (;;) | |||
| { | |||
| @@ -202,12 +200,9 @@ void OutputStream::printf (const char* pf, ...) | |||
| break; | |||
| } | |||
| juce_free (buf); | |||
| bufSize += 256; | |||
| buf = (char*) juce_malloc (bufSize); | |||
| buf.malloc (bufSize); | |||
| } | |||
| juce_free (buf); | |||
| } | |||
| OutputStream& OutputStream::operator<< (const int number) | |||
| @@ -44,53 +44,47 @@ | |||
| #ifndef __JUCE_APPLICATIONPROPERTIES_JUCEHEADER__ | |||
| #include "application/juce_ApplicationProperties.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIBUFFER_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiBuffer.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIFILE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiFile.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIKEYBOARDSTATE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiKeyboardState.h" | |||
| #ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AiffAudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIMESSAGECOLLECTOR_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiMessageCollector.h" | |||
| #ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioCDBurner.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIMESSAGESEQUENCE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiMessageSequence.h" | |||
| #ifndef __JUCE_AUDIOCDREADER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioCDReader.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIMESSAGE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiMessage.h" | |||
| #ifndef __JUCE_AUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIODATACONVERTERS_JUCEHEADER__ | |||
| #include "audio/dsp/juce_AudioDataConverters.h" | |||
| #ifndef __JUCE_AUDIOFORMATMANAGER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormatManager.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOSAMPLEBUFFER_JUCEHEADER__ | |||
| #include "audio/dsp/juce_AudioSampleBuffer.h" | |||
| #ifndef __JUCE_AUDIOFORMATREADER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormatReader.h" | |||
| #endif | |||
| #ifndef __JUCE_IIRFILTER_JUCEHEADER__ | |||
| #include "audio/dsp/juce_IIRFilter.h" | |||
| #ifndef __JUCE_AUDIOFORMATWRITER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormatWriter.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOPLAYHEAD_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioPlayHead.h" | |||
| #ifndef __JUCE_AUDIOSUBSECTIONREADER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioSubsectionReader.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOPROCESSOR_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessor.h" | |||
| #ifndef __JUCE_AUDIOTHUMBNAIL_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioThumbnail.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOPROCESSOREDITOR_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorEditor.h" | |||
| #ifndef __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioThumbnailCache.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOPROCESSORGRAPH_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorGraph.h" | |||
| #ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_FlacAudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOPROCESSORLISTENER_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorListener.h" | |||
| #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_OggVorbisAudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOPROCESSORPLAYER_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorPlayer.h" | |||
| #ifndef __JUCE_QUICKTIMEAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_QuickTimeAudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_GENERICAUDIOPROCESSOREDITOR_JUCEHEADER__ | |||
| #include "audio/processors/juce_GenericAudioProcessorEditor.h" | |||
| #ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_WavAudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOFORMATREADERSOURCE_JUCEHEADER__ | |||
| #include "audio/audio_sources/juce_AudioFormatReaderSource.h" | |||
| @@ -140,11 +134,32 @@ | |||
| #ifndef __JUCE_MIDIOUTPUT_JUCEHEADER__ | |||
| #include "audio/devices/juce_MidiOutput.h" | |||
| #endif | |||
| #ifndef __JUCE_SAMPLER_JUCEHEADER__ | |||
| #include "audio/synthesisers/juce_Sampler.h" | |||
| #ifndef __JUCE_AUDIODATACONVERTERS_JUCEHEADER__ | |||
| #include "audio/dsp/juce_AudioDataConverters.h" | |||
| #endif | |||
| #ifndef __JUCE_SYNTHESISER_JUCEHEADER__ | |||
| #include "audio/synthesisers/juce_Synthesiser.h" | |||
| #ifndef __JUCE_AUDIOSAMPLEBUFFER_JUCEHEADER__ | |||
| #include "audio/dsp/juce_AudioSampleBuffer.h" | |||
| #endif | |||
| #ifndef __JUCE_IIRFILTER_JUCEHEADER__ | |||
| #include "audio/dsp/juce_IIRFilter.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIBUFFER_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiBuffer.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIFILE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiFile.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIKEYBOARDSTATE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiKeyboardState.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIMESSAGE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiMessage.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIMESSAGECOLLECTOR_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiMessageCollector.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIMESSAGESEQUENCE_JUCEHEADER__ | |||
| #include "audio/midi/juce_MidiMessageSequence.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOUNITPLUGINFORMAT_JUCEHEADER__ | |||
| #include "audio/plugins/formats/juce_AudioUnitPluginFormat.h" | |||
| @@ -182,47 +197,32 @@ | |||
| #ifndef __JUCE_PLUGINLISTCOMPONENT_JUCEHEADER__ | |||
| #include "audio/plugins/juce_PluginListComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AiffAudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOFORMATMANAGER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormatManager.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOFORMATREADER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormatReader.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOFORMATWRITER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioFormatWriter.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOSUBSECTIONREADER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioSubsectionReader.h" | |||
| #ifndef __JUCE_AUDIOPLAYHEAD_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioPlayHead.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOTHUMBNAIL_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioThumbnail.h" | |||
| #ifndef __JUCE_AUDIOPROCESSOR_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessor.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioThumbnailCache.h" | |||
| #ifndef __JUCE_AUDIOPROCESSOREDITOR_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorEditor.h" | |||
| #endif | |||
| #ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_FlacAudioFormat.h" | |||
| #ifndef __JUCE_AUDIOPROCESSORGRAPH_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorGraph.h" | |||
| #endif | |||
| #ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_WavAudioFormat.h" | |||
| #ifndef __JUCE_AUDIOPROCESSORLISTENER_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorListener.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOCDREADER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioCDReader.h" | |||
| #ifndef __JUCE_AUDIOPROCESSORPLAYER_JUCEHEADER__ | |||
| #include "audio/processors/juce_AudioProcessorPlayer.h" | |||
| #endif | |||
| #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_OggVorbisAudioFormat.h" | |||
| #ifndef __JUCE_GENERICAUDIOPROCESSOREDITOR_JUCEHEADER__ | |||
| #include "audio/processors/juce_GenericAudioProcessorEditor.h" | |||
| #endif | |||
| #ifndef __JUCE_QUICKTIMEAUDIOFORMAT_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_QuickTimeAudioFormat.h" | |||
| #ifndef __JUCE_SAMPLER_JUCEHEADER__ | |||
| #include "audio/synthesisers/juce_Sampler.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__ | |||
| #include "audio/audio_file_formats/juce_AudioCDBurner.h" | |||
| #ifndef __JUCE_SYNTHESISER_JUCEHEADER__ | |||
| #include "audio/synthesisers/juce_Synthesiser.h" | |||
| #endif | |||
| #ifndef __JUCE_ACTIONBROADCASTER_JUCEHEADER__ | |||
| #include "events/juce_ActionBroadcaster.h" | |||
| @@ -269,113 +269,128 @@ | |||
| #ifndef __JUCE_TIMER_JUCEHEADER__ | |||
| #include "events/juce_Timer.h" | |||
| #endif | |||
| #ifndef __JUCE_PIXELFORMATS_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_PixelFormats.h" | |||
| #ifndef __JUCE_ARROWBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ArrowButton.h" | |||
| #endif | |||
| #ifndef __JUCE_COLOUR_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_Colour.h" | |||
| #ifndef __JUCE_BUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_Button.h" | |||
| #endif | |||
| #ifndef __JUCE_COLOURS_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_Colours.h" | |||
| #ifndef __JUCE_DRAWABLEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_DrawableButton.h" | |||
| #endif | |||
| #ifndef __JUCE_COLOURGRADIENT_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_ColourGradient.h" | |||
| #ifndef __JUCE_HYPERLINKBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_HyperlinkButton.h" | |||
| #endif | |||
| #ifndef __JUCE_TYPEFACE_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_Typeface.h" | |||
| #ifndef __JUCE_IMAGEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ImageButton.h" | |||
| #endif | |||
| #ifndef __JUCE_TEXTLAYOUT_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_TextLayout.h" | |||
| #ifndef __JUCE_SHAPEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ShapeButton.h" | |||
| #endif | |||
| #ifndef __JUCE_FONT_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_Font.h" | |||
| #ifndef __JUCE_TEXTBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_TextButton.h" | |||
| #endif | |||
| #ifndef __JUCE_GLYPHARRANGEMENT_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_GlyphArrangement.h" | |||
| #ifndef __JUCE_TOGGLEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ToggleButton.h" | |||
| #endif | |||
| #ifndef __JUCE_FILLTYPE_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_FillType.h" | |||
| #ifndef __JUCE_TOOLBARBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ToolbarButton.h" | |||
| #endif | |||
| #ifndef __JUCE_JUSTIFICATION_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_Justification.h" | |||
| #ifndef __JUCE_CODEDOCUMENT_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CodeDocument.h" | |||
| #endif | |||
| #ifndef __JUCE_RECTANGLEPLACEMENT_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_RectanglePlacement.h" | |||
| #ifndef __JUCE_CODEEDITORCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CodeEditorComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_EDGETABLE_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_EdgeTable.h" | |||
| #ifndef __JUCE_CODETOKENISER_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CodeTokeniser.h" | |||
| #endif | |||
| #ifndef __JUCE_LOWLEVELGRAPHICSCONTEXT_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_LowLevelGraphicsContext.h" | |||
| #ifndef __JUCE_CPLUSPLUSCODETOKENISER_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CPlusPlusCodeTokeniser.h" | |||
| #endif | |||
| #ifndef __JUCE_GRAPHICS_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_Graphics.h" | |||
| #ifndef __JUCE_COMBOBOX_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ComboBox.h" | |||
| #endif | |||
| #ifndef __JUCE_LOWLEVELGRAPHICSSOFTWARERENDERER_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" | |||
| #ifndef __JUCE_LABEL_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_Label.h" | |||
| #endif | |||
| #ifndef __JUCE_LOWLEVELGRAPHICSPOSTSCRIPTRENDERER_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h" | |||
| #ifndef __JUCE_LISTBOX_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ListBox.h" | |||
| #endif | |||
| #ifndef __JUCE_PATH_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Path.h" | |||
| #ifndef __JUCE_PROGRESSBAR_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ProgressBar.h" | |||
| #endif | |||
| #ifndef __JUCE_BORDERSIZE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_BorderSize.h" | |||
| #ifndef __JUCE_SLIDER_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_Slider.h" | |||
| #endif | |||
| #ifndef __JUCE_LINE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Line.h" | |||
| #ifndef __JUCE_SLIDERLISTENER_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_SliderListener.h" | |||
| #endif | |||
| #ifndef __JUCE_POINT_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Point.h" | |||
| #ifndef __JUCE_TABLEHEADERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TableHeaderComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_RECTANGLE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Rectangle.h" | |||
| #ifndef __JUCE_TABLELISTBOX_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TableListBox.h" | |||
| #endif | |||
| #ifndef __JUCE_PATHSTROKETYPE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_PathStrokeType.h" | |||
| #ifndef __JUCE_TEXTEDITOR_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TextEditor.h" | |||
| #endif | |||
| #ifndef __JUCE_POSITIONEDRECTANGLE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_PositionedRectangle.h" | |||
| #ifndef __JUCE_TOOLBAR_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_Toolbar.h" | |||
| #endif | |||
| #ifndef __JUCE_RECTANGLELIST_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_RectangleList.h" | |||
| #ifndef __JUCE_TOOLBARITEMCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ToolbarItemComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_PATHITERATOR_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_PathIterator.h" | |||
| #ifndef __JUCE_TOOLBARITEMFACTORY_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ToolbarItemFactory.h" | |||
| #endif | |||
| #ifndef __JUCE_AFFINETRANSFORM_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_AffineTransform.h" | |||
| #ifndef __JUCE_TOOLBARITEMPALETTE_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ToolbarItemPalette.h" | |||
| #endif | |||
| #ifndef __JUCE_CAMERADEVICE_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_CameraDevice.h" | |||
| #ifndef __JUCE_TREEVIEW_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TreeView.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGECACHE_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_ImageCache.h" | |||
| #ifndef __JUCE_DIRECTORYCONTENTSDISPLAYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGE_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_Image.h" | |||
| #ifndef __JUCE_DIRECTORYCONTENTSLIST_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_DirectoryContentsList.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEFILEFORMAT_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_ImageFileFormat.h" | |||
| #ifndef __JUCE_FILEBROWSERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileBrowserComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGECONVOLUTIONKERNEL_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_ImageConvolutionKernel.h" | |||
| #ifndef __JUCE_FILEBROWSERLISTENER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileBrowserListener.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAWABLE_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_Drawable.h" | |||
| #ifndef __JUCE_FILECHOOSER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileChooser.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAWABLECOMPOSITE_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawableComposite.h" | |||
| #ifndef __JUCE_FILECHOOSERDIALOGBOX_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileChooserDialogBox.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAWABLEIMAGE_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawableImage.h" | |||
| #ifndef __JUCE_FILEFILTER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileFilter.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAWABLETEXT_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawableText.h" | |||
| #ifndef __JUCE_FILELISTCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileListComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAWABLEPATH_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawablePath.h" | |||
| #ifndef __JUCE_FILENAMECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FilenameComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILEPREVIEWCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FilePreviewComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILESEARCHPATHLISTCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileSearchPathListComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILETREECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileTreeComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEPREVIEWCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_ImagePreviewComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_WILDCARDFILEFILTER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_WildcardFileFilter.h" | |||
| #endif | |||
| #ifndef __JUCE_COMPONENT_JUCEHEADER__ | |||
| #include "gui/components/juce_Component.h" | |||
| @@ -389,74 +404,71 @@ | |||
| #ifndef __JUCE_DESKTOP_JUCEHEADER__ | |||
| #include "gui/components/juce_Desktop.h" | |||
| #endif | |||
| #ifndef __JUCE_ARROWBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ArrowButton.h" | |||
| #endif | |||
| #ifndef __JUCE_BUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_Button.h" | |||
| #ifndef __JUCE_KEYBOARDFOCUSTRAVERSER_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyboardFocusTraverser.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAWABLEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_DrawableButton.h" | |||
| #ifndef __JUCE_KEYLISTENER_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyListener.h" | |||
| #endif | |||
| #ifndef __JUCE_HYPERLINKBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_HyperlinkButton.h" | |||
| #ifndef __JUCE_KEYMAPPINGEDITORCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyMappingEditorComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ImageButton.h" | |||
| #ifndef __JUCE_KEYPRESS_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyPress.h" | |||
| #endif | |||
| #ifndef __JUCE_SHAPEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ShapeButton.h" | |||
| #ifndef __JUCE_KEYPRESSMAPPINGSET_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyPressMappingSet.h" | |||
| #endif | |||
| #ifndef __JUCE_TEXTBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_TextButton.h" | |||
| #ifndef __JUCE_MODIFIERKEYS_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_ModifierKeys.h" | |||
| #endif | |||
| #ifndef __JUCE_TOGGLEBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ToggleButton.h" | |||
| #ifndef __JUCE_COMPONENTANIMATOR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ComponentAnimator.h" | |||
| #endif | |||
| #ifndef __JUCE_TOOLBARBUTTON_JUCEHEADER__ | |||
| #include "gui/components/buttons/juce_ToolbarButton.h" | |||
| #ifndef __JUCE_COMPONENTBOUNDSCONSTRAINER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ComponentBoundsConstrainer.h" | |||
| #endif | |||
| #ifndef __JUCE_DROPSHADOWEFFECT_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_DropShadowEffect.h" | |||
| #ifndef __JUCE_COMPONENTMOVEMENTWATCHER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ComponentMovementWatcher.h" | |||
| #endif | |||
| #ifndef __JUCE_GLOWEFFECT_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_GlowEffect.h" | |||
| #ifndef __JUCE_GROUPCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_GroupComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEEFFECTFILTER_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_ImageEffectFilter.h" | |||
| #ifndef __JUCE_MULTIDOCUMENTPANEL_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_MultiDocumentPanel.h" | |||
| #endif | |||
| #ifndef __JUCE_REDUCEOPACITYEFFECT_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_ReduceOpacityEffect.h" | |||
| #ifndef __JUCE_RESIZABLEBORDERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ResizableBorderComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_KEYLISTENER_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyListener.h" | |||
| #ifndef __JUCE_RESIZABLECORNERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ResizableCornerComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_KEYPRESS_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyPress.h" | |||
| #ifndef __JUCE_SCROLLBAR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ScrollBar.h" | |||
| #endif | |||
| #ifndef __JUCE_KEYPRESSMAPPINGSET_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyPressMappingSet.h" | |||
| #ifndef __JUCE_STRETCHABLELAYOUTMANAGER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_StretchableLayoutManager.h" | |||
| #endif | |||
| #ifndef __JUCE_KEYBOARDFOCUSTRAVERSER_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyboardFocusTraverser.h" | |||
| #ifndef __JUCE_STRETCHABLELAYOUTRESIZERBAR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_StretchableLayoutResizerBar.h" | |||
| #endif | |||
| #ifndef __JUCE_MODIFIERKEYS_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_ModifierKeys.h" | |||
| #ifndef __JUCE_STRETCHABLEOBJECTRESIZER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_StretchableObjectResizer.h" | |||
| #endif | |||
| #ifndef __JUCE_KEYMAPPINGEDITORCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/keyboard/juce_KeyMappingEditorComponent.h" | |||
| #ifndef __JUCE_TABBEDBUTTONBAR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_TabbedButtonBar.h" | |||
| #endif | |||
| #ifndef __JUCE_CODEEDITORCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CodeEditorComponent.h" | |||
| #ifndef __JUCE_TABBEDCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_TabbedComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_CPLUSPLUSCODETOKENISER_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CPlusPlusCodeTokeniser.h" | |||
| #ifndef __JUCE_VIEWPORT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_Viewport.h" | |||
| #endif | |||
| #ifndef __JUCE_CODEDOCUMENT_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CodeDocument.h" | |||
| #ifndef __JUCE_LOOKANDFEEL_JUCEHEADER__ | |||
| #include "gui/components/lookandfeel/juce_LookAndFeel.h" | |||
| #endif | |||
| #ifndef __JUCE_CODETOKENISER_JUCEHEADER__ | |||
| #include "gui/components/code_editor/juce_CodeTokeniser.h" | |||
| #ifndef __JUCE_OLDSCHOOLLOOKANDFEEL_JUCEHEADER__ | |||
| #include "gui/components/lookandfeel/juce_OldSchoolLookAndFeel.h" | |||
| #endif | |||
| #ifndef __JUCE_MENUBARCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/menus/juce_MenuBarComponent.h" | |||
| @@ -473,6 +485,9 @@ | |||
| #ifndef __JUCE_COMPONENTDRAGGER_JUCEHEADER__ | |||
| #include "gui/components/mouse/juce_ComponentDragger.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAGANDDROPCONTAINER_JUCEHEADER__ | |||
| #include "gui/components/mouse/juce_DragAndDropContainer.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAGANDDROPTARGET_JUCEHEADER__ | |||
| #include "gui/components/mouse/juce_DragAndDropTarget.h" | |||
| #endif | |||
| @@ -497,51 +512,6 @@ | |||
| #ifndef __JUCE_TOOLTIPCLIENT_JUCEHEADER__ | |||
| #include "gui/components/mouse/juce_TooltipClient.h" | |||
| #endif | |||
| #ifndef __JUCE_DRAGANDDROPCONTAINER_JUCEHEADER__ | |||
| #include "gui/components/mouse/juce_DragAndDropContainer.h" | |||
| #endif | |||
| #ifndef __JUCE_COMBOBOX_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ComboBox.h" | |||
| #endif | |||
| #ifndef __JUCE_LABEL_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_Label.h" | |||
| #endif | |||
| #ifndef __JUCE_PROGRESSBAR_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ProgressBar.h" | |||
| #endif | |||
| #ifndef __JUCE_SLIDER_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_Slider.h" | |||
| #endif | |||
| #ifndef __JUCE_SLIDERLISTENER_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_SliderListener.h" | |||
| #endif | |||
| #ifndef __JUCE_TABLEHEADERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TableHeaderComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_TABLELISTBOX_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TableListBox.h" | |||
| #endif | |||
| #ifndef __JUCE_TOOLBAR_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_Toolbar.h" | |||
| #endif | |||
| #ifndef __JUCE_TOOLBARITEMFACTORY_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ToolbarItemFactory.h" | |||
| #endif | |||
| #ifndef __JUCE_LISTBOX_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ListBox.h" | |||
| #endif | |||
| #ifndef __JUCE_TOOLBARITEMPALETTE_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ToolbarItemPalette.h" | |||
| #endif | |||
| #ifndef __JUCE_TREEVIEW_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TreeView.h" | |||
| #endif | |||
| #ifndef __JUCE_TEXTEDITOR_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_TextEditor.h" | |||
| #endif | |||
| #ifndef __JUCE_TOOLBARITEMCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/controls/juce_ToolbarItemComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_BOOLEANPROPERTYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_BooleanPropertyComponent.h" | |||
| #endif | |||
| @@ -551,105 +521,66 @@ | |||
| #ifndef __JUCE_CHOICEPROPERTYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_ChoicePropertyComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_PROPERTYPANEL_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_PropertyPanel.h" | |||
| #endif | |||
| #ifndef __JUCE_PROPERTYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_PropertyComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_PROPERTYPANEL_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_PropertyPanel.h" | |||
| #endif | |||
| #ifndef __JUCE_SLIDERPROPERTYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_SliderPropertyComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_TEXTPROPERTYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/properties/juce_TextPropertyComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_COMPONENTANIMATOR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ComponentAnimator.h" | |||
| #endif | |||
| #ifndef __JUCE_COMPONENTBOUNDSCONSTRAINER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ComponentBoundsConstrainer.h" | |||
| #endif | |||
| #ifndef __JUCE_COMPONENTMOVEMENTWATCHER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ComponentMovementWatcher.h" | |||
| #endif | |||
| #ifndef __JUCE_GROUPCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_GroupComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_MULTIDOCUMENTPANEL_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_MultiDocumentPanel.h" | |||
| #endif | |||
| #ifndef __JUCE_RESIZABLEBORDERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ResizableBorderComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_RESIZABLECORNERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ResizableCornerComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_SCROLLBAR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_ScrollBar.h" | |||
| #endif | |||
| #ifndef __JUCE_STRETCHABLELAYOUTMANAGER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_StretchableLayoutManager.h" | |||
| #endif | |||
| #ifndef __JUCE_STRETCHABLELAYOUTRESIZERBAR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_StretchableLayoutResizerBar.h" | |||
| #endif | |||
| #ifndef __JUCE_STRETCHABLEOBJECTRESIZER_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_StretchableObjectResizer.h" | |||
| #endif | |||
| #ifndef __JUCE_TABBEDBUTTONBAR_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_TabbedButtonBar.h" | |||
| #endif | |||
| #ifndef __JUCE_TABBEDCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_TabbedComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_VIEWPORT_JUCEHEADER__ | |||
| #include "gui/components/layout/juce_Viewport.h" | |||
| #endif | |||
| #ifndef __JUCE_DIRECTORYCONTENTSDISPLAYCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h" | |||
| #ifndef __JUCE_ACTIVEXCONTROLCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_ActiveXControlComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_DIRECTORYCONTENTSLIST_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_DirectoryContentsList.h" | |||
| #ifndef __JUCE_AUDIODEVICESELECTORCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_AudioDeviceSelectorComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILEBROWSERLISTENER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileBrowserListener.h" | |||
| #ifndef __JUCE_BUBBLECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_BubbleComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILELISTCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileListComponent.h" | |||
| #ifndef __JUCE_BUBBLEMESSAGECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_BubbleMessageComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILEFILTER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileFilter.h" | |||
| #ifndef __JUCE_COLOURSELECTOR_JUCEHEADER__ | |||
| #include "gui/components/special/juce_ColourSelector.h" | |||
| #endif | |||
| #ifndef __JUCE_FILETREECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileTreeComponent.h" | |||
| #ifndef __JUCE_DROPSHADOWER_JUCEHEADER__ | |||
| #include "gui/components/special/juce_DropShadower.h" | |||
| #endif | |||
| #ifndef __JUCE_FILECHOOSERDIALOGBOX_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileChooserDialogBox.h" | |||
| #ifndef __JUCE_MAGNIFIERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_MagnifierComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILEPREVIEWCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FilePreviewComponent.h" | |||
| #ifndef __JUCE_MIDIKEYBOARDCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_MidiKeyboardComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILENAMECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FilenameComponent.h" | |||
| #ifndef __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_NSViewComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILESEARCHPATHLISTCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileSearchPathListComponent.h" | |||
| #ifndef __JUCE_OPENGLCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_OpenGLComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_WILDCARDFILEFILTER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_WildcardFileFilter.h" | |||
| #ifndef __JUCE_PREFERENCESPANEL_JUCEHEADER__ | |||
| #include "gui/components/special/juce_PreferencesPanel.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEPREVIEWCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_ImagePreviewComponent.h" | |||
| #ifndef __JUCE_QUICKTIMEMOVIECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_QuickTimeMovieComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILEBROWSERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileBrowserComponent.h" | |||
| #ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_SystemTrayIconComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_FILECHOOSER_JUCEHEADER__ | |||
| #include "gui/components/filebrowser/juce_FileChooser.h" | |||
| #ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_WebBrowserComponent.h" | |||
| #endif | |||
| #ifndef __JUCE_ALERTWINDOW_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_AlertWindow.h" | |||
| #endif | |||
| #ifndef __JUCE_COMPONENTPEER_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_ComponentPeer.h" | |||
| #endif | |||
| #ifndef __JUCE_DIALOGWINDOW_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_DialogWindow.h" | |||
| #endif | |||
| @@ -662,65 +593,134 @@ | |||
| #ifndef __JUCE_SPLASHSCREEN_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_SplashScreen.h" | |||
| #endif | |||
| #ifndef __JUCE_THREADWITHPROGRESSWINDOW_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_ThreadWithProgressWindow.h" | |||
| #endif | |||
| #ifndef __JUCE_TOOLTIPWINDOW_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_TooltipWindow.h" | |||
| #endif | |||
| #ifndef __JUCE_TOPLEVELWINDOW_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_TopLevelWindow.h" | |||
| #endif | |||
| #ifndef __JUCE_THREADWITHPROGRESSWINDOW_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_ThreadWithProgressWindow.h" | |||
| #ifndef __JUCE_COLOUR_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_Colour.h" | |||
| #endif | |||
| #ifndef __JUCE_COMPONENTPEER_JUCEHEADER__ | |||
| #include "gui/components/windows/juce_ComponentPeer.h" | |||
| #ifndef __JUCE_COLOURGRADIENT_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_ColourGradient.h" | |||
| #endif | |||
| #ifndef __JUCE_ACTIVEXCONTROLCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_ActiveXControlComponent.h" | |||
| #ifndef __JUCE_COLOURS_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_Colours.h" | |||
| #endif | |||
| #ifndef __JUCE_AUDIODEVICESELECTORCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_AudioDeviceSelectorComponent.h" | |||
| #ifndef __JUCE_PIXELFORMATS_JUCEHEADER__ | |||
| #include "gui/graphics/colour/juce_PixelFormats.h" | |||
| #endif | |||
| #ifndef __JUCE_BUBBLECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_BubbleComponent.h" | |||
| #ifndef __JUCE_EDGETABLE_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_EdgeTable.h" | |||
| #endif | |||
| #ifndef __JUCE_BUBBLEMESSAGECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_BubbleMessageComponent.h" | |||
| #ifndef __JUCE_FILLTYPE_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_FillType.h" | |||
| #endif | |||
| #ifndef __JUCE_COLOURSELECTOR_JUCEHEADER__ | |||
| #include "gui/components/special/juce_ColourSelector.h" | |||
| #ifndef __JUCE_GRAPHICS_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_Graphics.h" | |||
| #endif | |||
| #ifndef __JUCE_DROPSHADOWER_JUCEHEADER__ | |||
| #include "gui/components/special/juce_DropShadower.h" | |||
| #ifndef __JUCE_JUSTIFICATION_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_Justification.h" | |||
| #endif | |||
| #ifndef __JUCE_MAGNIFIERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_MagnifierComponent.h" | |||
| #ifndef __JUCE_LOWLEVELGRAPHICSCONTEXT_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_LowLevelGraphicsContext.h" | |||
| #endif | |||
| #ifndef __JUCE_MIDIKEYBOARDCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_MidiKeyboardComponent.h" | |||
| #ifndef __JUCE_LOWLEVELGRAPHICSPOSTSCRIPTRENDERER_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h" | |||
| #endif | |||
| #ifndef __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_NSViewComponent.h" | |||
| #ifndef __JUCE_LOWLEVELGRAPHICSSOFTWARERENDERER_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" | |||
| #endif | |||
| #ifndef __JUCE_OPENGLCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_OpenGLComponent.h" | |||
| #ifndef __JUCE_RECTANGLEPLACEMENT_JUCEHEADER__ | |||
| #include "gui/graphics/contexts/juce_RectanglePlacement.h" | |||
| #endif | |||
| #ifndef __JUCE_PREFERENCESPANEL_JUCEHEADER__ | |||
| #include "gui/components/special/juce_PreferencesPanel.h" | |||
| #ifndef __JUCE_DRAWABLE_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_Drawable.h" | |||
| #endif | |||
| #ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_WebBrowserComponent.h" | |||
| #ifndef __JUCE_DRAWABLECOMPOSITE_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawableComposite.h" | |||
| #endif | |||
| #ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_SystemTrayIconComponent.h" | |||
| #ifndef __JUCE_DRAWABLEIMAGE_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawableImage.h" | |||
| #endif | |||
| #ifndef __JUCE_QUICKTIMEMOVIECOMPONENT_JUCEHEADER__ | |||
| #include "gui/components/special/juce_QuickTimeMovieComponent.h" | |||
| #ifndef __JUCE_DRAWABLEPATH_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawablePath.h" | |||
| #endif | |||
| #ifndef __JUCE_LOOKANDFEEL_JUCEHEADER__ | |||
| #include "gui/components/lookandfeel/juce_LookAndFeel.h" | |||
| #ifndef __JUCE_DRAWABLETEXT_JUCEHEADER__ | |||
| #include "gui/graphics/drawables/juce_DrawableText.h" | |||
| #endif | |||
| #ifndef __JUCE_OLDSCHOOLLOOKANDFEEL_JUCEHEADER__ | |||
| #include "gui/components/lookandfeel/juce_OldSchoolLookAndFeel.h" | |||
| #ifndef __JUCE_DROPSHADOWEFFECT_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_DropShadowEffect.h" | |||
| #endif | |||
| #ifndef __JUCE_GLOWEFFECT_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_GlowEffect.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEEFFECTFILTER_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_ImageEffectFilter.h" | |||
| #endif | |||
| #ifndef __JUCE_REDUCEOPACITYEFFECT_JUCEHEADER__ | |||
| #include "gui/graphics/effects/juce_ReduceOpacityEffect.h" | |||
| #endif | |||
| #ifndef __JUCE_FONT_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_Font.h" | |||
| #endif | |||
| #ifndef __JUCE_GLYPHARRANGEMENT_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_GlyphArrangement.h" | |||
| #endif | |||
| #ifndef __JUCE_TEXTLAYOUT_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_TextLayout.h" | |||
| #endif | |||
| #ifndef __JUCE_TYPEFACE_JUCEHEADER__ | |||
| #include "gui/graphics/fonts/juce_Typeface.h" | |||
| #endif | |||
| #ifndef __JUCE_AFFINETRANSFORM_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_AffineTransform.h" | |||
| #endif | |||
| #ifndef __JUCE_BORDERSIZE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_BorderSize.h" | |||
| #endif | |||
| #ifndef __JUCE_LINE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Line.h" | |||
| #endif | |||
| #ifndef __JUCE_PATH_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Path.h" | |||
| #endif | |||
| #ifndef __JUCE_PATHITERATOR_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_PathIterator.h" | |||
| #endif | |||
| #ifndef __JUCE_PATHSTROKETYPE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_PathStrokeType.h" | |||
| #endif | |||
| #ifndef __JUCE_POINT_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Point.h" | |||
| #endif | |||
| #ifndef __JUCE_POSITIONEDRECTANGLE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_PositionedRectangle.h" | |||
| #endif | |||
| #ifndef __JUCE_RECTANGLE_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_Rectangle.h" | |||
| #endif | |||
| #ifndef __JUCE_RECTANGLELIST_JUCEHEADER__ | |||
| #include "gui/graphics/geometry/juce_RectangleList.h" | |||
| #endif | |||
| #ifndef __JUCE_CAMERADEVICE_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_CameraDevice.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGE_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_Image.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGECACHE_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_ImageCache.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGECONVOLUTIONKERNEL_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_ImageConvolutionKernel.h" | |||
| #endif | |||
| #ifndef __JUCE_IMAGEFILEFORMAT_JUCEHEADER__ | |||
| #include "gui/graphics/imaging/juce_ImageFileFormat.h" | |||
| #endif | |||
| #ifndef __JUCE_DELETEDATSHUTDOWN_JUCEHEADER__ | |||
| #include "utilities/juce_DeletedAtShutdown.h" | |||
| @@ -26,6 +26,51 @@ | |||
| #ifndef __JUCE_JUCE_CORE_INCLUDES_INCLUDEFILES__ | |||
| #define __JUCE_JUCE_CORE_INCLUDES_INCLUDEFILES__ | |||
| #ifndef __JUCE_ARRAY_JUCEHEADER__ | |||
| #include "containers/juce_Array.h" | |||
| #endif | |||
| #ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ | |||
| #include "containers/juce_ArrayAllocationBase.h" | |||
| #endif | |||
| #ifndef __JUCE_BITARRAY_JUCEHEADER__ | |||
| #include "containers/juce_BitArray.h" | |||
| #endif | |||
| #ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ | |||
| #include "containers/juce_ElementComparator.h" | |||
| #endif | |||
| #ifndef __JUCE_HEAPBLOCK_JUCEHEADER__ | |||
| #include "containers/juce_HeapBlock.h" | |||
| #endif | |||
| #ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ | |||
| #include "containers/juce_MemoryBlock.h" | |||
| #endif | |||
| #ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ | |||
| #include "containers/juce_OwnedArray.h" | |||
| #endif | |||
| #ifndef __JUCE_PROPERTYSET_JUCEHEADER__ | |||
| #include "containers/juce_PropertySet.h" | |||
| #endif | |||
| #ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ | |||
| #include "containers/juce_ReferenceCountedArray.h" | |||
| #endif | |||
| #ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ | |||
| #include "containers/juce_ReferenceCountedObject.h" | |||
| #endif | |||
| #ifndef __JUCE_SORTEDSET_JUCEHEADER__ | |||
| #include "containers/juce_SortedSet.h" | |||
| #endif | |||
| #ifndef __JUCE_SPARSESET_JUCEHEADER__ | |||
| #include "containers/juce_SparseSet.h" | |||
| #endif | |||
| #ifndef __JUCE_VALUETREE_JUCEHEADER__ | |||
| #include "containers/juce_ValueTree.h" | |||
| #endif | |||
| #ifndef __JUCE_VARIANT_JUCEHEADER__ | |||
| #include "containers/juce_Variant.h" | |||
| #endif | |||
| #ifndef __JUCE_VOIDARRAY_JUCEHEADER__ | |||
| #include "containers/juce_VoidArray.h" | |||
| #endif | |||
| #ifndef __JUCE_ATOMIC_JUCEHEADER__ | |||
| #include "core/juce_Atomic.h" | |||
| #endif | |||
| @@ -41,8 +86,8 @@ | |||
| #ifndef __JUCE_LOGGER_JUCEHEADER__ | |||
| #include "core/juce_Logger.h" | |||
| #endif | |||
| #ifndef __JUCE_PLATFORMUTILITIES_JUCEHEADER__ | |||
| #include "core/juce_PlatformUtilities.h" | |||
| #ifndef __JUCE_MATHSFUNCTIONS_JUCEHEADER__ | |||
| #include "core/juce_MathsFunctions.h" | |||
| #endif | |||
| #ifndef __JUCE_MEMORY_JUCEHEADER__ | |||
| #include "core/juce_Memory.h" | |||
| @@ -53,8 +98,8 @@ | |||
| #ifndef __JUCE_PLATFORMDEFS_JUCEHEADER__ | |||
| #include "core/juce_PlatformDefs.h" | |||
| #endif | |||
| #ifndef __JUCE_SINGLETON_JUCEHEADER__ | |||
| #include "core/juce_Singleton.h" | |||
| #ifndef __JUCE_PLATFORMUTILITIES_JUCEHEADER__ | |||
| #include "core/juce_PlatformUtilities.h" | |||
| #endif | |||
| #ifndef __JUCE_RANDOM_JUCEHEADER__ | |||
| #include "core/juce_Random.h" | |||
| @@ -62,65 +107,35 @@ | |||
| #ifndef __JUCE_RELATIVETIME_JUCEHEADER__ | |||
| #include "core/juce_RelativeTime.h" | |||
| #endif | |||
| #ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ | |||
| #include "core/juce_SystemStats.h" | |||
| #endif | |||
| #ifndef __JUCE_TIME_JUCEHEADER__ | |||
| #include "core/juce_Time.h" | |||
| #endif | |||
| #ifndef __JUCE_UUID_JUCEHEADER__ | |||
| #include "core/juce_Uuid.h" | |||
| #ifndef __JUCE_SINGLETON_JUCEHEADER__ | |||
| #include "core/juce_Singleton.h" | |||
| #endif | |||
| #ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ | |||
| #include "core/juce_StandardHeader.h" | |||
| #endif | |||
| #ifndef __JUCE_MATHSFUNCTIONS_JUCEHEADER__ | |||
| #include "core/juce_MathsFunctions.h" | |||
| #ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ | |||
| #include "core/juce_SystemStats.h" | |||
| #endif | |||
| #ifndef __JUCE_TARGETPLATFORM_JUCEHEADER__ | |||
| #include "core/juce_TargetPlatform.h" | |||
| #endif | |||
| #ifndef __JUCE_ARRAY_JUCEHEADER__ | |||
| #include "containers/juce_Array.h" | |||
| #endif | |||
| #ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ | |||
| #include "containers/juce_ArrayAllocationBase.h" | |||
| #endif | |||
| #ifndef __JUCE_VARIANT_JUCEHEADER__ | |||
| #include "containers/juce_Variant.h" | |||
| #endif | |||
| #ifndef __JUCE_BITARRAY_JUCEHEADER__ | |||
| #include "containers/juce_BitArray.h" | |||
| #endif | |||
| #ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ | |||
| #include "containers/juce_ElementComparator.h" | |||
| #endif | |||
| #ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ | |||
| #include "containers/juce_MemoryBlock.h" | |||
| #endif | |||
| #ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ | |||
| #include "containers/juce_OwnedArray.h" | |||
| #endif | |||
| #ifndef __JUCE_PROPERTYSET_JUCEHEADER__ | |||
| #include "containers/juce_PropertySet.h" | |||
| #endif | |||
| #ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ | |||
| #include "containers/juce_ReferenceCountedArray.h" | |||
| #ifndef __JUCE_TIME_JUCEHEADER__ | |||
| #include "core/juce_Time.h" | |||
| #endif | |||
| #ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ | |||
| #include "containers/juce_ReferenceCountedObject.h" | |||
| #ifndef __JUCE_UUID_JUCEHEADER__ | |||
| #include "core/juce_Uuid.h" | |||
| #endif | |||
| #ifndef __JUCE_SORTEDSET_JUCEHEADER__ | |||
| #include "containers/juce_SortedSet.h" | |||
| #ifndef __JUCE_BLOWFISH_JUCEHEADER__ | |||
| #include "cryptography/juce_BlowFish.h" | |||
| #endif | |||
| #ifndef __JUCE_SPARSESET_JUCEHEADER__ | |||
| #include "containers/juce_SparseSet.h" | |||
| #ifndef __JUCE_MD5_JUCEHEADER__ | |||
| #include "cryptography/juce_MD5.h" | |||
| #endif | |||
| #ifndef __JUCE_VOIDARRAY_JUCEHEADER__ | |||
| #include "containers/juce_VoidArray.h" | |||
| #ifndef __JUCE_PRIMES_JUCEHEADER__ | |||
| #include "cryptography/juce_Primes.h" | |||
| #endif | |||
| #ifndef __JUCE_VALUETREE_JUCEHEADER__ | |||
| #include "containers/juce_ValueTree.h" | |||
| #ifndef __JUCE_RSAKEY_JUCEHEADER__ | |||
| #include "cryptography/juce_RSAKey.h" | |||
| #endif | |||
| #ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ | |||
| #include "io/files/juce_DirectoryIterator.h" | |||
| @@ -143,18 +158,6 @@ | |||
| #ifndef __JUCE_ZIPFILE_JUCEHEADER__ | |||
| #include "io/files/juce_ZipFile.h" | |||
| #endif | |||
| #ifndef __JUCE_BLOWFISH_JUCEHEADER__ | |||
| #include "cryptography/juce_BlowFish.h" | |||
| #endif | |||
| #ifndef __JUCE_MD5_JUCEHEADER__ | |||
| #include "cryptography/juce_MD5.h" | |||
| #endif | |||
| #ifndef __JUCE_PRIMES_JUCEHEADER__ | |||
| #include "cryptography/juce_Primes.h" | |||
| #endif | |||
| #ifndef __JUCE_RSAKEY_JUCEHEADER__ | |||
| #include "cryptography/juce_RSAKey.h" | |||
| #endif | |||
| #ifndef __JUCE_SOCKET_JUCEHEADER__ | |||
| #include "io/network/juce_Socket.h" | |||
| #endif | |||
| @@ -191,15 +194,15 @@ | |||
| #ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ | |||
| #include "io/streams/juce_SubregionStream.h" | |||
| #endif | |||
| #ifndef __JUCE_CHARACTERFUNCTIONS_JUCEHEADER__ | |||
| #include "text/juce_CharacterFunctions.h" | |||
| #endif | |||
| #ifndef __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ | |||
| #include "text/juce_LocalisedStrings.h" | |||
| #endif | |||
| #ifndef __JUCE_STRING_JUCEHEADER__ | |||
| #include "text/juce_String.h" | |||
| #endif | |||
| #ifndef __JUCE_CHARACTERFUNCTIONS_JUCEHEADER__ | |||
| #include "text/juce_CharacterFunctions.h" | |||
| #endif | |||
| #ifndef __JUCE_STRINGARRAY_JUCEHEADER__ | |||
| #include "text/juce_StringArray.h" | |||
| #endif | |||
| @@ -127,8 +127,6 @@ public: | |||
| outputId (outputId_), | |||
| isOpen_ (false), | |||
| callback (0), | |||
| inChans (0), | |||
| outChans (0), | |||
| totalNumberOfInputChannels (0), | |||
| totalNumberOfOutputChannels (0) | |||
| { | |||
| @@ -167,8 +165,8 @@ public: | |||
| JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0)); | |||
| } | |||
| inChans = (float**) juce_calloc (sizeof (float*) * (totalNumberOfInputChannels + 2)); | |||
| outChans = (float**) juce_calloc (sizeof (float*) * (totalNumberOfOutputChannels + 2)); | |||
| inChans.calloc (totalNumberOfInputChannels + 2); | |||
| outChans.calloc (totalNumberOfOutputChannels + 2); | |||
| } | |||
| } | |||
| @@ -180,9 +178,6 @@ public: | |||
| JUCE_NAMESPACE::jack_client_close (client); | |||
| client = 0; | |||
| } | |||
| juce_free (inChans); | |||
| juce_free (outChans); | |||
| } | |||
| const StringArray getChannelNames (bool forInput) const | |||
| @@ -447,8 +442,7 @@ private: | |||
| AudioIODeviceCallback* callback; | |||
| CriticalSection callbackLock; | |||
| float** inChans; | |||
| float** outChans; | |||
| HeapBlock <float*> inChans, outChans; | |||
| int totalNumberOfInputChannels; | |||
| int totalNumberOfOutputChannels; | |||
| VoidArray inputPorts, outputPorts; | |||
| @@ -301,7 +301,7 @@ public: | |||
| if (snd_midi_event_new (maxEventSize, &midiParser) >= 0) | |||
| { | |||
| uint8* const buffer = (uint8*) juce_malloc (maxEventSize); | |||
| HeapBlock <uint8> buffer (maxEventSize); | |||
| const int numPfds = snd_seq_poll_descriptors_count (seqHandle, POLLIN); | |||
| struct pollfd* const pfd = (struct pollfd*) alloca (numPfds * sizeof (struct pollfd)); | |||
| @@ -345,7 +345,6 @@ public: | |||
| } | |||
| snd_midi_event_free (midiParser); | |||
| juce_free (buffer); | |||
| } | |||
| }; | |||
| @@ -392,7 +392,7 @@ static Pixmap juce_createColourPixmapFromImage (Display* display, const Image& i | |||
| { | |||
| const int width = image.getWidth(); | |||
| const int height = image.getHeight(); | |||
| uint32* const colour = (uint32*) juce_malloc (width * height * sizeof (uint32)); | |||
| HeapBlock <uint32> colour (width * height); | |||
| int index = 0; | |||
| for (int y = 0; y < height; ++y) | |||
| @@ -408,7 +408,6 @@ static Pixmap juce_createColourPixmapFromImage (Display* display, const Image& i | |||
| GC gc = XCreateGC (display, pixmap, 0, 0); | |||
| XPutImage (display, pixmap, gc, ximage, 0, 0, 0, 0, width, height); | |||
| XFreeGC (display, gc); | |||
| juce_free (colour); | |||
| return pixmap; | |||
| } | |||
| @@ -418,7 +417,8 @@ static Pixmap juce_createMaskPixmapFromImage (Display* display, const Image& ima | |||
| const int width = image.getWidth(); | |||
| const int height = image.getHeight(); | |||
| const int stride = (width + 7) >> 3; | |||
| uint8* const mask = (uint8*) juce_calloc (stride * height); | |||
| HeapBlock <uint8> mask; | |||
| mask.calloc (stride * height); | |||
| const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); | |||
| for (int y = 0; y < height; ++y) | |||
| @@ -433,12 +433,8 @@ static Pixmap juce_createMaskPixmapFromImage (Display* display, const Image& ima | |||
| } | |||
| } | |||
| Pixmap pixmap = XCreatePixmapFromBitmapData (display, DefaultRootWindow (display), | |||
| (char*) mask, width, height, 1, 0, 1); | |||
| juce_free (mask); | |||
| return pixmap; | |||
| return XCreatePixmapFromBitmapData (display, DefaultRootWindow (display), | |||
| (char*) mask, width, height, 1, 0, 1); | |||
| } | |||
| @@ -506,7 +502,8 @@ public: | |||
| if (! usingXShm) | |||
| #endif | |||
| { | |||
| imageData = (uint8*) juce_malloc (lineStride * h); | |||
| imageDataAllocated.malloc (lineStride * h); | |||
| imageData = imageDataAllocated; | |||
| if (format_ == ARGB && clearImage) | |||
| zeromem (imageData, h * lineStride); | |||
| @@ -534,7 +531,8 @@ public: | |||
| const int pixelStride = 2; | |||
| const int lineStride = ((w * pixelStride + 3) & ~3); | |||
| xImage->data = (char*) juce_malloc (lineStride * h); | |||
| imageData16Bit.malloc (lineStride * h); | |||
| xImage->data = imageData16Bit; | |||
| xImage->bitmap_pad = 16; | |||
| xImage->depth = pixelStride * 8; | |||
| xImage->bytes_per_line = lineStride; | |||
| @@ -567,13 +565,9 @@ public: | |||
| else | |||
| #endif | |||
| { | |||
| juce_free (xImage->data); | |||
| xImage->data = 0; | |||
| XDestroyImage (xImage); | |||
| } | |||
| if (! is16Bit) | |||
| imageData = 0; // to stop the base class freeing this (for the 16-bit version we want it to free it) | |||
| } | |||
| void blitToWindow (Window window, int dx, int dy, int dw, int dh, int sx, int sy) | |||
| @@ -629,6 +623,7 @@ public: | |||
| private: | |||
| XImage* xImage; | |||
| const bool is16Bit; | |||
| HeapBlock <char> imageData16Bit; | |||
| #if JUCE_USE_XSHM | |||
| XShmSegmentInfo segmentInfo; | |||
| @@ -1094,7 +1089,7 @@ public: | |||
| void setIcon (const Image& newIcon) | |||
| { | |||
| const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2; | |||
| unsigned long* const data = (unsigned long*) juce_malloc (dataSize * sizeof (uint32)); | |||
| HeapBlock <unsigned long> data (dataSize); | |||
| int index = 0; | |||
| data[index++] = newIcon.getWidth(); | |||
| @@ -1109,8 +1104,6 @@ public: | |||
| XA_CARDINAL, 32, PropModeReplace, | |||
| (unsigned char*) data, dataSize); | |||
| juce_free (data); | |||
| deleteIconPixmaps(); | |||
| XWMHints* wmHints = XGetWMHints (display, windowH); | |||
| @@ -2739,8 +2732,9 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot | |||
| } | |||
| const int stride = (cursorW + 7) >> 3; | |||
| uint8* const maskPlane = (uint8*) juce_calloc (stride * cursorH); | |||
| uint8* const sourcePlane = (uint8*) juce_calloc (stride * cursorH); | |||
| HeapBlock <uint8> maskPlane, sourcePlane; | |||
| maskPlane.calloc (stride * cursorH); | |||
| sourcePlane.calloc (stride * cursorH); | |||
| const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); | |||
| @@ -2764,9 +2758,6 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot | |||
| Pixmap sourcePixmap = XCreatePixmapFromBitmapData (display, root, (char*) sourcePlane, cursorW, cursorH, 0xffff, 0, 1); | |||
| Pixmap maskPixmap = XCreatePixmapFromBitmapData (display, root, (char*) maskPlane, cursorW, cursorH, 0xffff, 0, 1); | |||
| juce_free (maskPlane); | |||
| juce_free (sourcePlane); | |||
| XColor white, black; | |||
| black.red = black.green = black.blue = 0; | |||
| white.red = white.green = white.blue = 0xffff; | |||
| @@ -77,16 +77,11 @@ public: | |||
| started (false), | |||
| sampleRate (0), | |||
| bufferSize (512), | |||
| audioBuffer (0), | |||
| numInputChans (0), | |||
| numOutputChans (0), | |||
| callbacksAllowed (true), | |||
| numInputChannelInfos (0), | |||
| numOutputChannelInfos (0), | |||
| tempInputBuffers (0), | |||
| tempOutputBuffers (0), | |||
| inputChannelInfo (0), | |||
| outputChannelInfo (0) | |||
| numOutputChannelInfos (0) | |||
| { | |||
| jassert (deviceID != 0); | |||
| @@ -111,24 +106,15 @@ public: | |||
| stop (false); | |||
| delete inputDevice; | |||
| juce_free (audioBuffer); | |||
| juce_free (tempInputBuffers); | |||
| juce_free (tempOutputBuffers); | |||
| juce_free (inputChannelInfo); | |||
| juce_free (outputChannelInfo); | |||
| } | |||
| void allocateTempBuffers() | |||
| { | |||
| const int tempBufSize = bufferSize + 4; | |||
| juce_free (audioBuffer); | |||
| audioBuffer = (float*) juce_calloc ((numInputChans + numOutputChans) * tempBufSize * sizeof (float)); | |||
| audioBuffer.calloc ((numInputChans + numOutputChans) * tempBufSize); | |||
| juce_free (tempInputBuffers); | |||
| tempInputBuffers = (float**) juce_calloc (sizeof (float*) * (numInputChans + 2)); | |||
| juce_free (tempOutputBuffers); | |||
| tempOutputBuffers = (float**) juce_calloc (sizeof (float*) * (numOutputChans + 2)); | |||
| tempInputBuffers.calloc (numInputChans + 2); | |||
| tempOutputBuffers.calloc (numOutputChans + 2); | |||
| int i, count = 0; | |||
| for (i = 0; i < numInputChans; ++i) | |||
| @@ -151,7 +137,8 @@ public: | |||
| if (OK (AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size))) | |||
| { | |||
| AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); | |||
| HeapBlock <AudioBufferList> bufList; | |||
| bufList.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, bufList))) | |||
| { | |||
| @@ -211,8 +198,6 @@ public: | |||
| } | |||
| } | |||
| } | |||
| juce_free (bufList); | |||
| } | |||
| } | |||
| @@ -252,7 +237,8 @@ public: | |||
| if (OK (AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size))) | |||
| { | |||
| AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); | |||
| HeapBlock <AudioValueRange> ranges; | |||
| ranges.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, ranges))) | |||
| { | |||
| @@ -273,8 +259,6 @@ public: | |||
| if (bufferSize > 0) | |||
| bufferSizes.addIfNotAlreadyThere (bufferSize); | |||
| } | |||
| juce_free (ranges); | |||
| } | |||
| if (bufferSizes.size() == 0 && bufferSize > 0) | |||
| @@ -288,7 +272,8 @@ public: | |||
| if (OK (AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size))) | |||
| { | |||
| AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); | |||
| HeapBlock <AudioValueRange> ranges; | |||
| ranges.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, ranges))) | |||
| { | |||
| @@ -307,8 +292,6 @@ public: | |||
| } | |||
| } | |||
| } | |||
| juce_free (ranges); | |||
| } | |||
| if (sampleRates.size() == 0 && sampleRate > 0) | |||
| @@ -340,12 +323,10 @@ public: | |||
| inChanNames.clear(); | |||
| outChanNames.clear(); | |||
| juce_free (inputChannelInfo); | |||
| inputChannelInfo = (CallbackDetailsForChannel*) juce_calloc (sizeof (CallbackDetailsForChannel) * (numInputChans + 2)); | |||
| inputChannelInfo.calloc (numInputChans + 2); | |||
| numInputChannelInfos = 0; | |||
| juce_free (outputChannelInfo); | |||
| outputChannelInfo = (CallbackDetailsForChannel*) juce_calloc (sizeof (CallbackDetailsForChannel) * (numOutputChans + 2)); | |||
| outputChannelInfo.calloc (numOutputChans + 2); | |||
| numOutputChannelInfos = 0; | |||
| fillInChannelInfo (true); | |||
| @@ -356,36 +337,31 @@ public: | |||
| const StringArray getSources (bool input) | |||
| { | |||
| StringArray s; | |||
| int num = 0; | |||
| OSType* types = getAllDataSourcesForDevice (deviceID, input, num); | |||
| HeapBlock <OSType> types; | |||
| const int num = getAllDataSourcesForDevice (deviceID, input, types); | |||
| if (types != 0) | |||
| for (int i = 0; i < num; ++i) | |||
| { | |||
| for (int i = 0; i < num; ++i) | |||
| { | |||
| AudioValueTranslation avt; | |||
| char buffer[256]; | |||
| AudioValueTranslation avt; | |||
| char buffer[256]; | |||
| avt.mInputData = (void*) &(types[i]); | |||
| avt.mInputDataSize = sizeof (UInt32); | |||
| avt.mOutputData = buffer; | |||
| avt.mOutputDataSize = 256; | |||
| avt.mInputData = (void*) &(types[i]); | |||
| avt.mInputDataSize = sizeof (UInt32); | |||
| avt.mOutputData = buffer; | |||
| avt.mOutputDataSize = 256; | |||
| UInt32 transSize = sizeof (avt); | |||
| UInt32 transSize = sizeof (avt); | |||
| AudioObjectPropertyAddress pa; | |||
| pa.mSelector = kAudioDevicePropertyDataSourceNameForID; | |||
| pa.mScope = input ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput; | |||
| pa.mElement = kAudioObjectPropertyElementMaster; | |||
| AudioObjectPropertyAddress pa; | |||
| pa.mSelector = kAudioDevicePropertyDataSourceNameForID; | |||
| pa.mScope = input ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput; | |||
| pa.mElement = kAudioObjectPropertyElementMaster; | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &transSize, &avt))) | |||
| { | |||
| DBG (buffer); | |||
| s.add (buffer); | |||
| } | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &transSize, &avt))) | |||
| { | |||
| DBG (buffer); | |||
| s.add (buffer); | |||
| } | |||
| juce_free (types); | |||
| } | |||
| return s; | |||
| @@ -406,21 +382,16 @@ public: | |||
| { | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, ¤tSourceID))) | |||
| { | |||
| int num = 0; | |||
| OSType* const types = getAllDataSourcesForDevice (deviceID, input, num); | |||
| HeapBlock <OSType> types; | |||
| const int num = getAllDataSourcesForDevice (deviceID, input, types); | |||
| if (types != 0) | |||
| for (int i = 0; i < num; ++i) | |||
| { | |||
| for (int i = 0; i < num; ++i) | |||
| if (types[num] == currentSourceID) | |||
| { | |||
| if (types[num] == currentSourceID) | |||
| { | |||
| result = i; | |||
| break; | |||
| } | |||
| result = i; | |||
| break; | |||
| } | |||
| juce_free (types); | |||
| } | |||
| } | |||
| } | |||
| @@ -432,24 +403,19 @@ public: | |||
| { | |||
| if (deviceID != 0) | |||
| { | |||
| int num = 0; | |||
| OSType* types = getAllDataSourcesForDevice (deviceID, input, num); | |||
| HeapBlock <OSType> types; | |||
| const int num = getAllDataSourcesForDevice (deviceID, input, types); | |||
| if (types != 0) | |||
| if (((unsigned int) index) < (unsigned int) num) | |||
| { | |||
| if (((unsigned int) index) < (unsigned int) num) | |||
| { | |||
| AudioObjectPropertyAddress pa; | |||
| pa.mSelector = kAudioDevicePropertyDataSource; | |||
| pa.mScope = input ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput; | |||
| pa.mElement = kAudioObjectPropertyElementMaster; | |||
| OSType typeId = types[index]; | |||
| AudioObjectPropertyAddress pa; | |||
| pa.mSelector = kAudioDevicePropertyDataSource; | |||
| pa.mScope = input ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput; | |||
| pa.mElement = kAudioObjectPropertyElementMaster; | |||
| OK (AudioObjectSetPropertyData (deviceID, &pa, 0, 0, sizeof (typeId), &typeId)); | |||
| } | |||
| OSType typeId = types[index]; | |||
| juce_free (types); | |||
| OK (AudioObjectSetPropertyData (deviceID, &pa, 0, 0, sizeof (typeId), &typeId)); | |||
| } | |||
| } | |||
| } | |||
| @@ -764,7 +730,8 @@ public: | |||
| && AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size) == noErr | |||
| && size > 0) | |||
| { | |||
| AudioDeviceID* devs = (AudioDeviceID*) juce_calloc (size); | |||
| HeapBlock <AudioDeviceID> devs; | |||
| devs.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, devs))) | |||
| { | |||
| @@ -786,8 +753,6 @@ public: | |||
| } | |||
| } | |||
| } | |||
| juce_free (devs); | |||
| } | |||
| return result; | |||
| @@ -815,7 +780,7 @@ private: | |||
| bool started; | |||
| double sampleRate; | |||
| int bufferSize; | |||
| float* audioBuffer; | |||
| HeapBlock <float> audioBuffer; | |||
| int numInputChans, numOutputChans; | |||
| bool callbacksAllowed; | |||
| @@ -827,10 +792,8 @@ private: | |||
| }; | |||
| int numInputChannelInfos, numOutputChannelInfos; | |||
| CallbackDetailsForChannel* inputChannelInfo; | |||
| CallbackDetailsForChannel* outputChannelInfo; | |||
| float** tempInputBuffers; | |||
| float** tempOutputBuffers; | |||
| HeapBlock <CallbackDetailsForChannel> inputChannelInfo, outputChannelInfo; | |||
| HeapBlock <float*> tempInputBuffers, tempOutputBuffers; | |||
| CoreAudioInternal (const CoreAudioInternal&); | |||
| const CoreAudioInternal& operator= (const CoreAudioInternal&); | |||
| @@ -875,34 +838,24 @@ private: | |||
| } | |||
| //============================================================================== | |||
| static OSType* getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, int& num) | |||
| static int getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, HeapBlock <OSType>& types) | |||
| { | |||
| OSType* types = 0; | |||
| UInt32 size = 0; | |||
| num = 0; | |||
| AudioObjectPropertyAddress pa; | |||
| pa.mSelector = kAudioDevicePropertyDataSources; | |||
| pa.mScope = kAudioObjectPropertyScopeWildcard; | |||
| pa.mElement = kAudioObjectPropertyElementMaster; | |||
| UInt32 size = 0; | |||
| if (deviceID != 0 | |||
| && OK (AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size))) | |||
| { | |||
| types = (OSType*) juce_calloc (size); | |||
| types.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, types))) | |||
| { | |||
| num = size / sizeof (OSType); | |||
| } | |||
| else | |||
| { | |||
| juce_free (types); | |||
| types = 0; | |||
| } | |||
| return size / sizeof (OSType); | |||
| } | |||
| return types; | |||
| return 0; | |||
| } | |||
| }; | |||
| @@ -1193,7 +1146,8 @@ public: | |||
| if (OK (AudioObjectGetPropertyDataSize (kAudioObjectSystemObject, &pa, 0, 0, &size))) | |||
| { | |||
| AudioDeviceID* const devs = (AudioDeviceID*) juce_calloc (size); | |||
| HeapBlock <AudioDeviceID> devs; | |||
| devs.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (kAudioObjectSystemObject, &pa, 0, 0, &size, devs))) | |||
| { | |||
| @@ -1231,8 +1185,6 @@ public: | |||
| alreadyLogged = true; | |||
| } | |||
| juce_free (devs); | |||
| } | |||
| inputDeviceNames.appendNumbersToDuplicates (false, true); | |||
| @@ -1340,7 +1292,8 @@ private: | |||
| if (OK (AudioObjectGetPropertyDataSize (deviceID, &pa, 0, 0, &size))) | |||
| { | |||
| AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); | |||
| HeapBlock <AudioBufferList> bufList; | |||
| bufList.calloc (size, 1); | |||
| if (OK (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, bufList))) | |||
| { | |||
| @@ -1352,8 +1305,6 @@ private: | |||
| total += b.mNumberChannels; | |||
| } | |||
| } | |||
| juce_free (bufList); | |||
| } | |||
| return total; | |||
| @@ -132,7 +132,6 @@ public: | |||
| CoreGraphicsContext (CGContextRef context_, const float flipHeight_) | |||
| : context (context_), | |||
| flipHeight (flipHeight_), | |||
| gradientLookupTable (0), | |||
| numGradientLookupEntries (0) | |||
| { | |||
| CGContextRetain (context); | |||
| @@ -155,7 +154,6 @@ public: | |||
| CGColorSpaceRelease (rgbColourSpace); | |||
| CGColorSpaceRelease (greyColourSpace); | |||
| delete state; | |||
| delete gradientLookupTable; | |||
| } | |||
| //============================================================================== | |||
| @@ -183,7 +181,7 @@ public: | |||
| { | |||
| const int numRects = clipRegion.getNumRectangles(); | |||
| CGRect* const rects = new CGRect [numRects]; | |||
| HeapBlock <CGRect> rects (numRects); | |||
| for (int i = 0; i < numRects; ++i) | |||
| { | |||
| const Rectangle& r = clipRegion.getRectangle(i); | |||
| @@ -191,8 +189,6 @@ public: | |||
| } | |||
| CGContextClipToRects (context, rects, numRects); | |||
| delete[] rects; | |||
| return ! isClipEmpty(); | |||
| } | |||
| } | |||
| @@ -565,7 +561,7 @@ private: | |||
| SavedState* state; | |||
| OwnedArray <SavedState> stateStack; | |||
| PixelARGB* gradientLookupTable; | |||
| HeapBlock <PixelARGB> gradientLookupTable; | |||
| int numGradientLookupEntries; | |||
| static void gradientCallback (void* info, const CGFloat* inData, CGFloat* outData) | |||
| @@ -584,8 +580,7 @@ private: | |||
| CGShadingRef createGradient (const AffineTransform& transform, ColourGradient gradient) throw() | |||
| { | |||
| delete gradientLookupTable; | |||
| gradientLookupTable = gradient.createLookupTable (transform, numGradientLookupEntries); | |||
| numGradientLookupEntries = gradient.createLookupTable (transform, gradientLookupTable); | |||
| --numGradientLookupEntries; | |||
| CGShadingRef result = 0; | |||
| @@ -334,7 +334,8 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| const int maxPacketSize = 256; | |||
| int pos = 0, bytesLeft = message.getRawDataSize(); | |||
| const int numPackets = (bytesLeft + maxPacketSize - 1) / maxPacketSize; | |||
| MIDIPacketList* const packets = (MIDIPacketList*) juce_malloc (32 * numPackets + message.getRawDataSize()); | |||
| HeapBlock <MIDIPacketList> packets; | |||
| packets.malloc (32 * numPackets + message.getRawDataSize(), 1); | |||
| packets->numPackets = numPackets; | |||
| MIDIPacket* p = packets->packet; | |||
| @@ -353,8 +354,6 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| MIDISend (mpe->port, mpe->endPoint, packets); | |||
| else | |||
| MIDIReceived (mpe->endPoint, packets); | |||
| juce_free (packets); | |||
| } | |||
| else | |||
| { | |||
| @@ -201,45 +201,38 @@ public: | |||
| return 0; | |||
| const int length = text.length(); | |||
| CGGlyph* const glyphs = createGlyphsForString (text, length); | |||
| HeapBlock <CGGlyph> glyphs; | |||
| createGlyphsForString (text, length, glyphs); | |||
| float x = 0; | |||
| #if SUPPORT_ONLY_10_4_FONTS | |||
| NSSize* const advances = (NSSize*) juce_malloc (length * sizeof (NSSize)); | |||
| HeapBlock <NSSize> advances (length); | |||
| [nsFont getAdvancements: advances forGlyphs: (NSGlyph*) glyphs count: length]; | |||
| for (int i = 0; i < length; ++i) | |||
| x += advances[i].width; | |||
| juce_free (advances); | |||
| #else | |||
| #if SUPPORT_10_4_FONTS | |||
| if (NEW_CGFONT_FUNCTIONS_UNAVAILABLE) | |||
| { | |||
| NSSize* const advances = (NSSize*) juce_malloc (length * sizeof (NSSize)); | |||
| HeapBlock <NSSize> advances (length); | |||
| [nsFont getAdvancements: advances forGlyphs: (NSGlyph*) glyphs count: length]; | |||
| for (int i = 0; i < length; ++i) | |||
| x += advances[i].width; | |||
| juce_free (advances); | |||
| } | |||
| else | |||
| #endif | |||
| { | |||
| int* const advances = (int*) juce_malloc (length * sizeof (int)); | |||
| HeapBlock <int> advances (length); | |||
| if (CGFontGetGlyphAdvances (fontRef, glyphs, length, advances)) | |||
| for (int i = 0; i < length; ++i) | |||
| x += advances[i]; | |||
| juce_free (advances); | |||
| } | |||
| #endif | |||
| juce_free (glyphs); | |||
| return x * unitsToHeightScaleFactor; | |||
| } | |||
| @@ -251,10 +244,11 @@ public: | |||
| return; | |||
| const int length = text.length(); | |||
| CGGlyph* const glyphs = createGlyphsForString (text, length); | |||
| HeapBlock <CGGlyph> glyphs; | |||
| createGlyphsForString (text, length, glyphs); | |||
| #if SUPPORT_ONLY_10_4_FONTS | |||
| NSSize* const advances = (NSSize*) juce_malloc (length * sizeof (NSSize)); | |||
| HeapBlock <NSSize> advances (length); | |||
| [nsFont getAdvancements: advances forGlyphs: (NSGlyph*) glyphs count: length]; | |||
| int x = 0; | |||
| @@ -265,12 +259,11 @@ public: | |||
| resultGlyphs.add (((NSGlyph*) glyphs)[i]); | |||
| } | |||
| juce_free (advances); | |||
| #else | |||
| #if SUPPORT_10_4_FONTS | |||
| if (NEW_CGFONT_FUNCTIONS_UNAVAILABLE) | |||
| { | |||
| NSSize* const advances = (NSSize*) juce_malloc (length * sizeof (NSSize)); | |||
| HeapBlock <NSSize> advances (length); | |||
| [nsFont getAdvancements: advances forGlyphs: (NSGlyph*) glyphs count: length]; | |||
| float x = 0; | |||
| @@ -280,13 +273,11 @@ public: | |||
| xOffsets.add (x * unitsToHeightScaleFactor); | |||
| resultGlyphs.add (((NSGlyph*) glyphs)[i]); | |||
| } | |||
| juce_free (advances); | |||
| } | |||
| else | |||
| #endif | |||
| { | |||
| int* const advances = (int*) juce_malloc (length * sizeof (int)); | |||
| HeapBlock <int> advances (length); | |||
| if (CGFontGetGlyphAdvances (fontRef, glyphs, length, advances)) | |||
| { | |||
| @@ -298,12 +289,8 @@ public: | |||
| resultGlyphs.add (glyphs[i]); | |||
| } | |||
| } | |||
| juce_free (advances); | |||
| } | |||
| #endif | |||
| juce_free (glyphs); | |||
| } | |||
| bool getOutlineForGlyph (int glyphNumber, Path& path) | |||
| @@ -369,19 +356,20 @@ private: | |||
| AffineTransform pathTransform; | |||
| #endif | |||
| CGGlyph* createGlyphsForString (const juce_wchar* const text, const int length) throw() | |||
| void createGlyphsForString (const juce_wchar* const text, const int length, HeapBlock <CGGlyph>& glyphs) throw() | |||
| { | |||
| #if SUPPORT_10_4_FONTS | |||
| #if ! SUPPORT_ONLY_10_4_FONTS | |||
| if (NEW_CGFONT_FUNCTIONS_UNAVAILABLE) | |||
| #endif | |||
| { | |||
| NSGlyph* const g = (NSGlyph*) juce_malloc (sizeof (NSGlyph) * length); | |||
| glyphs.malloc (sizeof (NSGlyph) * length, 1); | |||
| NSGlyph* const g = (NSGlyph*) glyphs; | |||
| for (int i = 0; i < length; ++i) | |||
| g[i] = (NSGlyph) [nsFont _defaultGlyphForChar: text[i]]; | |||
| return (CGGlyph*) g; | |||
| return; | |||
| } | |||
| #endif | |||
| @@ -389,12 +377,10 @@ private: | |||
| if (charToGlyphMapper == 0) | |||
| charToGlyphMapper = new CharToGlyphMapper (fontRef); | |||
| CGGlyph* const g = (CGGlyph*) juce_malloc (sizeof (CGGlyph) * length); | |||
| glyphs.malloc (length); | |||
| for (int i = 0; i < length; ++i) | |||
| g[i] = (CGGlyph) charToGlyphMapper->getGlyphForCharacter (text[i]); | |||
| return g; | |||
| glyphs[i] = (CGGlyph) charToGlyphMapper->getGlyphForCharacter (text[i]); | |||
| #endif | |||
| } | |||
| @@ -58,20 +58,15 @@ const String PlatformUtilities::cfStringToJuceString (CFStringRef cfString) | |||
| { | |||
| #if JUCE_STRINGS_ARE_UNICODE | |||
| CFRange range = { 0, CFStringGetLength (cfString) }; | |||
| UniChar* const u = (UniChar*) juce_malloc (sizeof (UniChar) * (range.length + 1)); | |||
| HeapBlock <UniChar> u (range.length + 1); | |||
| CFStringGetCharacters (cfString, range, u); | |||
| u[range.length] = 0; | |||
| result = convertUTF16ToString (u); | |||
| juce_free (u); | |||
| #else | |||
| const int len = CFStringGetLength (cfString); | |||
| char* buffer = (char*) juce_malloc (len + 1); | |||
| HeapBlock <char> buffer (len + 1); | |||
| CFStringGetCString (cfString, buffer, len + 1, CFStringGetSystemEncoding()); | |||
| result = buffer; | |||
| juce_free (buffer); | |||
| #endif | |||
| } | |||
| @@ -83,16 +78,12 @@ CFStringRef PlatformUtilities::juceStringToCFString (const String& s) | |||
| #if JUCE_STRINGS_ARE_UNICODE | |||
| const int len = s.length(); | |||
| const juce_wchar* t = (const juce_wchar*) s; | |||
| UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); | |||
| HeapBlock <UniChar> temp (len + 2); | |||
| for (int i = 0; i <= len; ++i) | |||
| temp[i] = t[i]; | |||
| CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); | |||
| juce_free (temp); | |||
| return result; | |||
| return CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); | |||
| #else | |||
| return CFStringCreateWithCString (kCFAllocatorDefault, | |||
| @@ -126,8 +117,9 @@ const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) | |||
| { | |||
| const int len = s.length(); | |||
| UniChar* const tempIn = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); | |||
| UniChar* const tempOut = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); | |||
| HeapBlock <UniChar> tempIn, tempOut; | |||
| tempIn.calloc (len + 2); | |||
| tempOut.calloc (len + 2); | |||
| for (int i = 0; i <= len; ++i) | |||
| tempIn[i] = s[i]; | |||
| @@ -153,9 +145,6 @@ const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) | |||
| t[i] = 0; | |||
| } | |||
| juce_free (tempIn); | |||
| juce_free (tempOut); | |||
| DisposeUnicodeToTextInfo (&conversionInfo); | |||
| } | |||
| @@ -88,7 +88,6 @@ public: | |||
| optionalDllForDirectLoading (optionalDllForDirectLoading_), | |||
| currentBitDepth (16), | |||
| currentSampleRate (0), | |||
| tempBuffer (0), | |||
| isOpen_ (false), | |||
| isStarted (false), | |||
| postOutput (true), | |||
| @@ -115,8 +114,6 @@ public: | |||
| close(); | |||
| log ("ASIO - exiting"); | |||
| removeCurrentDriver(); | |||
| juce_free (tempBuffer); | |||
| } | |||
| void updateSampleRates() | |||
| @@ -451,9 +448,7 @@ public: | |||
| { | |||
| buffersCreated = true; | |||
| juce_free (tempBuffer); | |||
| tempBuffer = (float*) juce_calloc (totalBuffers * currentBlockSizeSamples * sizeof (float) + 128); | |||
| tempBuffer.calloc (totalBuffers * currentBlockSizeSamples + 32); | |||
| int n = 0; | |||
| Array <int> types; | |||
| @@ -840,7 +835,7 @@ private: | |||
| bool outputChannelLittleEndian [maxASIOChannels]; | |||
| WaitableEvent event1; | |||
| float* tempBuffer; | |||
| HeapBlock <float> tempBuffer; | |||
| int volatile bufferIndex, numActiveInputChans, numActiveOutputChans; | |||
| bool isOpen_, isStarted; | |||
| @@ -2328,7 +2328,7 @@ bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamples) | |||
| hr = info->redbook->CreateAudioTrack ((long) numSamples / (bytesPerBlock * 4)); | |||
| byte* const buffer = (byte*) juce_malloc (bytesPerBlock); | |||
| HeapBlock <byte> buffer (bytesPerBlock); | |||
| AudioSampleBuffer sourceBuffer (2, samplesPerBlock); | |||
| int samplesDone = 0; | |||
| @@ -2366,8 +2366,6 @@ bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamples) | |||
| break; | |||
| } | |||
| juce_free (buffer); | |||
| hr = info->redbook->CloseAudioTrack(); | |||
| delete source; | |||
| @@ -196,14 +196,14 @@ public: | |||
| if (getPin (filter, PINDIR_OUTPUT, &pin)) | |||
| { | |||
| ComSmartPtr <IAMPushSource> pushSource; | |||
| hr = pin->QueryInterface (IID_IAMPushSource, (void**) &pushSource); | |||
| HRESULT hr = pin->QueryInterface (IID_IAMPushSource, (void**) &pushSource); | |||
| if (pushSource != 0) | |||
| { | |||
| REFERENCE_TIME latency = 0; | |||
| hr = ps->GetLatency (&latency); | |||
| hr = pushSource->GetLatency (&latency); | |||
| firstRecordedTime -= RelativeTime ((double) latency); | |||
| firstRecordedTime = firstRecordedTime - RelativeTime ((double) latency); | |||
| } | |||
| } | |||
| } | |||
| @@ -1170,8 +1170,7 @@ private: | |||
| int64 volatile lastBlockTime; | |||
| double sampleRate; | |||
| BitArray enabledInputs, enabledOutputs; | |||
| float** inputBuffers; | |||
| float** outputBuffers; | |||
| HeapBlock <float*> inputBuffers, outputBuffers; | |||
| AudioIODeviceCallback* callback; | |||
| CriticalSection startStopLock; | |||
| @@ -1196,15 +1195,13 @@ private: | |||
| for (i = 0; i < numInputBuffers; ++i) | |||
| juce_free (inputBuffers[i]); | |||
| delete[] inputBuffers; | |||
| inputBuffers = 0; | |||
| inputBuffers.free(); | |||
| numInputBuffers = 0; | |||
| for (i = 0; i < numOutputBuffers; ++i) | |||
| juce_free (outputBuffers[i]); | |||
| delete[] outputBuffers; | |||
| outputBuffers = 0; | |||
| outputBuffers.free(); | |||
| numOutputBuffers = 0; | |||
| } | |||
| @@ -1526,8 +1523,7 @@ const String DSoundAudioIODevice::openDevice (const BitArray& inputChannels, | |||
| false); | |||
| numInputBuffers = enabledInputs.countNumberOfSetBits(); | |||
| inputBuffers = new float* [numInputBuffers + 2]; | |||
| zeromem (inputBuffers, sizeof (float*) * numInputBuffers + 2); | |||
| inputBuffers.calloc (numInputBuffers + 2); | |||
| int i, numIns = 0; | |||
| for (i = 0; i <= enabledInputs.getHighestBit(); i += 2) | |||
| @@ -1554,8 +1550,7 @@ const String DSoundAudioIODevice::openDevice (const BitArray& inputChannels, | |||
| false); | |||
| numOutputBuffers = enabledOutputs.countNumberOfSetBits(); | |||
| outputBuffers = new float* [numOutputBuffers + 2]; | |||
| zeromem (outputBuffers, sizeof (float*) * numOutputBuffers + 2); | |||
| outputBuffers.calloc (numOutputBuffers + 2); | |||
| int numOuts = 0; | |||
| for (i = 0; i <= enabledOutputs.getHighestBit(); i += 2) | |||
| @@ -532,7 +532,8 @@ const String File::getVersion() const throw() | |||
| DWORD handle = 0; | |||
| DWORD bufferSize = GetFileVersionInfoSize (getFullPathName(), &handle); | |||
| void* buffer = juce_calloc (bufferSize); | |||
| HeapBlock <char> buffer; | |||
| buffer.calloc (bufferSize); | |||
| if (GetFileVersionInfo (getFullPathName(), 0, bufferSize, buffer)) | |||
| { | |||
| @@ -549,7 +550,6 @@ const String File::getVersion() const throw() | |||
| } | |||
| } | |||
| juce_free (buffer); | |||
| return result; | |||
| } | |||
| @@ -128,7 +128,7 @@ class FontDCHolder : private DeletedAtShutdown | |||
| public: | |||
| //============================================================================== | |||
| FontDCHolder() throw() | |||
| : dc (0), kps (0), numKPs (0), size (0), | |||
| : dc (0), numKPs (0), size (0), | |||
| bold (false), italic (false) | |||
| { | |||
| } | |||
| @@ -139,7 +139,6 @@ public: | |||
| { | |||
| DeleteDC (dc); | |||
| DeleteObject (fontH); | |||
| juce_free (kps); | |||
| } | |||
| clearSingletonInstance(); | |||
| @@ -161,8 +160,7 @@ public: | |||
| { | |||
| DeleteDC (dc); | |||
| DeleteObject (fontH); | |||
| juce_free (kps); | |||
| kps = 0; | |||
| kps.free(); | |||
| } | |||
| fontH = 0; | |||
| @@ -225,7 +223,7 @@ public: | |||
| if (kps == 0) | |||
| { | |||
| numKPs = GetKerningPairs (dc, 0, 0); | |||
| kps = (KERNINGPAIR*) juce_calloc (sizeof (KERNINGPAIR) * numKPs); | |||
| kps.calloc (numKPs); | |||
| GetKerningPairs (dc, numKPs, kps); | |||
| } | |||
| @@ -239,7 +237,7 @@ private: | |||
| HFONT fontH; | |||
| HDC dc; | |||
| String fontName; | |||
| KERNINGPAIR* kps; | |||
| HeapBlock <KERNINGPAIR> kps; | |||
| int numKPs, size; | |||
| bool bold, italic; | |||
| @@ -304,7 +302,7 @@ public: | |||
| if (bufSize > 0) | |||
| { | |||
| char* const data = (char*) juce_malloc (bufSize); | |||
| HeapBlock <char> data (bufSize); | |||
| GetGlyphOutline (dc, character, GGO_NATIVE, &gm, | |||
| bufSize, data, &identityMatrix); | |||
| @@ -372,8 +370,6 @@ public: | |||
| glyphPath.closeSubPath(); | |||
| } | |||
| juce_free (data); | |||
| } | |||
| addGlyph (character, glyphPath, gm.gmCellIncX / height); | |||
| @@ -346,15 +346,11 @@ static CFStringRef juceStringToCFString (const String& s) | |||
| const int len = s.length(); | |||
| const juce_wchar* const t = (const juce_wchar*) s; | |||
| UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); | |||
| HeapBlock <UniChar> temp (len + 2); | |||
| for (int i = 0; i <= len; ++i) | |||
| temp[i] = t[i]; | |||
| CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); | |||
| juce_free (temp); | |||
| return result; | |||
| return CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); | |||
| } | |||
| static bool openMovie (QTNewMoviePropertyElement* props, int prop, Movie& movie) | |||
| @@ -211,7 +211,6 @@ public: | |||
| { | |||
| DeleteDC (hdc); | |||
| DeleteObject (hBitmap); | |||
| imageData = 0; // to stop the base class freeing this | |||
| } | |||
| void blitToWindow (HWND hwnd, HDC dc, const bool transparent, | |||
| @@ -1814,415 +1813,415 @@ public: | |||
| private: | |||
| LRESULT peerWindowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) | |||
| { | |||
| if (isValidPeer (this)) | |||
| { | |||
| if (isValidPeer (this)) | |||
| switch (message) | |||
| { | |||
| switch (message) | |||
| { | |||
| case WM_NCHITTEST: | |||
| if (hasTitleBar()) | |||
| break; | |||
| //============================================================================== | |||
| case WM_NCHITTEST: | |||
| if ((styleFlags & windowIgnoresMouseClicks) != 0) | |||
| return HTTRANSPARENT; | |||
| if (hasTitleBar()) | |||
| break; | |||
| return HTCLIENT; | |||
| return HTCLIENT; | |||
| //============================================================================== | |||
| case WM_PAINT: | |||
| handlePaintMessage(); | |||
| return 0; | |||
| //============================================================================== | |||
| case WM_PAINT: | |||
| case WM_NCPAINT: | |||
| if (wParam != 1) | |||
| handlePaintMessage(); | |||
| return 0; | |||
| case WM_NCPAINT: | |||
| if (wParam != 1) | |||
| handlePaintMessage(); | |||
| if (hasTitleBar()) | |||
| break; | |||
| if (hasTitleBar()) | |||
| break; | |||
| return 0; | |||
| return 0; | |||
| case WM_ERASEBKGND: | |||
| case WM_NCCALCSIZE: | |||
| if (hasTitleBar()) | |||
| break; | |||
| case WM_ERASEBKGND: | |||
| case WM_NCCALCSIZE: | |||
| if (hasTitleBar()) | |||
| break; | |||
| return 1; | |||
| return 1; | |||
| //============================================================================== | |||
| case WM_MOUSEMOVE: | |||
| doMouseMove (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam)); | |||
| return 0; | |||
| //============================================================================== | |||
| case WM_MOUSEMOVE: | |||
| doMouseMove (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam)); | |||
| return 0; | |||
| case WM_MOUSELEAVE: | |||
| doMouseExit(); | |||
| return 0; | |||
| case WM_MOUSELEAVE: | |||
| doMouseExit(); | |||
| return 0; | |||
| case WM_LBUTTONDOWN: | |||
| case WM_MBUTTONDOWN: | |||
| case WM_RBUTTONDOWN: | |||
| doMouseDown (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); | |||
| return 0; | |||
| case WM_LBUTTONDOWN: | |||
| case WM_MBUTTONDOWN: | |||
| case WM_RBUTTONDOWN: | |||
| doMouseDown (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); | |||
| return 0; | |||
| case WM_LBUTTONUP: | |||
| case WM_MBUTTONUP: | |||
| case WM_RBUTTONUP: | |||
| doMouseUp (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); | |||
| return 0; | |||
| case WM_LBUTTONUP: | |||
| case WM_MBUTTONUP: | |||
| case WM_RBUTTONUP: | |||
| doMouseUp (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); | |||
| return 0; | |||
| case WM_CAPTURECHANGED: | |||
| doCaptureChanged(); | |||
| return 0; | |||
| case WM_CAPTURECHANGED: | |||
| doCaptureChanged(); | |||
| return 0; | |||
| case WM_NCMOUSEMOVE: | |||
| if (hasTitleBar()) | |||
| break; | |||
| case WM_NCMOUSEMOVE: | |||
| if (hasTitleBar()) | |||
| break; | |||
| return 0; | |||
| return 0; | |||
| case 0x020A: /* WM_MOUSEWHEEL */ | |||
| doMouseWheel (wParam, true); | |||
| return 0; | |||
| case 0x020A: /* WM_MOUSEWHEEL */ | |||
| doMouseWheel (wParam, true); | |||
| return 0; | |||
| case 0x020E: /* WM_MOUSEHWHEEL */ | |||
| doMouseWheel (wParam, false); | |||
| return 0; | |||
| case 0x020E: /* WM_MOUSEHWHEEL */ | |||
| doMouseWheel (wParam, false); | |||
| return 0; | |||
| //============================================================================== | |||
| case WM_WINDOWPOSCHANGING: | |||
| if ((styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) | |||
| { | |||
| WINDOWPOS* const wp = (WINDOWPOS*) lParam; | |||
| //============================================================================== | |||
| case WM_WINDOWPOSCHANGING: | |||
| if ((styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) | |||
| if ((wp->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE)) | |||
| { | |||
| WINDOWPOS* const wp = (WINDOWPOS*) lParam; | |||
| if ((wp->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE)) | |||
| if (constrainer != 0) | |||
| { | |||
| if (constrainer != 0) | |||
| { | |||
| const Rectangle current (component->getX() - windowBorder.getLeft(), | |||
| component->getY() - windowBorder.getTop(), | |||
| component->getWidth() + windowBorder.getLeftAndRight(), | |||
| component->getHeight() + windowBorder.getTopAndBottom()); | |||
| constrainer->checkBounds (wp->x, wp->y, wp->cx, wp->cy, | |||
| current, | |||
| Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), | |||
| wp->y != current.getY() && wp->y + wp->cy == current.getBottom(), | |||
| wp->x != current.getX() && wp->x + wp->cx == current.getRight(), | |||
| wp->y == current.getY() && wp->y + wp->cy != current.getBottom(), | |||
| wp->x == current.getX() && wp->x + wp->cx != current.getRight()); | |||
| } | |||
| const Rectangle current (component->getX() - windowBorder.getLeft(), | |||
| component->getY() - windowBorder.getTop(), | |||
| component->getWidth() + windowBorder.getLeftAndRight(), | |||
| component->getHeight() + windowBorder.getTopAndBottom()); | |||
| constrainer->checkBounds (wp->x, wp->y, wp->cx, wp->cy, | |||
| current, | |||
| Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), | |||
| wp->y != current.getY() && wp->y + wp->cy == current.getBottom(), | |||
| wp->x != current.getX() && wp->x + wp->cx == current.getRight(), | |||
| wp->y == current.getY() && wp->y + wp->cy != current.getBottom(), | |||
| wp->x == current.getX() && wp->x + wp->cx != current.getRight()); | |||
| } | |||
| } | |||
| } | |||
| return 0; | |||
| return 0; | |||
| case WM_WINDOWPOSCHANGED: | |||
| handleMovedOrResized(); | |||
| case WM_WINDOWPOSCHANGED: | |||
| handleMovedOrResized(); | |||
| if (dontRepaint) | |||
| break; // needed for non-accelerated openGL windows to draw themselves correctly.. | |||
| else | |||
| return 0; | |||
| if (dontRepaint) | |||
| break; // needed for non-accelerated openGL windows to draw themselves correctly.. | |||
| //============================================================================== | |||
| case WM_KEYDOWN: | |||
| case WM_SYSKEYDOWN: | |||
| if (doKeyDown (wParam)) | |||
| return 0; | |||
| return 0; | |||
| break; | |||
| case WM_KEYUP: | |||
| case WM_SYSKEYUP: | |||
| if (doKeyUp (wParam)) | |||
| return 0; | |||
| break; | |||
| //============================================================================== | |||
| case WM_KEYDOWN: | |||
| case WM_SYSKEYDOWN: | |||
| if (doKeyDown (wParam)) | |||
| return 0; | |||
| case WM_CHAR: | |||
| if (doKeyChar ((int) wParam, lParam)) | |||
| return 0; | |||
| break; | |||
| break; | |||
| case WM_KEYUP: | |||
| case WM_SYSKEYUP: | |||
| if (doKeyUp (wParam)) | |||
| return 0; | |||
| case WM_APPCOMMAND: | |||
| if (doAppCommand (lParam)) | |||
| return TRUE; | |||
| break; | |||
| break; | |||
| case WM_CHAR: | |||
| if (doKeyChar ((int) wParam, lParam)) | |||
| return 0; | |||
| //============================================================================== | |||
| case WM_SETFOCUS: | |||
| updateKeyModifiers(); | |||
| handleFocusGain(); | |||
| break; | |||
| break; | |||
| case WM_KILLFOCUS: | |||
| if (hasCreatedCaret) | |||
| { | |||
| hasCreatedCaret = false; | |||
| DestroyCaret(); | |||
| } | |||
| case WM_APPCOMMAND: | |||
| if (doAppCommand (lParam)) | |||
| return TRUE; | |||
| handleFocusLoss(); | |||
| break; | |||
| break; | |||
| case WM_ACTIVATEAPP: | |||
| // Windows does weird things to process priority when you swap apps, | |||
| // so this forces an update when the app is brought to the front | |||
| if (wParam != FALSE) | |||
| juce_repeatLastProcessPriority(); | |||
| else | |||
| Desktop::getInstance().setKioskModeComponent (0); // turn kiosk mode off if we lose focus | |||
| //============================================================================== | |||
| case WM_SETFOCUS: | |||
| updateKeyModifiers(); | |||
| handleFocusGain(); | |||
| break; | |||
| juce_CheckCurrentlyFocusedTopLevelWindow(); | |||
| modifiersAtLastCallback = -1; | |||
| return 0; | |||
| case WM_KILLFOCUS: | |||
| if (hasCreatedCaret) | |||
| { | |||
| hasCreatedCaret = false; | |||
| DestroyCaret(); | |||
| } | |||
| case WM_ACTIVATE: | |||
| if (LOWORD (wParam) == WA_ACTIVE || LOWORD (wParam) == WA_CLICKACTIVE) | |||
| { | |||
| modifiersAtLastCallback = -1; | |||
| updateKeyModifiers(); | |||
| handleFocusLoss(); | |||
| break; | |||
| if (isMinimised()) | |||
| { | |||
| component->repaint(); | |||
| handleMovedOrResized(); | |||
| case WM_ACTIVATEAPP: | |||
| // Windows does weird things to process priority when you swap apps, | |||
| // so this forces an update when the app is brought to the front | |||
| if (wParam != FALSE) | |||
| juce_repeatLastProcessPriority(); | |||
| else | |||
| Desktop::getInstance().setKioskModeComponent (0); // turn kiosk mode off if we lose focus | |||
| if (! isValidMessageListener()) | |||
| return 0; | |||
| } | |||
| juce_CheckCurrentlyFocusedTopLevelWindow(); | |||
| modifiersAtLastCallback = -1; | |||
| return 0; | |||
| if (LOWORD (wParam) == WA_CLICKACTIVE | |||
| && component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| { | |||
| int mx, my; | |||
| component->getMouseXYRelative (mx, my); | |||
| Component* const underMouse = component->getComponentAt (mx, my); | |||
| case WM_ACTIVATE: | |||
| if (LOWORD (wParam) == WA_ACTIVE || LOWORD (wParam) == WA_CLICKACTIVE) | |||
| { | |||
| modifiersAtLastCallback = -1; | |||
| updateKeyModifiers(); | |||
| if (underMouse != 0 && underMouse->isCurrentlyBlockedByAnotherModalComponent()) | |||
| Component::getCurrentlyModalComponent()->inputAttemptWhenModal(); | |||
| if (isMinimised()) | |||
| { | |||
| component->repaint(); | |||
| handleMovedOrResized(); | |||
| if (! isValidMessageListener()) | |||
| return 0; | |||
| } | |||
| } | |||
| handleBroughtToFront(); | |||
| if (LOWORD (wParam) == WA_CLICKACTIVE | |||
| && component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| { | |||
| int mx, my; | |||
| component->getMouseXYRelative (mx, my); | |||
| Component* const underMouse = component->getComponentAt (mx, my); | |||
| if (component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| Component::getCurrentlyModalComponent()->toFront (true); | |||
| if (underMouse != 0 && underMouse->isCurrentlyBlockedByAnotherModalComponent()) | |||
| Component::getCurrentlyModalComponent()->inputAttemptWhenModal(); | |||
| return 0; | |||
| } | |||
| break; | |||
| handleBroughtToFront(); | |||
| case WM_NCACTIVATE: | |||
| // while a temporary window is being shown, prevent Windows from deactivating the | |||
| // title bars of our main windows. | |||
| if (wParam == 0 && ! shouldDeactivateTitleBar) | |||
| wParam = TRUE; // change this and let it get passed to the DefWindowProc. | |||
| if (component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| Component::getCurrentlyModalComponent()->toFront (true); | |||
| break; | |||
| return 0; | |||
| } | |||
| case WM_MOUSEACTIVATE: | |||
| if (! component->getMouseClickGrabsKeyboardFocus()) | |||
| return MA_NOACTIVATE; | |||
| break; | |||
| break; | |||
| case WM_NCACTIVATE: | |||
| // while a temporary window is being shown, prevent Windows from deactivating the | |||
| // title bars of our main windows. | |||
| if (wParam == 0 && ! shouldDeactivateTitleBar) | |||
| wParam = TRUE; // change this and let it get passed to the DefWindowProc. | |||
| case WM_SHOWWINDOW: | |||
| if (wParam != 0) | |||
| handleBroughtToFront(); | |||
| break; | |||
| break; | |||
| case WM_MOUSEACTIVATE: | |||
| if (! component->getMouseClickGrabsKeyboardFocus()) | |||
| return MA_NOACTIVATE; | |||
| case WM_CLOSE: | |||
| if (! component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| handleUserClosingWindow(); | |||
| break; | |||
| return 0; | |||
| case WM_SHOWWINDOW: | |||
| if (wParam != 0) | |||
| handleBroughtToFront(); | |||
| case WM_QUIT: | |||
| if (JUCEApplication::getInstance() != 0) | |||
| JUCEApplication::getInstance()->systemRequestedQuit(); | |||
| return 0; | |||
| break; | |||
| case WM_QUERYENDSESSION: | |||
| if (JUCEApplication::getInstance() != 0) | |||
| { | |||
| JUCEApplication::getInstance()->systemRequestedQuit(); | |||
| return MessageManager::getInstance()->hasStopMessageBeenSent(); | |||
| } | |||
| return TRUE; | |||
| case WM_CLOSE: | |||
| if (! component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| handleUserClosingWindow(); | |||
| //============================================================================== | |||
| case WM_TRAYNOTIFY: | |||
| if (component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| return 0; | |||
| case WM_QUIT: | |||
| if (JUCEApplication::getInstance() != 0) | |||
| JUCEApplication::getInstance()->systemRequestedQuit(); | |||
| return 0; | |||
| case WM_QUERYENDSESSION: | |||
| if (JUCEApplication::getInstance() != 0) | |||
| { | |||
| JUCEApplication::getInstance()->systemRequestedQuit(); | |||
| return MessageManager::getInstance()->hasStopMessageBeenSent(); | |||
| } | |||
| return TRUE; | |||
| //============================================================================== | |||
| case WM_TRAYNOTIFY: | |||
| if (component->isCurrentlyBlockedByAnotherModalComponent()) | |||
| { | |||
| if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN | |||
| || lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) | |||
| { | |||
| if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN | |||
| || lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) | |||
| { | |||
| Component* const current = Component::getCurrentlyModalComponent(); | |||
| Component* const current = Component::getCurrentlyModalComponent(); | |||
| if (current != 0) | |||
| current->inputAttemptWhenModal(); | |||
| } | |||
| if (current != 0) | |||
| current->inputAttemptWhenModal(); | |||
| } | |||
| else | |||
| { | |||
| const int oldModifiers = currentModifiers; | |||
| } | |||
| else | |||
| { | |||
| const int oldModifiers = currentModifiers; | |||
| MouseEvent e (0, 0, ModifierKeys::getCurrentModifiersRealtime(), component, | |||
| getMouseEventTime(), 0, 0, getMouseEventTime(), 1, false); | |||
| MouseEvent e (0, 0, ModifierKeys::getCurrentModifiersRealtime(), component, | |||
| getMouseEventTime(), 0, 0, getMouseEventTime(), 1, false); | |||
| if (lParam == WM_LBUTTONDOWN || lParam == WM_LBUTTONDBLCLK) | |||
| e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::leftButtonModifier); | |||
| else if (lParam == WM_RBUTTONDOWN || lParam == WM_RBUTTONDBLCLK) | |||
| e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::rightButtonModifier); | |||
| if (lParam == WM_LBUTTONDOWN || lParam == WM_LBUTTONDBLCLK) | |||
| e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::leftButtonModifier); | |||
| else if (lParam == WM_RBUTTONDOWN || lParam == WM_RBUTTONDBLCLK) | |||
| e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::rightButtonModifier); | |||
| if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN) | |||
| { | |||
| SetFocus (hwnd); | |||
| SetForegroundWindow (hwnd); | |||
| if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN) | |||
| { | |||
| SetFocus (hwnd); | |||
| SetForegroundWindow (hwnd); | |||
| component->mouseDown (e); | |||
| } | |||
| else if (lParam == WM_LBUTTONUP || lParam == WM_RBUTTONUP) | |||
| { | |||
| e.mods = ModifierKeys (oldModifiers); | |||
| component->mouseUp (e); | |||
| } | |||
| else if (lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) | |||
| { | |||
| e.mods = ModifierKeys (oldModifiers); | |||
| component->mouseDoubleClick (e); | |||
| } | |||
| else if (lParam == WM_MOUSEMOVE) | |||
| { | |||
| component->mouseMove (e); | |||
| } | |||
| component->mouseDown (e); | |||
| } | |||
| else if (lParam == WM_LBUTTONUP || lParam == WM_RBUTTONUP) | |||
| { | |||
| e.mods = ModifierKeys (oldModifiers); | |||
| component->mouseUp (e); | |||
| } | |||
| else if (lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) | |||
| { | |||
| e.mods = ModifierKeys (oldModifiers); | |||
| component->mouseDoubleClick (e); | |||
| } | |||
| else if (lParam == WM_MOUSEMOVE) | |||
| { | |||
| component->mouseMove (e); | |||
| } | |||
| } | |||
| break; | |||
| break; | |||
| //============================================================================== | |||
| case WM_SYNCPAINT: | |||
| return 0; | |||
| //============================================================================== | |||
| case WM_SYNCPAINT: | |||
| return 0; | |||
| case WM_PALETTECHANGED: | |||
| InvalidateRect (h, 0, 0); | |||
| break; | |||
| case WM_PALETTECHANGED: | |||
| InvalidateRect (h, 0, 0); | |||
| break; | |||
| case WM_DISPLAYCHANGE: | |||
| InvalidateRect (h, 0, 0); | |||
| createPaletteIfNeeded = true; | |||
| // intentional fall-through... | |||
| case WM_SETTINGCHANGE: // note the fall-through in the previous case! | |||
| doSettingChange(); | |||
| break; | |||
| case WM_DISPLAYCHANGE: | |||
| InvalidateRect (h, 0, 0); | |||
| createPaletteIfNeeded = true; | |||
| // intentional fall-through... | |||
| case WM_SETTINGCHANGE: // note the fall-through in the previous case! | |||
| doSettingChange(); | |||
| break; | |||
| case WM_INITMENU: | |||
| if (! hasTitleBar()) | |||
| case WM_INITMENU: | |||
| if (! hasTitleBar()) | |||
| { | |||
| if (isFullScreen()) | |||
| { | |||
| if (isFullScreen()) | |||
| { | |||
| EnableMenuItem ((HMENU) wParam, SC_RESTORE, MF_BYCOMMAND | MF_ENABLED); | |||
| EnableMenuItem ((HMENU) wParam, SC_MOVE, MF_BYCOMMAND | MF_GRAYED); | |||
| } | |||
| else if (! isMinimised()) | |||
| { | |||
| EnableMenuItem ((HMENU) wParam, SC_MAXIMIZE, MF_BYCOMMAND | MF_GRAYED); | |||
| } | |||
| EnableMenuItem ((HMENU) wParam, SC_RESTORE, MF_BYCOMMAND | MF_ENABLED); | |||
| EnableMenuItem ((HMENU) wParam, SC_MOVE, MF_BYCOMMAND | MF_GRAYED); | |||
| } | |||
| break; | |||
| case WM_SYSCOMMAND: | |||
| switch (wParam & 0xfff0) | |||
| else if (! isMinimised()) | |||
| { | |||
| case SC_CLOSE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| EnableMenuItem ((HMENU) wParam, SC_MAXIMIZE, MF_BYCOMMAND | MF_GRAYED); | |||
| } | |||
| } | |||
| break; | |||
| if (hasTitleBar()) | |||
| { | |||
| PostMessage (h, WM_CLOSE, 0, 0); | |||
| return 0; | |||
| } | |||
| break; | |||
| case WM_SYSCOMMAND: | |||
| switch (wParam & 0xfff0) | |||
| { | |||
| case SC_CLOSE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| case SC_KEYMENU: | |||
| // (NB mustn't call sendInputAttemptWhenModalMessage() here because of very | |||
| // obscure situations that can arise if a modal loop is started from an alt-key | |||
| // keypress). | |||
| if (hasTitleBar()) | |||
| { | |||
| PostMessage (h, WM_CLOSE, 0, 0); | |||
| return 0; | |||
| } | |||
| break; | |||
| if (hasTitleBar() && h == GetCapture()) | |||
| ReleaseCapture(); | |||
| case SC_KEYMENU: | |||
| // (NB mustn't call sendInputAttemptWhenModalMessage() here because of very | |||
| // obscure situations that can arise if a modal loop is started from an alt-key | |||
| // keypress). | |||
| break; | |||
| if (hasTitleBar() && h == GetCapture()) | |||
| ReleaseCapture(); | |||
| case SC_MAXIMIZE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| break; | |||
| setFullScreen (true); | |||
| case SC_MAXIMIZE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| case SC_MINIMIZE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| setFullScreen (true); | |||
| return 0; | |||
| if (! hasTitleBar()) | |||
| { | |||
| setMinimised (true); | |||
| return 0; | |||
| } | |||
| break; | |||
| case SC_MINIMIZE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| case SC_RESTORE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| if (! hasTitleBar()) | |||
| { | |||
| setMinimised (true); | |||
| return 0; | |||
| } | |||
| break; | |||
| if (hasTitleBar()) | |||
| { | |||
| if (isFullScreen()) | |||
| { | |||
| setFullScreen (false); | |||
| return 0; | |||
| } | |||
| } | |||
| else | |||
| { | |||
| if (isMinimised()) | |||
| setMinimised (false); | |||
| else if (isFullScreen()) | |||
| setFullScreen (false); | |||
| case SC_RESTORE: | |||
| if (sendInputAttemptWhenModalMessage()) | |||
| return 0; | |||
| if (hasTitleBar()) | |||
| { | |||
| if (isFullScreen()) | |||
| { | |||
| setFullScreen (false); | |||
| return 0; | |||
| } | |||
| } | |||
| else | |||
| { | |||
| if (isMinimised()) | |||
| setMinimised (false); | |||
| else if (isFullScreen()) | |||
| setFullScreen (false); | |||
| break; | |||
| return 0; | |||
| } | |||
| break; | |||
| } | |||
| case WM_NCLBUTTONDOWN: | |||
| case WM_NCRBUTTONDOWN: | |||
| case WM_NCMBUTTONDOWN: | |||
| sendInputAttemptWhenModalMessage(); | |||
| break; | |||
| break; | |||
| //case WM_IME_STARTCOMPOSITION; | |||
| // return 0; | |||
| case WM_NCLBUTTONDOWN: | |||
| case WM_NCRBUTTONDOWN: | |||
| case WM_NCMBUTTONDOWN: | |||
| sendInputAttemptWhenModalMessage(); | |||
| break; | |||
| case WM_GETDLGCODE: | |||
| return DLGC_WANTALLKEYS; | |||
| //case WM_IME_STARTCOMPOSITION; | |||
| // return 0; | |||
| default: | |||
| break; | |||
| } | |||
| case WM_GETDLGCODE: | |||
| return DLGC_WANTALLKEYS; | |||
| default: | |||
| break; | |||
| } | |||
| } | |||
| // (the message manager lock exits before calling this, to avoid deadlocks if | |||
| // this calls into non-juce windows) | |||
| return DefWindowProc (h, message, wParam, lParam); | |||
| } | |||
| @@ -2635,8 +2634,9 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot | |||
| else | |||
| { | |||
| const int stride = (maxW + 7) >> 3; | |||
| uint8* const andPlane = (uint8*) juce_calloc (stride * maxH); | |||
| uint8* const xorPlane = (uint8*) juce_calloc (stride * maxH); | |||
| HeapBlock <uint8> andPlane, xorPlane; | |||
| andPlane.calloc (stride * maxH); | |||
| xorPlane.calloc (stride * maxH); | |||
| int index = 0; | |||
| for (int y = 0; y < maxH; ++y) | |||
| @@ -2657,9 +2657,6 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot | |||
| } | |||
| cursorH = CreateCursor (0, hotspotX, hotspotY, maxW, maxH, andPlane, xorPlane); | |||
| juce_free (andPlane); | |||
| juce_free (xorPlane); | |||
| } | |||
| delete newIm; | |||
| @@ -93,13 +93,8 @@ bool StringArray::operator== (const StringArray& other) const throw() | |||
| return false; | |||
| for (int i = size(); --i >= 0;) | |||
| { | |||
| if (*(String*) other.strings.getUnchecked(i) | |||
| != *(String*) strings.getUnchecked(i)) | |||
| { | |||
| if (*other.strings.getUnchecked(i) != *strings.getUnchecked(i)) | |||
| return false; | |||
| } | |||
| } | |||
| return true; | |||
| } | |||
| @@ -111,19 +106,13 @@ bool StringArray::operator!= (const StringArray& other) const throw() | |||
| void StringArray::clear() throw() | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| { | |||
| String* const s = (String*) strings.getUnchecked(i); | |||
| delete s; | |||
| } | |||
| strings.clear(); | |||
| } | |||
| const String& StringArray::operator[] (const int index) const throw() | |||
| { | |||
| if (((unsigned int) index) < (unsigned int) strings.size()) | |||
| return *(const String*) (strings.getUnchecked (index)); | |||
| return *strings.getUnchecked (index); | |||
| return String::empty; | |||
| } | |||
| @@ -160,22 +149,18 @@ void StringArray::addArray (const StringArray& otherArray, | |||
| numElementsToAdd = otherArray.size() - startIndex; | |||
| while (--numElementsToAdd >= 0) | |||
| strings.add (new String (*(const String*) otherArray.strings.getUnchecked (startIndex++))); | |||
| strings.add (new String (*otherArray.strings.getUnchecked (startIndex++))); | |||
| } | |||
| void StringArray::set (const int index, | |||
| const String& newString) throw() | |||
| { | |||
| String* const s = (String*) strings [index]; | |||
| String* const s = strings [index]; | |||
| if (s != 0) | |||
| { | |||
| *s = newString; | |||
| } | |||
| else if (index >= 0) | |||
| { | |||
| add (newString); | |||
| } | |||
| } | |||
| bool StringArray::contains (const String& stringToLookFor, | |||
| @@ -184,13 +169,13 @@ bool StringArray::contains (const String& stringToLookFor, | |||
| if (ignoreCase) | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| if (stringToLookFor.equalsIgnoreCase (*(const String*)(strings.getUnchecked(i)))) | |||
| if (strings.getUnchecked(i)->equalsIgnoreCase (stringToLookFor)) | |||
| return true; | |||
| } | |||
| else | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| if (stringToLookFor == *(const String*)(strings.getUnchecked(i))) | |||
| if (stringToLookFor == *strings.getUnchecked(i)) | |||
| return true; | |||
| } | |||
| @@ -210,7 +195,7 @@ int StringArray::indexOf (const String& stringToLookFor, | |||
| { | |||
| while (i < numElements) | |||
| { | |||
| if (stringToLookFor.equalsIgnoreCase (*(const String*) strings.getUnchecked (i))) | |||
| if (strings.getUnchecked(i)->equalsIgnoreCase (stringToLookFor)) | |||
| return i; | |||
| ++i; | |||
| @@ -220,7 +205,7 @@ int StringArray::indexOf (const String& stringToLookFor, | |||
| { | |||
| while (i < numElements) | |||
| { | |||
| if (stringToLookFor == *(const String*) strings.getUnchecked (i)) | |||
| if (stringToLookFor == *strings.getUnchecked (i)) | |||
| return i; | |||
| ++i; | |||
| @@ -233,13 +218,7 @@ int StringArray::indexOf (const String& stringToLookFor, | |||
| //============================================================================== | |||
| void StringArray::remove (const int index) throw() | |||
| { | |||
| String* const s = (String*) strings [index]; | |||
| if (s != 0) | |||
| { | |||
| strings.remove (index); | |||
| delete s; | |||
| } | |||
| strings.remove (index); | |||
| } | |||
| void StringArray::removeString (const String& stringToRemove, | |||
| @@ -248,14 +227,14 @@ void StringArray::removeString (const String& stringToRemove, | |||
| if (ignoreCase) | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| if (stringToRemove.equalsIgnoreCase (*(const String*) strings.getUnchecked (i))) | |||
| remove (i); | |||
| if (strings.getUnchecked(i)->equalsIgnoreCase (stringToRemove)) | |||
| strings.remove (i); | |||
| } | |||
| else | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| if (stringToRemove == *(const String*) strings.getUnchecked (i)) | |||
| remove (i); | |||
| if (stringToRemove == *strings.getUnchecked (i)) | |||
| strings.remove (i); | |||
| } | |||
| } | |||
| @@ -265,14 +244,14 @@ void StringArray::removeEmptyStrings (const bool removeWhitespaceStrings) throw( | |||
| if (removeWhitespaceStrings) | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| if (! ((const String*) strings.getUnchecked(i))->containsNonWhitespaceChars()) | |||
| remove (i); | |||
| if (! strings.getUnchecked(i)->containsNonWhitespaceChars()) | |||
| strings.remove (i); | |||
| } | |||
| else | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| if (((const String*) strings.getUnchecked(i))->isEmpty()) | |||
| remove (i); | |||
| if (strings.getUnchecked(i)->isEmpty()) | |||
| strings.remove (i); | |||
| } | |||
| } | |||
| @@ -280,7 +259,7 @@ void StringArray::trim() throw() | |||
| { | |||
| for (int i = size(); --i >= 0;) | |||
| { | |||
| String& s = *(String*) strings.getUnchecked(i); | |||
| String& s = *strings.getUnchecked(i); | |||
| s = s.trim(); | |||
| } | |||
| } | |||
| @@ -339,13 +318,13 @@ const String StringArray::joinIntoString (const String& separator, | |||
| return String::empty; | |||
| if (start == last - 1) | |||
| return *(const String*) strings.getUnchecked (start); | |||
| return *strings.getUnchecked (start); | |||
| const int separatorLen = separator.length(); | |||
| int charsNeeded = separatorLen * (last - start - 1); | |||
| for (int i = start; i < last; ++i) | |||
| charsNeeded += ((const String*) strings.getUnchecked(i))->length(); | |||
| charsNeeded += strings.getUnchecked(i)->length(); | |||
| String result; | |||
| result.preallocateStorage (charsNeeded); | |||
| @@ -354,7 +333,7 @@ const String StringArray::joinIntoString (const String& separator, | |||
| while (start < last) | |||
| { | |||
| const String& s = *(const String*) strings.getUnchecked (start); | |||
| const String& s = *strings.getUnchecked (start); | |||
| const int len = s.length(); | |||
| if (len > 0) | |||
| @@ -520,7 +499,7 @@ void StringArray::removeDuplicates (const bool ignoreCase) throw() | |||
| { | |||
| for (int i = 0; i < size() - 1; ++i) | |||
| { | |||
| const String& s = *(String*) strings.getUnchecked(i); | |||
| const String& s = *strings.getUnchecked(i); | |||
| int nextIndex = i + 1; | |||
| @@ -531,7 +510,7 @@ void StringArray::removeDuplicates (const bool ignoreCase) throw() | |||
| if (nextIndex < 0) | |||
| break; | |||
| remove (nextIndex); | |||
| strings.remove (nextIndex); | |||
| } | |||
| } | |||
| } | |||
| @@ -543,7 +522,7 @@ void StringArray::appendNumbersToDuplicates (const bool ignoreCase, | |||
| { | |||
| for (int i = 0; i < size() - 1; ++i) | |||
| { | |||
| String& s = *(String*) strings.getUnchecked(i); | |||
| String& s = *strings.getUnchecked(i); | |||
| int nextIndex = indexOf (s, ignoreCase, i + 1); | |||
| @@ -27,7 +27,7 @@ | |||
| #define __JUCE_STRINGARRAY_JUCEHEADER__ | |||
| #include "juce_String.h" | |||
| #include "../containers/juce_VoidArray.h" | |||
| #include "../containers/juce_OwnedArray.h" | |||
| #ifndef DOXYGEN | |||
| // (used in StringArray::appendNumbersToDuplicates) | |||
| @@ -325,7 +325,7 @@ public: | |||
| juce_UseDebuggingNewOperator | |||
| private: | |||
| VoidArray strings; | |||
| OwnedArray <String> strings; | |||
| }; | |||
| @@ -1073,20 +1073,15 @@ XmlElement* XmlElement::findParentElementOf (const XmlElement* const elementToLo | |||
| return 0; | |||
| } | |||
| XmlElement** XmlElement::getChildElementsAsArray (const int num) const throw() | |||
| void XmlElement::getChildElementsAsArray (XmlElement** elems) const throw() | |||
| { | |||
| XmlElement** const elems = new XmlElement* [num]; | |||
| XmlElement* e = firstChildElement; | |||
| int i = 0; | |||
| while (e != 0) | |||
| { | |||
| elems [i++] = e; | |||
| *elems++ = e; | |||
| e = e->nextElement; | |||
| } | |||
| return elems; | |||
| } | |||
| void XmlElement::reorderChildElements (XmlElement** const elems, const int num) throw() | |||
| @@ -594,10 +594,10 @@ public: | |||
| if (num > 1) | |||
| { | |||
| XmlElement** const elems = getChildElementsAsArray (num); | |||
| sortArray (comparator, elems, 0, num - 1, retainOrderOfEquivalentItems); | |||
| HeapBlock <XmlElement*> elems (num); | |||
| getChildElementsAsArray (elems); | |||
| sortArray (comparator, (XmlElement**) elems, 0, num - 1, retainOrderOfEquivalentItems); | |||
| reorderChildElements (elems, num); | |||
| delete[] elems; | |||
| } | |||
| } | |||
| @@ -706,7 +706,7 @@ private: | |||
| const int indentationLevel, | |||
| const int lineWrapLength) const throw(); | |||
| XmlElement** getChildElementsAsArray (const int) const throw(); | |||
| void getChildElementsAsArray (XmlElement**) const throw(); | |||
| void reorderChildElements (XmlElement** const, const int) throw(); | |||
| }; | |||
| @@ -106,7 +106,7 @@ ThreadPool::ThreadPool (const int numThreads_, | |||
| { | |||
| jassert (numThreads_ > 0); // not much point having one of these with no threads in it. | |||
| threads = (Thread**) juce_calloc (sizeof (Thread*) * numThreads); | |||
| threads.calloc (numThreads); | |||
| for (int i = numThreads; --i >= 0;) | |||
| threads[i] = new ThreadPoolThread (*this); | |||
| @@ -129,8 +129,6 @@ ThreadPool::~ThreadPool() | |||
| threads[i]->stopThread (500); | |||
| delete threads[i]; | |||
| } | |||
| juce_free (threads); | |||
| } | |||
| void ThreadPool::addJob (ThreadPoolJob* const job) | |||
| @@ -30,6 +30,7 @@ | |||
| #include "juce_ScopedLock.h" | |||
| #include "../text/juce_StringArray.h" | |||
| #include "../containers/juce_VoidArray.h" | |||
| #include "../containers/juce_HeapBlock.h" | |||
| class ThreadPool; | |||
| class ThreadPoolThread; | |||
| @@ -299,7 +300,7 @@ public: | |||
| private: | |||
| const int numThreads, threadStopTimeout; | |||
| int priority; | |||
| Thread** threads; | |||
| HeapBlock <Thread*> threads; | |||
| VoidArray jobs; | |||
| CriticalSection lock; | |||
| @@ -28,6 +28,7 @@ | |||
| #include "../text/juce_String.h" | |||
| #include "../containers/juce_OwnedArray.h" | |||
| #include "../containers/juce_Array.h" | |||
| #include "../text/juce_StringArray.h" | |||
| #include "../events/juce_ChangeBroadcaster.h" | |||
| #include "juce_UndoableAction.h" | |||