diff --git a/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm b/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm index 4a080ebde9..a8752bf1f3 100644 --- a/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm +++ b/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm @@ -55,20 +55,20 @@ END_JUCE_NAMESPACE - (void) dealloc; - (bool) isDiskPresent; - (int) getNumAvailableAudioBlocks; -- (void) addSourceTrack: (juce::AudioSource*) source numSamples: (int) numSamples_; -- (void) burn: (juce::AudioCDBurner::BurnProgressListener*) listener errorString: (juce::String*) error +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) numSamples_; +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting; @end //============================================================================== @interface AudioTrackProducer : NSObject { - juce::AudioSource* source; + JUCE_NAMESPACE::AudioSource* source; int readPosition, lengthInFrames; } - (AudioTrackProducer*) init: (int) lengthInFrames; -- (AudioTrackProducer*) initWithAudioSource: (juce::AudioSource*) source numSamples: (int) lengthInSamples; +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) lengthInSamples; - (void) dealloc; - (void) setupTrackProperties: (DRTrack*) track; @@ -125,7 +125,7 @@ END_JUCE_NAMESPACE objectForKey: DRDeviceMediaBlocksFreeKey] intValue]; } -- (void) addSourceTrack: (juce::AudioSource*) source_ numSamples: (int) numSamples_ +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) numSamples_ { AudioTrackProducer* p = [[AudioTrackProducer alloc] initWithAudioSource: source_ numSamples: numSamples_]; DRTrack* t = [[DRTrack alloc] initWithProducer: p]; @@ -137,7 +137,7 @@ END_JUCE_NAMESPACE [p release]; } -- (void) burn: (juce::AudioCDBurner::BurnProgressListener*) listener errorString: (juce::String*) error +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting { DRBurn* burn = [DRBurn burnForDevice: device]; @@ -162,7 +162,7 @@ END_JUCE_NAMESPACE for (;;) { - juce::Thread::sleep (300); + JUCE_NAMESPACE::Thread::sleep (300); float progress = [[[burn status] objectForKey: DRStatusPercentCompleteKey] floatValue]; NSLog ([[burn status] description]); @@ -189,7 +189,7 @@ NSLog ([[burn status] description]); if ([err length] > 0) { - *error = juce::String::fromUTF8 ((juce::uint8*) [err UTF8String]); + *error = JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [err UTF8String]); break; } } @@ -224,7 +224,7 @@ NSLog ([[burn status] description]); [p release]; } -- (AudioTrackProducer*) initWithAudioSource: (juce::AudioSource*) source_ numSamples: (int) lengthInSamples +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) lengthInSamples { AudioTrackProducer* s = [self init: (lengthInSamples + 587) / 588]; @@ -283,23 +283,23 @@ NSLog ([[burn status] description]); { if (source != 0) { - const int numSamples = juce::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); + const int numSamples = JUCE_NAMESPACE::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); if (numSamples > 0) { - juce::AudioSampleBuffer tempBuffer (2, numSamples); + JUCE_NAMESPACE::AudioSampleBuffer tempBuffer (2, numSamples); - juce::AudioSourceChannelInfo info; + JUCE_NAMESPACE::AudioSourceChannelInfo info; info.buffer = &tempBuffer; info.startSample = 0; info.numSamples = numSamples; source->getNextAudioBlock (info); - juce::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), - buffer, numSamples, 4); - juce::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), - buffer + 2, numSamples, 4); + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), + buffer, numSamples, 4); + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), + buffer + 2, numSamples, 4); readPosition += numSamples; } @@ -389,7 +389,7 @@ const StringArray AudioCDBurner::findAvailableDevices() StringArray s; for (int i = 0; i < [names count]; ++i) - s.add (String::fromUTF8 ((juce::uint8*) [[names objectAtIndex: i] UTF8String])); + s.add (String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [[names objectAtIndex: i] UTF8String])); return s; } @@ -422,18 +422,18 @@ bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) return false; } -const String AudioCDBurner::burn (juce::AudioCDBurner::BurnProgressListener* listener, +const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, const bool ejectDiscAfterwards, const bool peformFakeBurnForTesting) { const AutoPool pool; - juce::String error ("Couldn't open or write to the CD device"); + JUCE_NAMESPACE::String error ("Couldn't open or write to the CD device"); OpenDiskDevice* dev = (OpenDiskDevice*) internal; if (dev != 0) { - error = juce::String::empty; + error = JUCE_NAMESPACE::String::empty; [dev burn: listener errorString: &error ejectAfterwards: ejectDiscAfterwards diff --git a/build/macosx/platform_specific_code/juce_mac_FileChooser.mm b/build/macosx/platform_specific_code/juce_mac_FileChooser.mm index 5ad536281b..f9b3d147e7 100644 --- a/build/macosx/platform_specific_code/juce_mac_FileChooser.mm +++ b/build/macosx/platform_specific_code/juce_mac_FileChooser.mm @@ -36,12 +36,12 @@ BEGIN_JUCE_NAMESPACE #include "../../../src/juce_appframework/gui/components/filebrowser/juce_FileChooser.h" END_JUCE_NAMESPACE -static const juce::String nsStringToJuce (NSString* s) +static const JUCE_NAMESPACE::String nsStringToJuce (NSString* s) { - return juce::String::fromUTF8 ((juce::uint8*) [s UTF8String]); + return JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [s UTF8String]); } -static NSString* juceStringToNS (const juce::String& s) +static NSString* juceStringToNS (const JUCE_NAMESPACE::String& s) { return [NSString stringWithUTF8String: (const char*) s.toUTF8()]; } @@ -49,17 +49,17 @@ static NSString* juceStringToNS (const juce::String& s) //============================================================================== @interface JuceFileChooserDelegate : NSObject { - juce::StringArray* filters; + JUCE_NAMESPACE::StringArray* filters; } -- (JuceFileChooserDelegate*) initWithFilters: (juce::StringArray*) filters_; +- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_; - (void) dealloc; - (BOOL) panel:(id) sender shouldShowFilename: (NSString*) filename; @end @implementation JuceFileChooserDelegate -- (JuceFileChooserDelegate*) initWithFilters: (juce::StringArray*) filters_ +- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_ { [super init]; filters = filters_; @@ -78,7 +78,7 @@ static NSString* juceStringToNS (const juce::String& s) for (int i = filters->size(); --i >= 0;) { - const juce::String wildcard ((*filters)[i].toLowerCase()); + const JUCE_NAMESPACE::String wildcard ((*filters)[i].toLowerCase()); if (fnmatch (wildcard.toUTF8(), filenameUTF8, 0) == 0) return true; diff --git a/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h b/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h index b9dc3652c0..b1757002b3 100644 --- a/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h +++ b/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h @@ -29,7 +29,7 @@ ============================================================================== */ -#include "../../../src/juce_core/basics/juce_StandardHeader.h" +#include "../../../src/juce_core/basics/juce_StandardHeader. h" #include diff --git a/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm b/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm index 67515ab0d4..508de302ab 100644 --- a/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm +++ b/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm @@ -45,10 +45,10 @@ END_JUCE_NAMESPACE //============================================================================== @interface DownloadClickDetector : NSObject { - juce::WebBrowserComponent* ownerComponent; + JUCE_NAMESPACE::WebBrowserComponent* ownerComponent; } -- (DownloadClickDetector*) initWithOwner: (juce::WebBrowserComponent*) ownerComponent; +- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent; - (void) webView: (WebView*) webView decidePolicyForNavigationAction: (NSDictionary*) actionInformation request: (NSURLRequest*) request @@ -59,7 +59,7 @@ END_JUCE_NAMESPACE //============================================================================== @implementation DownloadClickDetector -- (DownloadClickDetector*) initWithOwner: (juce::WebBrowserComponent*) ownerComponent_ +- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent_ { [super init]; ownerComponent = ownerComponent_; @@ -70,7 +70,7 @@ END_JUCE_NAMESPACE { NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; - if (ownerComponent->pageAboutToLoad (juce::String::fromUTF8 ((const juce::uint8*) [[url absoluteString] UTF8String]))) + if (ownerComponent->pageAboutToLoad (JUCE_NAMESPACE::String::fromUTF8 ((const JUCE_NAMESPACE::uint8*) [[url absoluteString] UTF8String]))) [listener use]; else [listener ignore]; @@ -190,11 +190,11 @@ public: { const String headerName ((*headers)[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); headerNamesAsChars[i] = (char*) juce_calloc (headerName.copyToUTF8 (0)); - headerName.copyToUTF8 ((juce::uint8*) headerNamesAsChars[i]); + headerName.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerNamesAsChars[i]); const String headerValue ((*headers)[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); headerValuesAsChars[i] = (char*) juce_calloc (headerValue.copyToUTF8 (0)); - headerValue.copyToUTF8 ((juce::uint8*) headerValuesAsChars[i]); + headerValue.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerValuesAsChars[i]); } } diff --git a/build/win32/platform_specific_code/juce_win32_SystemStats.cpp b/build/win32/platform_specific_code/juce_win32_SystemStats.cpp index e5fcfa0d82..168b5ffe6f 100644 --- a/build/win32/platform_specific_code/juce_win32_SystemStats.cpp +++ b/build/win32/platform_specific_code/juce_win32_SystemStats.cpp @@ -341,6 +341,7 @@ bool SystemStats::isOperatingSystem64Bit() throw() #endif } + //============================================================================== int SystemStats::getMemorySizeInMegabytes() throw() { diff --git a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp index 112c565325..38930d715d 100644 --- a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp @@ -107,8 +107,8 @@ //============================================================================== #if JUCE_WIN32 - extern void JUCE_CALLTYPE attachSubWindow (void* hostWindow, int& titleW, int& titleH, juce::Component* comp); - extern void JUCE_CALLTYPE resizeHostWindow (void* hostWindow, int& titleW, int& titleH, juce::Component* comp); + extern void JUCE_CALLTYPE attachSubWindow (void* hostWindow, int& titleW, int& titleH, JUCE_NAMESPACE::Component* comp); + extern void JUCE_CALLTYPE resizeHostWindow (void* hostWindow, int& titleW, int& titleH, JUCE_NAMESPACE::Component* comp); #if ! JucePlugin_EditorRequiresKeyboardFocus extern void JUCE_CALLTYPE passFocusToHostWindow (void* hostWindow); #endif @@ -295,7 +295,7 @@ public: private: AudioProcessor* const filter; JucePlugInProcess* const process; - juce::Component* wrapper; + JUCE_NAMESPACE::Component* wrapper; AudioProcessorEditor* editorComp; void deleteEditorComp() @@ -304,7 +304,7 @@ public: { PopupMenu::dismissAllActiveMenus(); - juce::Component* const modalComponent = juce::Component::getCurrentlyModalComponent(); + JUCE_NAMESPACE::Component* const modalComponent = JUCE_NAMESPACE::Component::getCurrentlyModalComponent(); if (modalComponent != 0) modalComponent->exitModalState (0); @@ -317,7 +317,7 @@ public: //============================================================================== // A component to hold the AudioProcessorEditor, and cope with some housekeeping // chores when it changes or repaints. - class EditorCompWrapper : public juce::Component, + class EditorCompWrapper : public JUCE_NAMESPACE::Component, #if JUCE_MAC public Timer #else @@ -435,7 +435,7 @@ public: void resized() { - juce::Component* const c = getChildComponent (0); + JUCE_NAMESPACE::Component* const c = getChildComponent (0); if (c != 0) c->setBounds (0, 0, getWidth(), getHeight()); @@ -476,7 +476,7 @@ public: #endif #if JUCE_WIN32 - void globalFocusChanged (juce::Component*) + void globalFocusChanged (JUCE_NAMESPACE::Component*) { #if ! JucePlugin_EditorRequiresKeyboardFocus if (hasKeyboardFocus (true)) @@ -485,7 +485,7 @@ public: } #endif - void childBoundsChanged (juce::Component* child) + void childBoundsChanged (JUCE_NAMESPACE::Component* child) { setSize (child->getWidth(), child->getHeight()); child->setTopLeftPosition (0, 0); diff --git a/extras/audio plugins/wrapper/formats/Standalone/juce_StandaloneFilterWindow.cpp b/extras/audio plugins/wrapper/formats/Standalone/juce_StandaloneFilterWindow.cpp index 3a08751536..a98a7764ab 100644 --- a/extras/audio plugins/wrapper/formats/Standalone/juce_StandaloneFilterWindow.cpp +++ b/extras/audio plugins/wrapper/formats/Standalone/juce_StandaloneFilterWindow.cpp @@ -81,7 +81,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, if (globalSettings != 0) { - juce::MemoryBlock data; + JUCE_NAMESPACE::MemoryBlock data; if (data.fromBase64Encoding (globalSettings->getValue (T("filterState"))) && data.getSize() > 0) @@ -130,7 +130,7 @@ StandaloneFilterWindow::~StandaloneFilterWindow() if (globalSettings != 0 && filter != 0) { - juce::MemoryBlock data; + JUCE_NAMESPACE::MemoryBlock data; filter->getStateInformation (data); globalSettings->setValue (T("filterState"), data.toBase64Encoding()); @@ -185,7 +185,7 @@ void StandaloneFilterWindow::saveState() if (fc.browseForFileToSave (true)) { - juce::MemoryBlock data; + JUCE_NAMESPACE::MemoryBlock data; filter->getStateInformation (data); if (! fc.getResult().replaceWithData (data.getData(), data.getSize())) @@ -207,7 +207,7 @@ void StandaloneFilterWindow::loadState() if (fc.browseForFileToOpen()) { - juce::MemoryBlock data; + JUCE_NAMESPACE::MemoryBlock data; if (fc.getResult().loadFileAsData (data)) { diff --git a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp index 39a140ae6d..5f30a438c7 100644 --- a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp @@ -129,7 +129,7 @@ class JuceVSTWrapper; static bool recursionCheck = false; -static juce::uint32 lastMasterIdleCall = 0; +static JUCE_NAMESPACE::uint32 lastMasterIdleCall = 0; BEGIN_JUCE_NAMESPACE extern void juce_callAnyTimersSynchronously(); @@ -564,7 +564,7 @@ public: { const VstMidiEvent* const vme = (const VstMidiEvent*) e; - midiEvents.addEvent ((const juce::uint8*) vme->midiData, + midiEvents.addEvent ((const JUCE_NAMESPACE::uint8*) vme->midiData, 4, vme->deltaFrames); } @@ -692,7 +692,7 @@ public: ensureOutgoingEventSize (numEvents); outgoingEvents->numEvents = 0; - const juce::uint8* midiEventData; + const JUCE_NAMESPACE::uint8* midiEventData; int midiEventSize, midiEventPosition; MidiBuffer::Iterator i (midiEvents); @@ -1072,7 +1072,7 @@ public: if (Component::isMouseButtonDownAnywhere() && ! recursionCheck) { - const juce::uint32 now = JUCE_NAMESPACE::Time::getMillisecondCounter(); + const JUCE_NAMESPACE::uint32 now = JUCE_NAMESPACE::Time::getMillisecondCounter(); if (now > lastMasterIdleCall + 20 && editorComp != 0) { @@ -1378,8 +1378,8 @@ public: private: AudioProcessor* filter; - juce::MemoryBlock chunkMemory; - juce::uint32 chunkMemoryTime; + JUCE_NAMESPACE::MemoryBlock chunkMemory; + JUCE_NAMESPACE::uint32 chunkMemoryTime; EditorCompWrapper* editorComp; ERect editorSize; MidiBuffer midiEvents; diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index abcf3009d2..89734dc1a5 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -13834,6 +13834,24 @@ void ReadWriteLock::enterWrite() const throw() } } +bool ReadWriteLock::tryEnterWrite() const throw() +{ + const int threadId = Thread::getCurrentThreadId(); + const ScopedLock sl (accessLock); + + if (readerThreads.size() + numWriters == 0 + || threadId == writerThreadId + || (readerThreads.size() == 2 + && readerThreads.getUnchecked(0) == threadId)) + { + writerThreadId = threadId; + ++numWriters; + return true; + } + + return false; +} + void ReadWriteLock::exitWrite() const throw() { const ScopedLock sl (accessLock); @@ -97849,6 +97867,8 @@ void zcfree (voidpf opaque, voidpf ptr) #endif /* MY_ZCALLOC */ /********* End of inlined file: zutil.c *********/ + #undef Byte + #undef Bytef } } @@ -253097,6 +253117,7 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_mac_Network.mm *********/ /********* Start of inlined file: juce_mac_NativeHeaders.h *********/ +#include "../../../src/juce_core/basics/juce_StandardHeader. h" #include @@ -253627,6 +253648,7 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_mac_AudioCDBurner.mm *********/ /********* Start of inlined file: juce_mac_NativeHeaders.h *********/ +#include "../../../src/juce_core/basics/juce_StandardHeader. h" #include @@ -253664,19 +253686,19 @@ END_JUCE_NAMESPACE - (void) dealloc; - (bool) isDiskPresent; - (int) getNumAvailableAudioBlocks; -- (void) addSourceTrack: (juce::AudioSource*) source numSamples: (int) numSamples_; -- (void) burn: (juce::AudioCDBurner::BurnProgressListener*) listener errorString: (juce::String*) error +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) numSamples_; +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting; @end @interface AudioTrackProducer : NSObject { - juce::AudioSource* source; + JUCE_NAMESPACE::AudioSource* source; int readPosition, lengthInFrames; } - (AudioTrackProducer*) init: (int) lengthInFrames; -- (AudioTrackProducer*) initWithAudioSource: (juce::AudioSource*) source numSamples: (int) lengthInSamples; +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) lengthInSamples; - (void) dealloc; - (void) setupTrackProperties: (DRTrack*) track; @@ -253732,7 +253754,7 @@ END_JUCE_NAMESPACE objectForKey: DRDeviceMediaBlocksFreeKey] intValue]; } -- (void) addSourceTrack: (juce::AudioSource*) source_ numSamples: (int) numSamples_ +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) numSamples_ { AudioTrackProducer* p = [[AudioTrackProducer alloc] initWithAudioSource: source_ numSamples: numSamples_]; DRTrack* t = [[DRTrack alloc] initWithProducer: p]; @@ -253744,7 +253766,7 @@ END_JUCE_NAMESPACE [p release]; } -- (void) burn: (juce::AudioCDBurner::BurnProgressListener*) listener errorString: (juce::String*) error +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting { DRBurn* burn = [DRBurn burnForDevice: device]; @@ -253769,7 +253791,7 @@ END_JUCE_NAMESPACE for (;;) { - juce::Thread::sleep (300); + JUCE_NAMESPACE::Thread::sleep (300); float progress = [[[burn status] objectForKey: DRStatusPercentCompleteKey] floatValue]; NSLog ([[burn status] description]); @@ -253796,7 +253818,7 @@ NSLog ([[burn status] description]); if ([err length] > 0) { - *error = juce::String::fromUTF8 ((juce::uint8*) [err UTF8String]); + *error = JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [err UTF8String]); break; } } @@ -253829,7 +253851,7 @@ NSLog ([[burn status] description]); [p release]; } -- (AudioTrackProducer*) initWithAudioSource: (juce::AudioSource*) source_ numSamples: (int) lengthInSamples +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) lengthInSamples { AudioTrackProducer* s = [self init: (lengthInSamples + 587) / 588]; @@ -253888,23 +253910,23 @@ NSLog ([[burn status] description]); { if (source != 0) { - const int numSamples = juce::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); + const int numSamples = JUCE_NAMESPACE::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); if (numSamples > 0) { - juce::AudioSampleBuffer tempBuffer (2, numSamples); + JUCE_NAMESPACE::AudioSampleBuffer tempBuffer (2, numSamples); - juce::AudioSourceChannelInfo info; + JUCE_NAMESPACE::AudioSourceChannelInfo info; info.buffer = &tempBuffer; info.startSample = 0; info.numSamples = numSamples; source->getNextAudioBlock (info); - juce::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), - buffer, numSamples, 4); - juce::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), - buffer + 2, numSamples, 4); + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), + buffer, numSamples, 4); + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), + buffer + 2, numSamples, 4); readPosition += numSamples; } @@ -253992,7 +254014,7 @@ const StringArray AudioCDBurner::findAvailableDevices() StringArray s; for (int i = 0; i < [names count]; ++i) - s.add (String::fromUTF8 ((juce::uint8*) [[names objectAtIndex: i] UTF8String])); + s.add (String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [[names objectAtIndex: i] UTF8String])); return s; } @@ -254025,18 +254047,18 @@ bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) return false; } -const String AudioCDBurner::burn (juce::AudioCDBurner::BurnProgressListener* listener, +const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, const bool ejectDiscAfterwards, const bool peformFakeBurnForTesting) { const AutoPool pool; - juce::String error ("Couldn't open or write to the CD device"); + JUCE_NAMESPACE::String error ("Couldn't open or write to the CD device"); OpenDiskDevice* dev = (OpenDiskDevice*) internal; if (dev != 0) { - error = juce::String::empty; + error = JUCE_NAMESPACE::String::empty; [dev burn: listener errorString: &error ejectAfterwards: ejectDiscAfterwards @@ -255837,6 +255859,7 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_mac_FileChooser.mm *********/ /********* Start of inlined file: juce_mac_NativeHeaders.h *********/ +#include "../../../src/juce_core/basics/juce_StandardHeader. h" #include @@ -255861,29 +255884,29 @@ BEGIN_JUCE_NAMESPACE END_JUCE_NAMESPACE -static const juce::String nsStringToJuce (NSString* s) +static const JUCE_NAMESPACE::String nsStringToJuce (NSString* s) { - return juce::String::fromUTF8 ((juce::uint8*) [s UTF8String]); + return JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [s UTF8String]); } -static NSString* juceStringToNS (const juce::String& s) +static NSString* juceStringToNS (const JUCE_NAMESPACE::String& s) { return [NSString stringWithUTF8String: (const char*) s.toUTF8()]; } @interface JuceFileChooserDelegate : NSObject { - juce::StringArray* filters; + JUCE_NAMESPACE::StringArray* filters; } -- (JuceFileChooserDelegate*) initWithFilters: (juce::StringArray*) filters_; +- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_; - (void) dealloc; - (BOOL) panel:(id) sender shouldShowFilename: (NSString*) filename; @end @implementation JuceFileChooserDelegate -- (JuceFileChooserDelegate*) initWithFilters: (juce::StringArray*) filters_ +- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_ { [super init]; filters = filters_; @@ -255902,7 +255925,7 @@ static NSString* juceStringToNS (const juce::String& s) for (int i = filters->size(); --i >= 0;) { - const juce::String wildcard ((*filters)[i].toLowerCase()); + const JUCE_NAMESPACE::String wildcard ((*filters)[i].toLowerCase()); if (fnmatch (wildcard.toUTF8(), filenameUTF8, 0) == 0) return true; @@ -256796,10 +256819,10 @@ END_JUCE_NAMESPACE @interface DownloadClickDetector : NSObject { - juce::WebBrowserComponent* ownerComponent; + JUCE_NAMESPACE::WebBrowserComponent* ownerComponent; } -- (DownloadClickDetector*) initWithOwner: (juce::WebBrowserComponent*) ownerComponent; +- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent; - (void) webView: (WebView*) webView decidePolicyForNavigationAction: (NSDictionary*) actionInformation request: (NSURLRequest*) request @@ -256809,7 +256832,7 @@ END_JUCE_NAMESPACE @implementation DownloadClickDetector -- (DownloadClickDetector*) initWithOwner: (juce::WebBrowserComponent*) ownerComponent_ +- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent_ { [super init]; ownerComponent = ownerComponent_; @@ -256820,7 +256843,7 @@ END_JUCE_NAMESPACE { NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; - if (ownerComponent->pageAboutToLoad (juce::String::fromUTF8 ((const juce::uint8*) [[url absoluteString] UTF8String]))) + if (ownerComponent->pageAboutToLoad (JUCE_NAMESPACE::String::fromUTF8 ((const JUCE_NAMESPACE::uint8*) [[url absoluteString] UTF8String]))) [listener use]; else [listener ignore]; @@ -256939,11 +256962,11 @@ public: { const String headerName ((*headers)[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); headerNamesAsChars[i] = (char*) juce_calloc (headerName.copyToUTF8 (0)); - headerName.copyToUTF8 ((juce::uint8*) headerNamesAsChars[i]); + headerName.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerNamesAsChars[i]); const String headerValue ((*headers)[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); headerValuesAsChars[i] = (char*) juce_calloc (headerValue.copyToUTF8 (0)); - headerValue.copyToUTF8 ((juce::uint8*) headerValuesAsChars[i]); + headerValue.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerValuesAsChars[i]); } } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 8aa54b9122..6080a58bad 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -674,13 +674,13 @@ extern bool JUCE_API JUCE_CALLTYPE juce_isRunningUnderDebugger() throw(); extern JUCE_API void juce_DebugFree (void* const block); /** This should be used instead of calling malloc directly. */ - #define juce_malloc(numBytes) juce::juce_DebugMalloc (numBytes, __FILE__, __LINE__) + #define juce_malloc(numBytes) JUCE_NAMESPACE::juce_DebugMalloc (numBytes, __FILE__, __LINE__) /** This should be used instead of calling calloc directly. */ - #define juce_calloc(numBytes) juce::juce_DebugCalloc (numBytes, __FILE__, __LINE__) + #define juce_calloc(numBytes) JUCE_NAMESPACE::juce_DebugCalloc (numBytes, __FILE__, __LINE__) /** This should be used instead of calling realloc directly. */ - #define juce_realloc(location, numBytes) juce::juce_DebugRealloc (location, numBytes, __FILE__, __LINE__) + #define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_DebugRealloc (location, numBytes, __FILE__, __LINE__) /** This should be used instead of calling free directly. */ - #define juce_free(location) juce::juce_DebugFree (location) + #define juce_free(location) JUCE_NAMESPACE::juce_DebugFree (location) #endif #if ! defined (_AFXDLL) @@ -706,13 +706,13 @@ extern bool JUCE_API JUCE_CALLTYPE juce_isRunningUnderDebugger() throw(); extern JUCE_API void juce_Free (void* const block); /** This should be used instead of calling malloc directly. */ - #define juce_malloc(numBytes) juce::juce_Malloc (numBytes) + #define juce_malloc(numBytes) JUCE_NAMESPACE::juce_Malloc (numBytes) /** This should be used instead of calling calloc directly. */ - #define juce_calloc(numBytes) juce::juce_Calloc (numBytes) + #define juce_calloc(numBytes) JUCE_NAMESPACE::juce_Calloc (numBytes) /** This should be used instead of calling realloc directly. */ - #define juce_realloc(location, numBytes) juce::juce_Realloc (location, numBytes) + #define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_Realloc (location, numBytes) /** This should be used instead of calling free directly. */ - #define juce_free(location) juce::juce_Free (location) + #define juce_free(location) JUCE_NAMESPACE::juce_Free (location) #define juce_UseDebuggingNewOperator \ static void* operator new (size_t sz) { void* const p = juce_malloc ((int) sz); return (p != 0) ? p : ::operator new (sz); } \ @@ -7480,6 +7480,10 @@ public: */ static bool isOperatingSystem64Bit() throw(); + /** Returns a country code based on the current locale of the OS. + */ + static const String getCountryCode(); + // CPU and memory information.. /** Returns the approximate CPU speed. @@ -13922,6 +13926,15 @@ public: */ void enterWrite() const throw(); + /** Tries to lock this object for writing. + + This is like enterWrite(), but doesn't block - it returns true if it manages + to obtain the lock. + + @see enterWrite + */ + bool tryEnterWrite() const throw(); + /** Releases the write-lock. If the caller thread hasn't got the lock, this can have unpredictable results. diff --git a/src/juce_core/basics/juce_Memory.h b/src/juce_core/basics/juce_Memory.h index 39ca26c49c..514ebb5f43 100644 --- a/src/juce_core/basics/juce_Memory.h +++ b/src/juce_core/basics/juce_Memory.h @@ -64,13 +64,13 @@ extern JUCE_API void juce_DebugFree (void* const block); /** This should be used instead of calling malloc directly. */ - #define juce_malloc(numBytes) juce::juce_DebugMalloc (numBytes, __FILE__, __LINE__) + #define juce_malloc(numBytes) JUCE_NAMESPACE::juce_DebugMalloc (numBytes, __FILE__, __LINE__) /** This should be used instead of calling calloc directly. */ - #define juce_calloc(numBytes) juce::juce_DebugCalloc (numBytes, __FILE__, __LINE__) + #define juce_calloc(numBytes) JUCE_NAMESPACE::juce_DebugCalloc (numBytes, __FILE__, __LINE__) /** This should be used instead of calling realloc directly. */ - #define juce_realloc(location, numBytes) juce::juce_DebugRealloc (location, numBytes, __FILE__, __LINE__) + #define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_DebugRealloc (location, numBytes, __FILE__, __LINE__) /** This should be used instead of calling free directly. */ - #define juce_free(location) juce::juce_DebugFree (location) + #define juce_free(location) JUCE_NAMESPACE::juce_DebugFree (location) #endif #if ! defined (_AFXDLL) @@ -96,13 +96,13 @@ extern JUCE_API void juce_Free (void* const block); /** This should be used instead of calling malloc directly. */ - #define juce_malloc(numBytes) juce::juce_Malloc (numBytes) + #define juce_malloc(numBytes) JUCE_NAMESPACE::juce_Malloc (numBytes) /** This should be used instead of calling calloc directly. */ - #define juce_calloc(numBytes) juce::juce_Calloc (numBytes) + #define juce_calloc(numBytes) JUCE_NAMESPACE::juce_Calloc (numBytes) /** This should be used instead of calling realloc directly. */ - #define juce_realloc(location, numBytes) juce::juce_Realloc (location, numBytes) + #define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_Realloc (location, numBytes) /** This should be used instead of calling free directly. */ - #define juce_free(location) juce::juce_Free (location) + #define juce_free(location) JUCE_NAMESPACE::juce_Free (location) #define juce_UseDebuggingNewOperator \ static void* operator new (size_t sz) { void* const p = juce_malloc ((int) sz); return (p != 0) ? p : ::operator new (sz); } \ diff --git a/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp b/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp index 10261bcdae..a8af5c14f6 100644 --- a/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp +++ b/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp @@ -66,6 +66,8 @@ namespace zlibNamespace #include "zlib/trees.c" #include "zlib/uncompr.c" #include "zlib/zutil.c" + #undef Byte + #undef Bytef } } diff --git a/src/juce_core/threads/juce_ReadWriteLock.cpp b/src/juce_core/threads/juce_ReadWriteLock.cpp index 2731f8dd88..7a62680b83 100644 --- a/src/juce_core/threads/juce_ReadWriteLock.cpp +++ b/src/juce_core/threads/juce_ReadWriteLock.cpp @@ -144,6 +144,24 @@ void ReadWriteLock::enterWrite() const throw() } } +bool ReadWriteLock::tryEnterWrite() const throw() +{ + const int threadId = Thread::getCurrentThreadId(); + const ScopedLock sl (accessLock); + + if (readerThreads.size() + numWriters == 0 + || threadId == writerThreadId + || (readerThreads.size() == 2 + && readerThreads.getUnchecked(0) == threadId)) + { + writerThreadId = threadId; + ++numWriters; + return true; + } + + return false; +} + void ReadWriteLock::exitWrite() const throw() { const ScopedLock sl (accessLock); diff --git a/src/juce_core/threads/juce_ReadWriteLock.h b/src/juce_core/threads/juce_ReadWriteLock.h index 1ffcafe397..258221d8bd 100644 --- a/src/juce_core/threads/juce_ReadWriteLock.h +++ b/src/juce_core/threads/juce_ReadWriteLock.h @@ -105,6 +105,15 @@ public: */ void enterWrite() const throw(); + /** Tries to lock this object for writing. + + This is like enterWrite(), but doesn't block - it returns true if it manages + to obtain the lock. + + @see enterWrite + */ + bool tryEnterWrite() const throw(); + /** Releases the write-lock. If the caller thread hasn't got the lock, this can have unpredictable results.