From eda613c6db698f31ab2189cc289c9de2db821142 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 8 Sep 2017 08:59:55 +0100 Subject: [PATCH] Moved all "namespace juce" declarations from module headers to the individual .h and .cpp source files. This makes life a lot easier for Intellisense and other IDE autocompletion tools --- examples/OSCMonitor/Source/OSCLogListBox.h | 5 +- .../audio_play_head/juce_AudioPlayHead.h | 6 +- .../buffers/juce_AudioChannelSet.cpp | 5 + .../buffers/juce_AudioChannelSet.h | 6 +- .../buffers/juce_AudioDataConverters.cpp | 5 + .../buffers/juce_AudioDataConverters.h | 6 +- .../buffers/juce_AudioSampleBuffer.h | 6 +- .../buffers/juce_FloatVectorOperations.cpp | 5 + .../buffers/juce_FloatVectorOperations.h | 5 +- .../effects/juce_CatmullRomInterpolator.cpp | 5 + .../effects/juce_CatmullRomInterpolator.h | 5 + .../juce_audio_basics/effects/juce_Decibels.h | 6 +- .../effects/juce_IIRFilter.cpp | 6 +- .../effects/juce_IIRFilter.h | 5 +- .../effects/juce_LagrangeInterpolator.cpp | 5 + .../effects/juce_LagrangeInterpolator.h | 5 + .../effects/juce_LinearSmoothedValue.h | 6 +- .../juce_audio_basics/effects/juce_Reverb.h | 6 +- .../juce_audio_basics/juce_audio_basics.cpp | 5 - modules/juce_audio_basics/juce_audio_basics.h | 5 - .../midi/juce_MidiBuffer.cpp | 5 + .../juce_audio_basics/midi/juce_MidiBuffer.h | 6 +- .../juce_audio_basics/midi/juce_MidiFile.cpp | 5 + .../juce_audio_basics/midi/juce_MidiFile.h | 6 +- .../midi/juce_MidiKeyboardState.cpp | 5 + .../midi/juce_MidiKeyboardState.h | 5 +- .../midi/juce_MidiMessage.cpp | 5 + .../juce_audio_basics/midi/juce_MidiMessage.h | 6 +- .../midi/juce_MidiMessageSequence.cpp | 4 + .../midi/juce_MidiMessageSequence.h | 6 +- .../juce_audio_basics/midi/juce_MidiRPN.cpp | 5 + modules/juce_audio_basics/midi/juce_MidiRPN.h | 6 +- .../mpe/juce_MPEInstrument.cpp | 5 + .../mpe/juce_MPEInstrument.h | 6 +- .../mpe/juce_MPEMessages.cpp | 5 + .../juce_audio_basics/mpe/juce_MPEMessages.h | 6 +- .../juce_audio_basics/mpe/juce_MPENote.cpp | 5 + modules/juce_audio_basics/mpe/juce_MPENote.h | 6 +- .../mpe/juce_MPESynthesiser.cpp | 5 + .../mpe/juce_MPESynthesiser.h | 6 +- .../mpe/juce_MPESynthesiserBase.cpp | 5 + .../mpe/juce_MPESynthesiserBase.h | 6 +- .../mpe/juce_MPESynthesiserVoice.cpp | 5 + .../mpe/juce_MPESynthesiserVoice.h | 5 +- .../juce_audio_basics/mpe/juce_MPEValue.cpp | 5 + modules/juce_audio_basics/mpe/juce_MPEValue.h | 6 +- .../juce_audio_basics/mpe/juce_MPEZone.cpp | 5 + modules/juce_audio_basics/mpe/juce_MPEZone.h | 6 +- .../mpe/juce_MPEZoneLayout.cpp | 5 + .../mpe/juce_MPEZoneLayout.h | 6 +- .../native/juce_mac_CoreAudioLayouts.h | 5 +- .../sources/juce_AudioSource.h | 6 +- .../sources/juce_BufferingAudioSource.cpp | 5 + .../sources/juce_BufferingAudioSource.h | 6 +- .../juce_ChannelRemappingAudioSource.cpp | 5 + .../juce_ChannelRemappingAudioSource.h | 6 +- .../sources/juce_IIRFilterAudioSource.cpp | 5 + .../sources/juce_IIRFilterAudioSource.h | 6 +- .../sources/juce_MemoryAudioSource.cpp | 6 +- .../sources/juce_MemoryAudioSource.h | 6 +- .../sources/juce_MixerAudioSource.cpp | 5 + .../sources/juce_MixerAudioSource.h | 6 +- .../sources/juce_PositionableAudioSource.h | 6 +- .../sources/juce_ResamplingAudioSource.cpp | 5 + .../sources/juce_ResamplingAudioSource.h | 6 +- .../sources/juce_ReverbAudioSource.cpp | 5 + .../sources/juce_ReverbAudioSource.h | 6 +- .../sources/juce_ToneGeneratorAudioSource.cpp | 5 + .../sources/juce_ToneGeneratorAudioSource.h | 6 +- .../synthesisers/juce_Synthesiser.cpp | 5 + .../synthesisers/juce_Synthesiser.h | 6 +- .../audio_io/juce_AudioDeviceManager.cpp | 5 + .../audio_io/juce_AudioDeviceManager.h | 6 +- .../audio_io/juce_AudioIODevice.cpp | 5 + .../audio_io/juce_AudioIODevice.h | 5 +- .../audio_io/juce_AudioIODeviceType.cpp | 5 + .../audio_io/juce_AudioIODeviceType.h | 6 +- .../audio_io/juce_SystemAudioVolume.h | 6 +- .../juce_audio_devices/juce_audio_devices.cpp | 18 +-- .../juce_audio_devices/juce_audio_devices.h | 5 - .../midi_io/juce_MidiInput.h | 5 +- .../midi_io/juce_MidiMessageCollector.cpp | 5 + .../midi_io/juce_MidiMessageCollector.h | 6 +- .../midi_io/juce_MidiOutput.cpp | 5 + .../midi_io/juce_MidiOutput.h | 6 +- .../native/juce_MidiDataConcatenator.h | 16 +- .../native/juce_android_Audio.cpp | 6 +- .../native/juce_android_Midi.cpp | 5 + .../native/juce_android_OpenSL.cpp | 6 +- .../native/juce_ios_Audio.cpp | 13 +- .../native/juce_ios_Audio.h | 5 +- .../native/juce_linux_ALSA.cpp | 5 + .../native/juce_linux_JackAudio.cpp | 6 +- .../native/juce_linux_Midi.cpp | 5 + .../native/juce_mac_CoreAudio.cpp | 5 + .../native/juce_mac_CoreMidi.cpp | 5 + .../native/juce_win32_ASIO.cpp | 5 + .../native/juce_win32_DirectSound.cpp | 4 +- .../native/juce_win32_Midi.cpp | 32 ++-- .../native/juce_win32_WASAPI.cpp | 5 + .../sources/juce_AudioSourcePlayer.cpp | 5 + .../sources/juce_AudioSourcePlayer.h | 6 +- .../sources/juce_AudioTransportSource.cpp | 20 +-- .../sources/juce_AudioTransportSource.h | 26 +-- .../codecs/juce_AiffAudioFormat.cpp | 5 + .../codecs/juce_AiffAudioFormat.h | 5 + .../codecs/juce_CoreAudioFormat.cpp | 6 + .../codecs/juce_CoreAudioFormat.h | 5 + .../codecs/juce_FlacAudioFormat.cpp | 5 + .../codecs/juce_FlacAudioFormat.h | 5 + .../codecs/juce_LAMEEncoderAudioFormat.cpp | 5 + .../codecs/juce_LAMEEncoderAudioFormat.h | 5 + .../codecs/juce_MP3AudioFormat.cpp | 5 + .../codecs/juce_MP3AudioFormat.h | 5 + .../codecs/juce_OggVorbisAudioFormat.cpp | 5 + .../codecs/juce_OggVorbisAudioFormat.h | 5 + .../codecs/juce_WavAudioFormat.cpp | 5 + .../codecs/juce_WavAudioFormat.h | 5 + .../codecs/juce_WindowsMediaAudioFormat.cpp | 5 + .../codecs/juce_WindowsMediaAudioFormat.h | 5 + .../format/juce_AudioFormat.cpp | 5 + .../format/juce_AudioFormat.h | 6 +- .../format/juce_AudioFormatManager.cpp | 5 + .../format/juce_AudioFormatManager.h | 6 +- .../format/juce_AudioFormatReader.cpp | 5 + .../format/juce_AudioFormatReader.h | 7 +- .../format/juce_AudioFormatReaderSource.cpp | 5 + .../format/juce_AudioFormatReaderSource.h | 6 +- .../format/juce_AudioFormatWriter.cpp | 5 + .../format/juce_AudioFormatWriter.h | 6 +- .../format/juce_AudioSubsectionReader.cpp | 5 + .../format/juce_AudioSubsectionReader.h | 6 +- .../juce_BufferingAudioFormatReader.cpp | 5 + .../format/juce_BufferingAudioFormatReader.h | 5 +- .../juce_MemoryMappedAudioFormatReader.h | 6 +- .../juce_audio_formats/juce_audio_formats.cpp | 5 - .../juce_audio_formats/juce_audio_formats.h | 6 - .../sampler/juce_Sampler.cpp | 5 + .../juce_audio_formats/sampler/juce_Sampler.h | 6 +- .../AAX/juce_AAX_Modifier_Injector.h | 5 +- .../AAX/juce_AAX_Wrapper.cpp | 7 +- .../AU/juce_AU_Wrapper.mm | 2 + .../AU/juce_AUv3_Wrapper.mm | 7 +- .../RTAS/juce_RTAS_DigiCode1.cpp | 5 + .../RTAS/juce_RTAS_DigiCode2.cpp | 5 + .../RTAS/juce_RTAS_DigiCode3.cpp | 5 + .../RTAS/juce_RTAS_DigiCode_Header.h | 5 +- .../RTAS/juce_RTAS_WinUtilities.cpp | 5 + .../RTAS/juce_RTAS_Wrapper.cpp | 5 + .../Standalone/juce_StandaloneFilterApp.cpp | 16 +- .../Standalone/juce_StandaloneFilterWindow.h | 5 +- .../VST/juce_VSTCallbackHandler.h | 5 +- .../VST/juce_VST_Wrapper.cpp | 1 + .../juce_audio_plugin_client.h | 7 +- .../juce_audio_plugin_client_Standalone.cpp | 2 +- .../utility/juce_CarbonVisibility.h | 5 +- .../utility/juce_FakeMouseMoveGenerator.h | 5 +- .../utility/juce_IncludeModuleHeaders.h | 6 +- .../utility/juce_PluginHostType.h | 5 + .../utility/juce_PluginUtilities.cpp | 11 +- .../utility/juce_WindowsHooks.h | 16 +- .../format/juce_AudioPluginFormat.cpp | 5 + .../format/juce_AudioPluginFormat.h | 6 +- .../format/juce_AudioPluginFormatManager.cpp | 5 + .../format/juce_AudioPluginFormatManager.h | 6 +- .../format_types/juce_AU_Shared.h | 148 +++++++++--------- .../format_types/juce_AudioUnitPluginFormat.h | 5 + .../juce_AudioUnitPluginFormat.mm | 17 +- .../format_types/juce_LADSPAPluginFormat.cpp | 4 +- .../format_types/juce_LADSPAPluginFormat.h | 5 + .../format_types/juce_VST3Common.h | 5 +- .../format_types/juce_VST3Headers.h | 2 - .../format_types/juce_VST3PluginFormat.cpp | 9 +- .../format_types/juce_VST3PluginFormat.h | 7 +- .../format_types/juce_VSTCommon.h | 5 +- .../format_types/juce_VSTInterface.h | 3 - .../format_types/juce_VSTMidiEventList.h | 9 +- .../format_types/juce_VSTPluginFormat.cpp | 7 +- .../format_types/juce_VSTPluginFormat.h | 4 + .../juce_audio_processors.cpp | 9 +- .../juce_audio_processors.h | 6 - .../processors/juce_AudioPluginInstance.h | 6 +- .../processors/juce_AudioProcessor.cpp | 5 + .../processors/juce_AudioProcessor.h | 5 +- .../processors/juce_AudioProcessorEditor.cpp | 5 + .../processors/juce_AudioProcessorEditor.h | 7 +- .../processors/juce_AudioProcessorGraph.cpp | 5 + .../processors/juce_AudioProcessorGraph.h | 5 +- .../processors/juce_AudioProcessorListener.h | 6 +- .../processors/juce_AudioProcessorParameter.h | 6 +- .../juce_GenericAudioProcessorEditor.cpp | 5 + .../juce_GenericAudioProcessorEditor.h | 6 +- .../processors/juce_PluginDescription.cpp | 5 + .../processors/juce_PluginDescription.h | 6 +- .../scanning/juce_KnownPluginList.cpp | 5 + .../scanning/juce_KnownPluginList.h | 6 +- .../scanning/juce_PluginDirectoryScanner.cpp | 5 + .../scanning/juce_PluginDirectoryScanner.h | 6 +- .../scanning/juce_PluginListComponent.cpp | 5 + .../scanning/juce_PluginListComponent.h | 6 +- .../utilities/juce_AudioParameterBool.h | 5 + .../utilities/juce_AudioParameterChoice.h | 5 + .../utilities/juce_AudioParameterFloat.h | 5 + .../utilities/juce_AudioParameterInt.h | 5 + .../juce_AudioProcessorParameterWithID.h | 5 + .../juce_AudioProcessorParameters.cpp | 5 + .../juce_AudioProcessorValueTreeState.cpp | 6 +- .../juce_AudioProcessorValueTreeState.h | 5 +- .../audio_cd/juce_AudioCDBurner.h | 5 +- .../audio_cd/juce_AudioCDReader.cpp | 5 + .../audio_cd/juce_AudioCDReader.h | 5 +- .../gui/juce_AudioAppComponent.cpp | 5 + .../gui/juce_AudioAppComponent.h | 6 +- .../gui/juce_AudioDeviceSelectorComponent.cpp | 5 + .../gui/juce_AudioDeviceSelectorComponent.h | 6 +- .../gui/juce_AudioThumbnail.cpp | 5 + .../gui/juce_AudioThumbnail.h | 6 +- .../gui/juce_AudioThumbnailBase.h | 5 +- .../gui/juce_AudioThumbnailCache.cpp | 5 + .../gui/juce_AudioThumbnailCache.h | 6 +- .../gui/juce_AudioVisualiserComponent.cpp | 5 + .../gui/juce_AudioVisualiserComponent.h | 6 +- .../juce_BluetoothMidiDevicePairingDialogue.h | 5 +- .../gui/juce_MidiKeyboardComponent.cpp | 5 + .../gui/juce_MidiKeyboardComponent.h | 6 +- modules/juce_audio_utils/juce_audio_utils.cpp | 16 +- modules/juce_audio_utils/juce_audio_utils.h | 5 - ...oid_BluetoothMidiDevicePairingDialogue.cpp | 6 +- ..._ios_BluetoothMidiDevicePairingDialogue.mm | 16 +- .../native/juce_linux_AudioCDReader.cpp | 5 + ...nux_BluetoothMidiDevicePairingDialogue.cpp | 5 + .../native/juce_mac_AudioCDReader.mm | 7 +- ..._mac_BluetoothMidiDevicePairingDialogue.mm | 5 + .../native/juce_win32_AudioCDBurner.cpp | 5 + .../native/juce_win32_AudioCDReader.cpp | 11 +- ...win_BluetoothMidiDevicePairingDialogue.cpp | 5 + .../players/juce_AudioProcessorPlayer.cpp | 5 + .../players/juce_AudioProcessorPlayer.h | 5 +- .../players/juce_SoundPlayer.cpp | 6 +- .../players/juce_SoundPlayer.h | 5 +- .../juce_blocks_basics/blocks/juce_Block.cpp | 4 + .../juce_blocks_basics/blocks/juce_Block.h | 4 + .../blocks/juce_BlockConfigManager.h | 5 +- .../blocks/juce_ControlButton.h | 4 + .../juce_blocks_basics/blocks/juce_LEDGrid.h | 4 + .../juce_blocks_basics/blocks/juce_LEDRow.h | 4 + .../blocks/juce_StatusLight.h | 4 + .../blocks/juce_TouchList.h | 4 + .../blocks/juce_TouchSurface.h | 4 + .../juce_blocks_basics/juce_blocks_basics.cpp | 30 ++-- .../juce_blocks_basics/juce_blocks_basics.h | 50 +++--- .../littlefoot/juce_LittleFootCompiler.h | 2 - .../littlefoot/juce_LittleFootRemoteHeap.h | 2 - .../protocol/juce_BitPackingUtilities.h | 7 + .../protocol/juce_BlockModels.h | 7 + .../protocol/juce_BlocksProtocolDefinitions.h | 7 + .../protocol/juce_HostPacketBuilder.h | 7 + .../protocol/juce_HostPacketDecoder.h | 7 + .../topology/juce_PhysicalTopologySource.cpp | 5 + .../topology/juce_PhysicalTopologySource.h | 4 + .../topology/juce_RuleBasedTopologySource.cpp | 4 + .../topology/juce_RuleBasedTopologySource.h | 4 + .../topology/juce_Topology.h | 4 + .../topology/juce_TopologySource.h | 4 + .../visualisers/juce_BitmapLEDProgram.cpp | 4 + .../visualisers/juce_BitmapLEDProgram.h | 4 + .../visualisers/juce_DrumPadLEDProgram.cpp | 4 + .../visualisers/juce_DrumPadLEDProgram.h | 5 + modules/juce_box2d/juce_box2d.cpp | 3 - modules/juce_box2d/juce_box2d.h | 5 +- .../juce_box2d/utils/juce_Box2DRenderer.cpp | 5 + modules/juce_box2d/utils/juce_Box2DRenderer.h | 5 +- .../containers/juce_AbstractFifo.cpp | 5 + .../juce_core/containers/juce_AbstractFifo.h | 6 +- modules/juce_core/containers/juce_Array.h | 6 +- .../containers/juce_ArrayAllocationBase.h | 6 +- .../containers/juce_DynamicObject.cpp | 5 + .../juce_core/containers/juce_DynamicObject.h | 6 +- .../containers/juce_ElementComparator.h | 5 +- modules/juce_core/containers/juce_HashMap.h | 6 +- .../containers/juce_HashMap_test.cpp | 5 + .../containers/juce_LinkedListPointer.h | 6 +- .../containers/juce_ListenerList.cpp | 5 + .../juce_core/containers/juce_ListenerList.h | 6 +- .../containers/juce_NamedValueSet.cpp | 6 +- .../juce_core/containers/juce_NamedValueSet.h | 6 +- .../juce_core/containers/juce_OwnedArray.h | 6 +- .../juce_core/containers/juce_PropertySet.cpp | 5 + .../juce_core/containers/juce_PropertySet.h | 6 +- .../containers/juce_ReferenceCountedArray.h | 6 +- .../containers/juce_ScopedValueSetter.h | 6 +- modules/juce_core/containers/juce_SortedSet.h | 5 +- modules/juce_core/containers/juce_SparseSet.h | 6 +- modules/juce_core/containers/juce_Variant.cpp | 5 + modules/juce_core/containers/juce_Variant.h | 6 +- .../files/juce_DirectoryIterator.cpp | 5 + .../juce_core/files/juce_DirectoryIterator.h | 6 +- modules/juce_core/files/juce_File.cpp | 5 + modules/juce_core/files/juce_File.h | 6 +- modules/juce_core/files/juce_FileFilter.cpp | 5 + modules/juce_core/files/juce_FileFilter.h | 6 +- .../juce_core/files/juce_FileInputStream.cpp | 5 + .../juce_core/files/juce_FileInputStream.h | 6 +- .../juce_core/files/juce_FileOutputStream.cpp | 5 + .../juce_core/files/juce_FileOutputStream.h | 6 +- .../juce_core/files/juce_FileSearchPath.cpp | 5 + modules/juce_core/files/juce_FileSearchPath.h | 6 +- .../juce_core/files/juce_MemoryMappedFile.h | 6 +- .../juce_core/files/juce_TemporaryFile.cpp | 5 + modules/juce_core/files/juce_TemporaryFile.h | 6 +- .../files/juce_WildcardFileFilter.cpp | 5 + .../juce_core/files/juce_WildcardFileFilter.h | 6 +- modules/juce_core/javascript/juce_JSON.cpp | 11 +- modules/juce_core/javascript/juce_JSON.h | 6 +- .../juce_core/javascript/juce_Javascript.cpp | 5 + .../juce_core/javascript/juce_Javascript.h | 6 +- modules/juce_core/juce_core.cpp | 11 +- modules/juce_core/juce_core.h | 33 ++-- modules/juce_core/logging/juce_FileLogger.cpp | 5 + modules/juce_core/logging/juce_FileLogger.h | 6 +- modules/juce_core/logging/juce_Logger.cpp | 5 + modules/juce_core/logging/juce_Logger.h | 6 +- modules/juce_core/maths/juce_BigInteger.cpp | 5 + modules/juce_core/maths/juce_BigInteger.h | 6 +- modules/juce_core/maths/juce_Expression.cpp | 5 + modules/juce_core/maths/juce_Expression.h | 6 +- modules/juce_core/maths/juce_MathsFunctions.h | 6 +- .../juce_core/maths/juce_NormalisableRange.h | 6 +- modules/juce_core/maths/juce_Random.cpp | 7 +- modules/juce_core/maths/juce_Random.h | 6 +- modules/juce_core/maths/juce_Range.h | 6 +- .../maths/juce_StatisticsAccumulator.h | 6 +- modules/juce_core/memory/juce_Atomic.h | 5 +- modules/juce_core/memory/juce_ByteOrder.h | 6 +- .../memory/juce_ContainerDeletePolicy.h | 5 +- modules/juce_core/memory/juce_HeapBlock.h | 5 +- .../memory/juce_LeakedObjectDetector.h | 6 +- modules/juce_core/memory/juce_Memory.h | 8 +- modules/juce_core/memory/juce_MemoryBlock.cpp | 8 +- modules/juce_core/memory/juce_MemoryBlock.h | 6 +- .../memory/juce_OptionalScopedPointer.h | 6 +- .../memory/juce_ReferenceCountedObject.h | 6 +- modules/juce_core/memory/juce_ScopedPointer.h | 5 +- .../memory/juce_SharedResourcePointer.h | 6 +- modules/juce_core/memory/juce_Singleton.h | 6 +- modules/juce_core/memory/juce_WeakReference.h | 6 +- modules/juce_core/misc/juce_Result.cpp | 5 + modules/juce_core/misc/juce_Result.h | 6 +- .../misc/juce_RuntimePermissions.cpp | 22 +-- .../juce_core/misc/juce_RuntimePermissions.h | 5 +- .../juce_core/misc/juce_StdFunctionCompat.cpp | 5 + .../juce_core/misc/juce_StdFunctionCompat.h | 2 - modules/juce_core/misc/juce_Uuid.cpp | 5 + modules/juce_core/misc/juce_Uuid.h | 6 +- modules/juce_core/misc/juce_WindowsRegistry.h | 5 +- .../juce_core/native/juce_android_Files.cpp | 6 +- .../native/juce_android_JNIHelpers.h | 5 +- .../juce_core/native/juce_android_Misc.cpp | 5 + .../juce_core/native/juce_android_Network.cpp | 6 +- .../juce_android_RuntimePermissions.cpp | 28 ++-- .../native/juce_android_SystemStats.cpp | 6 +- .../juce_core/native/juce_android_Threads.cpp | 5 + .../juce_core/native/juce_curl_Network.cpp | 5 + .../native/juce_linux_CommonFile.cpp | 5 + modules/juce_core/native/juce_linux_Files.cpp | 5 + .../juce_core/native/juce_linux_Network.cpp | 5 + .../native/juce_linux_SystemStats.cpp | 5 + .../juce_core/native/juce_linux_Threads.cpp | 5 + modules/juce_core/native/juce_mac_Files.mm | 5 + modules/juce_core/native/juce_mac_Network.mm | 5 + modules/juce_core/native/juce_mac_Strings.mm | 5 + .../juce_core/native/juce_mac_SystemStats.mm | 5 + modules/juce_core/native/juce_mac_Threads.mm | 5 + .../juce_core/native/juce_osx_ObjCHelpers.h | 137 ++++++++-------- .../juce_core/native/juce_posix_NamedPipe.cpp | 5 + .../juce_core/native/juce_posix_SharedCode.h | 5 + .../juce_core/native/juce_win32_ComSmartPtr.h | 5 +- modules/juce_core/native/juce_win32_Files.cpp | 5 + .../juce_core/native/juce_win32_Network.cpp | 5 + .../juce_core/native/juce_win32_Registry.cpp | 5 + .../native/juce_win32_SystemStats.cpp | 5 + .../juce_core/native/juce_win32_Threads.cpp | 9 +- modules/juce_core/network/juce_IPAddress.cpp | 5 + modules/juce_core/network/juce_IPAddress.h | 6 +- modules/juce_core/network/juce_MACAddress.cpp | 5 + modules/juce_core/network/juce_MACAddress.h | 6 +- modules/juce_core/network/juce_NamedPipe.cpp | 7 +- modules/juce_core/network/juce_NamedPipe.h | 6 +- modules/juce_core/network/juce_Socket.cpp | 5 + modules/juce_core/network/juce_Socket.h | 6 +- modules/juce_core/network/juce_URL.cpp | 5 + modules/juce_core/network/juce_URL.h | 6 +- .../juce_core/network/juce_WebInputStream.cpp | 5 + .../juce_core/network/juce_WebInputStream.h | 5 +- .../streams/juce_BufferedInputStream.cpp | 5 + .../streams/juce_BufferedInputStream.h | 6 +- .../streams/juce_FileInputSource.cpp | 5 + .../juce_core/streams/juce_FileInputSource.h | 6 +- modules/juce_core/streams/juce_InputSource.h | 6 +- .../juce_core/streams/juce_InputStream.cpp | 5 + modules/juce_core/streams/juce_InputStream.h | 6 +- .../streams/juce_MemoryInputStream.cpp | 5 + .../streams/juce_MemoryInputStream.h | 6 +- .../streams/juce_MemoryOutputStream.cpp | 5 + .../streams/juce_MemoryOutputStream.h | 6 +- .../juce_core/streams/juce_OutputStream.cpp | 5 + modules/juce_core/streams/juce_OutputStream.h | 6 +- .../streams/juce_SubregionStream.cpp | 5 + .../juce_core/streams/juce_SubregionStream.h | 6 +- modules/juce_core/system/juce_PlatformDefs.h | 7 +- modules/juce_core/system/juce_SystemStats.cpp | 5 + modules/juce_core/system/juce_SystemStats.h | 6 +- modules/juce_core/text/juce_Base64.cpp | 5 + modules/juce_core/text/juce_Base64.h | 6 +- .../juce_core/text/juce_CharPointer_ASCII.h | 6 +- .../juce_core/text/juce_CharPointer_UTF16.h | 6 +- .../juce_core/text/juce_CharPointer_UTF32.h | 6 +- .../juce_core/text/juce_CharPointer_UTF8.h | 5 +- .../text/juce_CharacterFunctions.cpp | 6 +- .../juce_core/text/juce_CharacterFunctions.h | 6 +- modules/juce_core/text/juce_Identifier.cpp | 5 + modules/juce_core/text/juce_Identifier.h | 6 +- .../juce_core/text/juce_LocalisedStrings.cpp | 5 + .../juce_core/text/juce_LocalisedStrings.h | 6 +- modules/juce_core/text/juce_NewLine.h | 6 +- modules/juce_core/text/juce_String.cpp | 5 + modules/juce_core/text/juce_String.h | 9 +- modules/juce_core/text/juce_StringArray.cpp | 5 + modules/juce_core/text/juce_StringArray.h | 6 +- .../juce_core/text/juce_StringPairArray.cpp | 8 +- modules/juce_core/text/juce_StringPairArray.h | 6 +- modules/juce_core/text/juce_StringPool.cpp | 5 + modules/juce_core/text/juce_StringPool.h | 6 +- modules/juce_core/text/juce_StringRef.h | 5 +- modules/juce_core/text/juce_TextDiff.cpp | 5 + modules/juce_core/text/juce_TextDiff.h | 6 +- .../juce_core/threads/juce_ChildProcess.cpp | 7 +- modules/juce_core/threads/juce_ChildProcess.h | 6 +- .../juce_core/threads/juce_CriticalSection.h | 6 +- .../juce_core/threads/juce_DynamicLibrary.h | 13 +- .../threads/juce_HighResolutionTimer.cpp | 5 + .../threads/juce_HighResolutionTimer.h | 5 +- .../juce_core/threads/juce_InterProcessLock.h | 6 +- modules/juce_core/threads/juce_Process.h | 6 +- .../juce_core/threads/juce_ReadWriteLock.cpp | 5 + .../juce_core/threads/juce_ReadWriteLock.h | 6 +- modules/juce_core/threads/juce_ScopedLock.h | 6 +- .../juce_core/threads/juce_ScopedReadLock.h | 6 +- .../juce_core/threads/juce_ScopedWriteLock.h | 6 +- modules/juce_core/threads/juce_SpinLock.h | 6 +- modules/juce_core/threads/juce_Thread.cpp | 5 + modules/juce_core/threads/juce_Thread.h | 6 +- .../juce_core/threads/juce_ThreadLocalValue.h | 5 +- modules/juce_core/threads/juce_ThreadPool.cpp | 5 + modules/juce_core/threads/juce_ThreadPool.h | 5 +- .../threads/juce_TimeSliceThread.cpp | 9 +- .../juce_core/threads/juce_TimeSliceThread.h | 7 +- .../juce_core/threads/juce_WaitableEvent.h | 6 +- .../time/juce_PerformanceCounter.cpp | 5 + .../juce_core/time/juce_PerformanceCounter.h | 6 +- modules/juce_core/time/juce_RelativeTime.cpp | 5 + modules/juce_core/time/juce_RelativeTime.h | 6 +- modules/juce_core/time/juce_Time.cpp | 5 + modules/juce_core/time/juce_Time.h | 6 +- .../juce_core/unit_tests/juce_UnitTest.cpp | 5 + modules/juce_core/unit_tests/juce_UnitTest.h | 5 +- modules/juce_core/xml/juce_XmlDocument.cpp | 19 +-- modules/juce_core/xml/juce_XmlDocument.h | 13 +- modules/juce_core/xml/juce_XmlElement.cpp | 62 ++++---- modules/juce_core/xml/juce_XmlElement.h | 6 +- .../zip/juce_GZIPCompressorOutputStream.cpp | 15 +- .../zip/juce_GZIPCompressorOutputStream.h | 6 +- .../zip/juce_GZIPDecompressorInputStream.cpp | 21 ++- .../zip/juce_GZIPDecompressorInputStream.h | 6 +- modules/juce_core/zip/juce_ZipFile.cpp | 5 + modules/juce_core/zip/juce_ZipFile.h | 6 +- .../encryption/juce_BlowFish.cpp | 5 + .../encryption/juce_BlowFish.h | 6 +- .../encryption/juce_Primes.cpp | 5 + .../encryption/juce_Primes.h | 6 +- .../encryption/juce_RSAKey.cpp | 5 + .../encryption/juce_RSAKey.h | 6 +- .../juce_cryptography/hashing/juce_MD5.cpp | 5 + modules/juce_cryptography/hashing/juce_MD5.h | 6 +- .../juce_cryptography/hashing/juce_SHA256.cpp | 5 + .../juce_cryptography/hashing/juce_SHA256.h | 6 +- .../hashing/juce_Whirlpool.cpp | 5 + .../hashing/juce_Whirlpool.h | 6 +- .../juce_cryptography/juce_cryptography.cpp | 5 - modules/juce_cryptography/juce_cryptography.h | 5 - .../juce_ApplicationProperties.cpp | 5 + .../juce_ApplicationProperties.h | 6 +- .../app_properties/juce_PropertiesFile.cpp | 5 + .../app_properties/juce_PropertiesFile.h | 6 +- .../juce_data_structures.cpp | 5 - .../juce_data_structures.h | 5 - .../undomanager/juce_UndoManager.cpp | 5 + .../undomanager/juce_UndoManager.h | 6 +- .../undomanager/juce_UndoableAction.h | 6 +- .../values/juce_CachedValue.cpp | 5 + .../values/juce_CachedValue.h | 6 +- .../values/juce_Value.cpp | 5 + .../juce_data_structures/values/juce_Value.h | 6 +- .../values/juce_ValueTree.cpp | 5 + .../values/juce_ValueTree.h | 6 +- .../values/juce_ValueTreeSynchroniser.cpp | 5 + .../values/juce_ValueTreeSynchroniser.h | 6 +- modules/juce_dsp/containers/juce_AudioBlock.h | 8 + .../juce_dsp/containers/juce_SIMDRegister.h | 12 +- .../containers/juce_SIMDRegister_test.cpp | 7 + .../filter_design/juce_FilterDesign.cpp | 7 + .../filter_design/juce_FilterDesign.h | 7 + .../juce_dsp/frequency/juce_Convolution.cpp | 7 + modules/juce_dsp/frequency/juce_Convolution.h | 7 + modules/juce_dsp/frequency/juce_FFT.cpp | 7 + modules/juce_dsp/frequency/juce_FFT.h | 7 + modules/juce_dsp/frequency/juce_FFT_test.cpp | 7 + modules/juce_dsp/frequency/juce_Windowing.cpp | 8 + modules/juce_dsp/frequency/juce_Windowing.h | 7 + modules/juce_dsp/juce_dsp.cpp | 68 ++++---- modules/juce_dsp/juce_dsp.h | 91 +++++------ .../maths/juce_FastMathApproximations.h | 7 + modules/juce_dsp/maths/juce_LookupTable.cpp | 8 + modules/juce_dsp/maths/juce_LookupTable.h | 7 + modules/juce_dsp/maths/juce_Matrix.cpp | 7 + modules/juce_dsp/maths/juce_Matrix.h | 8 + modules/juce_dsp/maths/juce_Matrix_test.cpp | 7 + modules/juce_dsp/maths/juce_Polynomial.h | 7 + .../juce_dsp/maths/juce_SpecialFunctions.cpp | 7 + .../juce_dsp/maths/juce_SpecialFunctions.h | 7 + .../native/juce_avx_SIMDNativeOps.cpp | 43 ++--- .../juce_dsp/native/juce_avx_SIMDNativeOps.h | 7 + .../native/juce_fallback_SIMDNativeOps.h | 7 + .../native/juce_neon_SIMDNativeOps.cpp | 31 ++-- .../juce_dsp/native/juce_neon_SIMDNativeOps.h | 8 + .../native/juce_sse_SIMDNativeOps.cpp | 43 ++--- .../juce_dsp/native/juce_sse_SIMDNativeOps.h | 8 + modules/juce_dsp/processors/juce_Bias.h | 7 + .../juce_dsp/processors/juce_FIRFilter.cpp | 7 + modules/juce_dsp/processors/juce_FIRFilter.h | 7 + .../processors/juce_FIRFilter_test.cpp | 7 + modules/juce_dsp/processors/juce_Gain.h | 7 + .../juce_dsp/processors/juce_IIRFilter.cpp | 7 + modules/juce_dsp/processors/juce_IIRFilter.h | 12 +- .../juce_dsp/processors/juce_IIRFilter_Impl.h | 11 ++ modules/juce_dsp/processors/juce_Oscillator.h | 7 + .../juce_dsp/processors/juce_Oversampling.cpp | 8 +- .../juce_dsp/processors/juce_Oversampling.h | 8 + .../juce_dsp/processors/juce_ProcessContext.h | 7 + .../juce_dsp/processors/juce_ProcessorChain.h | 7 + .../processors/juce_ProcessorDuplicator.h | 7 + .../processors/juce_ProcessorWrapper.h | 7 + .../processors/juce_StateVariableFilter.h | 7 + modules/juce_dsp/processors/juce_WaveShaper.h | 7 + .../broadcasters/juce_ActionBroadcaster.cpp | 5 + .../broadcasters/juce_ActionBroadcaster.h | 6 +- .../broadcasters/juce_ActionListener.h | 6 +- .../broadcasters/juce_AsyncUpdater.cpp | 5 + .../broadcasters/juce_AsyncUpdater.h | 6 +- .../broadcasters/juce_ChangeBroadcaster.cpp | 5 + .../broadcasters/juce_ChangeBroadcaster.h | 6 +- .../broadcasters/juce_ChangeListener.h | 5 +- .../juce_ConnectedChildProcess.cpp | 5 + .../interprocess/juce_ConnectedChildProcess.h | 5 +- .../juce_InterprocessConnection.cpp | 5 + .../juce_InterprocessConnection.h | 5 +- .../juce_InterprocessConnectionServer.cpp | 5 + .../juce_InterprocessConnectionServer.h | 6 +- modules/juce_events/juce_events.cpp | 5 - modules/juce_events/juce_events.h | 6 - .../messages/juce_ApplicationBase.cpp | 5 + .../messages/juce_ApplicationBase.h | 6 +- .../messages/juce_CallbackMessage.h | 6 +- .../messages/juce_DeletedAtShutdown.cpp | 5 + .../messages/juce_DeletedAtShutdown.h | 6 +- .../messages/juce_Initialisation.h | 6 +- modules/juce_events/messages/juce_Message.h | 5 +- .../messages/juce_MessageListener.cpp | 5 + .../messages/juce_MessageListener.h | 6 +- .../messages/juce_MessageManager.cpp | 5 + .../messages/juce_MessageManager.h | 5 +- .../juce_MountedVolumeListChangeDetector.h | 5 +- .../messages/juce_NotificationType.h | 5 +- .../native/juce_android_Messaging.cpp | 6 +- .../native/juce_ios_MessageManager.mm | 5 + .../juce_events/native/juce_linux_EventLoop.h | 5 +- .../native/juce_linux_Messaging.cpp | 43 +++-- .../native/juce_mac_MessageManager.mm | 5 + .../native/juce_osx_MessageQueue.h | 5 +- .../native/juce_win32_HiddenMessageWindow.h | 7 +- .../native/juce_win32_Messaging.cpp | 5 + .../native/juce_win32_WinRTWrapper.cpp | 5 +- .../native/juce_win32_WinRTWrapper.h | 11 +- .../juce_events/timers/juce_MultiTimer.cpp | 5 + modules/juce_events/timers/juce_MultiTimer.h | 6 +- modules/juce_events/timers/juce_Timer.cpp | 5 + modules/juce_events/timers/juce_Timer.h | 6 +- modules/juce_graphics/colour/juce_Colour.cpp | 5 + modules/juce_graphics/colour/juce_Colour.h | 6 +- .../colour/juce_ColourGradient.cpp | 5 + .../colour/juce_ColourGradient.h | 6 +- modules/juce_graphics/colour/juce_Colours.cpp | 5 + modules/juce_graphics/colour/juce_Colours.h | 6 +- .../juce_graphics/colour/juce_FillType.cpp | 5 + modules/juce_graphics/colour/juce_FillType.h | 6 +- .../juce_graphics/colour/juce_PixelFormats.h | 6 +- .../contexts/juce_GraphicsContext.cpp | 5 + .../contexts/juce_GraphicsContext.h | 6 +- .../contexts/juce_LowLevelGraphicsContext.h | 6 +- ...uce_LowLevelGraphicsPostScriptRenderer.cpp | 5 + .../juce_LowLevelGraphicsPostScriptRenderer.h | 6 +- .../juce_LowLevelGraphicsSoftwareRenderer.cpp | 5 + .../juce_LowLevelGraphicsSoftwareRenderer.h | 6 +- .../effects/juce_DropShadowEffect.cpp | 5 + .../effects/juce_DropShadowEffect.h | 6 +- .../juce_graphics/effects/juce_GlowEffect.cpp | 5 + .../juce_graphics/effects/juce_GlowEffect.h | 6 +- .../effects/juce_ImageEffectFilter.h | 6 +- .../fonts/juce_AttributedString.cpp | 5 + .../fonts/juce_AttributedString.h | 6 +- .../fonts/juce_CustomTypeface.cpp | 5 + .../juce_graphics/fonts/juce_CustomTypeface.h | 6 +- modules/juce_graphics/fonts/juce_Font.cpp | 5 + modules/juce_graphics/fonts/juce_Font.h | 6 +- .../fonts/juce_GlyphArrangement.cpp | 5 + .../fonts/juce_GlyphArrangement.h | 6 +- .../juce_graphics/fonts/juce_TextLayout.cpp | 5 + modules/juce_graphics/fonts/juce_TextLayout.h | 6 +- modules/juce_graphics/fonts/juce_Typeface.cpp | 5 + modules/juce_graphics/fonts/juce_Typeface.h | 6 +- .../geometry/juce_AffineTransform.cpp | 5 + .../geometry/juce_AffineTransform.h | 6 +- .../juce_graphics/geometry/juce_BorderSize.h | 6 +- .../juce_graphics/geometry/juce_EdgeTable.cpp | 5 + .../juce_graphics/geometry/juce_EdgeTable.h | 6 +- modules/juce_graphics/geometry/juce_Line.h | 6 +- modules/juce_graphics/geometry/juce_Path.cpp | 5 + modules/juce_graphics/geometry/juce_Path.h | 6 +- .../geometry/juce_PathIterator.cpp | 5 + .../geometry/juce_PathIterator.h | 6 +- .../geometry/juce_PathStrokeType.cpp | 5 + .../geometry/juce_PathStrokeType.h | 6 +- modules/juce_graphics/geometry/juce_Point.h | 6 +- .../juce_graphics/geometry/juce_Rectangle.h | 6 +- .../geometry/juce_RectangleList.h | 6 +- .../image_formats/juce_GIFLoader.cpp | 5 + .../image_formats/juce_JPEGLoader.cpp | 5 + .../image_formats/juce_PNGLoader.cpp | 5 + modules/juce_graphics/images/juce_Image.cpp | 5 + modules/juce_graphics/images/juce_Image.h | 5 +- .../juce_graphics/images/juce_ImageCache.cpp | 5 + .../juce_graphics/images/juce_ImageCache.h | 6 +- .../images/juce_ImageConvolutionKernel.cpp | 5 + .../images/juce_ImageConvolutionKernel.h | 6 +- .../images/juce_ImageFileFormat.cpp | 5 + .../images/juce_ImageFileFormat.h | 6 +- modules/juce_graphics/juce_graphics.cpp | 4 - modules/juce_graphics/juce_graphics.h | 18 +-- .../native/juce_RenderingHelpers.h | 5 +- .../native/juce_android_Fonts.cpp | 5 + .../native/juce_android_GraphicsContext.cpp | 5 + .../native/juce_android_IconHelpers.cpp | 4 +- .../native/juce_freetype_Fonts.cpp | 5 + .../juce_graphics/native/juce_linux_Fonts.cpp | 5 + .../native/juce_linux_IconHelpers.cpp | 4 +- .../native/juce_mac_CoreGraphicsContext.h | 5 +- .../native/juce_mac_CoreGraphicsContext.mm | 6 +- .../native/juce_mac_CoreGraphicsHelpers.h | 8 +- .../juce_graphics/native/juce_mac_Fonts.mm | 5 + .../native/juce_mac_IconHelpers.cpp | 13 ++ .../juce_win32_Direct2DGraphicsContext.cpp | 5 + .../juce_win32_Direct2DGraphicsContext.h | 5 +- .../juce_win32_DirectWriteTypeLayout.cpp | 5 + .../native/juce_win32_DirectWriteTypeface.cpp | 5 + .../juce_graphics/native/juce_win32_Fonts.cpp | 5 + .../native/juce_win32_IconHelpers.cpp | 4 +- .../placement/juce_Justification.h | 6 +- .../placement/juce_RectanglePlacement.cpp | 5 + .../placement/juce_RectanglePlacement.h | 6 +- .../application/juce_Application.cpp | 5 + .../application/juce_Application.h | 6 +- .../buttons/juce_ArrowButton.cpp | 5 + .../buttons/juce_ArrowButton.h | 6 +- .../juce_gui_basics/buttons/juce_Button.cpp | 5 + modules/juce_gui_basics/buttons/juce_Button.h | 6 +- .../buttons/juce_DrawableButton.cpp | 5 + .../buttons/juce_DrawableButton.h | 6 +- .../buttons/juce_HyperlinkButton.cpp | 5 + .../buttons/juce_HyperlinkButton.h | 6 +- .../buttons/juce_ImageButton.cpp | 5 + .../buttons/juce_ImageButton.h | 6 +- .../buttons/juce_ShapeButton.cpp | 5 + .../buttons/juce_ShapeButton.h | 6 +- .../buttons/juce_TextButton.cpp | 5 + .../juce_gui_basics/buttons/juce_TextButton.h | 6 +- .../buttons/juce_ToggleButton.cpp | 5 + .../buttons/juce_ToggleButton.h | 6 +- .../buttons/juce_ToolbarButton.cpp | 5 + .../buttons/juce_ToolbarButton.h | 6 +- .../commands/juce_ApplicationCommandID.h | 6 +- .../commands/juce_ApplicationCommandInfo.cpp | 5 + .../commands/juce_ApplicationCommandInfo.h | 6 +- .../juce_ApplicationCommandManager.cpp | 5 + .../commands/juce_ApplicationCommandManager.h | 6 +- .../juce_ApplicationCommandTarget.cpp | 5 + .../commands/juce_ApplicationCommandTarget.h | 6 +- .../commands/juce_KeyPressMappingSet.cpp | 5 + .../commands/juce_KeyPressMappingSet.h | 6 +- .../components/juce_CachedComponentImage.h | 6 +- .../components/juce_Component.cpp | 5 + .../components/juce_Component.h | 6 +- .../components/juce_ComponentListener.cpp | 5 + .../components/juce_ComponentListener.h | 6 +- .../components/juce_Desktop.cpp | 5 + .../juce_gui_basics/components/juce_Desktop.h | 6 +- .../components/juce_ModalComponentManager.cpp | 5 + .../components/juce_ModalComponentManager.h | 6 +- .../drawables/juce_Drawable.cpp | 5 + .../juce_gui_basics/drawables/juce_Drawable.h | 6 +- .../drawables/juce_DrawableComposite.cpp | 5 + .../drawables/juce_DrawableComposite.h | 6 +- .../drawables/juce_DrawableImage.cpp | 5 + .../drawables/juce_DrawableImage.h | 6 +- .../drawables/juce_DrawablePath.cpp | 5 + .../drawables/juce_DrawablePath.h | 6 +- .../drawables/juce_DrawableRectangle.cpp | 5 + .../drawables/juce_DrawableRectangle.h | 6 +- .../drawables/juce_DrawableShape.cpp | 5 + .../drawables/juce_DrawableShape.h | 6 +- .../drawables/juce_DrawableText.cpp | 5 + .../drawables/juce_DrawableText.h | 6 +- .../drawables/juce_SVGParser.cpp | 5 + ...juce_DirectoryContentsDisplayComponent.cpp | 5 + .../juce_DirectoryContentsDisplayComponent.h | 6 +- .../juce_DirectoryContentsList.cpp | 5 + .../filebrowser/juce_DirectoryContentsList.h | 6 +- .../filebrowser/juce_FileBrowserComponent.cpp | 5 + .../filebrowser/juce_FileBrowserComponent.h | 6 +- .../filebrowser/juce_FileBrowserListener.h | 6 +- .../filebrowser/juce_FileChooser.cpp | 5 + .../filebrowser/juce_FileChooser.h | 6 +- .../filebrowser/juce_FileChooserDialogBox.cpp | 5 + .../filebrowser/juce_FileChooserDialogBox.h | 6 +- .../filebrowser/juce_FileListComponent.cpp | 5 + .../filebrowser/juce_FileListComponent.h | 6 +- .../filebrowser/juce_FilePreviewComponent.h | 6 +- .../juce_FileSearchPathListComponent.cpp | 5 + .../juce_FileSearchPathListComponent.h | 6 +- .../filebrowser/juce_FileTreeComponent.cpp | 5 + .../filebrowser/juce_FileTreeComponent.h | 6 +- .../filebrowser/juce_FilenameComponent.cpp | 5 + .../filebrowser/juce_FilenameComponent.h | 6 +- .../juce_ImagePreviewComponent.cpp | 5 + .../filebrowser/juce_ImagePreviewComponent.h | 6 +- modules/juce_gui_basics/juce_gui_basics.cpp | 10 +- modules/juce_gui_basics/juce_gui_basics.h | 118 +++++++------- .../keyboard/juce_CaretComponent.cpp | 5 + .../keyboard/juce_CaretComponent.h | 6 +- .../keyboard/juce_KeyListener.cpp | 5 + .../keyboard/juce_KeyListener.h | 6 +- .../keyboard/juce_KeyPress.cpp | 5 + .../juce_gui_basics/keyboard/juce_KeyPress.h | 6 +- .../keyboard/juce_KeyboardFocusTraverser.cpp | 5 + .../keyboard/juce_KeyboardFocusTraverser.h | 6 +- .../keyboard/juce_ModifierKeys.cpp | 5 + .../keyboard/juce_ModifierKeys.h | 6 +- .../keyboard/juce_SystemClipboard.h | 6 +- .../keyboard/juce_TextEditorKeyMapper.h | 6 +- .../keyboard/juce_TextInputTarget.h | 6 +- .../layout/juce_AnimatedPosition.h | 6 +- .../layout/juce_AnimatedPositionBehaviours.h | 6 +- .../layout/juce_ComponentAnimator.cpp | 5 + .../layout/juce_ComponentAnimator.h | 6 +- .../juce_ComponentBoundsConstrainer.cpp | 5 + .../layout/juce_ComponentBoundsConstrainer.h | 6 +- .../layout/juce_ComponentBuilder.cpp | 5 + .../layout/juce_ComponentBuilder.h | 6 +- .../layout/juce_ComponentMovementWatcher.cpp | 5 + .../layout/juce_ComponentMovementWatcher.h | 6 +- .../layout/juce_ConcertinaPanel.cpp | 5 + .../layout/juce_ConcertinaPanel.h | 6 +- .../juce_gui_basics/layout/juce_FlexBox.cpp | 5 + modules/juce_gui_basics/layout/juce_FlexBox.h | 4 + .../juce_gui_basics/layout/juce_FlexItem.h | 4 + modules/juce_gui_basics/layout/juce_Grid.cpp | 4 + modules/juce_gui_basics/layout/juce_Grid.h | 8 + .../juce_gui_basics/layout/juce_GridItem.cpp | 4 + .../juce_gui_basics/layout/juce_GridItem.h | 4 + .../layout/juce_GridUnitTests.cpp | 5 + .../layout/juce_GroupComponent.cpp | 5 + .../layout/juce_GroupComponent.h | 6 +- .../layout/juce_MultiDocumentPanel.cpp | 5 + .../layout/juce_MultiDocumentPanel.h | 5 +- .../layout/juce_ResizableBorderComponent.cpp | 5 + .../layout/juce_ResizableBorderComponent.h | 6 +- .../layout/juce_ResizableCornerComponent.cpp | 5 + .../layout/juce_ResizableCornerComponent.h | 6 +- .../layout/juce_ResizableEdgeComponent.cpp | 5 + .../layout/juce_ResizableEdgeComponent.h | 6 +- .../juce_gui_basics/layout/juce_ScrollBar.cpp | 5 + .../juce_gui_basics/layout/juce_ScrollBar.h | 6 +- .../layout/juce_StretchableLayoutManager.cpp | 5 + .../layout/juce_StretchableLayoutManager.h | 6 +- .../juce_StretchableLayoutResizerBar.cpp | 5 + .../layout/juce_StretchableLayoutResizerBar.h | 6 +- .../layout/juce_StretchableObjectResizer.cpp | 5 + .../layout/juce_StretchableObjectResizer.h | 6 +- .../layout/juce_TabbedButtonBar.cpp | 5 + .../layout/juce_TabbedButtonBar.h | 5 +- .../layout/juce_TabbedComponent.cpp | 5 + .../layout/juce_TabbedComponent.h | 6 +- .../juce_gui_basics/layout/juce_Viewport.cpp | 5 + .../juce_gui_basics/layout/juce_Viewport.h | 6 +- .../lookandfeel/juce_LookAndFeel.cpp | 6 +- .../lookandfeel/juce_LookAndFeel.h | 5 +- .../lookandfeel/juce_LookAndFeel_V1.cpp | 5 + .../lookandfeel/juce_LookAndFeel_V1.h | 5 +- .../lookandfeel/juce_LookAndFeel_V2.cpp | 5 + .../lookandfeel/juce_LookAndFeel_V2.h | 6 +- .../lookandfeel/juce_LookAndFeel_V3.cpp | 5 + .../lookandfeel/juce_LookAndFeel_V3.h | 5 +- .../lookandfeel/juce_LookAndFeel_V4.cpp | 4 + .../lookandfeel/juce_LookAndFeel_V4.h | 6 +- .../menus/juce_MenuBarComponent.cpp | 5 + .../menus/juce_MenuBarComponent.h | 6 +- .../menus/juce_MenuBarModel.cpp | 5 + .../juce_gui_basics/menus/juce_MenuBarModel.h | 6 +- .../juce_gui_basics/menus/juce_PopupMenu.cpp | 5 + .../juce_gui_basics/menus/juce_PopupMenu.h | 6 +- .../misc/juce_BubbleComponent.cpp | 5 + .../misc/juce_BubbleComponent.h | 6 +- .../misc/juce_DropShadower.cpp | 5 + .../juce_gui_basics/misc/juce_DropShadower.h | 6 +- .../misc/juce_JUCESplashScreen.cpp | 5 + .../misc/juce_JUCESplashScreen.h | 5 +- .../mouse/juce_ComponentDragger.cpp | 5 + .../mouse/juce_ComponentDragger.h | 6 +- .../mouse/juce_DragAndDropContainer.cpp | 5 + .../mouse/juce_DragAndDropContainer.h | 6 +- .../mouse/juce_DragAndDropTarget.h | 6 +- .../mouse/juce_FileDragAndDropTarget.h | 5 +- .../mouse/juce_LassoComponent.h | 6 +- .../mouse/juce_MouseCursor.cpp | 5 + .../juce_gui_basics/mouse/juce_MouseCursor.h | 6 +- .../juce_gui_basics/mouse/juce_MouseEvent.cpp | 5 + .../juce_gui_basics/mouse/juce_MouseEvent.h | 5 +- .../mouse/juce_MouseInactivityDetector.cpp | 5 + .../mouse/juce_MouseInactivityDetector.h | 6 +- .../mouse/juce_MouseInputSource.cpp | 5 + .../mouse/juce_MouseInputSource.h | 6 +- .../mouse/juce_MouseListener.cpp | 5 + .../mouse/juce_MouseListener.h | 6 +- .../mouse/juce_SelectedItemSet.h | 6 +- .../mouse/juce_TextDragAndDropTarget.h | 6 +- .../mouse/juce_TooltipClient.h | 6 +- .../native/juce_MultiTouchMapper.h | 9 +- .../native/juce_android_FileChooser.cpp | 5 + .../native/juce_android_Windowing.cpp | 4 +- .../native/juce_ios_UIViewComponentPeer.mm | 10 +- .../native/juce_ios_Windowing.mm | 21 +-- .../native/juce_linux_FileChooser.cpp | 5 + .../juce_gui_basics/native/juce_linux_X11.cpp | 5 + .../juce_gui_basics/native/juce_linux_X11.h | 9 +- .../native/juce_linux_X11_Clipboard.cpp | 5 + .../native/juce_linux_X11_Windowing.cpp | 5 + .../native/juce_mac_FileChooser.mm | 5 + .../native/juce_mac_MainMenu.mm | 5 + .../native/juce_mac_MouseCursor.mm | 7 +- .../native/juce_mac_NSViewComponentPeer.mm | 18 ++- .../native/juce_mac_Windowing.mm | 10 +- .../native/juce_win32_DragAndDrop.cpp | 5 + .../native/juce_win32_FileChooser.cpp | 5 + .../native/juce_win32_Windowing.cpp | 13 +- .../positioning/juce_MarkerList.cpp | 5 + .../positioning/juce_MarkerList.h | 6 +- .../positioning/juce_RelativeCoordinate.cpp | 5 + .../positioning/juce_RelativeCoordinate.h | 6 +- .../juce_RelativeCoordinatePositioner.cpp | 5 + .../juce_RelativeCoordinatePositioner.h | 6 +- .../juce_RelativeParallelogram.cpp | 5 + .../positioning/juce_RelativeParallelogram.h | 6 +- .../positioning/juce_RelativePoint.cpp | 5 + .../positioning/juce_RelativePoint.h | 6 +- .../positioning/juce_RelativePointPath.cpp | 5 + .../positioning/juce_RelativePointPath.h | 6 +- .../positioning/juce_RelativeRectangle.cpp | 5 + .../positioning/juce_RelativeRectangle.h | 6 +- .../juce_BooleanPropertyComponent.cpp | 5 + .../juce_BooleanPropertyComponent.h | 6 +- .../juce_ButtonPropertyComponent.cpp | 5 + .../properties/juce_ButtonPropertyComponent.h | 6 +- .../juce_ChoicePropertyComponent.cpp | 5 + .../properties/juce_ChoicePropertyComponent.h | 6 +- .../properties/juce_PropertyComponent.cpp | 5 + .../properties/juce_PropertyComponent.h | 6 +- .../properties/juce_PropertyPanel.cpp | 5 + .../properties/juce_PropertyPanel.h | 6 +- .../juce_SliderPropertyComponent.cpp | 5 + .../properties/juce_SliderPropertyComponent.h | 6 +- .../properties/juce_TextPropertyComponent.cpp | 5 + .../properties/juce_TextPropertyComponent.h | 6 +- .../juce_gui_basics/widgets/juce_ComboBox.cpp | 5 + .../juce_gui_basics/widgets/juce_ComboBox.h | 6 +- .../widgets/juce_ImageComponent.cpp | 5 + .../widgets/juce_ImageComponent.h | 6 +- .../juce_gui_basics/widgets/juce_Label.cpp | 5 + modules/juce_gui_basics/widgets/juce_Label.h | 6 +- .../juce_gui_basics/widgets/juce_ListBox.cpp | 5 + .../juce_gui_basics/widgets/juce_ListBox.h | 6 +- .../widgets/juce_ProgressBar.cpp | 5 + .../widgets/juce_ProgressBar.h | 6 +- .../juce_gui_basics/widgets/juce_Slider.cpp | 5 + modules/juce_gui_basics/widgets/juce_Slider.h | 6 +- .../widgets/juce_TableHeaderComponent.cpp | 5 + .../widgets/juce_TableHeaderComponent.h | 6 +- .../widgets/juce_TableListBox.cpp | 5 + .../widgets/juce_TableListBox.h | 6 +- .../widgets/juce_TextEditor.cpp | 5 + .../juce_gui_basics/widgets/juce_TextEditor.h | 6 +- .../juce_gui_basics/widgets/juce_Toolbar.cpp | 5 + .../juce_gui_basics/widgets/juce_Toolbar.h | 5 +- .../widgets/juce_ToolbarItemComponent.cpp | 5 + .../widgets/juce_ToolbarItemComponent.h | 6 +- .../widgets/juce_ToolbarItemFactory.h | 6 +- .../widgets/juce_ToolbarItemPalette.cpp | 5 + .../widgets/juce_ToolbarItemPalette.h | 6 +- .../juce_gui_basics/widgets/juce_TreeView.cpp | 5 + .../juce_gui_basics/widgets/juce_TreeView.h | 5 +- .../windows/juce_AlertWindow.cpp | 5 + .../windows/juce_AlertWindow.h | 6 +- .../windows/juce_CallOutBox.cpp | 5 + .../juce_gui_basics/windows/juce_CallOutBox.h | 6 +- .../windows/juce_ComponentPeer.cpp | 5 + .../windows/juce_ComponentPeer.h | 6 +- .../windows/juce_DialogWindow.cpp | 5 + .../windows/juce_DialogWindow.h | 6 +- .../windows/juce_DocumentWindow.cpp | 5 + .../windows/juce_DocumentWindow.h | 6 +- .../windows/juce_NativeMessageBox.h | 5 +- .../windows/juce_ResizableWindow.cpp | 5 + .../windows/juce_ResizableWindow.h | 6 +- .../windows/juce_ThreadWithProgressWindow.cpp | 5 + .../windows/juce_ThreadWithProgressWindow.h | 6 +- .../windows/juce_TooltipWindow.cpp | 5 + .../windows/juce_TooltipWindow.h | 6 +- .../windows/juce_TopLevelWindow.cpp | 5 + .../windows/juce_TopLevelWindow.h | 6 +- .../juce_CPlusPlusCodeTokeniser.cpp | 6 +- .../code_editor/juce_CPlusPlusCodeTokeniser.h | 6 +- .../juce_CPlusPlusCodeTokeniserFunctions.h | 6 +- .../code_editor/juce_CodeDocument.cpp | 5 + .../code_editor/juce_CodeDocument.h | 5 +- .../code_editor/juce_CodeEditorComponent.cpp | 5 + .../code_editor/juce_CodeEditorComponent.h | 5 +- .../code_editor/juce_CodeTokeniser.h | 6 +- .../code_editor/juce_LuaCodeTokeniser.cpp | 5 + .../code_editor/juce_LuaCodeTokeniser.h | 6 +- .../code_editor/juce_XMLCodeTokeniser.cpp | 5 + .../code_editor/juce_XMLCodeTokeniser.h | 6 +- .../documents/juce_FileBasedDocument.cpp | 5 + .../documents/juce_FileBasedDocument.h | 6 +- .../embedding/juce_ActiveXControlComponent.h | 5 +- .../embedding/juce_NSViewComponent.h | 5 +- .../embedding/juce_UIViewComponent.h | 5 +- .../embedding/juce_XEmbedComponent.h | 5 +- modules/juce_gui_extra/juce_gui_extra.cpp | 24 +-- modules/juce_gui_extra/juce_gui_extra.h | 5 - .../misc/juce_AnimatedAppComponent.cpp | 5 + .../misc/juce_AnimatedAppComponent.h | 6 +- .../juce_gui_extra/misc/juce_AppleRemote.h | 6 +- .../misc/juce_BubbleMessageComponent.cpp | 5 + .../misc/juce_BubbleMessageComponent.h | 6 +- .../misc/juce_ColourSelector.cpp | 7 +- .../juce_gui_extra/misc/juce_ColourSelector.h | 6 +- .../misc/juce_KeyMappingEditorComponent.cpp | 5 + .../misc/juce_KeyMappingEditorComponent.h | 6 +- .../misc/juce_LiveConstantEditor.cpp | 5 + .../misc/juce_LiveConstantEditor.h | 5 +- .../misc/juce_PreferencesPanel.cpp | 5 + .../misc/juce_PreferencesPanel.h | 6 +- .../misc/juce_RecentlyOpenedFilesList.cpp | 5 + .../misc/juce_RecentlyOpenedFilesList.h | 6 +- .../juce_gui_extra/misc/juce_SplashScreen.cpp | 5 + .../juce_gui_extra/misc/juce_SplashScreen.h | 6 +- .../misc/juce_SystemTrayIconComponent.cpp | 5 + .../misc/juce_SystemTrayIconComponent.h | 5 +- .../misc/juce_WebBrowserComponent.h | 5 +- .../juce_android_WebBrowserComponent.cpp | 5 + .../native/juce_ios_UIViewComponent.mm | 18 ++- .../native/juce_linux_X11_SystemTrayIcon.cpp | 6 +- .../juce_linux_X11_WebBrowserComponent.cpp | 6 +- .../native/juce_linux_XEmbedComponent.cpp | 10 +- .../native/juce_mac_AppleRemote.mm | 5 + .../juce_mac_CarbonViewWrapperComponent.h | 6 +- .../native/juce_mac_NSViewComponent.mm | 5 + .../native/juce_mac_SystemTrayIcon.cpp | 5 + .../native/juce_mac_WebBrowserComponent.mm | 18 ++- .../native/juce_win32_ActiveXComponent.cpp | 5 + .../native/juce_win32_SystemTrayIcon.cpp | 5 + .../native/juce_win32_WebBrowserComponent.cpp | 5 + .../geometry/juce_Draggable3DOrientation.h | 6 +- modules/juce_opengl/geometry/juce_Matrix3D.h | 5 +- .../juce_opengl/geometry/juce_Quaternion.h | 8 +- modules/juce_opengl/geometry/juce_Vector3D.h | 5 +- modules/juce_opengl/juce_opengl.cpp | 8 +- modules/juce_opengl/juce_opengl.h | 16 +- .../native/juce_MissingGLDefinitions.h | 5 + .../native/juce_OpenGLExtensions.h | 6 +- .../juce_opengl/native/juce_OpenGL_android.h | 6 +- modules/juce_opengl/native/juce_OpenGL_ios.h | 4 +- .../native/juce_OpenGL_linux_X11.h | 5 + modules/juce_opengl/native/juce_OpenGL_osx.h | 5 + .../juce_opengl/native/juce_OpenGL_win32.h | 5 + .../juce_opengl/opengl/juce_OpenGLContext.cpp | 5 + .../juce_opengl/opengl/juce_OpenGLContext.h | 6 +- .../opengl/juce_OpenGLFrameBuffer.cpp | 5 + .../opengl/juce_OpenGLFrameBuffer.h | 6 +- .../opengl/juce_OpenGLGraphicsContext.cpp | 5 + .../opengl/juce_OpenGLGraphicsContext.h | 6 +- .../juce_opengl/opengl/juce_OpenGLHelpers.cpp | 5 + .../juce_opengl/opengl/juce_OpenGLHelpers.h | 6 +- .../juce_opengl/opengl/juce_OpenGLImage.cpp | 5 + modules/juce_opengl/opengl/juce_OpenGLImage.h | 6 +- .../opengl/juce_OpenGLPixelFormat.cpp | 5 + .../opengl/juce_OpenGLPixelFormat.h | 6 +- .../juce_opengl/opengl/juce_OpenGLRenderer.h | 6 +- .../opengl/juce_OpenGLShaderProgram.cpp | 5 + .../opengl/juce_OpenGLShaderProgram.h | 5 +- .../juce_opengl/opengl/juce_OpenGLTexture.cpp | 5 + .../juce_opengl/opengl/juce_OpenGLTexture.h | 5 +- .../utils/juce_OpenGLAppComponent.cpp | 5 + .../utils/juce_OpenGLAppComponent.h | 6 +- modules/juce_osc/juce_osc.cpp | 3 - modules/juce_osc/juce_osc.h | 5 - modules/juce_osc/osc/juce_OSCAddress.cpp | 5 + modules/juce_osc/osc/juce_OSCAddress.h | 6 +- modules/juce_osc/osc/juce_OSCArgument.cpp | 5 + modules/juce_osc/osc/juce_OSCArgument.h | 6 +- modules/juce_osc/osc/juce_OSCBundle.cpp | 5 + modules/juce_osc/osc/juce_OSCBundle.h | 5 +- modules/juce_osc/osc/juce_OSCMessage.cpp | 6 +- modules/juce_osc/osc/juce_OSCMessage.h | 6 +- modules/juce_osc/osc/juce_OSCReceiver.cpp | 5 + modules/juce_osc/osc/juce_OSCReceiver.h | 5 +- modules/juce_osc/osc/juce_OSCSender.cpp | 5 + modules/juce_osc/osc/juce_OSCSender.h | 6 +- modules/juce_osc/osc/juce_OSCTimeTag.cpp | 5 + modules/juce_osc/osc/juce_OSCTimeTag.h | 6 +- modules/juce_osc/osc/juce_OSCTypes.cpp | 11 +- modules/juce_osc/osc/juce_OSCTypes.h | 5 +- .../in_app_purchases/juce_InAppPurchases.cpp | 5 + .../in_app_purchases/juce_InAppPurchases.h | 5 + .../juce_product_unlocking.cpp | 41 +++-- .../juce_product_unlocking.h | 30 ++-- .../marketplace/juce_KeyFileGeneration.h | 5 + .../marketplace/juce_OnlineUnlockForm.cpp | 5 + .../marketplace/juce_OnlineUnlockForm.h | 5 + .../marketplace/juce_OnlineUnlockStatus.cpp | 5 + .../marketplace/juce_OnlineUnlockStatus.h | 5 + .../juce_TracktionMarketplaceStatus.cpp | 5 + .../juce_TracktionMarketplaceStatus.h | 5 + .../native/juce_android_InAppPurchases.cpp | 4 + .../native/juce_ios_InAppPurchases.cpp | 5 + .../juce_video/capture/juce_CameraDevice.cpp | 4 + .../juce_video/capture/juce_CameraDevice.h | 5 +- modules/juce_video/juce_video.cpp | 7 - modules/juce_video/juce_video.h | 8 - .../playback/juce_VideoComponent.cpp | 5 + .../juce_video/playback/juce_VideoComponent.h | 4 + 1069 files changed, 5350 insertions(+), 1828 deletions(-) diff --git a/examples/OSCMonitor/Source/OSCLogListBox.h b/examples/OSCMonitor/Source/OSCLogListBox.h index 996a92fb7d..0fa9b3aa58 100644 --- a/examples/OSCMonitor/Source/OSCLogListBox.h +++ b/examples/OSCMonitor/Source/OSCLogListBox.h @@ -128,13 +128,12 @@ public: else if (arg.isBlob()) { typeAsString = "blob"; - const MemoryBlock& blob = arg.getBlob(); - valueAsString = String::fromUTF8( (const char*)blob.getData(), blob.getSize()); + auto& blob = arg.getBlob(); + valueAsString = String::fromUTF8 ((const char*) blob.getData(), (int) blob.getSize()); } else { typeAsString = "(unknown)"; - valueAsString = ""; } oscLogList.add (getIndentationString (level + 1) + "- " + typeAsString.paddedRight(' ', 12) + valueAsString); diff --git a/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h b/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h index 45f916238b..16e729db2b 100644 --- a/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h +++ b/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -151,3 +151,5 @@ public: /** Rewinds the audio. */ virtual void transportRewind() {} }; + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp index e75f90b4e9..754291d5bf 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp +++ b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + AudioChannelSet::AudioChannelSet (uint32 c) : channels (c) {} AudioChannelSet::AudioChannelSet (const Array& c) { @@ -414,3 +417,5 @@ int32 AudioChannelSet::getWaveChannelMask() const noexcept return (channels.toInteger() >> 1); } + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h index 14c0ff900a..bb99cff93e 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h +++ b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -388,3 +388,5 @@ private: explicit AudioChannelSet (uint32); explicit AudioChannelSet (const Array&); }; + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp index e46de33503..3f31379dd8 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) { const double maxVal = (double) 0x7fff; @@ -596,3 +599,5 @@ public: static AudioConversionTests audioConversionUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h index 91907c0285..6af6822009 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -708,3 +708,5 @@ private: AudioDataConverters(); JUCE_DECLARE_NON_COPYABLE (AudioDataConverters) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index 6ef06a177f..ac9addd564 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -1122,3 +1122,5 @@ private: @see AudioBuffer */ typedef AudioBuffer AudioSampleBuffer; + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index 7813c81abc..5523a4a2f7 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace FloatVectorHelpers { #define JUCE_INCREMENT_SRC_DEST dest += (16 / sizeof (*dest)); src += (16 / sizeof (*dest)); @@ -1200,3 +1203,5 @@ public: static FloatVectorOperationsTests vectorOpTests; #endif + +} // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h index 9cb7895fcf..708f5ac2aa 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_INTEL #define JUCE_SNAP_TO_ZERO(n) if (! (n < -1.0e-8f || n > 1.0e-8f)) n = 0; @@ -219,3 +220,5 @@ public: */ static void JUCE_CALLTYPE disableDenormalisedNumberSupport() noexcept; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.cpp b/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.cpp index 11f996b023..3d210938c6 100644 --- a/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.cpp +++ b/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct CatmullRomAlgorithm { static forcedinline float valueAtOffset (const float* const inputs, const float offset) noexcept @@ -58,3 +61,5 @@ int CatmullRomInterpolator::processAdding (double actualRatio, const float* in, { return interpolateAdding (lastInputSamples, subSamplePos, actualRatio, in, out, numOut, gain); } + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.h b/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.h index 75eaeeca4b..3876ae612e 100644 --- a/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.h +++ b/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.h @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /** Interpolator for resampling a stream of floats using Catmull-Rom interpolation. @@ -84,3 +87,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CatmullRomInterpolator) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_Decibels.h b/modules/juce_audio_basics/effects/juce_Decibels.h index e144f11e09..4fc2d2fdbf 100644 --- a/modules/juce_audio_basics/effects/juce_Decibels.h +++ b/modules/juce_audio_basics/effects/juce_Decibels.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -96,3 +96,5 @@ private: Decibels(); // This class can't be instantiated, it's just a holder for static methods.. JUCE_DECLARE_NON_COPYABLE (Decibels) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_IIRFilter.cpp b/modules/juce_audio_basics/effects/juce_IIRFilter.cpp index 39def04d38..01338c8d9d 100644 --- a/modules/juce_audio_basics/effects/juce_IIRFilter.cpp +++ b/modules/juce_audio_basics/effects/juce_IIRFilter.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + IIRCoefficients::IIRCoefficients() noexcept { zeromem (coefficients, sizeof (coefficients)); @@ -335,3 +337,5 @@ void IIRFilter::processSamples (float* const samples, const int numSamples) noex } #undef JUCE_SNAP_TO_ZERO + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_IIRFilter.h b/modules/juce_audio_basics/effects/juce_IIRFilter.h index b0ef1fa11f..9db85b5828 100644 --- a/modules/juce_audio_basics/effects/juce_IIRFilter.h +++ b/modules/juce_audio_basics/effects/juce_IIRFilter.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class IIRFilter; @@ -205,3 +206,5 @@ protected: IIRFilter& operator= (const IIRFilter&); JUCE_LEAK_DETECTOR (IIRFilter) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp b/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp index ecd892d722..eca8e98e62 100644 --- a/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp +++ b/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace { static forcedinline void pushInterpolationSample (float* lastInputSamples, const float newValue) noexcept @@ -196,3 +199,5 @@ int LagrangeInterpolator::processAdding (double actualRatio, const float* in, fl { return interpolateAdding (lastInputSamples, subSamplePos, actualRatio, in, out, numOut, gain); } + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h b/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h index 7143842e3a..d527574513 100644 --- a/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h +++ b/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /** Interpolator for resampling a stream of floats using 4-point lagrange interpolation. @@ -84,3 +87,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LagrangeInterpolator) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_LinearSmoothedValue.h b/modules/juce_audio_basics/effects/juce_LinearSmoothedValue.h index d39dc91734..3dc342c418 100644 --- a/modules/juce_audio_basics/effects/juce_LinearSmoothedValue.h +++ b/modules/juce_audio_basics/effects/juce_LinearSmoothedValue.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -182,3 +182,5 @@ private: FloatType currentValue = 0, target = 0, step = 0; int countdown = 0, stepsToTarget = 0; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/effects/juce_Reverb.h b/modules/juce_audio_basics/effects/juce_Reverb.h index 375fda0903..02b95b3c31 100644 --- a/modules/juce_audio_basics/effects/juce_Reverb.h +++ b/modules/juce_audio_basics/effects/juce_Reverb.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -316,3 +316,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Reverb) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/juce_audio_basics.cpp b/modules/juce_audio_basics/juce_audio_basics.cpp index 258de8fe44..09e13e49c8 100644 --- a/modules/juce_audio_basics/juce_audio_basics.cpp +++ b/modules/juce_audio_basics/juce_audio_basics.cpp @@ -76,9 +76,6 @@ #include #endif -namespace juce -{ - #include "buffers/juce_AudioDataConverters.cpp" #include "buffers/juce_FloatVectorOperations.cpp" #include "buffers/juce_AudioChannelSet.cpp" @@ -109,5 +106,3 @@ namespace juce #include "sources/juce_ReverbAudioSource.cpp" #include "sources/juce_ToneGeneratorAudioSource.cpp" #include "synthesisers/juce_Synthesiser.cpp" - -} diff --git a/modules/juce_audio_basics/juce_audio_basics.h b/modules/juce_audio_basics/juce_audio_basics.h index feb2a6e804..023fa4760b 100644 --- a/modules/juce_audio_basics/juce_audio_basics.h +++ b/modules/juce_audio_basics/juce_audio_basics.h @@ -51,9 +51,6 @@ #include -namespace juce -{ - #undef Complex // apparently some C libraries actually define these symbols (!) #undef Factor @@ -94,5 +91,3 @@ namespace juce #include "sources/juce_ToneGeneratorAudioSource.h" #include "synthesisers/juce_Synthesiser.h" #include "audio_play_head/juce_AudioPlayHead.h" - -} diff --git a/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp b/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp index 8795756c70..94d19898f7 100644 --- a/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace MidiBufferHelpers { inline int getEventTime (const void* const d) noexcept @@ -225,3 +228,5 @@ bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePositio return true; } + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiBuffer.h b/modules/juce_audio_basics/midi/juce_MidiBuffer.h index b69d8796cf..d4bfead789 100644 --- a/modules/juce_audio_basics/midi/juce_MidiBuffer.h +++ b/modules/juce_audio_basics/midi/juce_MidiBuffer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -227,3 +227,5 @@ public: private: JUCE_LEAK_DETECTOR (MidiBuffer) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiFile.cpp b/modules/juce_audio_basics/midi/juce_MidiFile.cpp index 727f9f62d0..6a67a0890f 100644 --- a/modules/juce_audio_basics/midi/juce_MidiFile.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiFile.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace MidiFileHelpers { static void writeVariableLengthInt (OutputStream& out, unsigned int v) @@ -443,3 +446,5 @@ bool MidiFile::writeTrack (OutputStream& mainOut, const int trackNum) return true; } + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiFile.h b/modules/juce_audio_basics/midi/juce_MidiFile.h index 47a1fab983..b06589d299 100644 --- a/modules/juce_audio_basics/midi/juce_MidiFile.h +++ b/modules/juce_audio_basics/midi/juce_MidiFile.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -178,3 +178,5 @@ private: JUCE_LEAK_DETECTOR (MidiFile) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp b/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp index 9f093628b8..ad52ceb8fd 100644 --- a/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MidiKeyboardState::MidiKeyboardState() { zerostruct (noteStates); @@ -179,3 +182,5 @@ void MidiKeyboardState::removeListener (MidiKeyboardStateListener* const listene const ScopedLock sl (lock); listeners.removeFirstMatchingValue (listener); } + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h b/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h index ef9a8f43c4..b3fc4e61e0 100644 --- a/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h +++ b/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class MidiKeyboardState; @@ -197,3 +198,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiKeyboardState) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.cpp b/modules/juce_audio_basics/midi/juce_MidiMessage.cpp index e9e6c1be3a..bf2eb56cd3 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessage.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiMessage.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace MidiHelpers { inline uint8 initialByte (const int type, const int channel) noexcept @@ -1119,3 +1122,5 @@ const char* MidiMessage::getControllerName (const int n) return isPositiveAndBelow (n, numElementsInArray (names)) ? names[n] : nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.h b/modules/juce_audio_basics/midi/juce_MidiMessage.h index aea8d42079..7fcefe2a2e 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessage.h +++ b/modules/juce_audio_basics/midi/juce_MidiMessage.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -936,3 +936,5 @@ private: inline uint8* getData() const noexcept { return isHeapAllocated() ? packedData.allocatedData : (uint8*) packedData.asBytes; } uint8* allocateSpace (int); }; + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp index 6a3f851cbf..fe8b2c083d 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& mm) : message (mm) {} MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (static_cast (mm)) {} @@ -334,3 +336,5 @@ void MidiMessageSequence::createControllerUpdatesForTime (int channelNumber, dou } } } + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h index 916431b986..8f5e3f6994 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h +++ b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -294,3 +294,5 @@ private: JUCE_LEAK_DETECTOR (MidiMessageSequence) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiRPN.cpp b/modules/juce_audio_basics/midi/juce_MidiRPN.cpp index a5189566c4..9e2c2df329 100644 --- a/modules/juce_audio_basics/midi/juce_MidiRPN.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiRPN.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MidiRPNDetector::MidiRPNDetector() noexcept { } @@ -369,3 +372,5 @@ private: static MidiRPNGeneratorTests MidiRPNGeneratorUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiRPN.h b/modules/juce_audio_basics/midi/juce_MidiRPN.h index 53219c1f9e..e8a74d1071 100644 --- a/modules/juce_audio_basics/midi/juce_MidiRPN.h +++ b/modules/juce_audio_basics/midi/juce_MidiRPN.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Represents a MIDI RPN (registered parameter number) or NRPN (non-registered @@ -144,3 +144,5 @@ public: bool isNRPN = false, bool use14BitValue = true); }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp b/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp index 70aee29fde..24bfd2e260 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace { const uint8 noLSBValueReceived = 0xff; @@ -2148,3 +2151,5 @@ private: static MPEInstrumentTests MPEInstrumentUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEInstrument.h b/modules/juce_audio_basics/mpe/juce_MPEInstrument.h index 8fe26ae919..b6d05ea843 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEInstrument.h +++ b/modules/juce_audio_basics/mpe/juce_MPEInstrument.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /* @@ -374,3 +374,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPEInstrument) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEMessages.cpp b/modules/juce_audio_basics/mpe/juce_MPEMessages.cpp index 09939a1045..ebdc68993c 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEMessages.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEMessages.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MidiBuffer MPEMessages::addZone (MPEZone zone) { MidiBuffer buffer (MidiRPNGenerator::generate (zone.getFirstNoteChannel(), @@ -193,3 +196,5 @@ private: static MPEMessagesTests MPEMessagesUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEMessages.h b/modules/juce_audio_basics/mpe/juce_MPEMessages.h index 87b12f09d7..76b58b2013 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEMessages.h +++ b/modules/juce_audio_basics/mpe/juce_MPEMessages.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -87,3 +87,5 @@ public: */ static const int zoneLayoutMessagesRpnNumber = 6; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPENote.cpp b/modules/juce_audio_basics/mpe/juce_MPENote.cpp index 1f47cec021..dad3ab6028 100644 --- a/modules/juce_audio_basics/mpe/juce_MPENote.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPENote.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace { uint16 generateNoteID (int midiChannel, int midiNoteNumber) noexcept @@ -128,3 +131,5 @@ private: static MPENoteTests MPENoteUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPENote.h b/modules/juce_audio_basics/mpe/juce_MPENote.h index 874a03f3e9..8d549ddd9e 100644 --- a/modules/juce_audio_basics/mpe/juce_MPENote.h +++ b/modules/juce_audio_basics/mpe/juce_MPENote.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -172,3 +172,5 @@ struct JUCE_API MPENote /** Returns true if two notes are different notes, determined by their unique ID. */ bool operator!= (const MPENote& other) const noexcept; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPESynthesiser.cpp b/modules/juce_audio_basics/mpe/juce_MPESynthesiser.cpp index 3e965f434b..94763f1bc7 100644 --- a/modules/juce_audio_basics/mpe/juce_MPESynthesiser.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPESynthesiser.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MPESynthesiser::MPESynthesiser() { } @@ -352,3 +355,5 @@ void MPESynthesiser::renderNextSubBlock (AudioBuffer& buffer, int startS voice->renderNextBlock (buffer, startSample, numSamples); } } + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPESynthesiser.h b/modules/juce_audio_basics/mpe/juce_MPESynthesiser.h index 73dcc9772f..408970e6c5 100644 --- a/modules/juce_audio_basics/mpe/juce_MPESynthesiser.h +++ b/modules/juce_audio_basics/mpe/juce_MPESynthesiser.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -305,3 +305,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiser) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.cpp b/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.cpp index 671249a307..7759eea5e2 100644 --- a/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MPESynthesiserBase::MPESynthesiserBase() : instrument (new MPEInstrument), sampleRate (0), @@ -178,3 +181,5 @@ void MPESynthesiserBase::setMinimumRenderingSubdivisionSize (int numSamples, boo minimumSubBlockSize = numSamples; subBlockSubdivisionIsStrict = shouldBeStrict; } + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.h b/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.h index 649abc884d..b2b787a58d 100644 --- a/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.h +++ b/modules/juce_audio_basics/mpe/juce_MPESynthesiserBase.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -204,3 +204,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiserBase) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.cpp b/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.cpp index cdd35cfc04..6ac688eba9 100644 --- a/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MPESynthesiserVoice::MPESynthesiserVoice() : currentSampleRate (0), noteStartTime (0) { @@ -49,3 +52,5 @@ void MPESynthesiserVoice::clearCurrentNote() noexcept { currentlyPlayingNote = MPENote(); } + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.h b/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.h index 9f8205e638..142c963783 100644 --- a/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.h +++ b/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -183,3 +184,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiserVoice) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEValue.cpp b/modules/juce_audio_basics/mpe/juce_MPEValue.cpp index 9413057542..d9fbd7db39 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEValue.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEValue.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MPEValue::MPEValue() noexcept : normalisedValue (8192) { } @@ -166,3 +169,5 @@ private: static MPEValueTests MPEValueUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEValue.h b/modules/juce_audio_basics/mpe/juce_MPEValue.h index 5743410058..4bb5afc966 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEValue.h +++ b/modules/juce_audio_basics/mpe/juce_MPEValue.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -88,3 +88,5 @@ private: MPEValue (int normalisedValue); int normalisedValue; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEZone.cpp b/modules/juce_audio_basics/mpe/juce_MPEZone.cpp index 912a86c3c5..5b97f0677f 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEZone.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEZone.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace { void checkAndLimitZoneParameters (int minValue, @@ -312,3 +315,5 @@ private: static MPEZoneTests MPEZoneUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEZone.h b/modules/juce_audio_basics/mpe/juce_MPEZone.h index 9fdfb5548e..7284398267 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEZone.h +++ b/modules/juce_audio_basics/mpe/juce_MPEZone.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -138,3 +138,5 @@ private: int perNotePitchbendRange; int masterPitchbendRange; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.cpp b/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.cpp index 450dc09f6b..f0d525ad35 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MPEZoneLayout::MPEZoneLayout() noexcept { } @@ -378,3 +381,5 @@ static MPEZoneLayoutTests MPEZoneLayoutUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.h b/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.h index 0b08eb5618..5b0337c113 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.h +++ b/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -157,3 +157,5 @@ private: void processZoneLayoutRpnMessage (MidiRPNMessage); void processPitchbendRangeRpnMessage (MidiRPNMessage); }; + +} // namespace juce diff --git a/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h b/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h index 1bf5cda274..0aaf6f6664 100644 --- a/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h +++ b/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MAC || JUCE_IOS @@ -304,3 +305,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_AudioSource.h b/modules/juce_audio_basics/sources/juce_AudioSource.h index e58f93b297..6e5ddba5df 100644 --- a/modules/juce_audio_basics/sources/juce_AudioSource.h +++ b/modules/juce_audio_basics/sources/juce_AudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -173,3 +173,5 @@ public: */ virtual void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) = 0; }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp b/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp index 1cf4718393..ae33bea0db 100644 --- a/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + BufferingAudioSource::BufferingAudioSource (PositionableAudioSource* s, TimeSliceThread& thread, const bool deleteSourceWhenDeleted, @@ -307,3 +310,5 @@ int BufferingAudioSource::useTimeSlice() { return readNextBufferChunk() ? 1 : 100; } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h b/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h index 803695ea44..5624f5ceb7 100644 --- a/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -113,3 +113,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BufferingAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp b/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp index a70fe866e1..3cec22131c 100644 --- a/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ChannelRemappingAudioSource::ChannelRemappingAudioSource (AudioSource* const source_, const bool deleteSourceWhenDeleted) : source (source_, deleteSourceWhenDeleted), @@ -180,3 +183,5 @@ void ChannelRemappingAudioSource::restoreFromXml (const XmlElement& e) remappedOutputs.add (outs[i].getIntValue()); } } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h b/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h index 1ed44d8244..b5a5cf058b 100644 --- a/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -135,3 +135,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChannelRemappingAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp b/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp index be4479fbb5..cbea3b8c29 100644 --- a/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + IIRFilterAudioSource::IIRFilterAudioSource (AudioSource* const inputSource, const bool deleteInputWhenDeleted) : input (inputSource, deleteInputWhenDeleted) @@ -73,3 +76,5 @@ void IIRFilterAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& buff ->processSamples (bufferToFill.buffer->getWritePointer (i, bufferToFill.startSample), bufferToFill.numSamples); } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h b/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h index 9f38d1ce80..38faf285bc 100644 --- a/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -62,3 +62,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (IIRFilterAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_MemoryAudioSource.cpp b/modules/juce_audio_basics/sources/juce_MemoryAudioSource.cpp index 220debfd1f..6adec04448 100644 --- a/modules/juce_audio_basics/sources/juce_MemoryAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_MemoryAudioSource.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + MemoryAudioSource::MemoryAudioSource (AudioBuffer& bufferToUse, bool copyMemory, bool shouldLoop) : isLooping (shouldLoop) { @@ -64,3 +66,5 @@ void MemoryAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& bufferT if (pos < m) dst.clear (bufferToFill.startSample + pos, m - pos); } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_MemoryAudioSource.h b/modules/juce_audio_basics/sources/juce_MemoryAudioSource.h index 1a6fabf1b8..50b11c7b93 100644 --- a/modules/juce_audio_basics/sources/juce_MemoryAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_MemoryAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -59,3 +59,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp b/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp index 70b2658652..b3f1d148c0 100644 --- a/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MixerAudioSource::MixerAudioSource() : currentSampleRate (0.0), bufferSizeExpected (0) { @@ -151,3 +154,5 @@ void MixerAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info) info.clearActiveBufferRegion(); } } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_MixerAudioSource.h b/modules/juce_audio_basics/sources/juce_MixerAudioSource.h index 5a3883f8e9..0c2b6e22c7 100644 --- a/modules/juce_audio_basics/sources/juce_MixerAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_MixerAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -93,3 +93,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MixerAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h b/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h index c9195dc90e..5908bb82bd 100644 --- a/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -70,3 +70,5 @@ public: /** Tells the source whether you'd like it to play in a loop. */ virtual void setLooping (bool shouldLoop) { ignoreUnused (shouldLoop); } }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp b/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp index 386f894ca4..67ff49ccd4 100644 --- a/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ResamplingAudioSource::ResamplingAudioSource (AudioSource* const inputSource, const bool deleteInputWhenDeleted, const int channels) @@ -259,3 +262,5 @@ void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& f *samples++ = (float) out; } } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h b/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h index 72134f9837..9f8fcd239a 100644 --- a/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -99,3 +99,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResamplingAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp b/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp index 86e54eaf96..dd4e7ab03f 100644 --- a/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ReverbAudioSource::ReverbAudioSource (AudioSource* const inputSource, const bool deleteInputWhenDeleted) : input (inputSource, deleteInputWhenDeleted), bypass (false) @@ -76,3 +79,5 @@ void ReverbAudioSource::setBypassed (bool b) noexcept reverb.reset(); } } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h b/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h index fbdf48c943..1d2591b649 100644 --- a/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -68,3 +68,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ReverbAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp b/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp index b0f24d3901..b33a922494 100644 --- a/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ToneGeneratorAudioSource::ToneGeneratorAudioSource() : frequency (1000.0), sampleRate (44100.0), @@ -71,3 +74,5 @@ void ToneGeneratorAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info.buffer->setSample (j, info.startSample + i, sample); } } + +} // namespace juce diff --git a/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h b/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h index a5fc03b4f1..9c8e939d94 100644 --- a/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -65,3 +65,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToneGeneratorAudioSource) }; + +} // namespace juce diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp index fa12e84033..cb2eaf904d 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + SynthesiserSound::SynthesiserSound() {} SynthesiserSound::~SynthesiserSound() {} @@ -567,3 +570,5 @@ SynthesiserVoice* Synthesiser::findVoiceToSteal (SynthesiserSound* soundToPlay, return low; } + +} // namespace juce diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h index 1089960628..b8e50876f0 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -645,3 +645,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Synthesiser) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp index a6e74c570f..6f0be5db75 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + AudioDeviceManager::AudioDeviceSetup::AudioDeviceSetup() : sampleRate (0), bufferSize (0), @@ -1000,3 +1003,5 @@ double AudioDeviceManager::getCurrentOutputLevel() const noexcept { return out void AudioDeviceManager::enableInputLevelMeasurement (bool enable) noexcept { inputLevelMeter.setEnabled (enable); } void AudioDeviceManager::enableOutputLevelMeasurement (bool enable) noexcept { outputLevelMeter.setEnabled (enable); } + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h index f4169644c6..5d7ae84038 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -518,3 +518,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDeviceManager) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp b/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp index 0fd48370f1..95ae0c8e41 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + AudioIODevice::AudioIODevice (const String& deviceName, const String& deviceTypeName) : name (deviceName), typeName (deviceTypeName) { @@ -37,3 +40,5 @@ bool AudioIODevice::showControlPanel() // their hasControlPanel() method. return false; } + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h b/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h index 6c3b8300f1..d1cb0d52f0 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class AudioIODevice; @@ -301,3 +302,5 @@ protected: /** @internal */ String name, typeName; }; + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp index aef772d0a3..838aaa6547 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + AudioIODeviceType::AudioIODeviceType (const String& name) : typeName (name) { @@ -74,3 +77,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android() #if ! (JUCE_ANDROID && JUCE_USE_ANDROID_OPENSLES) AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_OpenSLES() { return nullptr; } #endif + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h index eaba0080e0..c11f711a41 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -174,3 +174,5 @@ private: JUCE_DECLARE_NON_COPYABLE (AudioIODeviceType) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h b/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h index 592215c9d6..bf5c44c6af 100644 --- a/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h +++ b/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -53,3 +53,5 @@ private: SystemAudioVolume(); // Don't instantiate this class, just call its static fns. JUCE_DECLARE_NON_COPYABLE (SystemAudioVolume) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/juce_audio_devices.cpp b/modules/juce_audio_devices/juce_audio_devices.cpp index 33c6fe0c92..6bdd8fe06e 100644 --- a/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/modules/juce_audio_devices/juce_audio_devices.cpp @@ -155,9 +155,6 @@ #endif -namespace juce -{ - #include "audio_io/juce_AudioDeviceManager.cpp" #include "audio_io/juce_AudioIODevice.cpp" #include "audio_io/juce_AudioIODeviceType.cpp" @@ -214,14 +211,15 @@ namespace juce #if JUCE_USE_ANDROID_OPENSLES #include "native/juce_android_OpenSL.cpp" #endif - #endif #if ! JUCE_SYSTEMAUDIOVOL_IMPLEMENTED - // None of these methods are available. (On Windows you might need to enable WASAPI for this) - float JUCE_CALLTYPE SystemAudioVolume::getGain() { jassertfalse; return 0.0f; } - bool JUCE_CALLTYPE SystemAudioVolume::setGain (float) { jassertfalse; return false; } - bool JUCE_CALLTYPE SystemAudioVolume::isMuted() { jassertfalse; return false; } - bool JUCE_CALLTYPE SystemAudioVolume::setMuted (bool) { jassertfalse; return false; } -#endif +namespace juce +{ + // None of these methods are available. (On Windows you might need to enable WASAPI for this) + float JUCE_CALLTYPE SystemAudioVolume::getGain() { jassertfalse; return 0.0f; } + bool JUCE_CALLTYPE SystemAudioVolume::setGain (float) { jassertfalse; return false; } + bool JUCE_CALLTYPE SystemAudioVolume::isMuted() { jassertfalse; return false; } + bool JUCE_CALLTYPE SystemAudioVolume::setMuted (bool) { jassertfalse; return false; } } +#endif diff --git a/modules/juce_audio_devices/juce_audio_devices.h b/modules/juce_audio_devices/juce_audio_devices.h index 533bcd1af3..6dddca865e 100644 --- a/modules/juce_audio_devices/juce_audio_devices.h +++ b/modules/juce_audio_devices/juce_audio_devices.h @@ -140,9 +140,6 @@ //============================================================================== -namespace juce -{ - #include "midi_io/juce_MidiInput.h" #include "midi_io/juce_MidiMessageCollector.h" #include "midi_io/juce_MidiOutput.h" @@ -156,5 +153,3 @@ namespace juce #if JUCE_IOS #include "native/juce_ios_Audio.h" #endif - -} diff --git a/modules/juce_audio_devices/midi_io/juce_MidiInput.h b/modules/juce_audio_devices/midi_io/juce_MidiInput.h index 54cd0e4e77..52edd9fe09 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiInput.h +++ b/modules/juce_audio_devices/midi_io/juce_MidiInput.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class MidiInput; @@ -171,3 +172,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiInput) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp b/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp index 66bab1f852..50ca20569a 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp +++ b/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MidiMessageCollector::MidiMessageCollector() { } @@ -151,3 +154,5 @@ void MidiMessageCollector::handleIncomingMidiMessage (MidiInput*, const MidiMess { addMessageToQueue (message); } + +} // namespace juce diff --git a/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h b/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h index 97f2dd6bb5..aa8bcdbeb6 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h +++ b/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -99,3 +99,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiMessageCollector) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp b/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp index f364b31cd9..36b7cf6409 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp +++ b/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct MidiOutput::PendingMessage { PendingMessage (const void* const data, const int len, const double timeStamp) @@ -169,3 +172,5 @@ void MidiOutput::run() clearAllPendingMessages(); } + +} // namespace juce diff --git a/modules/juce_audio_devices/midi_io/juce_MidiOutput.h b/modules/juce_audio_devices/midi_io/juce_MidiOutput.h index f71553dc7e..f05dc32f14 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiOutput.h +++ b/modules/juce_audio_devices/midi_io/juce_MidiOutput.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -139,3 +139,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiOutput) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h b/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h index 0cf7e285d1..1df491240a 100644 --- a/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h +++ b/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -31,9 +32,8 @@ class MidiDataConcatenator { public: //============================================================================== - MidiDataConcatenator (const int initialBufferSize) - : pendingData ((size_t) initialBufferSize), - pendingDataTime (0), pendingBytes (0), runningStatus (0) + MidiDataConcatenator (int initialBufferSize) + : pendingData ((size_t) initialBufferSize) { } @@ -181,9 +181,11 @@ private: } MemoryBlock pendingData; - double pendingDataTime; - int pendingBytes; - uint8 runningStatus; + double pendingDataTime = 0; + int pendingBytes = 0; + uint8 runningStatus = 0; JUCE_DECLARE_NON_COPYABLE (MidiDataConcatenator) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_android_Audio.cpp b/modules/juce_audio_devices/native/juce_android_Audio.cpp index a22f0619fa..6ff8c32261 100644 --- a/modules/juce_audio_devices/native/juce_android_Audio.cpp +++ b/modules/juce_audio_devices/native/juce_android_Audio.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (getMinBufferSize, "getMinBufferSize", "(III)I") \ STATICMETHOD (getNativeOutputSampleRate, "getNativeOutputSampleRate", "(I)I") \ @@ -472,3 +474,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android() return new AndroidAudioIODeviceType(); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_android_Midi.cpp b/modules/juce_audio_devices/native/juce_android_Midi.cpp index 3bcd3ea053..5afe6562c3 100644 --- a/modules/juce_audio_devices/native/juce_android_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_android_Midi.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getJuceAndroidMidiInputDevices, "getJuceAndroidMidiInputDevices", "()[Ljava/lang/String;") \ METHOD (getJuceAndroidMidiOutputDevices, "getJuceAndroidMidiOutputDevices", "()[Ljava/lang/String;") \ @@ -357,3 +360,5 @@ MidiInput::~MidiInput() { delete reinterpret_cast (internal); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index 400d0f54f8..65362b8565 100644 --- a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICFIELD (SDK_INT, "SDK_INT", "I") \ @@ -1283,3 +1285,5 @@ pthread_t juce_createRealtimeAudioThread (void* (*entry) (void*), void* userPtr) return threadID; } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_ios_Audio.cpp b/modules/juce_audio_devices/native/juce_ios_Audio.cpp index ad69dad3c8..c123849b06 100644 --- a/modules/juce_audio_devices/native/juce_ios_Audio.cpp +++ b/modules/juce_audio_devices/native/juce_ios_Audio.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class iOSAudioIODevice; static const char* const iOSAudioDeviceName = "iOS Audio"; @@ -183,6 +186,10 @@ bool getNotificationValueForKey (NSNotification* notification, NSString* key, NS @end //============================================================================== +#if JUCE_MODULE_AVAILABLE_juce_graphics + #include +#endif + namespace juce { #ifndef JUCE_IOS_AUDIO_LOGGING @@ -206,10 +213,6 @@ static void logNSError (NSError* e) #define JUCE_NSERROR_CHECK(X) { NSError* error = nil; X; logNSError (error); } -#if JUCE_MODULE_AVAILABLE_juce_graphics -#include -#endif - //============================================================================== struct iOSAudioIODevice::Pimpl : public AudioPlayHead, public AsyncUpdater @@ -1168,3 +1171,5 @@ void AudioSessionHolder::handleRouteChange (const char* reason) } #undef JUCE_NSERROR_CHECK + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_ios_Audio.h b/modules/juce_audio_devices/native/juce_ios_Audio.h index bab7573845..f0b3733268 100644 --- a/modules/juce_audio_devices/native/juce_ios_Audio.h +++ b/modules/juce_audio_devices/native/juce_ios_Audio.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ struct iOSAudioIODeviceType; @@ -86,3 +87,5 @@ private: JUCE_DECLARE_NON_COPYABLE (iOSAudioIODevice) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp index 84432055a6..db984ebd44 100644 --- a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp +++ b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace { @@ -1272,3 +1275,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return createAudioIODeviceType_ALSA_PCMDevices(); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp b/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp index 482437e893..eb25bd7622 100644 --- a/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp +++ b/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + static void* juce_libjackHandle = nullptr; static void* juce_loadJackFunction (const char* const name) @@ -602,3 +604,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return new JackAudioIODeviceType(); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_linux_Midi.cpp b/modules/juce_audio_devices/native/juce_linux_Midi.cpp index 260fcc95d0..ef4dfade87 100644 --- a/modules/juce_audio_devices/native/juce_linux_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_linux_Midi.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_ALSA // You can define these strings in your app if you want to override the default names: @@ -610,3 +613,5 @@ MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { re MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return nullptr; } #endif + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp index 0cb091a7e6..4442d15603 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_COREAUDIO_LOGGING_ENABLED #define JUCE_COREAUDIOLOG(a) { String camsg ("CoreAudio: "); camsg << a; Logger::writeToLog (camsg); } #else @@ -2058,3 +2061,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_CoreAudio() } #undef JUCE_COREAUDIOLOG + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp index 4abff0f094..cd98d478e6 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #ifndef JUCE_LOG_COREMIDI_ERRORS #define JUCE_LOG_COREMIDI_ERRORS 1 #endif @@ -555,3 +558,5 @@ void MidiInput::stop() } #undef CHECK_ERROR + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index c919767207..54bc1e7b51 100644 --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #undef WINDOWS /* The ASIO SDK *should* declare its callback functions as being __cdecl, but different versions seem @@ -1639,3 +1642,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return new ASIOAudioIODeviceType(); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp index 031be1892c..83b60ce691 100644 --- a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp +++ b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp @@ -20,8 +20,6 @@ ============================================================================== */ -} // (juce namespace) - extern "C" { // Declare just the minimum number of interfaces for the DSound objects that we need.. @@ -1271,3 +1269,5 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_DirectSound() { return new DSoundAudioIODeviceType(); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_win32_Midi.cpp b/modules/juce_audio_devices/native/juce_win32_Midi.cpp index b614f71387..8aacbae9ce 100644 --- a/modules/juce_audio_devices/native/juce_win32_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_win32_Midi.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct MidiServiceType { struct InputWrapper @@ -27,7 +30,6 @@ struct MidiServiceType virtual ~InputWrapper() {} virtual String getDeviceName() = 0; - virtual void start() = 0; virtual void stop() = 0; }; @@ -37,7 +39,6 @@ struct MidiServiceType virtual ~OutputWrapper() {} virtual String getDeviceName() = 0; - virtual void sendMessageNow (const MidiMessage&) = 0; }; @@ -47,10 +48,8 @@ struct MidiServiceType virtual StringArray getDevices (bool) = 0; virtual int getDefaultDeviceIndex (bool) = 0; - virtual InputWrapper* createInputWrapper (MidiInput* const, - const int, - MidiInputCallback* const callback) = 0; - virtual OutputWrapper* createOutputWrapper (const int) = 0; + virtual InputWrapper* createInputWrapper (MidiInput*, int, MidiInputCallback*) = 0; + virtual OutputWrapper* createOutputWrapper (int) = 0; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiServiceType) }; @@ -510,14 +509,12 @@ public: : WindowsOutputWrapper::getDefaultDeviceIndex(); } - InputWrapper* createInputWrapper (MidiInput* const input, - const int index, - MidiInputCallback* const callback) override + InputWrapper* createInputWrapper (MidiInput* input, int index, MidiInputCallback* callback) override { return new WindowsInputWrapper (*this, input, index, callback); } - OutputWrapper* createOutputWrapper (const int index) override + OutputWrapper* createOutputWrapper (int index) override { return new WindowsOutputWrapper (*this, index); } @@ -1081,14 +1078,12 @@ public: : outputDeviceWatcher->getDefaultDeviceIndex(); } - InputWrapper* createInputWrapper (MidiInput* const input, - const int index, - MidiInputCallback* const callback) override + InputWrapper* createInputWrapper (MidiInput* input, int index, MidiInputCallback* callback) override { return new WinRTInputWrapper (*this, input, index, *callback); } - OutputWrapper* createOutputWrapper (const int index) override + OutputWrapper* createOutputWrapper (int index) override { return new WinRTOutputWrapper (*this, index); } @@ -1169,8 +1164,9 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call if (callback == nullptr) return nullptr; - ScopedPointer in (new MidiInput ("")); + ScopedPointer in (new MidiInput ({})); ScopedPointer wrapper; + try { wrapper = MidiService::getInstance()->getService()->createInputWrapper (in, index, callback); @@ -1207,6 +1203,7 @@ int MidiOutput::getDefaultDeviceIndex() MidiOutput* MidiOutput::openDevice (const int index) { ScopedPointer wrapper; + try { wrapper = MidiService::getInstance()->getService()->createOutputWrapper (index); @@ -1229,6 +1226,7 @@ MidiOutput::~MidiOutput() void MidiOutput::sendMessageNow (const MidiMessage& message) { - auto* const wrapper = static_cast (internal); - wrapper->sendMessageNow (message); + static_cast (internal)->sendMessageNow (message); } + +} // namespace juce diff --git a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp index 7fb96aaee3..16ed54c5c0 100644 --- a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp +++ b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #ifndef JUCE_WASAPI_LOGGING #define JUCE_WASAPI_LOGGING 0 #endif @@ -1715,3 +1718,5 @@ float JUCE_CALLTYPE SystemAudioVolume::getGain() { return WasapiCla bool JUCE_CALLTYPE SystemAudioVolume::setGain (float gain) { return WasapiClasses::MMDeviceMasterVolume().setGain (gain); } bool JUCE_CALLTYPE SystemAudioVolume::isMuted() { return WasapiClasses::MMDeviceMasterVolume().isMuted(); } bool JUCE_CALLTYPE SystemAudioVolume::setMuted (bool mute) { return WasapiClasses::MMDeviceMasterVolume().setMuted (mute); } + +} // namespace juce diff --git a/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp b/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp index 90525e01b8..b03ca9a93f 100644 --- a/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp +++ b/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + AudioSourcePlayer::AudioSourcePlayer() : source (nullptr), sampleRate (0), @@ -178,3 +181,5 @@ void AudioSourcePlayer::audioDeviceStopped() tempBuffer.setSize (2, 8); } + +} // namespace juce diff --git a/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h b/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h index 8ef1760679..d624b0a578 100644 --- a/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h +++ b/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioSourcePlayer) }; + +} // namespace juce diff --git a/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp b/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp index 7d59f13c76..bbc3d8ae48 100644 --- a/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp +++ b/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp @@ -20,22 +20,10 @@ ============================================================================== */ +namespace juce +{ + AudioTransportSource::AudioTransportSource() - : source (nullptr), - resamplerSource (nullptr), - bufferingSource (nullptr), - positionableSource (nullptr), - masterSource (nullptr), - gain (1.0f), - lastGain (1.0f), - playing (false), - stopped (true), - sampleRate (44100.0), - sourceSampleRate (0.0), - blockSize (128), - readAheadBufferSize (0), - isPrepared (false), - inputStreamEOF (false) { } @@ -294,3 +282,5 @@ void AudioTransportSource::getNextAudioBlock (const AudioSourceChannelInfo& info lastGain = gain; } + +} // namespace juce diff --git a/modules/juce_audio_devices/sources/juce_AudioTransportSource.h b/modules/juce_audio_devices/sources/juce_AudioTransportSource.h index 36cb8f5a2a..90103dad6b 100644 --- a/modules/juce_audio_devices/sources/juce_AudioTransportSource.h +++ b/modules/juce_audio_devices/sources/juce_AudioTransportSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -155,20 +155,22 @@ public: private: //============================================================================== - PositionableAudioSource* source; - ResamplingAudioSource* resamplerSource; - BufferingAudioSource* bufferingSource; - PositionableAudioSource* positionableSource; - AudioSource* masterSource; + PositionableAudioSource* source = nullptr; + ResamplingAudioSource* resamplerSource = nullptr; + BufferingAudioSource* bufferingSource = nullptr; + PositionableAudioSource* positionableSource = nullptr; + AudioSource* masterSource = nullptr; CriticalSection callbackLock; - float volatile gain, lastGain; - bool volatile playing, stopped; - double sampleRate, sourceSampleRate; - int blockSize, readAheadBufferSize; - bool volatile isPrepared, inputStreamEOF; + float volatile gain = 1.0f, lastGain = 1.0f; + bool volatile playing = false, stopped = true; + double sampleRate = 44100.0, sourceSampleRate = 0; + int blockSize = 128, readAheadBufferSize = 0; + bool volatile isPrepared = false, inputStreamEOF = false; void releaseMasterResources(); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioTransportSource) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index 40619c54c8..f3c8c8053d 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static const char* const aiffFormatName = "AIFF file"; //============================================================================== @@ -1015,3 +1018,5 @@ AudioFormatWriter* AiffAudioFormat::createWriterFor (OutputStream* out, return nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h index efafaa73ad..cd4c5f43a6 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + //============================================================================== /** Reads and Writes AIFF format audio files. @@ -85,3 +88,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AiffAudioFormat) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp index 1b310579e4..72d0aa9740 100644 --- a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp @@ -28,6 +28,9 @@ #include "../../juce_audio_basics/native/juce_mac_CoreAudioLayouts.h" +namespace juce +{ + //============================================================================== namespace { @@ -831,4 +834,7 @@ private: static CoreAudioLayoutsUnitTest coreAudioLayoutsUnitTest; #endif + +} // namespace juce + #endif diff --git a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h index dd5b54ab8b..878d84e0f6 100644 --- a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MAC || JUCE_IOS || DOXYGEN //============================================================================== @@ -77,3 +80,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp index d8b97fc2f0..05c3c44eac 100644 --- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_FLAC } @@ -621,3 +624,5 @@ StringArray FlacAudioFormat::getQualityOptions() } #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h index 8b3c43e4fd..fe61e3c59e 100644 --- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_FLAC || defined (DOXYGEN) //============================================================================== @@ -65,3 +68,5 @@ private: #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp index 78b61d9045..01b39ea247 100644 --- a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_LAME_AUDIO_FORMAT class LAMEEncoderAudioFormat::Writer : public AudioFormatWriter @@ -225,3 +228,5 @@ AudioFormatWriter* LAMEEncoderAudioFormat::createWriterFor (OutputStream* stream } #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h index dc0290d944..45b578842d 100644 --- a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_LAME_AUDIO_FORMAT || defined (DOXYGEN) //============================================================================== @@ -71,3 +74,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp index bfc987db3d..238eb4f3ea 100644 --- a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /* IMPORTANT DISCLAIMER: By choosing to enable the JUCE_USE_MP3AUDIOFORMAT flag and to compile this MP3 code into your software, you do so AT YOUR OWN RISK! By doing so, @@ -3161,3 +3164,5 @@ AudioFormatWriter* MP3AudioFormat::createWriterFor (OutputStream*, double /*samp } #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h index 5d952d42f7..cde3298ec7 100644 --- a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_MP3AUDIOFORMAT || DOXYGEN //============================================================================== @@ -64,3 +67,5 @@ public: }; #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp index 34a83caba8..0a2737bcab 100644 --- a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_OGGVORBIS #if JUCE_MAC && ! defined (__MACOSX__) @@ -537,3 +540,5 @@ int OggVorbisAudioFormat::estimateOggFileQuality (const File& source) } #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h index 416ecad200..c8f4704e54 100644 --- a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_OGGVORBIS || defined (DOXYGEN) //============================================================================== @@ -93,3 +96,5 @@ private: #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp index d54bdc6f78..565fecb6b5 100644 --- a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static const char* const wavFormatName = "WAV file"; //============================================================================== @@ -1867,3 +1870,5 @@ private: static const WaveAudioFormatTests waveAudioFormatTests; #endif + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h index e18e8e207a..85580208f3 100644 --- a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + //============================================================================== /** Reads and Writes WAV format audio files. @@ -218,3 +221,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WavAudioFormat) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp index 6e75610d34..3167ff3d0d 100644 --- a/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace WindowsMediaCodec { @@ -353,3 +356,5 @@ AudioFormatWriter* WindowsMediaAudioFormat::createWriterFor (OutputStream* /*str jassertfalse; // not yet implemented! return nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h b/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h index 39566f9ef9..97c746e299 100644 --- a/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_WINDOWS || DOXYGEN //============================================================================== @@ -53,3 +56,5 @@ public: }; #endif + +} diff --git a/modules/juce_audio_formats/format/juce_AudioFormat.cpp b/modules/juce_audio_formats/format/juce_AudioFormat.cpp index a1cacb4b4a..5bad00afe9 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormat.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioFormat::AudioFormat (String name, StringArray extensions) : formatName (name), fileExtensions (extensions) { @@ -85,3 +88,5 @@ AudioFormatWriter* AudioFormat::createWriterFor (OutputStream* streamToWriteTo, return nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormat.h b/modules/juce_audio_formats/format/juce_AudioFormat.h index 1db42e9797..bd8113fa31 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormat.h +++ b/modules/juce_audio_formats/format/juce_AudioFormat.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -216,3 +216,5 @@ private: String formatName; StringArray fileExtensions; }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp index 62406fea64..33f26d4370 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioFormatManager::AudioFormatManager() : defaultFormatIndex (0) {} AudioFormatManager::~AudioFormatManager() {} @@ -177,3 +180,5 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt return nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatManager.h b/modules/juce_audio_formats/format/juce_AudioFormatManager.h index 7c2f9d4f58..246908a415 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatManager.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatManager.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -139,3 +139,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioFormatManager) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp b/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp index d0521d2df5..7f29c83770 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioFormatReader::AudioFormatReader (InputStream* const in, const String& name) : sampleRate (0), bitsPerSample (0), @@ -419,3 +422,5 @@ void MemoryMappedAudioFormatReader::touchSample (int64 sample) const noexcept else jassertfalse; // you must make sure that the window contains all the samples you're going to attempt to read. } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReader.h b/modules/juce_audio_formats/format/juce_AudioFormatReader.h index 8af863a8f2..5486892eea 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReader.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatReader.h @@ -24,7 +24,10 @@ ============================================================================== */ -#pragma once +namespace juce +{ + +class AudioFormat; //============================================================================== @@ -299,3 +302,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioFormatReader) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp b/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp index 38c589304c..9e6c567570 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioFormatReaderSource::AudioFormatReaderSource (AudioFormatReader* const r, const bool deleteReaderWhenThisIsDeleted) : reader (r, deleteReaderWhenThisIsDeleted), @@ -85,3 +88,5 @@ void AudioFormatReaderSource::getNextAudioBlock (const AudioSourceChannelInfo& i } } } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h b/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h index a44709ced7..3ad72c3601 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -96,3 +96,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioFormatReaderSource) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp b/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp index febf8a3259..c7ba031033 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioFormatWriter::AudioFormatWriter (OutputStream* const out, const String& formatName_, const double rate, @@ -358,3 +361,5 @@ void AudioFormatWriter::ThreadedWriter::setFlushInterval (int numSamplesPerFlush { buffer->setFlushInterval (numSamplesPerFlush); } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioFormatWriter.h b/modules/juce_audio_formats/format/juce_AudioFormatWriter.h index de89989314..c817e0bc06 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatWriter.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatWriter.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -294,3 +294,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioFormatWriter) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp b/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp index 2ad71689dc..0fc827297a 100644 --- a/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp +++ b/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioSubsectionReader::AudioSubsectionReader (AudioFormatReader* const source_, const int64 startSample_, const int64 length_, @@ -66,3 +69,5 @@ void AudioSubsectionReader::readMaxLevels (int64 startSampleInFile, int64 numSam source->readMaxLevels (startSampleInFile + startSample, numSamples, results, numChannelsToRead); } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h b/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h index 63936138f1..523fb59cbf 100644 --- a/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h +++ b/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -80,3 +80,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioSubsectionReader) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp b/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp index da87e650d2..0980c00b23 100644 --- a/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp +++ b/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + BufferingAudioReader::BufferingAudioReader (AudioFormatReader* sourceReader, TimeSliceThread& timeSliceThread, int samplesToBuffer) @@ -173,3 +176,5 @@ bool BufferingAudioReader::readNextBufferChunk() return true; } + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h b/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h index 5bdd312186..c8a4e1d8e5 100644 --- a/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h +++ b/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -89,3 +90,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BufferingAudioReader) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h b/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h index 93deee3862..4b9454c953 100644 --- a/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h +++ b/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -108,3 +108,5 @@ protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryMappedAudioFormatReader) }; + +} // namespace juce diff --git a/modules/juce_audio_formats/juce_audio_formats.cpp b/modules/juce_audio_formats/juce_audio_formats.cpp index ab3464dfc8..7f930e7e09 100644 --- a/modules/juce_audio_formats/juce_audio_formats.cpp +++ b/modules/juce_audio_formats/juce_audio_formats.cpp @@ -53,9 +53,6 @@ #endif //============================================================================== -namespace juce -{ - #include "format/juce_AudioFormat.cpp" #include "format/juce_AudioFormatManager.cpp" #include "format/juce_AudioFormatReader.cpp" @@ -75,5 +72,3 @@ namespace juce #if JUCE_WINDOWS && JUCE_USE_WINDOWS_MEDIA_FORMAT #include "codecs/juce_WindowsMediaAudioFormat.cpp" #endif - -} diff --git a/modules/juce_audio_formats/juce_audio_formats.h b/modules/juce_audio_formats/juce_audio_formats.h index deabf519ce..4fa9e79eeb 100644 --- a/modules/juce_audio_formats/juce_audio_formats.h +++ b/modules/juce_audio_formats/juce_audio_formats.h @@ -110,10 +110,6 @@ #endif //============================================================================== -namespace juce -{ - -class AudioFormat; #include "format/juce_AudioFormatReader.h" #include "format/juce_AudioFormatWriter.h" #include "format/juce_MemoryMappedAudioFormatReader.h" @@ -131,5 +127,3 @@ class AudioFormat; #include "codecs/juce_WavAudioFormat.h" #include "codecs/juce_WindowsMediaAudioFormat.h" #include "sampler/juce_Sampler.h" - -} diff --git a/modules/juce_audio_formats/sampler/juce_Sampler.cpp b/modules/juce_audio_formats/sampler/juce_Sampler.cpp index eab9b01c5b..cb9aa5cf60 100644 --- a/modules/juce_audio_formats/sampler/juce_Sampler.cpp +++ b/modules/juce_audio_formats/sampler/juce_Sampler.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + SamplerSound::SamplerSound (const String& soundName, AudioFormatReader& source, const BigInteger& notes, @@ -224,3 +227,5 @@ void SamplerVoice::renderNextBlock (AudioSampleBuffer& outputBuffer, int startSa } } } + +} // namespace juce diff --git a/modules/juce_audio_formats/sampler/juce_Sampler.h b/modules/juce_audio_formats/sampler/juce_Sampler.h index 77df8e891a..68482d86be 100644 --- a/modules/juce_audio_formats/sampler/juce_Sampler.h +++ b/modules/juce_audio_formats/sampler/juce_Sampler.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -142,3 +142,5 @@ private: JUCE_LEAK_DETECTOR (SamplerVoice) }; + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Modifier_Injector.h b/modules/juce_audio_plugin_client/AAX/juce_AAX_Modifier_Injector.h index 7f2bb43815..bc73e38117 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Modifier_Injector.h +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Modifier_Injector.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ struct ModifierKeyProvider { @@ -38,3 +39,5 @@ struct ModifierKeyReceiver virtual void setModifierKeyProvider (ModifierKeyProvider*) = 0; virtual void removeModifierKeyProvider() = 0; }; + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 222de07caf..c2b6820ded 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -96,10 +96,9 @@ #undef check -namespace juce -{ - #include "juce_AAX_Modifier_Injector.h" -} +#include "juce_AAX_Modifier_Injector.h" + +using namespace juce; const int32_t juceChunkType = 'juce'; const int maxAAXChannels = 8; diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 7ee4f4e1d2..de27773daf 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -84,6 +84,8 @@ #include "../../juce_audio_processors/format_types/juce_AU_Shared.h" //============================================================================== +using namespace juce; + static Array activePlugins, activeUIs; static const AudioUnitPropertyID juceFilterObjectPropertyID = 0x1a45ffe9; diff --git a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm index 63e6a59676..c2fff35401 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm @@ -57,9 +57,10 @@ #error AUv3 needs Objective-C 2 support (compile with 64-bit) #endif +#define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 + #include "../utility/juce_IncludeSystemHeaders.h" #include "../utility/juce_IncludeModuleHeaders.h" -#include "../../juce_core/native/juce_osx_ObjCHelpers.h" #include "../../juce_graphics/native/juce_mac_CoreGraphicsHelpers.h" #include "../../juce_audio_basics/native/juce_mac_CoreAudioLayouts.h" @@ -82,7 +83,9 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullability-completeness" -// TODO: ask Timur: use SFINAE to automatically generate this for all NSObjects +using namespace juce; + +// TODO: use SFINAE to automatically generate this for all NSObjects template <> struct ContainerDeletePolicy { static void destroy (NSObject* o) { [o release]; } }; template <> struct ContainerDeletePolicy { static void destroy (NSObject* o) { [o release]; } }; template <> struct ContainerDeletePolicy > { static void destroy (NSObject* o) { [o release]; } }; diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp index 8aa575d254..7cc182dff9 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #include "../../juce_core/system/juce_TargetPlatform.h" #include "../utility/juce_CheckSettingMacros.h" @@ -75,3 +78,5 @@ #endif #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp index fb11cdffb6..be77d203eb 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #include "../../juce_core/system/juce_TargetPlatform.h" #include "../utility/juce_CheckSettingMacros.h" @@ -63,3 +66,5 @@ #endif #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp index 725d412a82..83f8b5e92a 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #include "../../juce_core/system/juce_TargetPlatform.h" #include "../utility/juce_CheckSettingMacros.h" @@ -78,3 +81,5 @@ #endif #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode_Header.h b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode_Header.h index 5e2a3094c7..d67f4e37e8 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode_Header.h +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode_Header.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JucePlugin_Build_RTAS #ifdef _MSC_VER @@ -67,3 +68,5 @@ #endif #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinUtilities.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinUtilities.cpp index 5317d09a17..ce6bce646c 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinUtilities.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinUtilities.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #include "../../juce_core/system/juce_TargetPlatform.h" #include "../utility/juce_CheckSettingMacros.h" @@ -151,3 +154,5 @@ void JUCE_CALLTYPE passFocusToHostWindow (void* hostWindow) #endif #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp index f97ec634c3..42c4f3f9f5 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #include "../../juce_core/system/juce_TargetPlatform.h" #include "../utility/juce_CheckSettingMacros.h" @@ -1043,3 +1046,5 @@ CProcessGroupInterface* CProcessGroup::CreateProcessGroup() } #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp index a4c9a1e6b8..9b62d22870 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp @@ -41,16 +41,16 @@ // set it then by default we'll just create a simple one as below. #if ! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP -extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); +extern juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter(); + +#if JucePlugin_Enable_IAA && JUCE_IOS + #include "../../juce_audio_devices/native/juce_ios_Audio.h" +#endif + +#include "juce_StandaloneFilterWindow.h" namespace juce { - #if JucePlugin_Enable_IAA && JUCE_IOS - #include "../../juce_audio_devices/native/juce_ios_Audio.h" - #endif - - #include "juce_StandaloneFilterWindow.h" -} //============================================================================== class StandaloneFilterApp : public JUCEApplication @@ -160,4 +160,6 @@ Image JUCE_CALLTYPE juce_getIAAHostIcon (int size) #endif #endif +} // namespace juce + #endif diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index 45dafcd28a..c85641e90a 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -841,3 +842,5 @@ StandalonePluginHolder* StandalonePluginHolder::getInstance() return nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/VST/juce_VSTCallbackHandler.h b/modules/juce_audio_plugin_client/VST/juce_VSTCallbackHandler.h index b08d8557f3..4a00dd3e20 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VSTCallbackHandler.h +++ b/modules/juce_audio_plugin_client/VST/juce_VSTCallbackHandler.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ /** An interface to allow an AudioProcessor to receive VST specific calls from the host. @@ -41,3 +42,5 @@ struct VSTCallbackHandler void* ptr, float opt) = 0; }; + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index e57d0f5776..ee89f838f5 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -59,6 +59,7 @@ #pragma warning (disable : 4458) #endif +#include #include "../../juce_audio_processors/format_types/juce_VSTInterface.h" #ifdef _MSC_VER diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client.h b/modules/juce_audio_plugin_client/juce_audio_plugin_client.h index d5f034c2a2..8dcb2d4adf 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client.h +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client.h @@ -91,8 +91,5 @@ #define JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS 1 #endif -namespace juce -{ - #include "utility/juce_PluginHostType.h" - #include "VST/juce_VSTCallbackHandler.h" -} +#include "utility/juce_PluginHostType.h" +#include "VST/juce_VSTCallbackHandler.h" diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_Standalone.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_Standalone.cpp index e5bf500d87..bd8ad92284 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_Standalone.cpp +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_Standalone.cpp @@ -38,7 +38,7 @@ #endif #else - JUCE_CREATE_APPLICATION_DEFINE(StandaloneFilterApp) + JUCE_CREATE_APPLICATION_DEFINE(juce::StandaloneFilterApp) #endif JUCE_MAIN_FUNCTION_DEFINITION diff --git a/modules/juce_audio_plugin_client/utility/juce_CarbonVisibility.h b/modules/juce_audio_plugin_client/utility/juce_CarbonVisibility.h index b3e4b18474..0d0f8aa99f 100644 --- a/modules/juce_audio_plugin_client/utility/juce_CarbonVisibility.h +++ b/modules/juce_audio_plugin_client/utility/juce_CarbonVisibility.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== #if JUCE_SUPPORT_CARBON && JUCE_MAC_WINDOW_VISIBITY_BODGE @@ -76,3 +77,5 @@ inline void removeWindowHidingHooks (Component* comp) inline void attachWindowHidingHooks (void*, void*, void*) {} inline void removeWindowHidingHooks (void*) {} #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h b/modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h index d78d3bd10d..299ca4ceb3 100644 --- a/modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h +++ b/modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MAC @@ -88,3 +89,5 @@ private: #else struct FakeMouseMoveGenerator {}; #endif + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h index f2e9efde84..701c4df909 100644 --- a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h +++ b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h @@ -24,12 +24,8 @@ ============================================================================== */ -#pragma once - #include "../juce_audio_plugin_client.h" -using namespace juce; - namespace juce { #define Component juce::Component @@ -47,4 +43,4 @@ namespace juce } } -extern AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType); +extern juce::AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (juce::AudioProcessor::WrapperType); diff --git a/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h b/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h index 97379a0768..d4a31a0fb6 100644 --- a/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h +++ b/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + //============================================================================== class PluginHostType { @@ -311,3 +314,5 @@ private: return UnknownHost; } }; + +} // namespace juce diff --git a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp index 4380839f4b..831f9ec4b5 100644 --- a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp +++ b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp @@ -32,14 +32,13 @@ #include "../utility/juce_CheckSettingMacros.h" #include "juce_IncludeModuleHeaders.h" -namespace juce -{ - AudioProcessor::WrapperType PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_Undefined; -} +using namespace juce; -//============================================================================== namespace juce { + +AudioProcessor::WrapperType PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_Undefined; + #ifndef JUCE_VST3_CAN_REPLACE_VST2 #define JUCE_VST3_CAN_REPLACE_VST2 1 #endif @@ -143,7 +142,7 @@ bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_i } #endif -} // namespace juce +} // namespace juce //============================================================================== /** Somewhere in the codebase of your plugin, you need to implement this function diff --git a/modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h b/modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h index 70f5503b1a..9407e7e710 100644 --- a/modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h +++ b/modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h @@ -28,9 +28,9 @@ namespace juce { - // This function is in juce_win32_Windowing.cpp - extern bool offerKeyMessageToJUCEWindow (MSG&); -} + +// This function is in juce_win32_Windowing.cpp +extern bool offerKeyMessageToJUCEWindow (MSG&); namespace { @@ -44,11 +44,11 @@ namespace if (numHookUsers++ == 0) { mouseWheelHook = SetWindowsHookEx (WH_MOUSE, mouseWheelHookCallback, - (HINSTANCE) Process::getCurrentModuleInstanceHandle(), + (HINSTANCE) juce::Process::getCurrentModuleInstanceHandle(), GetCurrentThreadId()); keyboardHook = SetWindowsHookEx (WH_GETMESSAGE, keyboardHookCallback, - (HINSTANCE) Process::getCurrentModuleInstanceHandle(), + (HINSTANCE) juce::Process::getCurrentModuleInstanceHandle(), GetCurrentThreadId()); } } @@ -78,9 +78,9 @@ namespace // using a local copy of this struct to support old mingw libraries struct MOUSEHOOKSTRUCTEX_ : public MOUSEHOOKSTRUCT { DWORD mouseData; }; - const MOUSEHOOKSTRUCTEX_& hs = *(MOUSEHOOKSTRUCTEX_*) lParam; + auto& hs = *(MOUSEHOOKSTRUCTEX_*) lParam; - if (Component* const comp = Desktop::getInstance().findComponentAt (Point (hs.pt.x, hs.pt.y))) + if (auto* comp = Desktop::getInstance().findComponentAt ({ hs.pt.x, hs.pt.y })) if (comp->getWindowHandle() != 0) return PostMessage ((HWND) comp->getWindowHandle(), WM_MOUSEWHEEL, hs.mouseData & 0xffff0000, (hs.pt.x & 0xffff) | (hs.pt.y << 16)); @@ -106,4 +106,6 @@ namespace }; } +} // juce namespace + #endif diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp index 720260de4c..8b33d4d043 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace AudioPluginFormatHelpers { struct CallbackInvoker @@ -207,3 +210,5 @@ void AudioPluginFormat::createPluginInstanceOnMessageThread (const PluginDescrip createPluginInstance (description, initialSampleRate, initialBufferSize, completion, AudioPluginFormatHelpers::CallbackInvoker::staticCompletionCallback); } + +} // namespace juce diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormat.h b/modules/juce_audio_processors/format/juce_AudioPluginFormat.h index f820257898..6eb08eb324 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormat.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormat.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -164,3 +164,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormat) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp index d9e5551ce1..ceedf1705d 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace PluginFormatManagerHelpers { struct ErrorCallbackOnMessageThread : public CallbackMessage @@ -176,3 +179,5 @@ bool AudioPluginFormatManager::doesPluginStillExist (const PluginDescription& de return false; } + +} // namespace juce diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h index 0be2c06b54..495c222919 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -134,3 +134,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormatManager) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_AU_Shared.h b/modules/juce_audio_processors/format_types/juce_AU_Shared.h index 5b5e5fcf65..434326ff28 100644 --- a/modules/juce_audio_processors/format_types/juce_AU_Shared.h +++ b/modules/juce_audio_processors/format_types/juce_AU_Shared.h @@ -29,6 +29,9 @@ #define JUCE_STATE_DICTIONARY_KEY "jucePluginState" #endif +namespace juce +{ + struct AudioUnitHelpers { class ChannelRemapper @@ -342,102 +345,102 @@ struct AudioUnitHelpers info.inChannels = 0; info.outChannels = 0; - return {&info, 1}; + return { &info, 1 }; } - else - { - auto layout = processor.getBusesLayout(); - auto maxNumChanToCheckFor = 9; - auto defaultInputs = processor.getChannelCountOfBus (true, 0); - auto defaultOutputs = processor.getChannelCountOfBus (false, 0); + auto layout = processor.getBusesLayout(); + auto maxNumChanToCheckFor = 9; + + auto defaultInputs = processor.getChannelCountOfBus (true, 0); + auto defaultOutputs = processor.getChannelCountOfBus (false, 0); - SortedSet supportedChannels; + SortedSet supportedChannels; - // add the current configuration - if (defaultInputs != 0 || defaultOutputs != 0) - supportedChannels.add ((defaultInputs << 16) | defaultOutputs); + // add the current configuration + if (defaultInputs != 0 || defaultOutputs != 0) + supportedChannels.add ((defaultInputs << 16) | defaultOutputs); - for (auto inChanNum = hasMainInputBus ? 1 : 0; inChanNum <= (hasMainInputBus ? maxNumChanToCheckFor : 0); ++inChanNum) + for (auto inChanNum = hasMainInputBus ? 1 : 0; inChanNum <= (hasMainInputBus ? maxNumChanToCheckFor : 0); ++inChanNum) + { + auto inLayout = layout; + + if (auto* inBus = processor.getBus (true, 0)) + if (! isNumberOfChannelsSupported (inBus, inChanNum, inLayout)) + continue; + + for (auto outChanNum = hasMainOutputBus ? 1 : 0; outChanNum <= (hasMainOutputBus ? maxNumChanToCheckFor : 0); ++outChanNum) { - auto inLayout = layout; + auto outLayout = inLayout; - if (auto* inBus = processor.getBus (true, 0)) - if (! isNumberOfChannelsSupported (inBus, inChanNum, inLayout)) + if (auto* outBus = processor.getBus (false, 0)) + if (! isNumberOfChannelsSupported (outBus, outChanNum, outLayout)) continue; - for (auto outChanNum = hasMainOutputBus ? 1 : 0; outChanNum <= (hasMainOutputBus ? maxNumChanToCheckFor : 0); ++outChanNum) - { - auto outLayout = inLayout; + supportedChannels.add (((hasMainInputBus ? outLayout.getMainInputChannels() : 0) << 16) + | (hasMainOutputBus ? outLayout.getMainOutputChannels() : 0)); + } + } - if (auto* outBus = processor.getBus (false, 0)) - if (! isNumberOfChannelsSupported (outBus, outChanNum, outLayout)) - continue; + auto hasInOutMismatch = false; - supportedChannels.add (((hasMainInputBus ? outLayout.getMainInputChannels() : 0) << 16) - | (hasMainOutputBus ? outLayout.getMainOutputChannels() : 0)); - } - } + for (auto supported : supportedChannels) + { + auto numInputs = (supported >> 16) & 0xffff; + auto numOutputs = (supported >> 0) & 0xffff; - auto hasInOutMismatch = false; - for (auto supported : supportedChannels) + if (numInputs != numOutputs) { - auto numInputs = (supported >> 16) & 0xffff; - auto numOutputs = (supported >> 0) & 0xffff; - - if (numInputs != numOutputs) - { - hasInOutMismatch = true; - break; - } + hasInOutMismatch = true; + break; } + } - auto hasUnsupportedInput = ! hasMainInputBus, hasUnsupportedOutput = ! hasMainOutputBus; - for (auto inChanNum = hasMainInputBus ? 1 : 0; inChanNum <= (hasMainInputBus ? maxNumChanToCheckFor : 0); ++inChanNum) - { - auto channelConfiguration = (inChanNum << 16) | (hasInOutMismatch ? defaultOutputs : inChanNum); + auto hasUnsupportedInput = ! hasMainInputBus, hasUnsupportedOutput = ! hasMainOutputBus; - if (! supportedChannels.contains (channelConfiguration)) - { - hasUnsupportedInput = true; - break; - } - } + for (auto inChanNum = hasMainInputBus ? 1 : 0; inChanNum <= (hasMainInputBus ? maxNumChanToCheckFor : 0); ++inChanNum) + { + auto channelConfiguration = (inChanNum << 16) | (hasInOutMismatch ? defaultOutputs : inChanNum); - for (auto outChanNum = hasMainOutputBus ? 1 : 0; outChanNum <= (hasMainOutputBus ? maxNumChanToCheckFor : 0); ++outChanNum) + if (! supportedChannels.contains (channelConfiguration)) { - auto channelConfiguration = ((hasInOutMismatch ? defaultInputs : outChanNum) << 16) | outChanNum; - - if (! supportedChannels.contains (channelConfiguration)) - { - hasUnsupportedOutput = true; - break; - } + hasUnsupportedInput = true; + break; } + } - for (auto supported : supportedChannels) + for (auto outChanNum = hasMainOutputBus ? 1 : 0; outChanNum <= (hasMainOutputBus ? maxNumChanToCheckFor : 0); ++outChanNum) + { + auto channelConfiguration = ((hasInOutMismatch ? defaultInputs : outChanNum) << 16) | outChanNum; + + if (! supportedChannels.contains (channelConfiguration)) { - auto numInputs = (supported >> 16) & 0xffff; - auto numOutputs = (supported >> 0) & 0xffff; + hasUnsupportedOutput = true; + break; + } + } + + for (auto supported : supportedChannels) + { + auto numInputs = (supported >> 16) & 0xffff; + auto numOutputs = (supported >> 0) & 0xffff; - AUChannelInfo info; + AUChannelInfo info; - // see here: https://developer.apple.com/library/mac/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html - info.inChannels = static_cast (hasMainInputBus ? (hasUnsupportedInput ? numInputs : (hasInOutMismatch && (! hasUnsupportedOutput) ? -2 : -1)) : 0); - info.outChannels = static_cast (hasMainOutputBus ? (hasUnsupportedOutput ? numOutputs : (hasInOutMismatch && (! hasUnsupportedInput) ? -2 : -1)) : 0); + // see here: https://developer.apple.com/library/mac/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html + info.inChannels = static_cast (hasMainInputBus ? (hasUnsupportedInput ? numInputs : (hasInOutMismatch && (! hasUnsupportedOutput) ? -2 : -1)) : 0); + info.outChannels = static_cast (hasMainOutputBus ? (hasUnsupportedOutput ? numOutputs : (hasInOutMismatch && (! hasUnsupportedInput) ? -2 : -1)) : 0); - if (info.inChannels == -2 && info.outChannels == -2) - info.inChannels = -1; + if (info.inChannels == -2 && info.outChannels == -2) + info.inChannels = -1; - int j; - for (j = 0; j < channelInfo.size(); ++j) - if (info.inChannels == channelInfo.getReference (j).inChannels - && info.outChannels == channelInfo.getReference (j).outChannels) - break; + int j; + for (j = 0; j < channelInfo.size(); ++j) + if (info.inChannels == channelInfo.getReference (j).inChannels + && info.outChannels == channelInfo.getReference (j).outChannels) + break; - if (j >= channelInfo.size()) - channelInfo.add (info); - } + if (j >= channelInfo.size()) + channelInfo.add (info); } return channelInfo; @@ -447,7 +450,6 @@ struct AudioUnitHelpers { auto potentialSets = AudioChannelSet::channelSetsWithNumberOfChannels (static_cast (numChannels)); - for (auto set : potentialSets) { auto copy = inOutCurrentLayout; @@ -517,7 +519,7 @@ struct AudioUnitHelpers const int actualBuses = juceFilter->getBusCount (isInput); const int auNumBuses = getBusCount (juceFilter, isInput); - Array& buses = (isInput ? layout.inputBuses : layout.outputBuses); + auto& buses = (isInput ? layout.inputBuses : layout.outputBuses); for (int i = auNumBuses; i < actualBuses; ++i) buses.removeLast(); @@ -529,3 +531,5 @@ struct AudioUnitHelpers #endif } }; + +} // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h index 9ade640df8..a4d0e1b169 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if (JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)) || DOXYGEN //============================================================================== @@ -72,3 +75,5 @@ enum kAudioUnitProperty_SupportsMPE = 58 }; #endif + +} diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index fa379c3659..942441c2f2 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -26,8 +26,6 @@ #if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS) -} // (juce namespace) - #include #if JUCE_MAC #include @@ -57,20 +55,17 @@ #include -namespace juce -{ - -#include "../../juce_audio_devices/native/juce_MidiDataConcatenator.h" - #if JUCE_SUPPORT_CARBON #include "../../juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h" #endif -#include "../../juce_core/native/juce_osx_ObjCHelpers.h" - #include "../../juce_audio_basics/native/juce_mac_CoreAudioLayouts.h" +#include "../../juce_audio_devices/native/juce_MidiDataConcatenator.h" #include "juce_AU_Shared.h" +namespace juce +{ + // Change this to disable logging of various activities #ifndef AU_LOGGING #define AU_LOGGING 1 @@ -2463,9 +2458,11 @@ bool AudioUnitPluginFormat::doesPluginStillExist (const PluginDescription& desc) FileSearchPath AudioUnitPluginFormat::getDefaultLocationsToSearch() { - return FileSearchPath(); + return {}; } #undef JUCE_AU_LOG +} // namespace juce + #endif diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index 7ec05c1ed1..dfbc7bc9ae 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -26,8 +26,6 @@ #if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX -} // (juce namespace) - #include namespace juce @@ -715,4 +713,6 @@ FileSearchPath LADSPAPluginFormat::getDefaultLocationsToSearch() .replace (":", ";")); } +} // namespace juce + #endif diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h index 27f91276df..7002c51814 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX) || DOXYGEN //============================================================================== @@ -63,3 +66,5 @@ private: #endif + +} diff --git a/modules/juce_audio_processors/format_types/juce_VST3Common.h b/modules/juce_audio_processors/format_types/juce_VST3Common.h index 02a4b8a834..8df5f36ffa 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== #define JUCE_DECLARE_VST3_COM_REF_METHODS \ @@ -620,3 +621,5 @@ template <> struct VST3FloatAndDoubleBusMapCompositeHelper { static inline VST3BufferExchange::BusMap& get (VST3FloatAndDoubleBusMapComposite& impl) { return impl.doubleVersion; } }; + +} // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index 57a47752af..ec062f0676 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -24,8 +24,6 @@ ============================================================================== */ -#pragma once - // Wow, those Steinberg guys really don't worry too much about compiler warnings. #if _MSC_VER #pragma warning (disable: 4505) diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 892e302eda..18f3db32a6 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -26,16 +26,13 @@ #if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS) -} // namespace juce - #include #include "juce_VST3Headers.h" +#include "juce_VST3Common.h" namespace juce { -#include "juce_VST3Common.h" - using namespace Steinberg; //============================================================================== @@ -2978,4 +2975,6 @@ FileSearchPath VST3PluginFormat::getDefaultLocationsToSearch() #endif } -#endif //JUCE_PLUGINHOST_VST3 +} // namespace juce + +#endif // JUCE_PLUGINHOST_VST3 diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index 4adbcefafa..4c3f140b57 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS)) || DOXYGEN @@ -65,4 +66,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VST3PluginFormat) }; -#endif // JUCE_PLUGINHOST_VST3 +#endif // JUCE_PLUGINHOST_VST3 + +} // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_VSTCommon.h b/modules/juce_audio_processors/format_types/juce_VSTCommon.h index cbd5446d1b..50494a7484 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTCommon.h +++ b/modules/juce_audio_processors/format_types/juce_VSTCommon.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== struct SpeakerMappings : private AudioChannelSet // (inheritance only to give easier access to items in the namespace) @@ -293,3 +294,5 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e return AudioChannelSet::unknown; } }; + +} // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_VSTInterface.h b/modules/juce_audio_processors/format_types/juce_VSTInterface.h index c8310a0022..4d31c312a0 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTInterface.h +++ b/modules/juce_audio_processors/format_types/juce_VSTInterface.h @@ -24,11 +24,8 @@ ============================================================================== */ -#pragma once #define JUCE_VSTINTERFACE_H_INCLUDED -#include "../../juce_core/juce_core.h" - using namespace juce; #if JUCE_MSVC diff --git a/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h b/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h index d78d7e0db6..6665cb9ae3 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h +++ b/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h @@ -27,7 +27,8 @@ // NB: this must come first, *before* the header-guard. #ifdef JUCE_VSTINTERFACE_H_INCLUDED -#pragma once +namespace juce +{ //============================================================================== /** Holds a set of VSTMidiEvent objects and makes it easy to add @@ -169,8 +170,8 @@ private: static VstEvent* allocateVSTEvent() { - VstEvent* const e = (VstEvent*) std::calloc (1, sizeof (VstMidiEvent) > sizeof (VstSysExEvent) ? sizeof (VstMidiEvent) - : sizeof (VstSysExEvent)); + auto e = (VstEvent*) std::calloc (1, sizeof (VstMidiEvent) > sizeof (VstSysExEvent) ? sizeof (VstMidiEvent) + : sizeof (VstSysExEvent)); e->type = vstMidiEventType; e->size = sizeof (VstMidiEvent); return e; @@ -185,4 +186,6 @@ private: } }; +} // namespace juce + #endif // JUCE_VSTINTERFACE_H_INCLUDED diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index ea64a20085..cf741b43c9 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -55,7 +55,6 @@ using namespace Vst2; #pragma warning (disable: 4355) // ("this" used in initialiser list warning) #endif -//============================================================================== #include "juce_VSTMidiEventList.h" #if JUCE_MINGW @@ -78,6 +77,10 @@ using namespace Vst2; #define JUCE_VST_WRAPPER_INVOKE_MAIN effect = module->moduleMain (&audioMaster); #endif +//============================================================================== +namespace juce +{ + //============================================================================== namespace { @@ -2972,4 +2975,6 @@ pointer_sized_int JUCE_CALLTYPE VSTPluginFormat::dispatcher (AudioPluginInstance void VSTPluginFormat::aboutToScanVSTShellPlugin (const PluginDescription&) {} +} // namespace juce + #endif diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h index c6793a20be..1edeb83e1e 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h @@ -26,6 +26,9 @@ #if (JUCE_PLUGINHOST_VST || DOXYGEN) +namespace juce +{ + //============================================================================== /** Implements a plugin format manager for VSTs. @@ -124,5 +127,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginFormat) }; +} // namespace juce #endif diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 20dee1058f..9f4e1e67bd 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -34,6 +34,7 @@ #endif #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1 +#define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 #include "juce_audio_processors.h" #include @@ -65,8 +66,8 @@ namespace juce static inline bool arrayContainsPlugin (const OwnedArray& list, const PluginDescription& desc) { - for (int i = list.size(); --i >= 0;) - if (list.getUnchecked(i)->isDuplicateOf (desc)) + for (auto* p : list) + if (p->isDuplicateOf (desc)) return true; return false; @@ -140,6 +141,8 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone }; #endif +} // namespace juce + #if JUCE_CLANG #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif @@ -160,5 +163,3 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone #include "scanning/juce_PluginListComponent.cpp" #include "utilities/juce_AudioProcessorParameters.cpp" #include "utilities/juce_AudioProcessorValueTreeState.cpp" - -} diff --git a/modules/juce_audio_processors/juce_audio_processors.h b/modules/juce_audio_processors/juce_audio_processors.h index 6589718c02..abfcf43bf3 100644 --- a/modules/juce_audio_processors/juce_audio_processors.h +++ b/modules/juce_audio_processors/juce_audio_processors.h @@ -112,10 +112,6 @@ //============================================================================== //============================================================================== -namespace juce -{ - -class AudioProcessor; #include "processors/juce_AudioProcessorEditor.h" #include "processors/juce_AudioProcessorListener.h" #include "processors/juce_AudioProcessorParameter.h" @@ -140,5 +136,3 @@ class AudioProcessor; #include "utilities/juce_AudioParameterBool.h" #include "utilities/juce_AudioParameterChoice.h" #include "utilities/juce_AudioProcessorValueTreeState.h" - -} diff --git a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h index 8acc557922..5e5c21c50a 100644 --- a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h +++ b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -85,3 +85,5 @@ protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginInstance) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp index e33eee651b..0e9a679cde 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static ThreadLocalValue wrapperTypeBeingCreated; void JUCE_CALLTYPE AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::WrapperType type) @@ -1451,3 +1454,5 @@ void AudioPlayHead::CurrentPositionInfo::resetToDefault() timeSigDenominator = 4; bpm = 120; } + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h index a39b111373..32e828fe84 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ struct PluginBusUtilities; @@ -1624,3 +1625,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessor) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp index a061a44665..07097b5682 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioProcessorEditor::AudioProcessorEditor (AudioProcessor& p) noexcept : processor (p) { initialise(); @@ -201,3 +204,5 @@ void AudioProcessorEditor::setScaleFactor (float newScale) setTransform (AffineTransform::scale (newScale)); editorResized (true); } + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h index a4286c26dc..0b65f0400b 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h @@ -24,9 +24,12 @@ ============================================================================== */ -#pragma once +namespace juce +{ +class AudioProcessor; class AudioProcessorEditorListener; + //============================================================================== /** Base class for the component that acts as the GUI for an AudioProcessor. @@ -203,3 +206,5 @@ private: JUCE_DECLARE_NON_COPYABLE (AudioProcessorEditor) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp index 8ae84d6fb4..2388c9930b 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + const int AudioProcessorGraph::midiChannelIndex = 0x1000; //============================================================================== @@ -1693,3 +1696,5 @@ void AudioProcessorGraph::AudioGraphIOProcessor::setParentGraph (AudioProcessorG updateHostDisplay(); } } + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h index b6ed9ea039..c9a2b1cd88 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -402,3 +403,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorGraph) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h b/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h index 7b6ef71e5e..7781af1fec 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -103,3 +103,5 @@ public: virtual void audioProcessorParameterChangeGestureEnd (AudioProcessor* processor, int parameterIndex); }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h b/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h index d6ef2ddf5a..8dc6e5eb0a 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** An abstract base class for parameter objects that can be added to an @@ -193,3 +193,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorParameter) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp index 32a2db8549..08f160932c 100644 --- a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp +++ b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ProcessorParameterPropertyComp : public PropertyComponent, private AudioProcessorListener, private Timer @@ -185,3 +188,5 @@ void GenericAudioProcessorEditor::resized() { panel.setBounds (getLocalBounds()); } + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h index e5d54e5fa7..611d62129a 100644 --- a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h +++ b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -54,3 +54,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GenericAudioProcessorEditor) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_PluginDescription.cpp b/modules/juce_audio_processors/processors/juce_PluginDescription.cpp index 445ca73f2a..6d885d722b 100644 --- a/modules/juce_audio_processors/processors/juce_PluginDescription.cpp +++ b/modules/juce_audio_processors/processors/juce_PluginDescription.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + PluginDescription::PluginDescription() : uid (0), isInstrument (false), @@ -144,3 +147,5 @@ bool PluginDescription::loadFromXml (const XmlElement& xml) return false; } + +} // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_PluginDescription.h b/modules/juce_audio_processors/processors/juce_PluginDescription.h index 046626a505..7642545a10 100644 --- a/modules/juce_audio_processors/processors/juce_PluginDescription.h +++ b/modules/juce_audio_processors/processors/juce_PluginDescription.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -152,3 +152,5 @@ private: //============================================================================== JUCE_LEAK_DETECTOR (PluginDescription) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp b/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp index 352b6c1c0b..f7c0bf71e0 100644 --- a/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp +++ b/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + KnownPluginList::KnownPluginList() {} KnownPluginList::~KnownPluginList() {} @@ -580,3 +583,5 @@ bool KnownPluginList::CustomScanner::shouldExit() const noexcept return false; } + +} // namespace juce diff --git a/modules/juce_audio_processors/scanning/juce_KnownPluginList.h b/modules/juce_audio_processors/scanning/juce_KnownPluginList.h index 9095873bd0..17ce28fb31 100644 --- a/modules/juce_audio_processors/scanning/juce_KnownPluginList.h +++ b/modules/juce_audio_processors/scanning/juce_KnownPluginList.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -221,3 +221,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (KnownPluginList) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp b/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp index 680e17edd3..1c68861b6a 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static StringArray readDeadMansPedalFile (const File& file) { StringArray lines; @@ -129,3 +132,5 @@ void PluginDirectoryScanner::applyBlacklistingsFromDeadMansPedal (KnownPluginLis for (auto& crashedPlugin : readDeadMansPedalFile (file)) list.addToBlacklist (crashedPlugin); } + +} // namespace juce diff --git a/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h b/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h index c22ccf300c..200835a1e7 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h +++ b/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -127,3 +127,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginDirectoryScanner) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index dd18d45e81..733842ffbe 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class PluginListComponent::TableModel : public TableListBoxModel { public: @@ -586,3 +589,5 @@ void PluginListComponent::scanFinished (const StringArray& failedFiles) + ":\n\n" + shortNames.joinIntoString (", ")); } + +} // namespace juce diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.h b/modules/juce_audio_processors/scanning/juce_PluginListComponent.h index da60cd0ea9..df3ec367c8 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.h +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -128,3 +128,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginListComponent) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioParameterBool.h b/modules/juce_audio_processors/utilities/juce_AudioParameterBool.h index 5c6f7153e3..c664ce8014 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioParameterBool.h +++ b/modules/juce_audio_processors/utilities/juce_AudioParameterBool.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Provides a class of AudioProcessorParameter that can be used as a boolean value. @@ -64,3 +67,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterBool) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h b/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h index 784107bc02..dc711d5830 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h +++ b/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Provides a class of AudioProcessorParameter that can be used to select an indexed, named choice from a list. @@ -79,3 +82,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterChoice) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioParameterFloat.h b/modules/juce_audio_processors/utilities/juce_AudioParameterFloat.h index e4c27e2ba5..c422749edf 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioParameterFloat.h +++ b/modules/juce_audio_processors/utilities/juce_AudioParameterFloat.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** A subclass of AudioProcessorParameter that provides an easy way to create a parameter which maps onto a given NormalisableRange. @@ -80,3 +83,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterFloat) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h b/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h index 91f0579769..4c2f02c33b 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h +++ b/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Provides a class of AudioProcessorParameter that can be used as an integer value with a given range. @@ -77,3 +80,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioParameterInt) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorParameterWithID.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorParameterWithID.h index 2569c4d06e..d5d0052349 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorParameterWithID.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorParameterWithID.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** This abstract base class is used by some AudioProcessorParameter helper classes. @@ -62,3 +65,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorParameterWithID) }; + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp b/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp index f0b2c0b99c..88da76bc00 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + // This file contains the implementations of the various AudioParameter[XYZ] classes.. @@ -168,3 +171,5 @@ AudioParameterChoice& AudioParameterChoice::operator= (int newValue) return *this; } + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp index da4462f0d5..055b1566c4 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + struct AudioProcessorValueTreeState::Parameter : public AudioProcessorParameterWithID, private ValueTree::Listener { @@ -570,3 +572,5 @@ AudioProcessorValueTreeState::ButtonAttachment::ButtonAttachment (AudioProcessor } AudioProcessorValueTreeState::ButtonAttachment::~ButtonAttachment() {} + +} // namespace juce diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h index d1b3ec8c42..13ace95955 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ /** This class contains a ValueTree which is used to manage an AudioProcessor's entire state. @@ -233,3 +234,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorValueTreeState) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h b/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h index e8d541a90a..ad583d4c6e 100644 --- a/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h +++ b/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_USE_CDBURNER || DOXYGEN @@ -167,3 +168,5 @@ private: #endif + +} // namespace juce diff --git a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.cpp b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.cpp index c5f293835f..f632d65bff 100644 --- a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.cpp +++ b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_CDREADER int AudioCDReader::getNumTracks() const @@ -57,3 +60,5 @@ int AudioCDReader::getCDDBId() } #endif + +} // namespace juce diff --git a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h index ca94e101eb..540754c6c4 100644 --- a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h +++ b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_USE_CDREADER || DOXYGEN @@ -172,3 +173,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioAppComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioAppComponent.cpp index df27b7d103..19dd48d241 100644 --- a/modules/juce_audio_utils/gui/juce_AudioAppComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioAppComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioAppComponent::AudioAppComponent() { } @@ -50,3 +53,5 @@ void AudioAppComponent::shutdownAudio() deviceManager.removeAudioCallback (&audioSourcePlayer); deviceManager.closeAudioDevice(); } + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioAppComponent.h b/modules/juce_audio_utils/gui/juce_AudioAppComponent.h index 98005c9198..d4bec5d046 100644 --- a/modules/juce_audio_utils/gui/juce_AudioAppComponent.h +++ b/modules/juce_audio_utils/gui/juce_AudioAppComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -113,3 +113,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioAppComponent) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp index 5e4c83afb6..f2cb5350c7 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class SimpleDeviceManagerInputLevelMeter : public Component, public Timer { @@ -1217,3 +1220,5 @@ ListBox* AudioDeviceSelectorComponent::getMidiInputSelectorListBox() const noexc { return midiInputsList; } + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h index a52d0526cd..ca2d8df76c 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -120,3 +120,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDeviceSelectorComponent) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp b/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp index 46f8dbac74..1e3ea0eea6 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct AudioThumbnail::MinMaxValue { MinMaxValue() noexcept @@ -830,3 +833,5 @@ void AudioThumbnail::drawChannels (Graphics& g, const Rectangle& area, doub startTimeSeconds, endTimeSeconds, i, verticalZoomFactor); } } + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnail.h b/modules/juce_audio_utils/gui/juce_AudioThumbnail.h index 2ba8359780..ecfc42a40e 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnail.h +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnail.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -223,3 +223,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioThumbnail) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnailBase.h b/modules/juce_audio_utils/gui/juce_AudioThumbnailBase.h index 452179c6f9..2ee81e4a44 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnailBase.h +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnailBase.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class AudioThumbnailCache; @@ -152,3 +153,5 @@ public: /** Returns the hash code that was set by setSource() or setReader(). */ virtual int64 getHashCode() const = 0; }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp b/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp index 853fe333d2..7157cfbe21 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class AudioThumbnailCache::ThumbnailCacheEntry { public: @@ -191,3 +194,5 @@ bool AudioThumbnailCache::loadNewThumb (AudioThumbnailBase&, int64) { return false; } + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h b/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h index bae7bc78b0..60057a6480 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -114,3 +114,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioThumbnailCache) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.cpp index e7635cb81d..596c467174 100644 --- a/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct AudioVisualiserComponent::ChannelInfo { ChannelInfo (AudioVisualiserComponent& o, int bufferSize) @@ -220,3 +223,5 @@ void AudioVisualiserComponent::paintChannel (Graphics& g, Rectangle area, 0.0f, 1.0f, area.getX(), area.getBottom(), (float) numLevels, -1.0f, area.getRight(), area.getY())); } + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.h b/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.h index 19448db2b8..8abd76704a 100644 --- a/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.h +++ b/modules/juce_audio_utils/gui/juce_AudioVisualiserComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -130,3 +130,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioVisualiserComponent) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h b/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h index cf7e7bb984..a048d52f71 100644 --- a/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h +++ b/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -74,3 +75,5 @@ public: */ static bool isAvailable(); }; + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp index c35ada229e..d6edfe25e3 100644 --- a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class MidiKeyboardUpDownButton : public Button { public: @@ -936,3 +939,5 @@ void MidiKeyboardComponent::focusLost (FocusChangeType) { resetAnyKeysInUse(); } + +} // namespace juce diff --git a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h index 47ccd8df62..7d40fc10f3 100644 --- a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h +++ b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -420,3 +420,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiKeyboardComponent) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/juce_audio_utils.cpp b/modules/juce_audio_utils/juce_audio_utils.cpp index 36a3d4e364..e0169121a9 100644 --- a/modules/juce_audio_utils/juce_audio_utils.cpp +++ b/modules/juce_audio_utils/juce_audio_utils.cpp @@ -33,8 +33,10 @@ #error "Incorrect use of JUCE cpp file" #endif -#define JUCE_CORE_INCLUDE_JNI_HELPERS 1 #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1 +#define JUCE_CORE_INCLUDE_JNI_HELPERS 1 +#define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 +#define JUCE_CORE_INCLUDE_COM_SMART_PTR 1 #include "juce_audio_utils.h" @@ -55,9 +57,6 @@ #endif #endif -namespace juce -{ - #include "gui/juce_AudioDeviceSelectorComponent.cpp" #include "gui/juce_AudioThumbnail.cpp" #include "gui/juce_AudioThumbnailCache.cpp" @@ -69,9 +68,7 @@ namespace juce #include "audio_cd/juce_AudioCDReader.cpp" #if JUCE_MAC - #include "native/juce_mac_BluetoothMidiDevicePairingDialogue.mm" - #include "../juce_core/native/juce_osx_ObjCHelpers.h" #if JUCE_USE_CDREADER #include "native/juce_mac_AudioCDReader.mm" @@ -82,15 +79,12 @@ namespace juce #endif #elif JUCE_IOS - #include "native/juce_ios_BluetoothMidiDevicePairingDialogue.mm" #elif JUCE_ANDROID - #include "native/juce_android_BluetoothMidiDevicePairingDialogue.cpp" #elif JUCE_LINUX - #if JUCE_USE_CDREADER #include "native/juce_linux_AudioCDReader.cpp" #endif @@ -98,9 +92,7 @@ namespace juce #include "native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp" #elif JUCE_WINDOWS - #include "native/juce_win_BluetoothMidiDevicePairingDialogue.cpp" - #include "../juce_core/native/juce_win32_ComSmartPtr.h" #if JUCE_USE_CDREADER #include "native/juce_win32_AudioCDReader.cpp" @@ -111,5 +103,3 @@ namespace juce #endif #endif - -} diff --git a/modules/juce_audio_utils/juce_audio_utils.h b/modules/juce_audio_utils/juce_audio_utils.h index 2ba9532ab2..d8816ef2d6 100644 --- a/modules/juce_audio_utils/juce_audio_utils.h +++ b/modules/juce_audio_utils/juce_audio_utils.h @@ -74,9 +74,6 @@ #endif //============================================================================== -namespace juce -{ - #include "gui/juce_AudioDeviceSelectorComponent.h" #include "gui/juce_AudioThumbnailBase.h" #include "gui/juce_AudioThumbnail.h" @@ -89,5 +86,3 @@ namespace juce #include "players/juce_AudioProcessorPlayer.h" #include "audio_cd/juce_AudioCDBurner.h" #include "audio_cd/juce_AudioCDReader.h" - -} diff --git a/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp b/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp index e9b03bab04..82681e77a8 100644 --- a/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp +++ b/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getMidiBluetoothAddresses, "getMidiBluetoothAddresses", "()[Ljava/lang/String;") \ METHOD (pairBluetoothMidiDevice, "pairBluetoothMidiDevice", "(Ljava/lang/String;)Z") \ @@ -482,3 +484,5 @@ bool BluetoothMidiDevicePairingDialogue::isAvailable() jobject btManager (android.activity.callObjectMethod (JuceAppActivity.getAndroidBluetoothManager)); return btManager != nullptr; } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm b/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm index f0dabef5ce..befb3a0269 100644 --- a/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm +++ b/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm @@ -31,8 +31,6 @@ // It is also not available in the iPhone/iPad simulator. #if JUCE_MODULE_AVAILABLE_juce_gui_extra && ! TARGET_IPHONE_SIMULATOR -} // (juce namespace) - #include namespace juce @@ -118,14 +116,20 @@ bool BluetoothMidiDevicePairingDialogue::isAvailable() return NSClassFromString ([NSString stringWithUTF8String: "CABTMIDICentralViewController"]) != nil; } +} // namespace juce + //============================================================================== #else -bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback) +namespace juce { - ScopedPointer cb (exitCallback); - return false; + bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback) + { + ScopedPointer cb (exitCallback); + return false; + } + + bool BluetoothMidiDevicePairingDialogue::isAvailable() { return false; } } -bool BluetoothMidiDevicePairingDialogue::isAvailable() { return false; } #endif diff --git a/modules/juce_audio_utils/native/juce_linux_AudioCDReader.cpp b/modules/juce_audio_utils/native/juce_linux_AudioCDReader.cpp index 018ab26b8b..3af5291666 100644 --- a/modules/juce_audio_utils/native/juce_linux_AudioCDReader.cpp +++ b/modules/juce_audio_utils/native/juce_linux_AudioCDReader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioCDReader::AudioCDReader() : AudioFormatReader (0, "CD Audio") { @@ -77,3 +80,5 @@ Array AudioCDReader::findIndexesInTrack (const int) { return Array(); } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp b/modules/juce_audio_utils/native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp index 5f52be49e7..fc876dcbef 100644 --- a/modules/juce_audio_utils/native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp +++ b/modules/juce_audio_utils/native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback) { ScopedPointer cb (exitCallback); @@ -38,3 +41,5 @@ bool BluetoothMidiDevicePairingDialogue::isAvailable() { return false; } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm b/modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm index e0dd0a8a92..4066369713 100644 --- a/modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm +++ b/modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace CDReaderHelpers { inline const XmlElement* getElementForKey (const XmlElement& xml, const String& key) @@ -258,5 +261,7 @@ int AudioCDReader::getLastIndex() const Array AudioCDReader::findIndexesInTrack (const int /*trackNumber*/) { - return Array(); + return {}; } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm b/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm index ccdab0375b..65d0395ec9 100644 --- a/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm +++ b/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback) { ScopedPointer cb (exitCallback); @@ -37,3 +40,5 @@ bool BluetoothMidiDevicePairingDialogue::isAvailable() { return false; } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_win32_AudioCDBurner.cpp b/modules/juce_audio_utils/native/juce_win32_AudioCDBurner.cpp index 8977773f9c..89e6ec4e5a 100644 --- a/modules/juce_audio_utils/native/juce_win32_AudioCDBurner.cpp +++ b/modules/juce_audio_utils/native/juce_win32_AudioCDBurner.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace CDBurnerHelpers { IDiscRecorder* enumCDBurners (StringArray* list, int indexToOpen, IDiscMaster** master) @@ -411,3 +414,5 @@ bool AudioCDBurner::addAudioTrack (AudioSource* audioSource, int numSamples) hr = pimpl->redbook->CloseAudioTrack(); return ok && hr == S_OK; } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_win32_AudioCDReader.cpp b/modules/juce_audio_utils/native/juce_win32_AudioCDReader.cpp index 534268555d..bdcef8cf47 100644 --- a/modules/juce_audio_utils/native/juce_win32_AudioCDReader.cpp +++ b/modules/juce_audio_utils/native/juce_win32_AudioCDReader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace CDReaderHelpers { @@ -1176,7 +1179,7 @@ int AudioCDReader::getLastIndex() const int AudioCDReader::getIndexAt (int samplePos) { using namespace CDReaderHelpers; - CDDeviceWrapper* const device = static_cast (handle); + auto* device = static_cast (handle); const int frameNeeded = samplePos / samplesPerFrame; @@ -1210,7 +1213,7 @@ int AudioCDReader::getIndexAt (int samplePos) Array AudioCDReader::findIndexesInTrack (const int trackNumber) { using namespace CDReaderHelpers; - Array indexes; + Array indexes; const int trackStart = getPositionOfTrackStart (trackNumber); const int trackEnd = getPositionOfTrackStart (trackNumber + 1); @@ -1257,7 +1260,7 @@ Array AudioCDReader::findIndexesInTrack (const int trackNumber) if (needToScan) { - CDDeviceWrapper* const device = static_cast (handle); + auto* device = static_cast (handle); int pos = trackStart; int last = -1; @@ -1309,3 +1312,5 @@ void AudioCDReader::ejectDisk() using namespace CDReaderHelpers; static_cast (handle)->deviceHandle.openDrawer (true); } + +} // namespace juce diff --git a/modules/juce_audio_utils/native/juce_win_BluetoothMidiDevicePairingDialogue.cpp b/modules/juce_audio_utils/native/juce_win_BluetoothMidiDevicePairingDialogue.cpp index e051e42fd0..ee17d80744 100644 --- a/modules/juce_audio_utils/native/juce_win_BluetoothMidiDevicePairingDialogue.cpp +++ b/modules/juce_audio_utils/native/juce_win_BluetoothMidiDevicePairingDialogue.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback) { ScopedPointer cb (exitCallback); @@ -38,3 +41,5 @@ bool BluetoothMidiDevicePairingDialogue::isAvailable() { return false; } + +} // namespace juce diff --git a/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp b/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp index c10a8f4c98..9bfe2ca23c 100644 --- a/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp +++ b/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AudioProcessorPlayer::AudioProcessorPlayer (bool doDoublePrecisionProcessing) : isDoublePrecision (doDoublePrecisionProcessing) { @@ -214,3 +217,5 @@ void AudioProcessorPlayer::handleIncomingMidiMessage (MidiInput*, const MidiMess { messageCollector.addMessageToQueue (message); } + +} // namespace juce diff --git a/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.h b/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.h index 10f62abb13..d93956474a 100644 --- a/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.h +++ b/modules/juce_audio_utils/players/juce_AudioProcessorPlayer.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -107,3 +108,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorPlayer) }; + +} // namespace juce diff --git a/modules/juce_audio_utils/players/juce_SoundPlayer.cpp b/modules/juce_audio_utils/players/juce_SoundPlayer.cpp index 1623eba09c..29a270d637 100644 --- a/modules/juce_audio_utils/players/juce_SoundPlayer.cpp +++ b/modules/juce_audio_utils/players/juce_SoundPlayer.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + // This is an AudioTransportSource which will own it's assigned source struct AudioSourceOwningTransportSource : public AudioTransportSource { @@ -273,3 +275,5 @@ void SoundPlayer::audioDeviceError (const String& errorMessage) { player.audioDeviceError (errorMessage); } + +} // namespace juce diff --git a/modules/juce_audio_utils/players/juce_SoundPlayer.h b/modules/juce_audio_utils/players/juce_SoundPlayer.h index b436c6316e..535c936ae4 100644 --- a/modules/juce_audio_utils/players/juce_SoundPlayer.h +++ b/modules/juce_audio_utils/players/juce_SoundPlayer.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -130,3 +131,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SoundPlayer) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_Block.cpp b/modules/juce_blocks_basics/blocks/juce_Block.cpp index 6b4093899b..4336a92f90 100644 --- a/modules/juce_blocks_basics/blocks/juce_Block.cpp +++ b/modules/juce_blocks_basics/blocks/juce_Block.cpp @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ static Block::UID getBlockUIDFromSerialNumber (const uint8* serial) noexcept { @@ -104,3 +106,5 @@ LEDRow::~LEDRow() {} //============================================================================== StatusLight::StatusLight (Block& b) : block (b) {} StatusLight::~StatusLight() {} + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_Block.h b/modules/juce_blocks_basics/blocks/juce_Block.h index 1332dc3828..b7460746b9 100644 --- a/modules/juce_blocks_basics/blocks/juce_Block.h +++ b/modules/juce_blocks_basics/blocks/juce_Block.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Represents an individual BLOCKS device. @@ -431,3 +433,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Block) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h b/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h index 4369372c8d..eb591576fb 100644 --- a/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h +++ b/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h @@ -28,7 +28,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ // This file provides interfaces for managing the internal configuration of Blocks // and synchronises with the connected Block @@ -347,3 +348,5 @@ private: TopologyIndex deviceIndex; PhysicalTopologySource::DeviceConnection* deviceConnection; }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_ControlButton.h b/modules/juce_blocks_basics/blocks/juce_ControlButton.h index 2117e2cb60..4925747a8c 100644 --- a/modules/juce_blocks_basics/blocks/juce_ControlButton.h +++ b/modules/juce_blocks_basics/blocks/juce_ControlButton.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Represents a button on a block device. @@ -132,3 +134,5 @@ protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ControlButton) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_LEDGrid.h b/modules/juce_blocks_basics/blocks/juce_LEDGrid.h index 51eec3e32a..6340fb303a 100644 --- a/modules/juce_blocks_basics/blocks/juce_LEDGrid.h +++ b/modules/juce_blocks_basics/blocks/juce_LEDGrid.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** A simple ARGB colour class for setting LEDs. @@ -94,3 +96,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LEDGrid) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_LEDRow.h b/modules/juce_blocks_basics/blocks/juce_LEDRow.h index 244133fd36..e32083985e 100644 --- a/modules/juce_blocks_basics/blocks/juce_LEDRow.h +++ b/modules/juce_blocks_basics/blocks/juce_LEDRow.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Represents an LED strip on a device. @@ -56,3 +58,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LEDRow) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_StatusLight.h b/modules/juce_blocks_basics/blocks/juce_StatusLight.h index d452d5b9b8..79d13ca54a 100644 --- a/modules/juce_blocks_basics/blocks/juce_StatusLight.h +++ b/modules/juce_blocks_basics/blocks/juce_StatusLight.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Represents a status LED on a device. @@ -45,3 +47,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StatusLight) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_TouchList.h b/modules/juce_blocks_basics/blocks/juce_TouchList.h index 84eb45845c..81a4a4680d 100644 --- a/modules/juce_blocks_basics/blocks/juce_TouchList.h +++ b/modules/juce_blocks_basics/blocks/juce_TouchList.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Utility class to hold a list of TouchSurface::Touch objects with different @@ -137,3 +139,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TouchList) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/blocks/juce_TouchSurface.h b/modules/juce_blocks_basics/blocks/juce_TouchSurface.h index 82d2a849d0..0a8d71e96f 100644 --- a/modules/juce_blocks_basics/blocks/juce_TouchSurface.h +++ b/modules/juce_blocks_basics/blocks/juce_TouchSurface.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Represents the touch surface of a BLOCKS device. @@ -129,3 +131,5 @@ protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TouchSurface) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/juce_blocks_basics.cpp b/modules/juce_blocks_basics/juce_blocks_basics.cpp index 140a88136a..27a5dd1b40 100644 --- a/modules/juce_blocks_basics/juce_blocks_basics.cpp +++ b/modules/juce_blocks_basics/juce_blocks_basics.cpp @@ -23,21 +23,15 @@ #include "juce_blocks_basics.h" -namespace juce -{ - namespace BlocksProtocol - { - #include "protocol/juce_BitPackingUtilities.h" - #include "protocol/juce_BlocksProtocolDefinitions.h" - #include "protocol/juce_HostPacketDecoder.h" - #include "protocol/juce_HostPacketBuilder.h" - #include "protocol/juce_BlockModels.h" - } - - #include "blocks/juce_BlockConfigManager.h" - #include "blocks/juce_Block.cpp" - #include "topology/juce_PhysicalTopologySource.cpp" - #include "topology/juce_RuleBasedTopologySource.cpp" - #include "visualisers/juce_DrumPadLEDProgram.cpp" - #include "visualisers/juce_BitmapLEDProgram.cpp" -} +#include "protocol/juce_BitPackingUtilities.h" +#include "protocol/juce_BlocksProtocolDefinitions.h" +#include "protocol/juce_HostPacketDecoder.h" +#include "protocol/juce_HostPacketBuilder.h" +#include "protocol/juce_BlockModels.h" + +#include "blocks/juce_BlockConfigManager.h" +#include "blocks/juce_Block.cpp" +#include "topology/juce_PhysicalTopologySource.cpp" +#include "topology/juce_RuleBasedTopologySource.cpp" +#include "visualisers/juce_DrumPadLEDProgram.cpp" +#include "visualisers/juce_BitmapLEDProgram.cpp" diff --git a/modules/juce_blocks_basics/juce_blocks_basics.h b/modules/juce_blocks_basics/juce_blocks_basics.h index 9a5587c213..700592fbc2 100644 --- a/modules/juce_blocks_basics/juce_blocks_basics.h +++ b/modules/juce_blocks_basics/juce_blocks_basics.h @@ -52,27 +52,31 @@ namespace juce { - class TouchSurface; - class LEDGrid; - class LEDRow; - class StatusLight; - class LightRing; - class ControlButton; - - #include "blocks/juce_Block.h" - #include "blocks/juce_TouchSurface.h" - #include "blocks/juce_LEDGrid.h" - #include "blocks/juce_LEDRow.h" - #include "blocks/juce_ControlButton.h" - #include "blocks/juce_TouchList.h" - #include "blocks/juce_StatusLight.h" - #include "topology/juce_Topology.h" - #include "topology/juce_TopologySource.h" - #include "topology/juce_PhysicalTopologySource.h" - #include "topology/juce_RuleBasedTopologySource.h" - #include "littlefoot/juce_LittleFootRunner.h" - #include "littlefoot/juce_LittleFootCompiler.h" - #include "littlefoot/juce_LittleFootRemoteHeap.h" - #include "visualisers/juce_DrumPadLEDProgram.h" - #include "visualisers/juce_BitmapLEDProgram.h" + class TouchSurface; + class LEDGrid; + class LEDRow; + class StatusLight; + class LightRing; + class ControlButton; +} + +#include "blocks/juce_Block.h" +#include "blocks/juce_TouchSurface.h" +#include "blocks/juce_LEDGrid.h" +#include "blocks/juce_LEDRow.h" +#include "blocks/juce_ControlButton.h" +#include "blocks/juce_TouchList.h" +#include "blocks/juce_StatusLight.h" +#include "topology/juce_Topology.h" +#include "topology/juce_TopologySource.h" +#include "topology/juce_PhysicalTopologySource.h" +#include "topology/juce_RuleBasedTopologySource.h" +#include "visualisers/juce_DrumPadLEDProgram.h" +#include "visualisers/juce_BitmapLEDProgram.h" + +namespace juce +{ + #include "littlefoot/juce_LittleFootRunner.h" + #include "littlefoot/juce_LittleFootCompiler.h" + #include "littlefoot/juce_LittleFootRemoteHeap.h" } diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h index 09b79da4bf..56aea22488 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h @@ -28,8 +28,6 @@ namespace littlefoot { -using namespace juce; - /** This class compiles littlefoot source code into a littlefoot::Program object which can be executed by a littlefoot::Runner. diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h index 143b05099c..40d07c103d 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h @@ -23,8 +23,6 @@ namespace littlefoot { -using namespace juce; - //============================================================================== /** This class manages the synchronisation of a remote block of heap memory used diff --git a/modules/juce_blocks_basics/protocol/juce_BitPackingUtilities.h b/modules/juce_blocks_basics/protocol/juce_BitPackingUtilities.h index 7acc4d9691..4d122d6486 100644 --- a/modules/juce_blocks_basics/protocol/juce_BitPackingUtilities.h +++ b/modules/juce_blocks_basics/protocol/juce_BitPackingUtilities.h @@ -20,6 +20,10 @@ ============================================================================== */ +namespace juce +{ +namespace BlocksProtocol +{ /** All sysex messages to or from a BLOCKS device begin with these header bytes. @@ -270,3 +274,6 @@ private: const uint8* data; int totalBits, bitsReadInCurrentByte = 0; }; + +} // namespace BlocksProtocol +} // namespace juce diff --git a/modules/juce_blocks_basics/protocol/juce_BlockModels.h b/modules/juce_blocks_basics/protocol/juce_BlockModels.h index e83b1458b3..e809c880d1 100644 --- a/modules/juce_blocks_basics/protocol/juce_BlockModels.h +++ b/modules/juce_blocks_basics/protocol/juce_BlockModels.h @@ -20,6 +20,10 @@ ============================================================================== */ +namespace juce +{ +namespace BlocksProtocol +{ // This file isn't part of the public API, it's where we encode the knowledge base // of all the different types of block we know about.. @@ -312,3 +316,6 @@ static const char* getButtonNameForFunction (ControlButton::ButtonFunction fn) n jassertfalse; return nullptr; } + +} // namespace BlocksProtocol +} // namespace juce diff --git a/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h b/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h index 519889d873..94910de1f1 100644 --- a/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h +++ b/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h @@ -20,6 +20,10 @@ ============================================================================== */ +namespace juce +{ +namespace BlocksProtocol +{ /** This value is incremented when the format of the API changes in a way which breaks compatibility. @@ -503,3 +507,6 @@ static constexpr const char* ledProgramLittleFootFunctions[] = "initControl/viiiiiiiii", nullptr }; + +} // namespace BlocksProtocol +} // namespace juce diff --git a/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h b/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h index 84f9bf4963..2a2841651e 100644 --- a/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h +++ b/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h @@ -20,6 +20,10 @@ ============================================================================== */ +namespace juce +{ +namespace BlocksProtocol +{ /** Helper class for constructing a packet for sending to a BLOCKS device @@ -314,3 +318,6 @@ private: data << MessageType ((uint32) type); } }; + +} // namespace BlocksProtocol +} // namespace juce diff --git a/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h b/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h index cd1b39c023..16142ae793 100644 --- a/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h +++ b/modules/juce_blocks_basics/protocol/juce_HostPacketDecoder.h @@ -20,6 +20,10 @@ ============================================================================== */ +namespace juce +{ +namespace BlocksProtocol +{ /** Parses data packets from a BLOCKS device, and translates them into callbacks @@ -352,3 +356,6 @@ struct HostPacketDecoder return true; } }; + +} // namespace BlocksProtocol +} // namespace juce diff --git a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp index ae88a60ee6..6099cc8530 100644 --- a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp +++ b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #define JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED \ jassert (juce::MessageManager::getInstance()->currentThreadHasLockedMessageManager()); @@ -2353,3 +2356,5 @@ bool BlockDeviceConnection::operator!= (const BlockDeviceConnection& other) cons { return ! operator== (other); } + +} // namespace juce diff --git a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h index e809175e0b..442e78e28a 100644 --- a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h +++ b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** This topology source manages the topology of the physical Blocks devices @@ -80,3 +82,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PhysicalTopologySource) }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp index 476223f841..33ff36c286 100644 --- a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp +++ b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ struct RuleBasedTopologySource::Internal : public TopologySource::Listener, private juce::AsyncUpdater @@ -100,3 +102,5 @@ BlockTopology RuleBasedTopologySource::getCurrentTopology() const { void RuleBasedTopologySource::clearRules() { internal->clearRules(); } void RuleBasedTopologySource::addRule (Rule* r) { internal->addRule (r); } + +} // namespace juce diff --git a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.h b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.h index b25292f87d..7b155a1d89 100644 --- a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.h +++ b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** This topology source holds and applies a set of rules for transforming one device topology into another one that may involve virtual and/or @@ -74,3 +76,5 @@ private: struct Internal; juce::ScopedPointer internal; }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/topology/juce_Topology.h b/modules/juce_blocks_basics/topology/juce_Topology.h index e132ca38c4..2c846a036f 100644 --- a/modules/juce_blocks_basics/topology/juce_Topology.h +++ b/modules/juce_blocks_basics/topology/juce_Topology.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Describes a phyiscal connection between two ports of two block devices. */ struct BlockDeviceConnection @@ -41,3 +43,5 @@ struct BlockTopology bool operator== (const BlockTopology&) const noexcept; bool operator!= (const BlockTopology&) const noexcept; }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/topology/juce_TopologySource.h b/modules/juce_blocks_basics/topology/juce_TopologySource.h index f3f06a7476..f0b5bdbc6c 100644 --- a/modules/juce_blocks_basics/topology/juce_TopologySource.h +++ b/modules/juce_blocks_basics/topology/juce_TopologySource.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** Base class for an entity that provides access to a blocks topology. */ class TopologySource @@ -49,3 +51,5 @@ protected: //========================================================================== juce::ListenerList listeners; }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp index fa2e89b244..e2df561f27 100644 --- a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp +++ b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ BitmapLEDProgram::BitmapLEDProgram (Block& b) : Program (b) {} @@ -81,3 +83,5 @@ juce::String BitmapLEDProgram::getLittleFootProgram() jassertfalse; return {}; } + +} // namespace juce diff --git a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h index 113569d840..795c7eca7c 100644 --- a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h +++ b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ /** A simple Program to set the colours of individual LEDs. @@ -34,3 +36,5 @@ struct BitmapLEDProgram : public Block::Program private: juce::String getLittleFootProgram() override; }; + +} // namespace juce diff --git a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp index 263561a066..cc559789c5 100644 --- a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp +++ b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp @@ -20,6 +20,8 @@ ============================================================================== */ +namespace juce +{ DrumPadGridProgram::DrumPadGridProgram (Block& b) : Program (b) {} @@ -870,3 +872,5 @@ juce::String DrumPadGridProgram::getLittleFootProgramPost25() const )littlefoot"; } + +} // namespace juce diff --git a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h index a92e82e635..b45f235734 100644 --- a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h +++ b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /** */ struct DrumPadGridProgram : public Block::Program @@ -118,3 +121,5 @@ private: juce::String getLittleFootProgramPre25() const; juce::String getLittleFootProgramPost25() const; }; + +} // namespace juce diff --git a/modules/juce_box2d/juce_box2d.cpp b/modules/juce_box2d/juce_box2d.cpp index e3ab3e0ec4..5fa5497a7a 100644 --- a/modules/juce_box2d/juce_box2d.cpp +++ b/modules/juce_box2d/juce_box2d.cpp @@ -87,10 +87,7 @@ #include "box2d/Dynamics/Joints/b2WheelJoint.cpp" #include "box2d/Rope/b2Rope.cpp" -namespace juce -{ #include "utils/juce_Box2DRenderer.cpp" -} #if JUCE_CLANG #pragma clang diagnostic pop diff --git a/modules/juce_box2d/juce_box2d.h b/modules/juce_box2d/juce_box2d.h index 095c84f1b4..2eb94954aa 100644 --- a/modules/juce_box2d/juce_box2d.h +++ b/modules/juce_box2d/juce_box2d.h @@ -66,8 +66,5 @@ #endif #ifndef DOXYGEN // for some reason, Doxygen sees this as a re-definition of Box2DRenderer -namespace juce -{ - #include "utils/juce_Box2DRenderer.h" -} + #include "utils/juce_Box2DRenderer.h" #endif // DOXYGEN diff --git a/modules/juce_box2d/utils/juce_Box2DRenderer.cpp b/modules/juce_box2d/utils/juce_Box2DRenderer.cpp index c2dcb11bc5..0988f0f07b 100644 --- a/modules/juce_box2d/utils/juce_Box2DRenderer.cpp +++ b/modules/juce_box2d/utils/juce_Box2DRenderer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Box2DRenderer::Box2DRenderer() noexcept : graphics (nullptr) { SetFlags (e_shapeBit); @@ -105,3 +108,5 @@ void Box2DRenderer::DrawSegment (const b2Vec2& p1, const b2Vec2& p2, const b2Col void Box2DRenderer::DrawTransform (const b2Transform&) { } + +} // namespace juce diff --git a/modules/juce_box2d/utils/juce_Box2DRenderer.h b/modules/juce_box2d/utils/juce_Box2DRenderer.h index 063f26fba2..89d56db9a2 100644 --- a/modules/juce_box2d/utils/juce_Box2DRenderer.h +++ b/modules/juce_box2d/utils/juce_Box2DRenderer.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** A simple implementation of the b2Draw class, used to draw a Box2D world. @@ -73,3 +74,5 @@ protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Box2DRenderer) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_AbstractFifo.cpp b/modules/juce_core/containers/juce_AbstractFifo.cpp index 03d61396b5..d33f7f85b1 100644 --- a/modules/juce_core/containers/juce_AbstractFifo.cpp +++ b/modules/juce_core/containers/juce_AbstractFifo.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + AbstractFifo::AbstractFifo (const int capacity) noexcept : bufferSize (capacity) { @@ -227,3 +230,5 @@ public: static AbstractFifoTests fifoUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_core/containers/juce_AbstractFifo.h b/modules/juce_core/containers/juce_AbstractFifo.h index 5412a20202..0d41d6d9b9 100644 --- a/modules/juce_core/containers/juce_AbstractFifo.h +++ b/modules/juce_core/containers/juce_AbstractFifo.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -208,3 +208,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AbstractFifo) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 11465ed4ee..8f7380b1ea 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -1265,3 +1265,5 @@ private: addAssumingCapacityIsReady (otherElements...); } }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_ArrayAllocationBase.h b/modules/juce_core/containers/juce_ArrayAllocationBase.h index a4c3d89f1d..5ab3ce00f9 100644 --- a/modules/juce_core/containers/juce_ArrayAllocationBase.h +++ b/modules/juce_core/containers/juce_ArrayAllocationBase.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -124,3 +124,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE (ArrayAllocationBase) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_DynamicObject.cpp b/modules/juce_core/containers/juce_DynamicObject.cpp index 697205bfa8..4d299ac0cc 100644 --- a/modules/juce_core/containers/juce_DynamicObject.cpp +++ b/modules/juce_core/containers/juce_DynamicObject.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + DynamicObject::DynamicObject() { } @@ -125,3 +128,5 @@ void DynamicObject::writeAsJSON (OutputStream& out, const int indentLevel, const out << '}'; } + +} // namespace juce diff --git a/modules/juce_core/containers/juce_DynamicObject.h b/modules/juce_core/containers/juce_DynamicObject.h index 20c4e7608b..83ee6ccf0e 100644 --- a/modules/juce_core/containers/juce_DynamicObject.h +++ b/modules/juce_core/containers/juce_DynamicObject.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -126,3 +126,5 @@ private: JUCE_LEAK_DETECTOR (DynamicObject) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_ElementComparator.h b/modules/juce_core/containers/juce_ElementComparator.h index 3f5881c1d1..aa30b194a5 100644 --- a/modules/juce_core/containers/juce_ElementComparator.h +++ b/modules/juce_core/containers/juce_ElementComparator.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #ifndef DOXYGEN @@ -183,3 +184,5 @@ public: return (first < second) ? -1 : ((second < first) ? 1 : 0); } }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_HashMap.h b/modules/juce_core/containers/juce_HashMap.h index 019e5b41d5..ab04728d7d 100644 --- a/modules/juce_core/containers/juce_HashMap.h +++ b/modules/juce_core/containers/juce_HashMap.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -496,3 +496,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HashMap) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_HashMap_test.cpp b/modules/juce_core/containers/juce_HashMap_test.cpp index 428bdc8071..76dcd87e0a 100644 --- a/modules/juce_core/containers/juce_HashMap_test.cpp +++ b/modules/juce_core/containers/juce_HashMap_test.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct HashMapTest : public UnitTest { HashMapTest() : UnitTest ("HashMap", "Containers") {} @@ -269,3 +272,5 @@ template <> String HashMapTest::RandomKeys::generateRandomKey (Random& r } static HashMapTest hashMapTest; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_LinkedListPointer.h b/modules/juce_core/containers/juce_LinkedListPointer.h index d8ddc7ed05..00994bc958 100644 --- a/modules/juce_core/containers/juce_LinkedListPointer.h +++ b/modules/juce_core/containers/juce_LinkedListPointer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -357,3 +357,5 @@ private: JUCE_DECLARE_NON_COPYABLE (LinkedListPointer) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_ListenerList.cpp b/modules/juce_core/containers/juce_ListenerList.cpp index f0885171b0..972122e0a0 100644 --- a/modules/juce_core/containers/juce_ListenerList.cpp +++ b/modules/juce_core/containers/juce_ListenerList.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_UNIT_TESTS struct ListenerBase @@ -182,3 +185,5 @@ public: static ListenerListTests listenerListTests; #endif + +} // namespace juce diff --git a/modules/juce_core/containers/juce_ListenerList.h b/modules/juce_core/containers/juce_ListenerList.h index 36ca27e3c9..7986b74ecd 100644 --- a/modules/juce_core/containers/juce_ListenerList.h +++ b/modules/juce_core/containers/juce_ListenerList.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -540,3 +540,5 @@ private: #undef LL_TEMPLATE #undef LL_PARAM }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_NamedValueSet.cpp b/modules/juce_core/containers/juce_NamedValueSet.cpp index b33ea1da9e..45bfff11d4 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.cpp +++ b/modules/juce_core/containers/juce_NamedValueSet.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + NamedValueSet::NamedValueSet() noexcept { } @@ -241,3 +243,5 @@ void NamedValueSet::copyToXmlAttributes (XmlElement& xml) const } } } + +} // namespace juce diff --git a/modules/juce_core/containers/juce_NamedValueSet.h b/modules/juce_core/containers/juce_NamedValueSet.h index 0916052585..4e6ea7ab43 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.h +++ b/modules/juce_core/containers/juce_NamedValueSet.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Holds a set of named var objects. @@ -171,3 +171,5 @@ private: //============================================================================== Array values; }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_OwnedArray.h b/modules/juce_core/containers/juce_OwnedArray.h index 4edc190683..ccfacb0436 100644 --- a/modules/juce_core/containers/juce_OwnedArray.h +++ b/modules/juce_core/containers/juce_OwnedArray.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** An array designed for holding objects. @@ -892,3 +892,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OwnedArray) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_PropertySet.cpp b/modules/juce_core/containers/juce_PropertySet.cpp index ce28d140c6..b1938de478 100644 --- a/modules/juce_core/containers/juce_PropertySet.cpp +++ b/modules/juce_core/containers/juce_PropertySet.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + PropertySet::PropertySet (const bool ignoreCaseOfKeyNames) : properties (ignoreCaseOfKeyNames), fallbackProperties (nullptr), @@ -211,3 +214,5 @@ void PropertySet::restoreFromXml (const XmlElement& xml) void PropertySet::propertyChanged() { } + +} // namespace juce diff --git a/modules/juce_core/containers/juce_PropertySet.h b/modules/juce_core/containers/juce_PropertySet.h index b8e934fce2..26a2cad525 100644 --- a/modules/juce_core/containers/juce_PropertySet.h +++ b/modules/juce_core/containers/juce_PropertySet.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -199,3 +199,5 @@ private: JUCE_LEAK_DETECTOR (PropertySet) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_ReferenceCountedArray.h b/modules/juce_core/containers/juce_ReferenceCountedArray.h index 7c10c9c690..aaee953955 100644 --- a/modules/juce_core/containers/juce_ReferenceCountedArray.h +++ b/modules/juce_core/containers/juce_ReferenceCountedArray.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -909,3 +909,5 @@ private: ContainerDeletePolicy::destroy (o); } }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_ScopedValueSetter.h b/modules/juce_core/containers/juce_ScopedValueSetter.h index eeb3426509..f5e03345a8 100644 --- a/modules/juce_core/containers/juce_ScopedValueSetter.h +++ b/modules/juce_core/containers/juce_ScopedValueSetter.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -88,3 +88,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ScopedValueSetter) }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_SortedSet.h b/modules/juce_core/containers/juce_SortedSet.h index 3007f43f46..192de75082 100644 --- a/modules/juce_core/containers/juce_SortedSet.h +++ b/modules/juce_core/containers/juce_SortedSet.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MSVC #pragma warning (push) @@ -481,3 +482,5 @@ private: #if JUCE_MSVC #pragma warning (pop) #endif + +} // namespace juce diff --git a/modules/juce_core/containers/juce_SparseSet.h b/modules/juce_core/containers/juce_SparseSet.h index 1b4e478e73..37efeb4f78 100644 --- a/modules/juce_core/containers/juce_SparseSet.h +++ b/modules/juce_core/containers/juce_SparseSet.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -285,3 +285,5 @@ private: values.removeRange (--i, 2); } }; + +} // namespace juce diff --git a/modules/juce_core/containers/juce_Variant.cpp b/modules/juce_core/containers/juce_Variant.cpp index 2d79e22bd8..7c517bb886 100644 --- a/modules/juce_core/containers/juce_Variant.cpp +++ b/modules/juce_core/containers/juce_Variant.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + enum VariantStreamMarkers { varMarker_Int = 1, @@ -785,3 +788,5 @@ var var::readFromStream (InputStream& input) var::NativeFunctionArgs::NativeFunctionArgs (const var& t, const var* args, int numArgs) noexcept : thisObject (t), arguments (args), numArguments (numArgs) {} + +} // namespace juce diff --git a/modules/juce_core/containers/juce_Variant.h b/modules/juce_core/containers/juce_Variant.h index d227a6a046..6cb65043aa 100644 --- a/modules/juce_core/containers/juce_Variant.h +++ b/modules/juce_core/containers/juce_Variant.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -334,3 +334,5 @@ struct VariantConverter static String fromVar (const var& v) { return v.toString(); } static var toVar (const String& s) { return s; } }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_DirectoryIterator.cpp b/modules/juce_core/files/juce_DirectoryIterator.cpp index c32ae7b519..a0f8aaa38e 100644 --- a/modules/juce_core/files/juce_DirectoryIterator.cpp +++ b/modules/juce_core/files/juce_DirectoryIterator.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + DirectoryIterator::DirectoryIterator (const File& directory, bool recursive, const String& pattern, const int type) : wildCards (parseWildcards (pattern)), @@ -158,3 +161,5 @@ float DirectoryIterator::getEstimatedProgress() const return jlimit (0.0f, 1.0f, detailedIndex / totalNumFiles); } + +} // namespace juce diff --git a/modules/juce_core/files/juce_DirectoryIterator.h b/modules/juce_core/files/juce_DirectoryIterator.h index 83e579bcd9..a9b576f249 100644 --- a/modules/juce_core/files/juce_DirectoryIterator.h +++ b/modules/juce_core/files/juce_DirectoryIterator.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -148,3 +148,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryIterator) }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index c5bd5b8be6..ef96be662c 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + File::File (const String& fullPathName) : fullPath (parseAbsolutePath (fullPathName)) { @@ -1205,3 +1208,5 @@ public: static FileTests fileUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index de3a7d9e9f..36b58f3f35 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -1043,3 +1043,5 @@ private: bool setFileReadOnlyInternal (bool) const; bool setFileExecutableInternal (bool) const; }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileFilter.cpp b/modules/juce_core/files/juce_FileFilter.cpp index 3fe61708a4..2d0cb624a1 100644 --- a/modules/juce_core/files/juce_FileFilter.cpp +++ b/modules/juce_core/files/juce_FileFilter.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + FileFilter::FileFilter (const String& filterDescription) : description (filterDescription) { @@ -33,3 +36,5 @@ const String& FileFilter::getDescription() const noexcept { return description; } + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileFilter.h b/modules/juce_core/files/juce_FileFilter.h index d40da458c5..e1e241c7f9 100644 --- a/modules/juce_core/files/juce_FileFilter.h +++ b/modules/juce_core/files/juce_FileFilter.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -65,3 +65,5 @@ protected: //============================================================================== String description; }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileInputStream.cpp b/modules/juce_core/files/juce_FileInputStream.cpp index f136cf0907..638abf9831 100644 --- a/modules/juce_core/files/juce_FileInputStream.cpp +++ b/modules/juce_core/files/juce_FileInputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + int64 juce_fileSetPosition (void* handle, int64 pos); @@ -76,3 +79,5 @@ bool FileInputStream::setPosition (int64 pos) return currentPosition == pos; } + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileInputStream.h b/modules/juce_core/files/juce_FileInputStream.h index 8354b20d59..9fd84b0251 100644 --- a/modules/juce_core/files/juce_FileInputStream.h +++ b/modules/juce_core/files/juce_FileInputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -84,3 +84,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileInputStream) }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileOutputStream.cpp b/modules/juce_core/files/juce_FileOutputStream.cpp index 31d013b113..495104380d 100644 --- a/modules/juce_core/files/juce_FileOutputStream.cpp +++ b/modules/juce_core/files/juce_FileOutputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + int64 juce_fileSetPosition (void* handle, int64 pos); //============================================================================== @@ -126,3 +129,5 @@ bool FileOutputStream::writeRepeatedByte (uint8 byte, size_t numBytes) return OutputStream::writeRepeatedByte (byte, numBytes); } + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileOutputStream.h b/modules/juce_core/files/juce_FileOutputStream.h index 75b14bc49a..3e1100ce76 100644 --- a/modules/juce_core/files/juce_FileOutputStream.h +++ b/modules/juce_core/files/juce_FileOutputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -109,3 +109,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileOutputStream) }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileSearchPath.cpp b/modules/juce_core/files/juce_FileSearchPath.cpp index 8219de13a3..baa2539f6f 100644 --- a/modules/juce_core/files/juce_FileSearchPath.cpp +++ b/modules/juce_core/files/juce_FileSearchPath.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + FileSearchPath::FileSearchPath() {} FileSearchPath::~FileSearchPath() {} @@ -165,3 +168,5 @@ bool FileSearchPath::isFileInPath (const File& fileToCheck, return false; } + +} // namespace juce diff --git a/modules/juce_core/files/juce_FileSearchPath.h b/modules/juce_core/files/juce_FileSearchPath.h index 94cde68c93..91011c093a 100644 --- a/modules/juce_core/files/juce_FileSearchPath.h +++ b/modules/juce_core/files/juce_FileSearchPath.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -157,3 +157,5 @@ private: JUCE_LEAK_DETECTOR (FileSearchPath) }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_MemoryMappedFile.h b/modules/juce_core/files/juce_MemoryMappedFile.h index cd8a4b3ca6..1afc083122 100644 --- a/modules/juce_core/files/juce_MemoryMappedFile.h +++ b/modules/juce_core/files/juce_MemoryMappedFile.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -109,3 +109,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryMappedFile) }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_TemporaryFile.cpp b/modules/juce_core/files/juce_TemporaryFile.cpp index a3c17ef63e..7010677920 100644 --- a/modules/juce_core/files/juce_TemporaryFile.cpp +++ b/modules/juce_core/files/juce_TemporaryFile.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + static File createTempFile (const File& parentDirectory, String name, const String& suffix, const int optionFlags) { @@ -109,3 +112,5 @@ bool TemporaryFile::deleteTemporaryFile() const return false; } + +} // namespace juce diff --git a/modules/juce_core/files/juce_TemporaryFile.h b/modules/juce_core/files/juce_TemporaryFile.h index 8663f0cde9..a781a101b3 100644 --- a/modules/juce_core/files/juce_TemporaryFile.h +++ b/modules/juce_core/files/juce_TemporaryFile.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -158,3 +158,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TemporaryFile) }; + +} // namespace juce diff --git a/modules/juce_core/files/juce_WildcardFileFilter.cpp b/modules/juce_core/files/juce_WildcardFileFilter.cpp index 82ffe9645e..8db43f34e7 100644 --- a/modules/juce_core/files/juce_WildcardFileFilter.cpp +++ b/modules/juce_core/files/juce_WildcardFileFilter.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + static void parseWildcard (const String& pattern, StringArray& result) { result.addTokens (pattern.toLowerCase(), ";,", "\"'"); @@ -68,3 +71,5 @@ bool WildcardFileFilter::isDirectorySuitable (const File& file) const { return matchWildcard (file, directoryWildcards); } + +} // namespace juce diff --git a/modules/juce_core/files/juce_WildcardFileFilter.h b/modules/juce_core/files/juce_WildcardFileFilter.h index 5492bdaaa4..b49c498988 100644 --- a/modules/juce_core/files/juce_WildcardFileFilter.h +++ b/modules/juce_core/files/juce_WildcardFileFilter.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -70,3 +70,5 @@ private: JUCE_LEAK_DETECTOR (WildcardFileFilter) }; + +} // namespace juce diff --git a/modules/juce_core/javascript/juce_JSON.cpp b/modules/juce_core/javascript/juce_JSON.cpp index 749d1067c2..494da5a83d 100644 --- a/modules/juce_core/javascript/juce_JSON.cpp +++ b/modules/juce_core/javascript/juce_JSON.cpp @@ -20,9 +20,11 @@ ============================================================================== */ -class JSONParser +namespace juce +{ + +struct JSONParser { -public: static Result parseObjectOrArray (String::CharPointerType t, var& result) { t = t.findEndOfWhitespace(); @@ -319,9 +321,8 @@ private: }; //============================================================================== -class JSONFormatter +struct JSONFormatter { -public: static void write (OutputStream& out, const var& v, const int indentLevel, const bool allOnOneLine, int maximumDecimalPlaces) @@ -648,3 +649,5 @@ public: static JSONTests JSONUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_core/javascript/juce_JSON.h b/modules/juce_core/javascript/juce_JSON.h index 1cbe1a1d62..c185442be6 100644 --- a/modules/juce_core/javascript/juce_JSON.h +++ b/modules/juce_core/javascript/juce_JSON.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -128,3 +128,5 @@ private: //============================================================================== JSON() JUCE_DELETED_FUNCTION; // This class can't be instantiated - just use its static methods. }; + +} // namespace juce diff --git a/modules/juce_core/javascript/juce_Javascript.cpp b/modules/juce_core/javascript/juce_Javascript.cpp index 72b059de27..9ef8305160 100644 --- a/modules/juce_core/javascript/juce_Javascript.cpp +++ b/modules/juce_core/javascript/juce_Javascript.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #define JUCE_JS_OPERATORS(X) \ X(semicolon, ";") X(dot, ".") X(comma, ",") \ X(openParen, "(") X(closeParen, ")") X(openBrace, "{") X(closeBrace, "}") \ @@ -1891,3 +1894,5 @@ const NamedValueSet& JavascriptEngine::getRootObjectProperties() const noexcept #if JUCE_MSVC #pragma warning (pop) #endif + +} // namespace juce diff --git a/modules/juce_core/javascript/juce_Javascript.h b/modules/juce_core/javascript/juce_Javascript.h index 93a55a405f..1a95998a5b 100644 --- a/modules/juce_core/javascript/juce_Javascript.h +++ b/modules/juce_core/javascript/juce_Javascript.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -116,3 +116,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JavascriptEngine) }; + +} // namespace juce diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index 7d10dfa25e..df5d73287b 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -32,6 +32,7 @@ #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1 #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1 +#define JUCE_CORE_INCLUDE_JNI_HELPERS 1 #include "juce_core.h" @@ -114,9 +115,6 @@ #endif //============================================================================== -namespace juce -{ - #include "containers/juce_AbstractFifo.cpp" #include "containers/juce_NamedValueSet.cpp" #include "containers/juce_ListenerList.cpp" @@ -179,10 +177,6 @@ namespace juce #include "files/juce_WildcardFileFilter.cpp" //============================================================================== -#if JUCE_ANDROID -#include "native/juce_android_JNIHelpers.h" -#endif - #if ! JUCE_WINDOWS #include "native/juce_posix_SharedCode.h" #include "native/juce_posix_NamedPipe.cpp" @@ -238,6 +232,8 @@ namespace juce #endif //============================================================================== +namespace juce +{ /* As the very long class names here try to explain, the purpose of this code is to cause a linker error if not all of your compile units are consistent in the options that they @@ -253,5 +249,4 @@ namespace juce this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode ::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode() noexcept {} #endif - } diff --git a/modules/juce_core/juce_core.h b/modules/juce_core/juce_core.h index c6aead166c..f1bbc4f029 100644 --- a/modules/juce_core/juce_core.h +++ b/modules/juce_core/juce_core.h @@ -175,20 +175,19 @@ namespace juce { - -class StringRef; -class MemoryBlock; -class File; -class InputStream; -class OutputStream; -class DynamicObject; -class FileInputStream; -class FileOutputStream; -class XmlElement; -class JSONFormatter; - -extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept; -extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noexcept; + class StringRef; + class MemoryBlock; + class File; + class InputStream; + class OutputStream; + class DynamicObject; + class FileInputStream; + class FileOutputStream; + class XmlElement; + + extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept; + extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noexcept; +} #include "memory/juce_Memory.h" #include "maths/juce_MathsFunctions.h" @@ -322,8 +321,9 @@ extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noe #include "native/juce_android_JNIHelpers.h" #endif - #ifndef DOXYGEN +namespace juce +{ /* As the very long class names here try to explain, the purpose of this code is to cause a linker error if not all of your compile units are consistent in the options that they @@ -341,9 +341,8 @@ extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noe { this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode() noexcept; }; static this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode compileUnitMismatchSentinel; #endif -#endif - } +#endif #if JUCE_MSVC #pragma warning (pop) diff --git a/modules/juce_core/logging/juce_FileLogger.cpp b/modules/juce_core/logging/juce_FileLogger.cpp index 9a92d383a8..7ec9dba6df 100644 --- a/modules/juce_core/logging/juce_FileLogger.cpp +++ b/modules/juce_core/logging/juce_FileLogger.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + FileLogger::FileLogger (const File& file, const String& welcomeMessage, const int64 maxInitialFileSizeBytes) @@ -126,3 +129,5 @@ FileLogger* FileLogger::createDateStampedLogger (const String& logFileSubDirecto .getNonexistentSibling(), welcomeMessage, 0); } + +} // namespace juce diff --git a/modules/juce_core/logging/juce_FileLogger.h b/modules/juce_core/logging/juce_FileLogger.h index c9846f81d8..ac29683ca8 100644 --- a/modules/juce_core/logging/juce_FileLogger.h +++ b/modules/juce_core/logging/juce_FileLogger.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -127,3 +127,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileLogger) }; + +} // namespace juce diff --git a/modules/juce_core/logging/juce_Logger.cpp b/modules/juce_core/logging/juce_Logger.cpp index b69d69dc6f..3cb0d89631 100644 --- a/modules/juce_core/logging/juce_Logger.cpp +++ b/modules/juce_core/logging/juce_Logger.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + Logger::Logger() {} Logger::~Logger() @@ -55,3 +58,5 @@ void JUCE_API JUCE_CALLTYPE logAssertion (const char* const filename, const int #endif } #endif + +} // namespace juce diff --git a/modules/juce_core/logging/juce_Logger.h b/modules/juce_core/logging/juce_Logger.h index 45b5949b8c..bb38c565bd 100644 --- a/modules/juce_core/logging/juce_Logger.h +++ b/modules/juce_core/logging/juce_Logger.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -85,3 +85,5 @@ protected: private: static Logger* currentLogger; }; + +} // namespace juce diff --git a/modules/juce_core/maths/juce_BigInteger.cpp b/modules/juce_core/maths/juce_BigInteger.cpp index 14a9354394..78634ed2ff 100644 --- a/modules/juce_core/maths/juce_BigInteger.cpp +++ b/modules/juce_core/maths/juce_BigInteger.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace { inline uint32 bitToMask (const int bit) noexcept { return (uint32) 1 << (bit & 31); } @@ -1370,3 +1373,5 @@ public: static BigIntegerTests bigIntegerTests; #endif + +} // namespace juce diff --git a/modules/juce_core/maths/juce_BigInteger.h b/modules/juce_core/maths/juce_BigInteger.h index 01a0965e3d..54726e7fe4 100644 --- a/modules/juce_core/maths/juce_BigInteger.h +++ b/modules/juce_core/maths/juce_BigInteger.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -342,3 +342,5 @@ OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const BigInteger& // For backwards compatibility, BitArray is defined as an alias for BigInteger. typedef BigInteger BitArray; #endif + +} // namespace juce diff --git a/modules/juce_core/maths/juce_Expression.cpp b/modules/juce_core/maths/juce_Expression.cpp index 639d85a1df..afab1ae9d6 100644 --- a/modules/juce_core/maths/juce_Expression.cpp +++ b/modules/juce_core/maths/juce_Expression.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class Expression::Term : public SingleThreadedReferenceCountedObject { public: @@ -1167,3 +1170,5 @@ String Expression::Scope::getScopeUID() const { return {}; } + +} // namespace juce diff --git a/modules/juce_core/maths/juce_Expression.h b/modules/juce_core/maths/juce_Expression.h index 189a4f03d9..a3a4af7a4e 100644 --- a/modules/juce_core/maths/juce_Expression.h +++ b/modules/juce_core/maths/juce_Expression.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -249,3 +249,5 @@ private: explicit Expression (Term*); }; + +} // namespace juce diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 7361ea71f0..7e6b348f8e 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /* @@ -661,5 +662,4 @@ namespace TypeHelpers template <> struct UnsignedTypeWithSize<8> { typedef uint64 type; }; } - -//============================================================================== +} // namespace juce diff --git a/modules/juce_core/maths/juce_NormalisableRange.h b/modules/juce_core/maths/juce_NormalisableRange.h index 3f3794e151..cf5b3e7a11 100644 --- a/modules/juce_core/maths/juce_NormalisableRange.h +++ b/modules/juce_core/maths/juce_NormalisableRange.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -266,3 +266,5 @@ private: convertTo0To1Function = nullptr, snapToLegalValueFunction = nullptr; }; + +} // namespace juce diff --git a/modules/juce_core/maths/juce_Random.cpp b/modules/juce_core/maths/juce_Random.cpp index 9fa81369e4..219e1b40c8 100644 --- a/modules/juce_core/maths/juce_Random.cpp +++ b/modules/juce_core/maths/juce_Random.cpp @@ -20,7 +20,10 @@ ============================================================================== */ -Random::Random (const int64 seedValue) noexcept : seed (seedValue) +namespace juce +{ + +Random::Random (int64 seedValue) noexcept : seed (seedValue) { } @@ -181,3 +184,5 @@ public: static RandomTests randomTests; #endif + +} // namespace juce diff --git a/modules/juce_core/maths/juce_Random.h b/modules/juce_core/maths/juce_Random.h index fa97413f3b..f3d7d490cf 100644 --- a/modules/juce_core/maths/juce_Random.h +++ b/modules/juce_core/maths/juce_Random.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -131,3 +131,5 @@ private: JUCE_LEAK_DETECTOR (Random) }; + +} // namespace juce diff --git a/modules/juce_core/maths/juce_Range.h b/modules/juce_core/maths/juce_Range.h index bdb388530f..bbdfa765f6 100644 --- a/modules/juce_core/maths/juce_Range.h +++ b/modules/juce_core/maths/juce_Range.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A general-purpose range object, that simply represents any linear range with @@ -301,3 +301,5 @@ private: //============================================================================== ValueType start, end; }; + +} // namespace juce diff --git a/modules/juce_core/maths/juce_StatisticsAccumulator.h b/modules/juce_core/maths/juce_StatisticsAccumulator.h index 31be08e4d3..4d1b61f4ba 100644 --- a/modules/juce_core/maths/juce_StatisticsAccumulator.h +++ b/modules/juce_core/maths/juce_StatisticsAccumulator.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -133,3 +133,5 @@ private: KahanSum sum, sumSquares; FloatType minimum, maximum; }; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_Atomic.h b/modules/juce_core/memory/juce_Atomic.h index 65408b4c01..353ca2a0d5 100644 --- a/modules/juce_core/memory/juce_Atomic.h +++ b/modules/juce_core/memory/juce_Atomic.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #ifndef DOXYGEN namespace AtomicHelpers @@ -472,3 +473,5 @@ #endif #endif + +} // namespace juce diff --git a/modules/juce_core/memory/juce_ByteOrder.h b/modules/juce_core/memory/juce_ByteOrder.h index 49c79c181a..f2e53d5cb4 100644 --- a/modules/juce_core/memory/juce_ByteOrder.h +++ b/modules/juce_core/memory/juce_ByteOrder.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Contains static methods for converting the byte order between different @@ -233,3 +233,5 @@ inline int ByteOrder::littleEndian24Bit (const void* const bytes) noexcept inline int ByteOrder::bigEndian24Bit (const void* const bytes) noexcept { return (int) ((((unsigned int) static_cast (bytes)[0]) << 16) | (((unsigned int) static_cast (bytes)[1]) << 8) | ((unsigned int) static_cast (bytes)[2])); } inline void ByteOrder::littleEndian24BitToChars (const int value, void* const destBytes) noexcept { static_cast (destBytes)[0] = (uint8) value; static_cast (destBytes)[1] = (uint8) (value >> 8); static_cast (destBytes)[2] = (uint8) (value >> 16); } inline void ByteOrder::bigEndian24BitToChars (const int value, void* const destBytes) noexcept { static_cast (destBytes)[0] = (uint8) (value >> 16); static_cast (destBytes)[1] = (uint8) (value >> 8); static_cast (destBytes)[2] = (uint8) value; } + +} // namespace juce diff --git a/modules/juce_core/memory/juce_ContainerDeletePolicy.h b/modules/juce_core/memory/juce_ContainerDeletePolicy.h index 156feafa5c..26d1497382 100644 --- a/modules/juce_core/memory/juce_ContainerDeletePolicy.h +++ b/modules/juce_core/memory/juce_ContainerDeletePolicy.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -51,3 +52,5 @@ struct ContainerDeletePolicy delete object; } }; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_HeapBlock.h b/modules/juce_core/memory/juce_HeapBlock.h index 5bb5aa9657..a469d58905 100644 --- a/modules/juce_core/memory/juce_HeapBlock.h +++ b/modules/juce_core/memory/juce_HeapBlock.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if ! (defined (DOXYGEN) || JUCE_EXCEPTIONS_DISABLED) namespace HeapBlockHelper @@ -307,3 +308,5 @@ private: JUCE_PREVENT_HEAP_ALLOCATION // Creating a 'new HeapBlock' would be missing the point! #endif }; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_LeakedObjectDetector.h b/modules/juce_core/memory/juce_LeakedObjectDetector.h index 293ab18daf..d48be309eb 100644 --- a/modules/juce_core/memory/juce_LeakedObjectDetector.h +++ b/modules/juce_core/memory/juce_LeakedObjectDetector.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -134,3 +134,5 @@ private: #define JUCE_LEAK_DETECTOR(OwnerClass) #endif #endif + +} // namespace juce diff --git a/modules/juce_core/memory/juce_Memory.h b/modules/juce_core/memory/juce_Memory.h index ab9d833082..83b81117a9 100644 --- a/modules/juce_core/memory/juce_Memory.h +++ b/modules/juce_core/memory/juce_Memory.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** Fills a block of memory with zeros. */ @@ -72,7 +73,6 @@ inline Type readUnaligned (const void* srcPtr) noexcept { Type value; memcpy (&value, srcPtr, sizeof (Type)); - return value; } @@ -80,7 +80,7 @@ inline Type readUnaligned (const void* srcPtr) noexcept template inline void writeUnaligned (void* dstPtr, Type value) noexcept { - memcpy (dstPtr, &value, sizeof(Type)); + memcpy (dstPtr, &value, sizeof (Type)); } //============================================================================== @@ -140,3 +140,5 @@ inline void writeUnaligned (void* dstPtr, Type value) noexcept #ifndef juce_UseDebuggingNewOperator #define juce_UseDebuggingNewOperator #endif + +} // namespace juce diff --git a/modules/juce_core/memory/juce_MemoryBlock.cpp b/modules/juce_core/memory/juce_MemoryBlock.cpp index 85d3e20d91..8bf8b76672 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.cpp +++ b/modules/juce_core/memory/juce_MemoryBlock.cpp @@ -20,8 +20,10 @@ ============================================================================== */ -MemoryBlock::MemoryBlock() noexcept - : size (0) +namespace juce +{ + +MemoryBlock::MemoryBlock() noexcept : size (0) { } @@ -405,3 +407,5 @@ bool MemoryBlock::fromBase64Encoding (StringRef s) } } } + +} // namespace juce diff --git a/modules/juce_core/memory/juce_MemoryBlock.h b/modules/juce_core/memory/juce_MemoryBlock.h index ad70739a17..888449a4be 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.h +++ b/modules/juce_core/memory/juce_MemoryBlock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -256,3 +256,5 @@ private: JUCE_LEAK_DETECTOR (MemoryBlock) }; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_OptionalScopedPointer.h b/modules/juce_core/memory/juce_OptionalScopedPointer.h index 6d6ad66c3e..898c95ca56 100644 --- a/modules/juce_core/memory/juce_OptionalScopedPointer.h +++ b/modules/juce_core/memory/juce_OptionalScopedPointer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -180,3 +180,5 @@ private: // myPointer.setOwned (myScopedPointer.release()) void setOwned (const ScopedPointer&) JUCE_DELETED_FUNCTION; }; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_ReferenceCountedObject.h b/modules/juce_core/memory/juce_ReferenceCountedObject.h index ba4b893c61..052e136dc3 100644 --- a/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -407,3 +407,5 @@ bool operator!= (ReferenceCountedObjectClass* object1, const ReferenceCountedObj { return object1 != object2.get(); } + +} // namespace juce diff --git a/modules/juce_core/memory/juce_ScopedPointer.h b/modules/juce_core/memory/juce_ScopedPointer.h index d0c5cee701..8c7499ec8a 100644 --- a/modules/juce_core/memory/juce_ScopedPointer.h +++ b/modules/juce_core/memory/juce_ScopedPointer.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -249,3 +250,5 @@ template void deleteAndZero (ScopedPointer&) { static_assert (sizeof (Type) == 12345, "Attempt to call deleteAndZero() on a ScopedPointer"); } #endif + +} // namespace juce diff --git a/modules/juce_core/memory/juce_SharedResourcePointer.h b/modules/juce_core/memory/juce_SharedResourcePointer.h index 181f93fc6f..89de47a64b 100644 --- a/modules/juce_core/memory/juce_SharedResourcePointer.h +++ b/modules/juce_core/memory/juce_SharedResourcePointer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -158,3 +158,5 @@ private: JUCE_LEAK_DETECTOR (SharedResourcePointer) }; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_Singleton.h b/modules/juce_core/memory/juce_Singleton.h index 9bcaa34eb5..e9567e4615 100644 --- a/modules/juce_core/memory/juce_Singleton.h +++ b/modules/juce_core/memory/juce_Singleton.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -279,3 +279,5 @@ #define juce_ImplementSingleton_SingleThreaded(classname) \ \ classname* classname::_singletonInstance = nullptr; + +} // namespace juce diff --git a/modules/juce_core/memory/juce_WeakReference.h b/modules/juce_core/memory/juce_WeakReference.h index 1751cecc72..c743fc6c9b 100644 --- a/modules/juce_core/memory/juce_WeakReference.h +++ b/modules/juce_core/memory/juce_WeakReference.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -201,3 +201,5 @@ private: return (o != nullptr) ? o->masterReference.getSharedPointer (o) : nullptr; } }; + +} // namespace juce diff --git a/modules/juce_core/misc/juce_Result.cpp b/modules/juce_core/misc/juce_Result.cpp index 678af8747c..f94e0f2688 100644 --- a/modules/juce_core/misc/juce_Result.cpp +++ b/modules/juce_core/misc/juce_Result.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + Result::Result() noexcept {} Result::Result (const String& message) noexcept @@ -73,3 +76,5 @@ bool Result::wasOk() const noexcept { return errorMessage.isEmpty(); } Result::operator bool() const noexcept { return errorMessage.isEmpty(); } bool Result::failed() const noexcept { return errorMessage.isNotEmpty(); } bool Result::operator!() const noexcept { return errorMessage.isNotEmpty(); } + +} // namespace juce diff --git a/modules/juce_core/misc/juce_Result.h b/modules/juce_core/misc/juce_Result.h index 0eda20c38c..5f08bfc4d6 100644 --- a/modules/juce_core/misc/juce_Result.h +++ b/modules/juce_core/misc/juce_Result.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -110,3 +110,5 @@ private: operator int() const; operator void*() const; }; + +} // namespace juce diff --git a/modules/juce_core/misc/juce_RuntimePermissions.cpp b/modules/juce_core/misc/juce_RuntimePermissions.cpp index e15a071935..bf7306b554 100644 --- a/modules/juce_core/misc/juce_RuntimePermissions.cpp +++ b/modules/juce_core/misc/juce_RuntimePermissions.cpp @@ -20,23 +20,17 @@ ============================================================================== */ +namespace juce +{ + #if ! JUCE_ANDROID // We currently don't request runtime permissions on any other platform // than Android, so this file contains a dummy implementation for those. // This may change in the future. -void RuntimePermissions::request (PermissionID /*permission*/, Callback callback) -{ - callback (true); -} - -bool RuntimePermissions::isRequired (PermissionID /*permission*/) -{ - return false; -} - -bool RuntimePermissions::isGranted (PermissionID /*permission*/) -{ - return true; -} +void RuntimePermissions::request (PermissionID, Callback callback) { callback (true); } +bool RuntimePermissions::isRequired (PermissionID) { return false; } +bool RuntimePermissions::isGranted (PermissionID) { return true; } #endif + +} // namespace juce diff --git a/modules/juce_core/misc/juce_RuntimePermissions.h b/modules/juce_core/misc/juce_RuntimePermissions.h index bb170eea33..4de84c678f 100644 --- a/modules/juce_core/misc/juce_RuntimePermissions.h +++ b/modules/juce_core/misc/juce_RuntimePermissions.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -121,3 +122,5 @@ public: */ static bool isGranted (PermissionID permission); }; + +} // namespace juce diff --git a/modules/juce_core/misc/juce_StdFunctionCompat.cpp b/modules/juce_core/misc/juce_StdFunctionCompat.cpp index ec56e2255e..93bcf5c602 100644 --- a/modules/juce_core/misc/juce_StdFunctionCompat.cpp +++ b/modules/juce_core/misc/juce_StdFunctionCompat.cpp @@ -28,6 +28,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_UNIT_TESTS namespace FunctionTestsHelpers @@ -252,3 +255,5 @@ public: static FunctionTests functionTests; #endif + +} // namespace juce diff --git a/modules/juce_core/misc/juce_StdFunctionCompat.h b/modules/juce_core/misc/juce_StdFunctionCompat.h index f1b262b760..3d5381a461 100644 --- a/modules/juce_core/misc/juce_StdFunctionCompat.h +++ b/modules/juce_core/misc/juce_StdFunctionCompat.h @@ -28,8 +28,6 @@ ============================================================================== */ -#pragma once - namespace std { /** diff --git a/modules/juce_core/misc/juce_Uuid.cpp b/modules/juce_core/misc/juce_Uuid.cpp index 03f911cbf2..807031d02b 100644 --- a/modules/juce_core/misc/juce_Uuid.cpp +++ b/modules/juce_core/misc/juce_Uuid.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + Uuid::Uuid() { Random r; @@ -130,3 +133,5 @@ uint16 Uuid::getTimeHighAndVersion() const noexcept { return ByteOrder::bi uint8 Uuid::getClockSeqAndReserved() const noexcept { return uuid[8]; } uint8 Uuid::getClockSeqLow() const noexcept { return uuid[9]; } uint64 Uuid::getNode() const noexcept { return (((uint64) ByteOrder::bigEndianShort (uuid + 10)) << 32) + ByteOrder::bigEndianInt (uuid + 12); } + +} // namespace juce diff --git a/modules/juce_core/misc/juce_Uuid.h b/modules/juce_core/misc/juce_Uuid.h index cab55d8dc7..5eee6d67cc 100644 --- a/modules/juce_core/misc/juce_Uuid.h +++ b/modules/juce_core/misc/juce_Uuid.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -128,3 +128,5 @@ private: JUCE_LEAK_DETECTOR (Uuid) }; + +} // namespace juce diff --git a/modules/juce_core/misc/juce_WindowsRegistry.h b/modules/juce_core/misc/juce_WindowsRegistry.h index 239849cc74..1c49ac32ae 100644 --- a/modules/juce_core/misc/juce_WindowsRegistry.h +++ b/modules/juce_core/misc/juce_WindowsRegistry.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_WINDOWS || DOXYGEN @@ -131,3 +132,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_Files.cpp b/modules/juce_core/native/juce_android_Files.cpp index 41f8ec5f66..5c0de20908 100644 --- a/modules/juce_core/native/juce_android_Files.cpp +++ b/modules/juce_core/native/juce_android_Files.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(Landroid/content/Context;Landroid/media/MediaScannerConnection$MediaScannerConnectionClient;)V") \ METHOD (connect, "connect", "()V") \ @@ -190,3 +192,5 @@ void FileOutputStream::flushInternal() new SingleMediaScanner (file.getFullPathName()); } } + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_JNIHelpers.h b/modules/juce_core/native/juce_android_JNIHelpers.h index 1b5b100ea8..ceb8dc3948 100644 --- a/modules/juce_core/native/juce_android_JNIHelpers.h +++ b/modules/juce_core/native/juce_android_JNIHelpers.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if ! (defined (JUCE_ANDROID_ACTIVITY_CLASSNAME) && defined (JUCE_ANDROID_ACTIVITY_CLASSPATH)) #error "The JUCE_ANDROID_ACTIVITY_CLASSNAME and JUCE_ANDROID_ACTIVITY_CLASSPATH macros must be set!" @@ -429,3 +430,5 @@ LocalRef CreateJavaInterface (AndroidInterfaceImplementer* implementer, const StringArray& interfaceNames); LocalRef CreateJavaInterface (AndroidInterfaceImplementer* implementer, const String& interfaceName); + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_Misc.cpp b/modules/juce_core/native/juce_android_Misc.cpp index 4a0f8189f7..8ad39bed56 100644 --- a/modules/juce_core/native/juce_android_Misc.cpp +++ b/modules/juce_core/native/juce_android_Misc.cpp @@ -20,7 +20,12 @@ ============================================================================== */ +namespace juce +{ + void Logger::outputDebugString (const String& text) { __android_log_print (ANDROID_LOG_INFO, "JUCE", "%s", text.toUTF8().getAddress()); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_Network.cpp b/modules/juce_core/native/juce_android_Network.cpp index 4189766e4d..136ce47de3 100644 --- a/modules/juce_core/native/juce_android_Network.cpp +++ b/modules/juce_core/native/juce_android_Network.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "()V") \ METHOD (toString, "toString", "()Ljava/lang/String;") \ @@ -298,3 +300,5 @@ void IPAddress::findAllAddresses (Array& result, bool /*includeIPv6*/ ::close (sock); } } + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_RuntimePermissions.cpp b/modules/juce_core/native/juce_android_RuntimePermissions.cpp index 155cffc746..6158271d64 100644 --- a/modules/juce_core/native/juce_android_RuntimePermissions.cpp +++ b/modules/juce_core/native/juce_android_RuntimePermissions.cpp @@ -20,27 +20,27 @@ ============================================================================== */ -namespace +namespace juce { - void handleAndroidCallback (bool permissionWasGranted, RuntimePermissions::Callback* callbackPtr) + +static void handleAndroidCallback (bool permissionWasGranted, RuntimePermissions::Callback* callbackPtr) +{ + if (callbackPtr == nullptr) { - if (callbackPtr == nullptr) - { - // got a nullptr passed in from java! this should never happen... - jassertfalse; - return; - } + // got a nullptr passed in from java! this should never happen... + jassertfalse; + return; + } - std::unique_ptr uptr (callbackPtr); + std::unique_ptr uptr (callbackPtr); - if (RuntimePermissions::Callback callbackObj = *uptr) - callbackObj (permissionWasGranted); - } + if (RuntimePermissions::Callback callbackObj = *uptr) + callbackObj (permissionWasGranted); } JUCE_JNI_CALLBACK (JUCE_ANDROID_ACTIVITY_CLASSNAME, androidRuntimePermissionsCallback, - void, (JNIEnv* env, jobject /*javaObjectHandle*/, jboolean permissionsGranted, jlong callbackPtr)) + void, (JNIEnv* env, jobject, jboolean permissionsGranted, jlong callbackPtr)) { setEnv (env); handleAndroidCallback (permissionsGranted != 0, @@ -84,3 +84,5 @@ bool RuntimePermissions::isGranted (PermissionID permission) { return android.activity.callBooleanMethod (JuceAppActivity.isPermissionGranted, permission); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_SystemStats.cpp b/modules/juce_core/native/juce_android_SystemStats.cpp index 762ce02f48..00d0c44c64 100644 --- a/modules/juce_core/native/juce_android_SystemStats.cpp +++ b/modules/juce_core/native/juce_android_SystemStats.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (newProxyInstance, "newProxyInstance", "(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;") \ @@ -514,3 +516,5 @@ bool Time::setSystemTimeToThisTime() const jassertfalse; return false; } + +} // namespace juce diff --git a/modules/juce_core/native/juce_android_Threads.cpp b/modules/juce_core/native/juce_android_Threads.cpp index 7a526e4503..be8780d232 100644 --- a/modules/juce_core/native/juce_android_Threads.cpp +++ b/modules/juce_core/native/juce_android_Threads.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in juce_posix_SharedCode.h! @@ -70,3 +73,5 @@ JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept JUCE_API void JUCE_CALLTYPE Process::raisePrivilege() {} JUCE_API void JUCE_CALLTYPE Process::lowerPrivilege() {} + +} // namespace juce diff --git a/modules/juce_core/native/juce_curl_Network.cpp b/modules/juce_core/native/juce_curl_Network.cpp index 9c14f69848..8781712c18 100644 --- a/modules/juce_core/native/juce_curl_Network.cpp +++ b/modules/juce_core/native/juce_curl_Network.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class WebInputStream::Pimpl { public: @@ -552,3 +555,5 @@ URL::DownloadTask* URL::downloadToFile (const File& targetLocation, String extra { return URL::DownloadTask::createFallbackDownloader (*this, targetLocation, extraHeaders, listener, shouldUsePost); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_linux_CommonFile.cpp b/modules/juce_core/native/juce_linux_CommonFile.cpp index 1166bd7b7a..c22f64f779 100644 --- a/modules/juce_core/native/juce_linux_CommonFile.cpp +++ b/modules/juce_core/native/juce_linux_CommonFile.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + bool File::copyInternal (const File& dest) const { FileInputStream in (*this); @@ -145,3 +148,5 @@ bool DirectoryIterator::NativeIterator::next (String& filenameFound, { return pimpl->next (filenameFound, isDir, isHidden, fileSize, modTime, creationTime, isReadOnly); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_linux_Files.cpp b/modules/juce_core/native/juce_linux_Files.cpp index 1867cb770d..5e34d6a717 100644 --- a/modules/juce_core/native/juce_linux_Files.cpp +++ b/modules/juce_core/native/juce_linux_Files.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + enum { U_ISOFS_SUPER_MAGIC = 0x9660, // linux/iso_fs.h @@ -229,3 +232,5 @@ void File::revealToUser() const else if (getParentDirectory().exists()) getParentDirectory().startAsProcess(); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_linux_Network.cpp b/modules/juce_core/native/juce_linux_Network.cpp index c2965a323e..2ca8d51200 100644 --- a/modules/juce_core/native/juce_linux_Network.cpp +++ b/modules/juce_core/native/juce_linux_Network.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + void MACAddress::findAllAddresses (Array& result) { const int s = socket (AF_INET, SOCK_DGRAM, 0); @@ -578,3 +581,5 @@ URL::DownloadTask* URL::downloadToFile (const File& targetLocation, String extra return URL::DownloadTask::createFallbackDownloader (*this, targetLocation, extraHeaders, listener, shouldUsePost); } #endif + +} // namespace juce diff --git a/modules/juce_core/native/juce_linux_SystemStats.cpp b/modules/juce_core/native/juce_linux_SystemStats.cpp index 4b8f4bdfb9..40f19187fc 100644 --- a/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + void Logger::outputDebugString (const String& text) { std::cerr << text << std::endl; @@ -199,3 +202,5 @@ JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept .getIntValue() > 0; #endif } + +} // namespace juce diff --git a/modules/juce_core/native/juce_linux_Threads.cpp b/modules/juce_core/native/juce_linux_Threads.cpp index d293a76e03..144fa05d95 100644 --- a/modules/juce_core/native/juce_linux_Threads.cpp +++ b/modules/juce_core/native/juce_linux_Threads.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in juce_posix_SharedCode.h! @@ -55,3 +58,5 @@ static bool swapUserAndEffectiveUser() JUCE_API void JUCE_CALLTYPE Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); } JUCE_API void JUCE_CALLTYPE Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm index 85ca9a39b3..845cec0a6c 100644 --- a/modules/juce_core/native/juce_mac_Files.mm +++ b/modules/juce_core/native/juce_mac_Files.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in juce_posix_SharedCode.h! @@ -488,3 +491,5 @@ void File::addToDock() const } } #endif + +} // namespace juce diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 6410a8b223..f182a42b52 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + void MACAddress::findAllAddresses (Array& result) { ifaddrs* addrs = nullptr; @@ -1119,3 +1122,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl) }; + +} // namespace juce diff --git a/modules/juce_core/native/juce_mac_Strings.mm b/modules/juce_core/native/juce_mac_Strings.mm index e8996ba5e0..b8a479ead8 100644 --- a/modules/juce_core/native/juce_mac_Strings.mm +++ b/modules/juce_core/native/juce_mac_Strings.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + String String::fromCFString (CFStringRef cfString) { if (cfString == 0) @@ -98,3 +101,5 @@ String String::convertToPrecomposedUnicode() const return result; #endif } + +} // namespace juce diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index a3f97d208f..81f62192ec 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ScopedAutoReleasePool::ScopedAutoReleasePool() { pool = [[NSAutoreleasePool alloc] init]; @@ -313,3 +316,5 @@ int SystemStats::getPageSize() { return (int) NSPageSize(); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_mac_Threads.mm b/modules/juce_core/native/juce_mac_Threads.mm index a02403e178..8ac6c0ed52 100644 --- a/modules/juce_core/native/juce_mac_Threads.mm +++ b/modules/juce_core/native/juce_mac_Threads.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in juce_posix_SharedCode.h! @@ -82,3 +85,5 @@ JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept sysctl (m, 4, &info, &sz, 0, 0); return (info.kp_proc.p_flag & P_TRACED) != 0; } + +} // namespace juce diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h index 760803edfc..b335287cbe 100644 --- a/modules/juce_core/native/juce_osx_ObjCHelpers.h +++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h @@ -20,92 +20,89 @@ ============================================================================== */ -#pragma once - - /* This file contains a few helper functions that are used internally but which need to be kept away from the public headers because they use obj-C symbols. */ -namespace +namespace juce { - //============================================================================== - static inline String nsStringToJuce (NSString* s) - { - return CharPointer_UTF8 ([s UTF8String]); - } - - static inline NSString* juceStringToNS (const String& s) - { - return [NSString stringWithUTF8String: s.toUTF8()]; - } - static inline NSString* nsStringLiteral (const char* const s) noexcept - { - return [NSString stringWithUTF8String: s]; - } +//============================================================================== +static inline String nsStringToJuce (NSString* s) +{ + return CharPointer_UTF8 ([s UTF8String]); +} - static inline NSString* nsEmptyString() noexcept - { - return [NSString string]; - } +static inline NSString* juceStringToNS (const String& s) +{ + return [NSString stringWithUTF8String: s.toUTF8()]; +} - static inline NSURL* createNSURLFromFile (const String& f) - { - return [NSURL fileURLWithPath: juceStringToNS (f)]; - } +static inline NSString* nsStringLiteral (const char* const s) noexcept +{ + return [NSString stringWithUTF8String: s]; +} - static inline NSURL* createNSURLFromFile (const File& f) - { - return createNSURLFromFile (f.getFullPathName()); - } +static inline NSString* nsEmptyString() noexcept +{ + return [NSString string]; +} - static inline NSArray* createNSArrayFromStringArray (const StringArray& strings) - { - auto* array = [[NSMutableArray alloc] init]; +static inline NSURL* createNSURLFromFile (const String& f) +{ + return [NSURL fileURLWithPath: juceStringToNS (f)]; +} - for (auto string: strings) - [array addObject:juceStringToNS (string)]; +static inline NSURL* createNSURLFromFile (const File& f) +{ + return createNSURLFromFile (f.getFullPathName()); +} - return [array autorelease]; - } +static inline NSArray* createNSArrayFromStringArray (const StringArray& strings) +{ + auto* array = [[NSMutableArray alloc] init]; - #if JUCE_MAC - template - static NSRect makeNSRect (const RectangleType& r) noexcept - { - return NSMakeRect (static_cast (r.getX()), - static_cast (r.getY()), - static_cast (r.getWidth()), - static_cast (r.getHeight())); - } - #endif - #if JUCE_MAC || JUCE_IOS - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES - - // This is necessary as on iOS builds, some arguments may be passed on registers - // depending on the argument type. The re-cast objc_msgSendSuper to a function - // take the same arguments as the target method. - template - static inline ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Params... params) - { - typedef ReturnValue (*SuperFn)(struct objc_super*, SEL, Params...); - SuperFn fn = reinterpret_cast (objc_msgSendSuper); - return fn (s, sel, params...); - } + for (auto string: strings) + [array addObject:juceStringToNS (string)]; - #endif + return [array autorelease]; +} - // These hacks are a workaround for newer Xcode builds which by default prevent calls to these objc functions.. - typedef id (*MsgSendSuperFn) (struct objc_super*, SEL, ...); - static inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; } +#if JUCE_MAC +template +static NSRect makeNSRect (const RectangleType& r) noexcept +{ + return NSMakeRect (static_cast (r.getX()), + static_cast (r.getY()), + static_cast (r.getWidth()), + static_cast (r.getHeight())); +} +#endif +#if JUCE_MAC || JUCE_IOS +#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES - #if ! JUCE_IOS - typedef double (*MsgSendFPRetFn) (id, SEL op, ...); - static inline MsgSendFPRetFn getMsgSendFPRetFn() noexcept { return (MsgSendFPRetFn) (void*) objc_msgSend_fpret; } - #endif - #endif +// This is necessary as on iOS builds, some arguments may be passed on registers +// depending on the argument type. The re-cast objc_msgSendSuper to a function +// take the same arguments as the target method. +template +static inline ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Params... params) +{ + typedef ReturnValue (*SuperFn)(struct objc_super*, SEL, Params...); + SuperFn fn = reinterpret_cast (objc_msgSendSuper); + return fn (s, sel, params...); } +#endif + +// These hacks are a workaround for newer Xcode builds which by default prevent calls to these objc functions.. +typedef id (*MsgSendSuperFn) (struct objc_super*, SEL, ...); +static inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; } + +#if ! JUCE_IOS +typedef double (*MsgSendFPRetFn) (id, SEL op, ...); +static inline MsgSendFPRetFn getMsgSendFPRetFn() noexcept { return (MsgSendFPRetFn) (void*) objc_msgSend_fpret; } +#endif +#endif + //============================================================================== template struct NSObjectRetainer @@ -236,3 +233,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_core/native/juce_posix_NamedPipe.cpp b/modules/juce_core/native/juce_posix_NamedPipe.cpp index 80bfa2e703..be948ffd4f 100644 --- a/modules/juce_core/native/juce_posix_NamedPipe.cpp +++ b/modules/juce_core/native/juce_posix_NamedPipe.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class NamedPipe::Pimpl { public: @@ -226,3 +229,5 @@ int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOut ScopedReadLock sl (lock); return pimpl != nullptr ? pimpl->write (static_cast (sourceBuffer), numBytesToWrite, timeOutMilliseconds) : -1; } + +} // namespace juce diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 2e6d75547b..dc81366ad9 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + CriticalSection::CriticalSection() noexcept { pthread_mutexattr_t atts; @@ -1497,3 +1500,5 @@ private: JUCE_DECLARE_NON_COPYABLE (Pimpl) }; + +} // namespace juce diff --git a/modules/juce_core/native/juce_win32_ComSmartPtr.h b/modules/juce_core/native/juce_win32_ComSmartPtr.h index 09bfd5b7b5..0a6511c4c8 100644 --- a/modules/juce_core/native/juce_win32_ComSmartPtr.h +++ b/modules/juce_core/native/juce_win32_ComSmartPtr.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MINGW || (! (defined (_MSC_VER) || defined (__uuidof))) #ifdef __uuidof @@ -189,3 +190,5 @@ public: return ComBaseClassHelperBase::QueryInterface (refId, result); } }; + +} // namespace juce diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 07641d558f..6534ba6a6a 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #ifndef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD) -1) #endif @@ -1071,3 +1074,5 @@ int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOut ScopedReadLock sl (lock); return pimpl != nullptr ? pimpl->write (sourceBuffer, numBytesToWrite, timeOutMilliseconds) : -1; } + +} // namespace juce diff --git a/modules/juce_core/native/juce_win32_Network.cpp b/modules/juce_core/native/juce_win32_Network.cpp index 42f17d9db2..21da41aba4 100644 --- a/modules/juce_core/native/juce_win32_Network.cpp +++ b/modules/juce_core/native/juce_win32_Network.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #ifndef INTERNET_FLAG_NEED_FILE #define INTERNET_FLAG_NEED_FILE 0x00000010 #endif @@ -655,3 +658,5 @@ URL::DownloadTask* URL::downloadToFile (const File& targetLocation, String extra { return URL::DownloadTask::createFallbackDownloader (*this, targetLocation, extraHeaders, listener, shouldUsePost); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_win32_Registry.cpp b/modules/juce_core/native/juce_win32_Registry.cpp index 91b2c12570..e1b5f5b814 100644 --- a/modules/juce_core/native/juce_win32_Registry.cpp +++ b/modules/juce_core/native/juce_win32_Registry.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct RegistryKeyWrapper { RegistryKeyWrapper (String name, bool createForWriting, DWORD wow64Flags) @@ -244,3 +247,5 @@ bool JUCE_CALLTYPE WindowsRegistry::registerFileAssociation (const String& fileE String WindowsRegistry::getValueWow64 (const String& p, const String& defVal) { return getValue (p, defVal, WoW64_64bit); } bool WindowsRegistry::valueExistsWow64 (const String& p) { return valueExists (p, WoW64_64bit); } bool WindowsRegistry::keyExistsWow64 (const String& p) { return keyExists (p, WoW64_64bit); } + +} // namespace juce diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index b2ff9e9450..3f28dded45 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if ! JUCE_MINGW #pragma intrinsic (__cpuid) #pragma intrinsic (__rdtsc) @@ -479,3 +482,5 @@ String SystemStats::getDisplayLanguage() return mainLang; } + +} // namespace juce diff --git a/modules/juce_core/native/juce_win32_Threads.cpp b/modules/juce_core/native/juce_win32_Threads.cpp index 68d891f6d9..62c7b76643 100644 --- a/modules/juce_core/native/juce_win32_Threads.cpp +++ b/modules/juce_core/native/juce_win32_Threads.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + HWND juce_messageWindowHandle = 0; // (this is used by other parts of the codebase) void* getUser32Function (const char* functionName) @@ -529,7 +532,7 @@ bool ChildProcess::start (const StringArray& args, int streamFlags) //============================================================================== struct HighResolutionTimer::Pimpl { - Pimpl (HighResolutionTimer& t) noexcept : owner (t), periodMs (0) + Pimpl (HighResolutionTimer& t) noexcept : owner (t) { } @@ -563,7 +566,7 @@ struct HighResolutionTimer::Pimpl } HighResolutionTimer& owner; - int periodMs; + int periodMs = 0; private: unsigned int timerID; @@ -577,3 +580,5 @@ private: JUCE_DECLARE_NON_COPYABLE (Pimpl) }; + +} // namespace juce diff --git a/modules/juce_core/network/juce_IPAddress.cpp b/modules/juce_core/network/juce_IPAddress.cpp index 92c68bab66..2b38499faa 100644 --- a/modules/juce_core/network/juce_IPAddress.cpp +++ b/modules/juce_core/network/juce_IPAddress.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + IPAddress::IPAddress (bool IPv6) noexcept : isIPv6 (IPv6) { for (int i = 0; i < 16; ++i) @@ -296,3 +299,5 @@ void IPAddress::findAllAddresses (Array& result, bool includeIPv6) freeifaddrs (ifaddr); } #endif + +} // namespace juce diff --git a/modules/juce_core/network/juce_IPAddress.h b/modules/juce_core/network/juce_IPAddress.h index a450ff7d18..ac29e0c41a 100644 --- a/modules/juce_core/network/juce_IPAddress.h +++ b/modules/juce_core/network/juce_IPAddress.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -108,3 +108,5 @@ private: address[i] = 0; } }; + +} // namespace juce diff --git a/modules/juce_core/network/juce_MACAddress.cpp b/modules/juce_core/network/juce_MACAddress.cpp index 62b0e24eac..a2c7e1fb55 100644 --- a/modules/juce_core/network/juce_MACAddress.cpp +++ b/modules/juce_core/network/juce_MACAddress.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MACAddress::MACAddress() noexcept { zeromem (address, sizeof (address)); @@ -86,3 +89,5 @@ bool MACAddress::isNull() const noexcept { return bool MACAddress::operator== (const MACAddress& other) const noexcept { return memcmp (address, other.address, sizeof (address)) == 0; } bool MACAddress::operator!= (const MACAddress& other) const noexcept { return ! operator== (other); } + +} // namespace juce diff --git a/modules/juce_core/network/juce_MACAddress.h b/modules/juce_core/network/juce_MACAddress.h index 7a709b01cb..45a5a1a04a 100644 --- a/modules/juce_core/network/juce_MACAddress.h +++ b/modules/juce_core/network/juce_MACAddress.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -79,3 +79,5 @@ public: private: uint8 address[6]; }; + +} // namespace juce diff --git a/modules/juce_core/network/juce_NamedPipe.cpp b/modules/juce_core/network/juce_NamedPipe.cpp index 434fdb6063..8d493488f0 100644 --- a/modules/juce_core/network/juce_NamedPipe.cpp +++ b/modules/juce_core/network/juce_NamedPipe.cpp @@ -20,9 +20,10 @@ ============================================================================== */ -NamedPipe::NamedPipe() +namespace juce { -} + +NamedPipe::NamedPipe() {} NamedPipe::~NamedPipe() { @@ -58,3 +59,5 @@ String NamedPipe::getName() const } // other methods for this class are implemented in the platform-specific files + +} // namespace juce diff --git a/modules/juce_core/network/juce_NamedPipe.h b/modules/juce_core/network/juce_NamedPipe.h index af09f49000..8ae0482086 100644 --- a/modules/juce_core/network/juce_NamedPipe.h +++ b/modules/juce_core/network/juce_NamedPipe.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -94,3 +94,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NamedPipe) }; + +} // namespace juce diff --git a/modules/juce_core/network/juce_Socket.cpp b/modules/juce_core/network/juce_Socket.cpp index 64288abcea..f850bad50f 100644 --- a/modules/juce_core/network/juce_Socket.cpp +++ b/modules/juce_core/network/juce_Socket.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable : 4127 4389 4018) @@ -770,3 +773,5 @@ bool DatagramSocket::setEnablePortReuse (bool enabled) #if JUCE_MSVC #pragma warning (pop) #endif + +} // namespace juce diff --git a/modules/juce_core/network/juce_Socket.h b/modules/juce_core/network/juce_Socket.h index 8c586f9f38..6a6b7b5982 100644 --- a/modules/juce_core/network/juce_Socket.h +++ b/modules/juce_core/network/juce_Socket.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -349,3 +349,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DatagramSocket) }; + +} // namespace juce diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index 9505dd89b6..402aa62989 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct FallbackDownloadTask : public URL::DownloadTask, public Thread { @@ -661,3 +664,5 @@ bool URL::launchInDefaultBrowser() const return Process::openDocument (u, String()); } + +} // namespace juce diff --git a/modules/juce_core/network/juce_URL.h b/modules/juce_core/network/juce_URL.h index b2a3f592c8..fa2169ddf8 100644 --- a/modules/juce_core/network/juce_URL.h +++ b/modules/juce_core/network/juce_URL.h @@ -20,9 +20,11 @@ ============================================================================== */ -#pragma once +namespace juce +{ class WebInputStream; + //============================================================================== /** Represents a URL and has a bunch of useful functions to manipulate it. @@ -516,3 +518,5 @@ private: JUCE_LEAK_DETECTOR (URL) }; + +} // namespace juce diff --git a/modules/juce_core/network/juce_WebInputStream.cpp b/modules/juce_core/network/juce_WebInputStream.cpp index 4a7aafc1f9..c82b396a8f 100644 --- a/modules/juce_core/network/juce_WebInputStream.cpp +++ b/modules/juce_core/network/juce_WebInputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + WebInputStream::WebInputStream (const URL& url, const bool usePost) : pimpl (new Pimpl (*this, url, usePost)), hasCalledConnect (false) {} @@ -79,3 +82,5 @@ void WebInputStream::createHeadersAndPostData (const URL& aURL, String& headers, { aURL.createHeadersAndPostData (headers, data); } + +} // namespace juce diff --git a/modules/juce_core/network/juce_WebInputStream.h b/modules/juce_core/network/juce_WebInputStream.h index 5d013ea4a4..fe6da1cfbd 100644 --- a/modules/juce_core/network/juce_WebInputStream.h +++ b/modules/juce_core/network/juce_WebInputStream.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -208,3 +209,5 @@ class JUCE_API WebInputStream : public InputStream JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream) }; + +} // namespace juce diff --git a/modules/juce_core/streams/juce_BufferedInputStream.cpp b/modules/juce_core/streams/juce_BufferedInputStream.cpp index b17c526915..8af122a694 100644 --- a/modules/juce_core/streams/juce_BufferedInputStream.cpp +++ b/modules/juce_core/streams/juce_BufferedInputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + static inline int calcBufferStreamBufferSize (int requestedSize, InputStream* source) noexcept { // You need to supply a real stream when creating a BufferedInputStream @@ -180,3 +183,5 @@ String BufferedInputStream::readString() return InputStream::readString(); } + +} // namespace juce diff --git a/modules/juce_core/streams/juce_BufferedInputStream.h b/modules/juce_core/streams/juce_BufferedInputStream.h index 5a51053858..8719b66c5b 100644 --- a/modules/juce_core/streams/juce_BufferedInputStream.h +++ b/modules/juce_core/streams/juce_BufferedInputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Wraps another input stream, and reads from it using an intermediate buffer @@ -84,3 +84,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BufferedInputStream) }; + +} // namespace juce diff --git a/modules/juce_core/streams/juce_FileInputSource.cpp b/modules/juce_core/streams/juce_FileInputSource.cpp index ab777793ea..feb4081a8d 100644 --- a/modules/juce_core/streams/juce_FileInputSource.cpp +++ b/modules/juce_core/streams/juce_FileInputSource.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + FileInputSource::FileInputSource (const File& f, bool useFileTimeInHash) : file (f), useFileTimeInHashGeneration (useFileTimeInHash) { @@ -48,3 +51,5 @@ int64 FileInputSource::hashCode() const return h; } + +} // namespace juce diff --git a/modules/juce_core/streams/juce_FileInputSource.h b/modules/juce_core/streams/juce_FileInputSource.h index 00f8bee369..d5f5942132 100644 --- a/modules/juce_core/streams/juce_FileInputSource.h +++ b/modules/juce_core/streams/juce_FileInputSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -54,3 +54,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileInputSource) }; + +} diff --git a/modules/juce_core/streams/juce_InputSource.h b/modules/juce_core/streams/juce_InputSource.h index 14f3d96b49..925cdf30f6 100644 --- a/modules/juce_core/streams/juce_InputSource.h +++ b/modules/juce_core/streams/juce_InputSource.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -66,3 +66,5 @@ private: //============================================================================== JUCE_LEAK_DETECTOR (InputSource) }; + +} // namespace juce diff --git a/modules/juce_core/streams/juce_InputStream.cpp b/modules/juce_core/streams/juce_InputStream.cpp index eb6bc57a7e..a27f5cfc1d 100644 --- a/modules/juce_core/streams/juce_InputStream.cpp +++ b/modules/juce_core/streams/juce_InputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + int64 InputStream::getNumBytesRemaining() { int64 len = getTotalLength(); @@ -227,3 +230,5 @@ void InputStream::skipNextBytes (int64 numBytesToSkip) numBytesToSkip -= read (temp, (int) jmin (numBytesToSkip, (int64) skipBufferSize)); } } + +} // namespace juce diff --git a/modules/juce_core/streams/juce_InputStream.h b/modules/juce_core/streams/juce_InputStream.h index 3db0e9d71c..398615ad85 100644 --- a/modules/juce_core/streams/juce_InputStream.h +++ b/modules/juce_core/streams/juce_InputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** The base class for streams that read data. @@ -255,3 +255,5 @@ protected: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputStream) }; + +} // namespace juce diff --git a/modules/juce_core/streams/juce_MemoryInputStream.cpp b/modules/juce_core/streams/juce_MemoryInputStream.cpp index 3dfb1237c6..041b24ec8c 100644 --- a/modules/juce_core/streams/juce_MemoryInputStream.cpp +++ b/modules/juce_core/streams/juce_MemoryInputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MemoryInputStream::MemoryInputStream (const void* const sourceData, const size_t sourceDataSize, const bool keepInternalCopy) @@ -156,3 +159,5 @@ public: static MemoryStreamTests memoryInputStreamUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_core/streams/juce_MemoryInputStream.h b/modules/juce_core/streams/juce_MemoryInputStream.h index 3bfa985ac6..86373ca657 100644 --- a/modules/juce_core/streams/juce_MemoryInputStream.h +++ b/modules/juce_core/streams/juce_MemoryInputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -86,3 +86,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryInputStream) }; + +} // namespace juce diff --git a/modules/juce_core/streams/juce_MemoryOutputStream.cpp b/modules/juce_core/streams/juce_MemoryOutputStream.cpp index 57226cb2ae..1b27e05dec 100644 --- a/modules/juce_core/streams/juce_MemoryOutputStream.cpp +++ b/modules/juce_core/streams/juce_MemoryOutputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MemoryOutputStream::MemoryOutputStream (const size_t initialSize) : blockToUse (&internalBlock), externalData (nullptr), position (0), size (0), availableSize (0) @@ -206,3 +209,5 @@ OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryOutput return stream; } + +} // namespace juce diff --git a/modules/juce_core/streams/juce_MemoryOutputStream.h b/modules/juce_core/streams/juce_MemoryOutputStream.h index 794d78f86c..6f89c940ce 100644 --- a/modules/juce_core/streams/juce_MemoryOutputStream.h +++ b/modules/juce_core/streams/juce_MemoryOutputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -127,3 +127,5 @@ private: /** Copies all the data that has been written to a MemoryOutputStream into another stream. */ OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryOutputStream& streamToRead); + +} // namespace juce diff --git a/modules/juce_core/streams/juce_OutputStream.cpp b/modules/juce_core/streams/juce_OutputStream.cpp index a87e5b2fcc..499f532cf7 100644 --- a/modules/juce_core/streams/juce_OutputStream.cpp +++ b/modules/juce_core/streams/juce_OutputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_DEBUG struct DanglingStreamChecker @@ -343,3 +346,5 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const New { return stream << stream.getNewLineString(); } + +} // namespace juce diff --git a/modules/juce_core/streams/juce_OutputStream.h b/modules/juce_core/streams/juce_OutputStream.h index 2b53107aa5..1ab0a0ce77 100644 --- a/modules/juce_core/streams/juce_OutputStream.h +++ b/modules/juce_core/streams/juce_OutputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -265,3 +265,5 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, InputStre @see OutputStream::setNewLineString */ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const NewLine&); + +} // namespace juce diff --git a/modules/juce_core/streams/juce_SubregionStream.cpp b/modules/juce_core/streams/juce_SubregionStream.cpp index 5e74c28945..c7b67900cb 100644 --- a/modules/juce_core/streams/juce_SubregionStream.cpp +++ b/modules/juce_core/streams/juce_SubregionStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + SubregionStream::SubregionStream (InputStream* const sourceStream, const int64 start, const int64 length, const bool deleteSourceWhenDestroyed) @@ -74,3 +77,5 @@ bool SubregionStream::isExhausted() return source->isExhausted(); } + +} // namespace juce diff --git a/modules/juce_core/streams/juce_SubregionStream.h b/modules/juce_core/streams/juce_SubregionStream.h index 624d6b8a7f..998a2ccdb1 100644 --- a/modules/juce_core/streams/juce_SubregionStream.h +++ b/modules/juce_core/streams/juce_SubregionStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Wraps another input stream, and reads from a specific part of it. @@ -77,3 +77,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SubregionStream) }; + +} // namespace juce diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index d29b492371..32b9323596 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /* This file defines miscellaneous macros for debugging, assertions, etc. @@ -81,7 +82,7 @@ #if JUCE_CLANG && defined (__has_feature) && ! defined (JUCE_ANALYZER_NORETURN) #if __has_feature (attribute_analyzer_noreturn) inline void __attribute__((analyzer_noreturn)) juce_assert_noreturn() {} - #define JUCE_ANALYZER_NORETURN juce_assert_noreturn(); + #define JUCE_ANALYZER_NORETURN juce::juce_assert_noreturn(); #endif #endif @@ -293,3 +294,5 @@ #else #define JUCE_NO_ASSOCIATIVE_MATH_OPTIMISATIONS #endif + +} // namespace juce diff --git a/modules/juce_core/system/juce_SystemStats.cpp b/modules/juce_core/system/juce_SystemStats.cpp index 7e05277429..c073331b97 100644 --- a/modules/juce_core/system/juce_SystemStats.cpp +++ b/modules/juce_core/system/juce_SystemStats.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + String SystemStats::getJUCEVersion() { // Some basic tests, to keep an eye on things and make sure these types work ok @@ -230,3 +233,5 @@ bool SystemStats::isRunningInAppExtensionSandbox() noexcept return false; #endif } + +} // namespace juce diff --git a/modules/juce_core/system/juce_SystemStats.h b/modules/juce_core/system/juce_SystemStats.h index 4bf4e0e13e..89d3854e33 100644 --- a/modules/juce_core/system/juce_SystemStats.h +++ b/modules/juce_core/system/juce_SystemStats.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -217,3 +217,5 @@ private: JUCE_DECLARE_NON_COPYABLE (SystemStats) }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_Base64.cpp b/modules/juce_core/text/juce_Base64.cpp index bda7c3b669..14bcdeb795 100644 --- a/modules/juce_core/text/juce_Base64.cpp +++ b/modules/juce_core/text/juce_Base64.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + bool Base64::convertToBase64 (OutputStream& base64Result, const void* sourceData, size_t sourceDataSize) { static const char lookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -157,3 +160,5 @@ public: static Base64Tests base64Tests; #endif + +} // namespace juce diff --git a/modules/juce_core/text/juce_Base64.h b/modules/juce_core/text/juce_Base64.h index 169c0e2ebb..c7eafa2212 100644 --- a/modules/juce_core/text/juce_Base64.h +++ b/modules/juce_core/text/juce_Base64.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ /** Contains some static methods for converting between binary and the @@ -47,3 +47,5 @@ struct JUCE_API Base64 /** Converts a string's UTF-8 representation to a base-64 string. */ static String toBase64 (const String& textToEncode); }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_CharPointer_ASCII.h b/modules/juce_core/text/juce_CharPointer_ASCII.h index 0c9ed44ac7..2e6b2b808b 100644 --- a/modules/juce_core/text/juce_CharPointer_ASCII.h +++ b/modules/juce_core/text/juce_CharPointer_ASCII.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -374,3 +374,5 @@ public: private: CharType* data; }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_CharPointer_UTF16.h b/modules/juce_core/text/juce_CharPointer_UTF16.h index 7d45f95208..2176482de0 100644 --- a/modules/juce_core/text/juce_CharPointer_UTF16.h +++ b/modules/juce_core/text/juce_CharPointer_UTF16.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -516,3 +516,5 @@ private: return n; } }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_CharPointer_UTF32.h b/modules/juce_core/text/juce_CharPointer_UTF32.h index 5367fbec84..41a9a7c251 100644 --- a/modules/juce_core/text/juce_CharPointer_UTF32.h +++ b/modules/juce_core/text/juce_CharPointer_UTF32.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -369,3 +369,5 @@ public: private: CharType* data; }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_CharPointer_UTF8.h b/modules/juce_core/text/juce_CharPointer_UTF8.h index 639b5c2d1e..0d3c5d6634 100644 --- a/modules/juce_core/text/juce_CharPointer_UTF8.h +++ b/modules/juce_core/text/juce_CharPointer_UTF8.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -560,3 +561,5 @@ public: private: CharType* data; }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_CharacterFunctions.cpp b/modules/juce_core/text/juce_CharacterFunctions.cpp index cd81957d95..9c10e8c38f 100644 --- a/modules/juce_core/text/juce_CharacterFunctions.cpp +++ b/modules/juce_core/text/juce_CharacterFunctions.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4514 4996) @@ -280,3 +282,5 @@ public: static CharacterFunctionsTests characterFunctionsTests; #endif + +} // namespace juce diff --git a/modules/juce_core/text/juce_CharacterFunctions.h b/modules/juce_core/text/juce_CharacterFunctions.h index 759080b283..27894bd8f5 100644 --- a/modules/juce_core/text/juce_CharacterFunctions.h +++ b/modules/juce_core/text/juce_CharacterFunctions.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== #if JUCE_WINDOWS && ! DOXYGEN @@ -631,3 +631,5 @@ public: private: static double mulexp10 (double value, int exponent) noexcept; }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_Identifier.cpp b/modules/juce_core/text/juce_Identifier.cpp index 513b921e5c..3ca2b45ff7 100644 --- a/modules/juce_core/text/juce_Identifier.cpp +++ b/modules/juce_core/text/juce_Identifier.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + Identifier::Identifier() noexcept {} Identifier::~Identifier() noexcept {} @@ -67,3 +70,5 @@ bool Identifier::isValidIdentifier (const String& possibleIdentifier) noexcept return possibleIdentifier.isNotEmpty() && possibleIdentifier.containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-:#@$%"); } + +} // namespace juce diff --git a/modules/juce_core/text/juce_Identifier.h b/modules/juce_core/text/juce_Identifier.h index 1d960e586f..4c6d9bcd23 100644 --- a/modules/juce_core/text/juce_Identifier.h +++ b/modules/juce_core/text/juce_Identifier.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -126,3 +126,5 @@ public: private: String name; }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_LocalisedStrings.cpp b/modules/juce_core/text/juce_LocalisedStrings.cpp index 58533de91d..c5d091f640 100644 --- a/modules/juce_core/text/juce_LocalisedStrings.cpp +++ b/modules/juce_core/text/juce_LocalisedStrings.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + LocalisedStrings::LocalisedStrings (const String& fileContents, bool ignoreCase) { loadFromText (fileContents, ignoreCase); @@ -201,3 +204,5 @@ JUCE_API String translate (const String& text, const String& resultIfNotFound) return resultIfNotFound; } + +} // namespace juce diff --git a/modules/juce_core/text/juce_LocalisedStrings.h b/modules/juce_core/text/juce_LocalisedStrings.h index 71b6423fde..0cee6b3ad0 100644 --- a/modules/juce_core/text/juce_LocalisedStrings.h +++ b/modules/juce_core/text/juce_LocalisedStrings.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -235,3 +235,5 @@ JUCE_API String translate (CharPointer_UTF8 stringLiteral); @see LocalisedStrings */ JUCE_API String translate (const String& stringLiteral, const String& resultIfNotFound); + +} // namespace juce diff --git a/modules/juce_core/text/juce_NewLine.h b/modules/juce_core/text/juce_NewLine.h index 885618a7a7..164f4b1c3f 100644 --- a/modules/juce_core/text/juce_NewLine.h +++ b/modules/juce_core/text/juce_NewLine.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** This class is used for represent a new-line character sequence. @@ -76,3 +76,5 @@ inline String& operator+= (String& s1, const NewLine&) { return s1 += NewLi inline String operator+ (const NewLine&, const NewLine&) { return String (NewLine::getDefault()) + NewLine::getDefault(); } inline String operator+ (String s1, const NewLine&) { return s1 += NewLine::getDefault(); } inline String operator+ (const NewLine&, const char* s2) { return String (NewLine::getDefault()) + s2; } + +} // namespace juce diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 5f2ac413de..7de15744e0 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4514 4996) @@ -2709,3 +2712,5 @@ public: static StringTests stringUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index 8b5bf10e61..642c10dd15 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -1411,10 +1411,9 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const Str /** Writes a string to an OutputStream as UTF8. */ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, StringRef stringToWrite); - -#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS // just used to avoid compiling this under compilers that lack libc++ } // namespace juce +#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS // just used to avoid compiling this under compilers that lack libc++ namespace std { template <> struct hash @@ -1422,6 +1421,4 @@ namespace std size_t operator() (const juce::String& s) const noexcept { return s.hash(); } }; } - -namespace juce { #endif diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index 2ce830f71d..a22b31c7b0 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + StringArray::StringArray() noexcept { } @@ -492,3 +495,5 @@ void StringArray::minimiseStorageOverheads() { strings.minimiseStorageOverheads(); } + +} // namespace juce diff --git a/modules/juce_core/text/juce_StringArray.h b/modules/juce_core/text/juce_StringArray.h index a49c65f6b8..49d8662753 100644 --- a/modules/juce_core/text/juce_StringArray.h +++ b/modules/juce_core/text/juce_StringArray.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -423,3 +423,5 @@ public: private: JUCE_LEAK_DETECTOR (StringArray) }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_StringPairArray.cpp b/modules/juce_core/text/juce_StringPairArray.cpp index 5ae706fbc2..202fd44f8c 100644 --- a/modules/juce_core/text/juce_StringPairArray.cpp +++ b/modules/juce_core/text/juce_StringPairArray.cpp @@ -20,8 +20,10 @@ ============================================================================== */ -StringPairArray::StringPairArray (const bool ignoreCase_) - : ignoreCase (ignoreCase_) +namespace juce +{ + +StringPairArray::StringPairArray (bool shouldIgnoreCase) : ignoreCase (shouldIgnoreCase) { } @@ -139,3 +141,5 @@ void StringPairArray::minimiseStorageOverheads() keys.minimiseStorageOverheads(); values.minimiseStorageOverheads(); } + +} // namespace juce diff --git a/modules/juce_core/text/juce_StringPairArray.h b/modules/juce_core/text/juce_StringPairArray.h index 7d9f3afef5..8bf8b61543 100644 --- a/modules/juce_core/text/juce_StringPairArray.h +++ b/modules/juce_core/text/juce_StringPairArray.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -145,3 +145,5 @@ private: JUCE_LEAK_DETECTOR (StringPairArray) }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_StringPool.cpp b/modules/juce_core/text/juce_StringPool.cpp index 65bde3535f..a9a1121032 100644 --- a/modules/juce_core/text/juce_StringPool.cpp +++ b/modules/juce_core/text/juce_StringPool.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + static const int minNumberOfStringsForGarbageCollection = 300; static const uint32 garbageCollectionInterval = 30000; @@ -158,3 +161,5 @@ StringPool& StringPool::getGlobalPool() noexcept static StringPool pool; return pool; } + +} // namespace juce diff --git a/modules/juce_core/text/juce_StringPool.h b/modules/juce_core/text/juce_StringPool.h index 26240ca036..0f81bbbca3 100644 --- a/modules/juce_core/text/juce_StringPool.h +++ b/modules/juce_core/text/juce_StringPool.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -84,3 +84,5 @@ private: JUCE_DECLARE_NON_COPYABLE (StringPool) }; + +} // namespace juce diff --git a/modules/juce_core/text/juce_StringRef.h b/modules/juce_core/text/juce_StringRef.h index 77919b63bc..308474d10c 100644 --- a/modules/juce_core/text/juce_StringRef.h +++ b/modules/juce_core/text/juce_StringRef.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -128,3 +129,5 @@ inline String operator+ (String s1, StringRef s2) { return s1 += Strin inline String operator+ (StringRef s1, const String& s2) { return String (s1.text) + s2; } inline String operator+ (const char* s1, StringRef s2) { return String (s1) + String (s2.text); } inline String operator+ (StringRef s1, const char* s2) { return String (s1.text) + String (s2); } + +} // namespace juce diff --git a/modules/juce_core/text/juce_TextDiff.cpp b/modules/juce_core/text/juce_TextDiff.cpp index 35b13f7a48..f3e6b21daf 100644 --- a/modules/juce_core/text/juce_TextDiff.cpp +++ b/modules/juce_core/text/juce_TextDiff.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct TextDiffHelpers { enum { minLengthToMatch = 3, @@ -276,3 +279,5 @@ public: static DiffTests diffTests; #endif + +} // namespace juce diff --git a/modules/juce_core/text/juce_TextDiff.h b/modules/juce_core/text/juce_TextDiff.h index a0b9c29bad..05910ff0cd 100644 --- a/modules/juce_core/text/juce_TextDiff.h +++ b/modules/juce_core/text/juce_TextDiff.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ /** Calculates and applies a sequence of changes to convert one text string into @@ -68,3 +68,5 @@ public: */ Array changes; }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ChildProcess.cpp b/modules/juce_core/threads/juce_ChildProcess.cpp index 5648c5d673..0a74d7bf50 100644 --- a/modules/juce_core/threads/juce_ChildProcess.cpp +++ b/modules/juce_core/threads/juce_ChildProcess.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ChildProcess::ChildProcess() {} ChildProcess::~ChildProcess() {} @@ -45,7 +48,7 @@ uint32 ChildProcess::getExitCode() const bool ChildProcess::waitForProcessToFinish (const int timeoutMs) const { - const uint32 timeoutTime = Time::getMillisecondCounter() + (uint32) timeoutMs; + auto timeoutTime = Time::getMillisecondCounter() + (uint32) timeoutMs; do { @@ -105,3 +108,5 @@ public: static ChildProcessTests childProcessUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ChildProcess.h b/modules/juce_core/threads/juce_ChildProcess.h index b2bd0e1b63..98250f3613 100644 --- a/modules/juce_core/threads/juce_ChildProcess.h +++ b/modules/juce_core/threads/juce_ChildProcess.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcess) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_CriticalSection.h b/modules/juce_core/threads/juce_CriticalSection.h index 60a2409232..b382acdc75 100644 --- a/modules/juce_core/threads/juce_CriticalSection.h +++ b/modules/juce_core/threads/juce_CriticalSection.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -254,3 +254,5 @@ typedef CriticalSection::ScopedUnlockType ScopedUnlock; @see CriticalSection::tryEnter, ScopedLock, ScopedUnlock, ScopedReadLock */ typedef CriticalSection::ScopedTryLockType ScopedTryLock; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_DynamicLibrary.h b/modules/juce_core/threads/juce_DynamicLibrary.h index 0d07839997..a4a273769b 100644 --- a/modules/juce_core/threads/juce_DynamicLibrary.h +++ b/modules/juce_core/threads/juce_DynamicLibrary.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ /** Handles the opening and closing of DLLs. @@ -35,14 +36,14 @@ public: /** Creates an unopened DynamicLibrary object. Call open() to actually open one. */ - DynamicLibrary() noexcept : handle (nullptr) {} + DynamicLibrary() noexcept {} /** */ - DynamicLibrary (const String& name) : handle (nullptr) { open (name); } + DynamicLibrary (const String& name) { open (name); } /** Move constructor */ - DynamicLibrary (DynamicLibrary&& other) noexcept : handle (nullptr) + DynamicLibrary (DynamicLibrary&& other) noexcept { std::swap (handle, other.handle); } @@ -75,7 +76,9 @@ public: void* getNativeHandle() const noexcept { return handle; } private: - void* handle; + void* handle = nullptr; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DynamicLibrary) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_HighResolutionTimer.cpp b/modules/juce_core/threads/juce_HighResolutionTimer.cpp index 9e7550d7f9..91f9eac784 100644 --- a/modules/juce_core/threads/juce_HighResolutionTimer.cpp +++ b/modules/juce_core/threads/juce_HighResolutionTimer.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + HighResolutionTimer::HighResolutionTimer() { pimpl = new Pimpl (*this); } HighResolutionTimer::~HighResolutionTimer() { stopTimer(); } @@ -28,3 +31,5 @@ void HighResolutionTimer::stopTimer() { pimpl->stop(); } bool HighResolutionTimer::isTimerRunning() const noexcept { return pimpl->periodMs != 0; } int HighResolutionTimer::getTimerInterval() const noexcept { return pimpl->periodMs; } + +} // namespace juce diff --git a/modules/juce_core/threads/juce_HighResolutionTimer.h b/modules/juce_core/threads/juce_HighResolutionTimer.h index d90f59737e..4c846093cb 100644 --- a/modules/juce_core/threads/juce_HighResolutionTimer.h +++ b/modules/juce_core/threads/juce_HighResolutionTimer.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ /** A high-resolution periodic timer. @@ -97,3 +98,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HighResolutionTimer) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_InterProcessLock.h b/modules/juce_core/threads/juce_InterProcessLock.h index effcf26e9b..3bec0275d7 100644 --- a/modules/juce_core/threads/juce_InterProcessLock.h +++ b/modules/juce_core/threads/juce_InterProcessLock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -116,3 +116,5 @@ private: JUCE_DECLARE_NON_COPYABLE (InterProcessLock) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_Process.h b/modules/juce_core/threads/juce_Process.h index 656f88acb3..1804b89452 100644 --- a/modules/juce_core/threads/juce_Process.h +++ b/modules/juce_core/threads/juce_Process.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Represents the current executable's process. @@ -150,3 +150,5 @@ private: Process(); JUCE_DECLARE_NON_COPYABLE (Process) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ReadWriteLock.cpp b/modules/juce_core/threads/juce_ReadWriteLock.cpp index 7a7efe4391..27347d5f40 100644 --- a/modules/juce_core/threads/juce_ReadWriteLock.cpp +++ b/modules/juce_core/threads/juce_ReadWriteLock.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ReadWriteLock::ReadWriteLock() noexcept : numWaitingWriters (0), numWriters (0), @@ -142,3 +145,5 @@ void ReadWriteLock::exitWrite() const noexcept waitEvent.signal(); } } + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ReadWriteLock.h b/modules/juce_core/threads/juce_ReadWriteLock.h index cb5e4cdddf..4d3f6e5172 100644 --- a/modules/juce_core/threads/juce_ReadWriteLock.h +++ b/modules/juce_core/threads/juce_ReadWriteLock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -140,3 +140,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ReadWriteLock) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ScopedLock.h b/modules/juce_core/threads/juce_ScopedLock.h index c1b5795be1..886f555e9e 100644 --- a/modules/juce_core/threads/juce_ScopedLock.h +++ b/modules/juce_core/threads/juce_ScopedLock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -225,3 +225,5 @@ private: JUCE_DECLARE_NON_COPYABLE (GenericScopedTryLock) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ScopedReadLock.h b/modules/juce_core/threads/juce_ScopedReadLock.h index c459c29d02..fa5fe1ab04 100644 --- a/modules/juce_core/threads/juce_ScopedReadLock.h +++ b/modules/juce_core/threads/juce_ScopedReadLock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -78,3 +78,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ScopedReadLock) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ScopedWriteLock.h b/modules/juce_core/threads/juce_ScopedWriteLock.h index 52539fb7bb..7a9e8e53ef 100644 --- a/modules/juce_core/threads/juce_ScopedWriteLock.h +++ b/modules/juce_core/threads/juce_ScopedWriteLock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -78,3 +78,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ScopedWriteLock) }; + +} diff --git a/modules/juce_core/threads/juce_SpinLock.h b/modules/juce_core/threads/juce_SpinLock.h index 5454006adb..f79a6e5afd 100644 --- a/modules/juce_core/threads/juce_SpinLock.h +++ b/modules/juce_core/threads/juce_SpinLock.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -79,3 +79,5 @@ private: JUCE_DECLARE_NON_COPYABLE (SpinLock) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_Thread.cpp b/modules/juce_core/threads/juce_Thread.cpp index fa2b26a12d..8195ce7f49 100644 --- a/modules/juce_core/threads/juce_Thread.cpp +++ b/modules/juce_core/threads/juce_Thread.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + Thread::Thread (const String& name, size_t stackSize) : threadName (name), threadStackSize (stackSize) { @@ -503,3 +506,5 @@ private: ThreadLocalValueUnitTest threadLocalValueUnitTest; #endif + +} // namespace juce diff --git a/modules/juce_core/threads/juce_Thread.h b/modules/juce_core/threads/juce_Thread.h index e5d1a49230..e4baa969d6 100644 --- a/modules/juce_core/threads/juce_Thread.h +++ b/modules/juce_core/threads/juce_Thread.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -330,3 +330,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Thread) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ThreadLocalValue.h b/modules/juce_core/threads/juce_ThreadLocalValue.h index 2b6d4fe028..ca2630976d 100644 --- a/modules/juce_core/threads/juce_ThreadLocalValue.h +++ b/modules/juce_core/threads/juce_ThreadLocalValue.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -143,3 +144,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ThreadLocalValue) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ThreadPool.cpp b/modules/juce_core/threads/juce_ThreadPool.cpp index f12300155f..4cee61dabf 100644 --- a/modules/juce_core/threads/juce_ThreadPool.cpp +++ b/modules/juce_core/threads/juce_ThreadPool.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class ThreadPool::ThreadPoolThread : public Thread { public: @@ -419,3 +422,5 @@ void ThreadPool::addToDeleteList (OwnedArray& deletionList, Threa if (job->shouldBeDeleted) deletionList.add (job); } + +} // namespace juce diff --git a/modules/juce_core/threads/juce_ThreadPool.h b/modules/juce_core/threads/juce_ThreadPool.h index 6dda3ed939..9ead49c864 100644 --- a/modules/juce_core/threads/juce_ThreadPool.h +++ b/modules/juce_core/threads/juce_ThreadPool.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class ThreadPool; class ThreadPoolThread; @@ -328,3 +329,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPool) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_TimeSliceThread.cpp b/modules/juce_core/threads/juce_TimeSliceThread.cpp index 94ecca528f..d5c4c227e5 100644 --- a/modules/juce_core/threads/juce_TimeSliceThread.cpp +++ b/modules/juce_core/threads/juce_TimeSliceThread.cpp @@ -20,9 +20,10 @@ ============================================================================== */ -TimeSliceThread::TimeSliceThread (const String& name) - : Thread (name), - clientBeingCalled (nullptr) +namespace juce +{ + +TimeSliceThread::TimeSliceThread (const String& name) : Thread (name) { } @@ -179,3 +180,5 @@ void TimeSliceThread::run() wait (timeToWait); } } + +} // namespace juce diff --git a/modules/juce_core/threads/juce_TimeSliceThread.h b/modules/juce_core/threads/juce_TimeSliceThread.h index 7a3ad7791e..53648b69c5 100644 --- a/modules/juce_core/threads/juce_TimeSliceThread.h +++ b/modules/juce_core/threads/juce_TimeSliceThread.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class TimeSliceThread; @@ -135,9 +136,11 @@ public: private: CriticalSection callbackLock, listLock; Array clients; - TimeSliceClient* clientBeingCalled; + TimeSliceClient* clientBeingCalled = nullptr; TimeSliceClient* getNextClient (int index) const; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TimeSliceThread) }; + +} // namespace juce diff --git a/modules/juce_core/threads/juce_WaitableEvent.h b/modules/juce_core/threads/juce_WaitableEvent.h index 55900a268d..e13ec398d9 100644 --- a/modules/juce_core/threads/juce_WaitableEvent.h +++ b/modules/juce_core/threads/juce_WaitableEvent.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -106,3 +106,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WaitableEvent) }; + +} // namespace juce diff --git a/modules/juce_core/time/juce_PerformanceCounter.cpp b/modules/juce_core/time/juce_PerformanceCounter.cpp index 6c3c3bbdd6..4650e16f17 100644 --- a/modules/juce_core/time/juce_PerformanceCounter.cpp +++ b/modules/juce_core/time/juce_PerformanceCounter.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + static void appendToFile (const File& f, const String& s) { if (f.getFullPathName().isNotEmpty()) @@ -124,3 +127,5 @@ PerformanceCounter::Statistics PerformanceCounter::getStatisticsAndReset() return s; } + +} // namespace juce diff --git a/modules/juce_core/time/juce_PerformanceCounter.h b/modules/juce_core/time/juce_PerformanceCounter.h index 7108b0f874..506a490442 100644 --- a/modules/juce_core/time/juce_PerformanceCounter.h +++ b/modules/juce_core/time/juce_PerformanceCounter.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A timer for measuring performance of code and dumping the results to a file. @@ -157,3 +157,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ScopedTimeMeasurement) }; + +} // namespace juce diff --git a/modules/juce_core/time/juce_RelativeTime.cpp b/modules/juce_core/time/juce_RelativeTime.cpp index 013a1fc26f..3dc2fd4da9 100644 --- a/modules/juce_core/time/juce_RelativeTime.cpp +++ b/modules/juce_core/time/juce_RelativeTime.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + RelativeTime::RelativeTime (const double secs) noexcept : numSeconds (secs) {} RelativeTime::RelativeTime (const RelativeTime& other) noexcept : numSeconds (other.numSeconds) {} RelativeTime::~RelativeTime() noexcept {} @@ -131,3 +134,5 @@ String RelativeTime::getDescription (const String& returnValueForZeroTime) const return result.trimEnd(); } + +} // namespace juce diff --git a/modules/juce_core/time/juce_RelativeTime.h b/modules/juce_core/time/juce_RelativeTime.h index 9700d9aa29..7ccbce2cd1 100644 --- a/modules/juce_core/time/juce_RelativeTime.h +++ b/modules/juce_core/time/juce_RelativeTime.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A relative measure of time. @@ -171,3 +171,5 @@ JUCE_API bool JUCE_CALLTYPE operator<= (RelativeTime t1, RelativeTime t2) noexce JUCE_API RelativeTime JUCE_CALLTYPE operator+ (RelativeTime t1, RelativeTime t2) noexcept; /** Subtracts two RelativeTimes. */ JUCE_API RelativeTime JUCE_CALLTYPE operator- (RelativeTime t1, RelativeTime t2) noexcept; + +} // namespace juce diff --git a/modules/juce_core/time/juce_Time.cpp b/modules/juce_core/time/juce_Time.cpp index 2e78b58edb..dfa54dfa77 100644 --- a/modules/juce_core/time/juce_Time.cpp +++ b/modules/juce_core/time/juce_Time.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + namespace TimeHelpers { static std::tm millisToLocal (int64 millis) noexcept @@ -679,3 +682,5 @@ public: static TimeTests timeTests; #endif + +} // namespace juce diff --git a/modules/juce_core/time/juce_Time.h b/modules/juce_core/time/juce_Time.h index c38321b5a0..2ff37375b5 100644 --- a/modules/juce_core/time/juce_Time.h +++ b/modules/juce_core/time/juce_Time.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -403,3 +403,5 @@ JUCE_API bool operator<= (Time time1, Time time2) noexcept; JUCE_API bool operator> (Time time1, Time time2) noexcept; /** Compares two Time objects. */ JUCE_API bool operator>= (Time time1, Time time2) noexcept; + +} // namespace juce diff --git a/modules/juce_core/unit_tests/juce_UnitTest.cpp b/modules/juce_core/unit_tests/juce_UnitTest.cpp index 2ed41b9813..9e9150ee63 100644 --- a/modules/juce_core/unit_tests/juce_UnitTest.cpp +++ b/modules/juce_core/unit_tests/juce_UnitTest.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + UnitTest::UnitTest (const String& nm, const String& ctg) : name (nm), category (ctg), runner (nullptr) { @@ -286,3 +289,5 @@ void UnitTestRunner::addFail (const String& failureMessage) if (assertOnFailure) { jassertfalse; } } + +} // namespace juce diff --git a/modules/juce_core/unit_tests/juce_UnitTest.h b/modules/juce_core/unit_tests/juce_UnitTest.h index 68c4459818..9a9580b836 100644 --- a/modules/juce_core/unit_tests/juce_UnitTest.h +++ b/modules/juce_core/unit_tests/juce_UnitTest.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class UnitTestRunner; @@ -431,3 +432,5 @@ private: JUCE_DECLARE_NON_COPYABLE (UnitTestRunner) }; + +} // namespace juce diff --git a/modules/juce_core/xml/juce_XmlDocument.cpp b/modules/juce_core/xml/juce_XmlDocument.cpp index e522a45a83..b3268dfc7c 100644 --- a/modules/juce_core/xml/juce_XmlDocument.cpp +++ b/modules/juce_core/xml/juce_XmlDocument.cpp @@ -20,23 +20,16 @@ ============================================================================== */ +namespace juce +{ + XmlDocument::XmlDocument (const String& documentText) - : originalText (documentText), - input (nullptr), - outOfData (false), - errorOccurred (false), - needToLoadDTD (false), - ignoreEmptyTextElements (true) + : originalText (documentText) { } XmlDocument::XmlDocument (const File& file) - : input (nullptr), - outOfData (false), - errorOccurred (false), - needToLoadDTD (false), - ignoreEmptyTextElements (true), - inputSource (new FileInputSource (file)) + : inputSource (new FileInputSource (file)) { } @@ -883,3 +876,5 @@ String XmlDocument::getParameterEntity (const String& entity) return entity; } + +} diff --git a/modules/juce_core/xml/juce_XmlDocument.h b/modules/juce_core/xml/juce_XmlDocument.h index 6d0bd62174..e09bd63584 100644 --- a/modules/juce_core/xml/juce_XmlDocument.h +++ b/modules/juce_core/xml/juce_XmlDocument.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -143,12 +143,11 @@ public: //============================================================================== private: String originalText; - String::CharPointerType input; - bool outOfData, errorOccurred; - + String::CharPointerType input { nullptr }; + bool outOfData = false, errorOccurred = false; String lastError, dtdText; StringArray tokenisedDTD; - bool needToLoadDTD, ignoreEmptyTextElements; + bool needToLoadDTD = false, ignoreEmptyTextElements = true; ScopedPointer inputSource; XmlElement* parseDocumentElement (String::CharPointerType, bool outer); @@ -169,3 +168,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (XmlDocument) }; + +} // namespace juce diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index 04e81b6da2..b04e307282 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -20,38 +20,38 @@ ============================================================================== */ -namespace +namespace juce { - inline bool isValidXmlNameStartCharacter (const juce_wchar character) noexcept - { - return character == ':' - || character == '_' - || (character >= 'a' && character <= 'z') - || (character >= 'A' && character <= 'Z') - || (character >= 0xc0 && character <= 0xd6) - || (character >= 0xd8 && character <= 0xf6) - || (character >= 0xf8 && character <= 0x2ff) - || (character >= 0x370 && character <= 0x37d) - || (character >= 0x37f && character <= 0x1fff) - || (character >= 0x200c && character <= 0x200d) - || (character >= 0x2070 && character <= 0x218f) - || (character >= 0x2c00 && character <= 0x2fef) - || (character >= 0x3001 && character <= 0xd7ff) - || (character >= 0xf900 && character <= 0xfdcf) - || (character >= 0xfdf0 && character <= 0xfffd) - || (character >= 0x10000 && character <= 0xeffff); - } - inline bool isValidXmlNameBodyCharacter (const juce_wchar character) noexcept - { - return isValidXmlNameStartCharacter (character) - || character == '-' - || character == '.' - || character == 0xb7 - || (character >= '0' && character <= '9') - || (character >= 0x300 && character <= 0x036f) - || (character >= 0x203f && character <= 0x2040); - } +inline static bool isValidXmlNameStartCharacter (juce_wchar character) noexcept +{ + return character == ':' + || character == '_' + || (character >= 'a' && character <= 'z') + || (character >= 'A' && character <= 'Z') + || (character >= 0xc0 && character <= 0xd6) + || (character >= 0xd8 && character <= 0xf6) + || (character >= 0xf8 && character <= 0x2ff) + || (character >= 0x370 && character <= 0x37d) + || (character >= 0x37f && character <= 0x1fff) + || (character >= 0x200c && character <= 0x200d) + || (character >= 0x2070 && character <= 0x218f) + || (character >= 0x2c00 && character <= 0x2fef) + || (character >= 0x3001 && character <= 0xd7ff) + || (character >= 0xf900 && character <= 0xfdcf) + || (character >= 0xfdf0 && character <= 0xfffd) + || (character >= 0x10000 && character <= 0xeffff); +} + +inline static bool isValidXmlNameBodyCharacter (juce_wchar character) noexcept +{ + return isValidXmlNameStartCharacter (character) + || character == '-' + || character == '.' + || character == 0xb7 + || (character >= '0' && character <= '9') + || (character >= 0x300 && character <= 0x036f) + || (character >= 0x203f && character <= 0x2040); } XmlElement::XmlAttributeNode::XmlAttributeNode (const XmlAttributeNode& other) noexcept @@ -928,3 +928,5 @@ void XmlElement::deleteAllTextElements() noexcept child = next; } } + +} // namespace juce diff --git a/modules/juce_core/xml/juce_XmlElement.h b/modules/juce_core/xml/juce_XmlElement.h index 5c1b90fe34..33f86744ec 100644 --- a/modules/juce_core/xml/juce_XmlElement.h +++ b/modules/juce_core/xml/juce_XmlElement.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A handy macro to make it easy to iterate all the child elements in an XmlElement. @@ -762,3 +762,5 @@ private: JUCE_LEAK_DETECTOR (XmlElement) }; + +} // namespace juce diff --git a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp index d8c46bc009..df64f23d2c 100644 --- a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp +++ b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp @@ -20,14 +20,14 @@ ============================================================================== */ +namespace juce +{ + class GZIPCompressorOutputStream::GZIPCompressorHelper { public: GZIPCompressorHelper (const int compressionLevel, const int windowBits) - : compLevel ((compressionLevel < 0 || compressionLevel > 9) ? -1 : compressionLevel), - isFirstDeflate (true), - streamIsValid (false), - finished (false) + : compLevel ((compressionLevel < 0 || compressionLevel > 9) ? -1 : compressionLevel) { using namespace zlibNamespace; zerostruct (stream); @@ -70,7 +70,7 @@ private: zlibNamespace::z_stream stream; const int compLevel; - bool isFirstDeflate, streamIsValid, finished; + bool isFirstDeflate = true, streamIsValid = false, finished = false; zlibNamespace::Bytef buffer[32768]; bool doNextBlock (const uint8*& data, size_t& dataSize, OutputStream& out, const int flushMode) @@ -155,9 +155,8 @@ bool GZIPCompressorOutputStream::setPosition (int64 /*newPosition*/) //============================================================================== #if JUCE_UNIT_TESTS -class GZIPTests : public UnitTest +struct GZIPTests : public UnitTest { -public: GZIPTests() : UnitTest ("GZIP", "Compression") {} void runTest() override @@ -205,3 +204,5 @@ public: static GZIPTests gzipTests; #endif + +} // namespace juce diff --git a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h index ff14f9fcc2..25a28101a6 100644 --- a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h +++ b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -90,3 +90,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPCompressorOutputStream) }; + +} // namespace juce diff --git a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp index 35e7a15042..0bae4d39d6 100644 --- a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp +++ b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4309 4305 4365) @@ -97,12 +100,6 @@ class GZIPDecompressorInputStream::GZIPDecompressHelper { public: GZIPDecompressHelper (Format f) - : finished (true), - needsDictionary (false), - error (true), - streamIsValid (false), - data (nullptr), - dataSize (0) { using namespace zlibNamespace; zerostruct (stream); @@ -112,9 +109,8 @@ public: ~GZIPDecompressHelper() { - using namespace zlibNamespace; if (streamIsValid) - inflateEnd (&stream); + zlibNamespace::inflateEnd (&stream); } bool needsInput() const noexcept { return dataSize <= 0; } @@ -128,6 +124,7 @@ public: int doNextBlock (uint8* const dest, const unsigned int destSize) { using namespace zlibNamespace; + if (streamIsValid && data != nullptr && ! finished) { stream.next_in = data; @@ -176,14 +173,14 @@ public: return MAX_WBITS; } - bool finished, needsDictionary, error, streamIsValid; + bool finished = true, needsDictionary = false, error = true, streamIsValid = false; enum { gzipDecompBufferSize = 32768 }; private: zlibNamespace::z_stream stream; - uint8* data; - size_t dataSize; + uint8* data = nullptr; + size_t dataSize = 0; JUCE_DECLARE_NON_COPYABLE (GZIPDecompressHelper) }; @@ -303,3 +300,5 @@ bool GZIPDecompressorInputStream::setPosition (int64 newPos) skipNextBytes (newPos - currentPos); return true; } + +} // namespace juce diff --git a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h index be0e287310..a7edadc04d 100644 --- a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h +++ b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -98,3 +98,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPDecompressorInputStream) }; + +} // namespace juce diff --git a/modules/juce_core/zip/juce_ZipFile.cpp b/modules/juce_core/zip/juce_ZipFile.cpp index 87e461f14f..78badf8165 100644 --- a/modules/juce_core/zip/juce_ZipFile.cpp +++ b/modules/juce_core/zip/juce_ZipFile.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class ZipFile::ZipEntryHolder { public: @@ -603,3 +606,5 @@ bool ZipFile::Builder::writeToStream (OutputStream& target, double* const progre return true; } + +} // namespace juce diff --git a/modules/juce_core/zip/juce_ZipFile.h b/modules/juce_core/zip/juce_ZipFile.h index ca83230577..4e1c75bf11 100644 --- a/modules/juce_core/zip/juce_ZipFile.h +++ b/modules/juce_core/zip/juce_ZipFile.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -254,3 +254,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ZipFile) }; + +} // namespace juce diff --git a/modules/juce_cryptography/encryption/juce_BlowFish.cpp b/modules/juce_cryptography/encryption/juce_BlowFish.cpp index 7d2f7358f4..ca1b3f3741 100644 --- a/modules/juce_cryptography/encryption/juce_BlowFish.cpp +++ b/modules/juce_cryptography/encryption/juce_BlowFish.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + BlowFish::BlowFish (const void* const keyData, const int keyBytes) { jassert (keyData != nullptr); @@ -466,3 +469,5 @@ public: static BlowFishTests blowFishUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_cryptography/encryption/juce_BlowFish.h b/modules/juce_cryptography/encryption/juce_BlowFish.h index dfa50dd88d..cdabc1ac68 100644 --- a/modules/juce_cryptography/encryption/juce_BlowFish.h +++ b/modules/juce_cryptography/encryption/juce_BlowFish.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_LEAK_DETECTOR (BlowFish) }; + +} // namespace juce diff --git a/modules/juce_cryptography/encryption/juce_Primes.cpp b/modules/juce_cryptography/encryption/juce_Primes.cpp index 16c9ec2232..217f98156f 100644 --- a/modules/juce_cryptography/encryption/juce_Primes.cpp +++ b/modules/juce_cryptography/encryption/juce_Primes.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace PrimesHelpers { static void createSmallSieve (const int numBits, BigInteger& result) @@ -238,3 +241,5 @@ bool Primes::isProbablyPrime (const BigInteger& number, const int certainty) return passesMillerRabin (number, certainty); } } + +} // namespace juce diff --git a/modules/juce_cryptography/encryption/juce_Primes.h b/modules/juce_cryptography/encryption/juce_Primes.h index 904c92d073..7adcddb0cb 100644 --- a/modules/juce_cryptography/encryption/juce_Primes.h +++ b/modules/juce_cryptography/encryption/juce_Primes.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -69,3 +69,5 @@ private: JUCE_DECLARE_NON_COPYABLE (Primes) }; + +} // namespace juce diff --git a/modules/juce_cryptography/encryption/juce_RSAKey.cpp b/modules/juce_cryptography/encryption/juce_RSAKey.cpp index 6536cd64fe..7e7735a7d1 100644 --- a/modules/juce_cryptography/encryption/juce_RSAKey.cpp +++ b/modules/juce_cryptography/encryption/juce_RSAKey.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + RSAKey::RSAKey() { } @@ -135,3 +138,5 @@ void RSAKey::createKeyPair (RSAKey& publicKey, RSAKey& privateKey, privateKey.part1 = d; privateKey.part2 = n; } + +} // namespace juce diff --git a/modules/juce_cryptography/encryption/juce_RSAKey.h b/modules/juce_cryptography/encryption/juce_RSAKey.h index 6927175e93..334513ea0f 100644 --- a/modules/juce_cryptography/encryption/juce_RSAKey.h +++ b/modules/juce_cryptography/encryption/juce_RSAKey.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -170,3 +170,5 @@ private: JUCE_LEAK_DETECTOR (RSAKey) }; + +} // namespace juce diff --git a/modules/juce_cryptography/hashing/juce_MD5.cpp b/modules/juce_cryptography/hashing/juce_MD5.cpp index c4f7f86393..d139393b00 100644 --- a/modules/juce_cryptography/hashing/juce_MD5.cpp +++ b/modules/juce_cryptography/hashing/juce_MD5.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class MD5Generator { public: @@ -336,3 +339,5 @@ public: static MD5Tests MD5UnitTests; #endif + +} // namespace juce diff --git a/modules/juce_cryptography/hashing/juce_MD5.h b/modules/juce_cryptography/hashing/juce_MD5.h index 0eed61e8cb..ffd22f8f47 100644 --- a/modules/juce_cryptography/hashing/juce_MD5.h +++ b/modules/juce_cryptography/hashing/juce_MD5.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -115,3 +115,5 @@ private: JUCE_LEAK_DETECTOR (MD5) }; + +} // namespace juce diff --git a/modules/juce_cryptography/hashing/juce_SHA256.cpp b/modules/juce_cryptography/hashing/juce_SHA256.cpp index 4173e4c644..8504eaa8fc 100644 --- a/modules/juce_cryptography/hashing/juce_SHA256.cpp +++ b/modules/juce_cryptography/hashing/juce_SHA256.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class SHA256Processor { public: @@ -275,3 +278,5 @@ public: static SHA256Tests sha256UnitTests; #endif + +} // namespace juce diff --git a/modules/juce_cryptography/hashing/juce_SHA256.h b/modules/juce_cryptography/hashing/juce_SHA256.h index 5c30cae3c2..de56d5e9c1 100644 --- a/modules/juce_cryptography/hashing/juce_SHA256.h +++ b/modules/juce_cryptography/hashing/juce_SHA256.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -103,3 +103,5 @@ private: JUCE_LEAK_DETECTOR (SHA256) }; + +} // namespace juce diff --git a/modules/juce_cryptography/hashing/juce_Whirlpool.cpp b/modules/juce_cryptography/hashing/juce_Whirlpool.cpp index de4474fbbd..0078ceda4c 100644 --- a/modules/juce_cryptography/hashing/juce_Whirlpool.cpp +++ b/modules/juce_cryptography/hashing/juce_Whirlpool.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct WhirlpoolProcessor { WhirlpoolProcessor() noexcept : bufferBits (0), bufferPos (0) @@ -661,3 +664,5 @@ public: static WhirlpoolTests whirlpoolUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_cryptography/hashing/juce_Whirlpool.h b/modules/juce_cryptography/hashing/juce_Whirlpool.h index a6912d557c..b04622fbaa 100644 --- a/modules/juce_cryptography/hashing/juce_Whirlpool.h +++ b/modules/juce_cryptography/hashing/juce_Whirlpool.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -109,3 +109,5 @@ private: JUCE_LEAK_DETECTOR (Whirlpool) }; + +} // namespace juce diff --git a/modules/juce_cryptography/juce_cryptography.cpp b/modules/juce_cryptography/juce_cryptography.cpp index 931013b442..e9cf86f33c 100644 --- a/modules/juce_cryptography/juce_cryptography.cpp +++ b/modules/juce_cryptography/juce_cryptography.cpp @@ -35,14 +35,9 @@ #include "juce_cryptography.h" -namespace juce -{ - #include "encryption/juce_BlowFish.cpp" #include "encryption/juce_Primes.cpp" #include "encryption/juce_RSAKey.cpp" #include "hashing/juce_MD5.cpp" #include "hashing/juce_SHA256.cpp" #include "hashing/juce_Whirlpool.cpp" - -} diff --git a/modules/juce_cryptography/juce_cryptography.h b/modules/juce_cryptography/juce_cryptography.h index 269777f772..07b5494658 100644 --- a/modules/juce_cryptography/juce_cryptography.h +++ b/modules/juce_cryptography/juce_cryptography.h @@ -54,14 +54,9 @@ //============================================================================== #include -namespace juce -{ - #include "encryption/juce_BlowFish.h" #include "encryption/juce_Primes.h" #include "encryption/juce_RSAKey.h" #include "hashing/juce_MD5.h" #include "hashing/juce_SHA256.h" #include "hashing/juce_Whirlpool.h" - -} diff --git a/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp b/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp index e120a1469d..eca113fb41 100644 --- a/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp +++ b/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ApplicationProperties::ApplicationProperties() : commonSettingsAreReadOnly (0) { @@ -102,3 +105,5 @@ void ApplicationProperties::closeFiles() userProps = nullptr; commonProps = nullptr; } + +} // namespace juce diff --git a/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h b/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h index b65e5854d7..faa3817c43 100644 --- a/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h +++ b/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -128,3 +128,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ApplicationProperties) }; + +} // namespace juce diff --git a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp index 666710f865..d964fb9cdd 100644 --- a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp +++ b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace PropertyFileConstants { JUCE_CONSTEXPR static const int magicNumber = (int) ByteOrder::littleEndianInt ('P', 'R', 'O', 'P'); @@ -356,3 +359,5 @@ void PropertiesFile::propertyChanged() else if (options.millisecondsBeforeSaving == 0) saveIfNeeded(); } + +} // namespace juce diff --git a/modules/juce_data_structures/app_properties/juce_PropertiesFile.h b/modules/juce_data_structures/app_properties/juce_PropertiesFile.h index bc29a13659..2848c5bb2c 100644 --- a/modules/juce_data_structures/app_properties/juce_PropertiesFile.h +++ b/modules/juce_data_structures/app_properties/juce_PropertiesFile.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Wrapper on a file that stores a list of key/value data pairs. @@ -248,3 +248,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PropertiesFile) }; + +} // namespace juce diff --git a/modules/juce_data_structures/juce_data_structures.cpp b/modules/juce_data_structures/juce_data_structures.cpp index 7b3a3c497c..5913ca47f5 100644 --- a/modules/juce_data_structures/juce_data_structures.cpp +++ b/modules/juce_data_structures/juce_data_structures.cpp @@ -35,9 +35,6 @@ #include "juce_data_structures.h" -namespace juce -{ - #include "values/juce_Value.cpp" #include "values/juce_ValueTree.cpp" #include "values/juce_ValueTreeSynchroniser.cpp" @@ -45,5 +42,3 @@ namespace juce #include "undomanager/juce_UndoManager.cpp" #include "app_properties/juce_ApplicationProperties.cpp" #include "app_properties/juce_PropertiesFile.cpp" - -} diff --git a/modules/juce_data_structures/juce_data_structures.h b/modules/juce_data_structures/juce_data_structures.h index 0692f4682a..183df62279 100644 --- a/modules/juce_data_structures/juce_data_structures.h +++ b/modules/juce_data_structures/juce_data_structures.h @@ -54,9 +54,6 @@ //============================================================================== #include -namespace juce -{ - #include "undomanager/juce_UndoableAction.h" #include "undomanager/juce_UndoManager.h" #include "values/juce_Value.h" @@ -65,5 +62,3 @@ namespace juce #include "values/juce_CachedValue.h" #include "app_properties/juce_PropertiesFile.h" #include "app_properties/juce_ApplicationProperties.h" - -} diff --git a/modules/juce_data_structures/undomanager/juce_UndoManager.cpp b/modules/juce_data_structures/undomanager/juce_UndoManager.cpp index 5c0fb525f8..a5a705a32e 100644 --- a/modules/juce_data_structures/undomanager/juce_UndoManager.cpp +++ b/modules/juce_data_structures/undomanager/juce_UndoManager.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct UndoManager::ActionSet { ActionSet (const String& transactionName) @@ -345,3 +348,5 @@ int UndoManager::getNumActionsInCurrentTransaction() const return 0; } + +} // namespace juce diff --git a/modules/juce_data_structures/undomanager/juce_UndoManager.h b/modules/juce_data_structures/undomanager/juce_UndoManager.h index 1cca8518a1..75f3d0f30d 100644 --- a/modules/juce_data_structures/undomanager/juce_UndoManager.h +++ b/modules/juce_data_structures/undomanager/juce_UndoManager.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -242,3 +242,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UndoManager) }; + +} // namespace juce diff --git a/modules/juce_data_structures/undomanager/juce_UndoableAction.h b/modules/juce_data_structures/undomanager/juce_UndoableAction.h index b5447210e5..9b418cd4ff 100644 --- a/modules/juce_data_structures/undomanager/juce_UndoableAction.h +++ b/modules/juce_data_structures/undomanager/juce_UndoableAction.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -95,3 +95,5 @@ public: */ virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { ignoreUnused (nextAction); return nullptr; } }; + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_CachedValue.cpp b/modules/juce_data_structures/values/juce_CachedValue.cpp index b8ecbcc34d..ace2c41de7 100644 --- a/modules/juce_data_structures/values/juce_CachedValue.cpp +++ b/modules/juce_data_structures/values/juce_CachedValue.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_UNIT_TESTS class CachedValueTests : public UnitTest @@ -152,3 +155,5 @@ public: static CachedValueTests cachedValueTests; #endif + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_CachedValue.h b/modules/juce_data_structures/values/juce_CachedValue.h index f2725b6a8e..7a807df300 100644 --- a/modules/juce_data_structures/values/juce_CachedValue.h +++ b/modules/juce_data_structures/values/juce_CachedValue.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -308,3 +308,5 @@ inline void CachedValue::valueTreePropertyChanged (ValueTree& changedTree, if (changedProperty == targetProperty && targetTree == changedTree) forceUpdateOfCachedValue(); } + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_Value.cpp b/modules/juce_data_structures/values/juce_Value.cpp index 19e678871c..b09530fed6 100644 --- a/modules/juce_data_structures/values/juce_Value.cpp +++ b/modules/juce_data_structures/values/juce_Value.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Value::ValueSource::ValueSource() { } @@ -235,3 +238,5 @@ OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const Value& value { return stream << value.toString(); } + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_Value.h b/modules/juce_data_structures/values/juce_Value.h index d470a9da73..e1216da45c 100644 --- a/modules/juce_data_structures/values/juce_Value.h +++ b/modules/juce_data_structures/values/juce_Value.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -239,3 +239,5 @@ OutputStream& JUCE_CALLTYPE operator<< (OutputStream&, const Value&); /** This typedef is just for compatibility with old code - newer code should use the Value::Listener class directly. */ typedef Value::Listener ValueListener; + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index afe068d16d..b1e596e354 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ValueTree::SharedObject : public ReferenceCountedObject { public: @@ -1144,3 +1147,5 @@ public: static ValueTreeTests valueTreeTests; #endif + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_ValueTree.h b/modules/juce_data_structures/values/juce_ValueTree.h index 7c3e3eccfc..d0a66f0cff 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.h +++ b/modules/juce_data_structures/values/juce_ValueTree.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -574,3 +574,5 @@ private: explicit ValueTree (SharedObject*) noexcept; }; + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp b/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp index d29b692b4c..7e49e712fb 100644 --- a/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp +++ b/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace ValueTreeSynchroniserHelpers { enum ChangeType @@ -235,3 +238,5 @@ bool ValueTreeSynchroniser::applyChange (ValueTree& root, const void* data, size return false; } + +} // namespace juce diff --git a/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h b/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h index 0867a56e95..42c3823602 100644 --- a/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h +++ b/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -93,3 +93,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ValueTreeSynchroniser) }; + +} // namespace juce diff --git a/modules/juce_dsp/containers/juce_AudioBlock.h b/modules/juce_dsp/containers/juce_AudioBlock.h index cd4ccd2daa..b8a40f23af 100644 --- a/modules/juce_dsp/containers/juce_AudioBlock.h +++ b/modules/juce_dsp/containers/juce_AudioBlock.h @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + #ifndef DOXYGEN namespace SampleTypeHelpers // Internal classes needed for handling sample type classes { @@ -539,3 +544,6 @@ private: ChannelCountType numChannels = 0; size_t startSample = 0, numSamples = 0; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/containers/juce_SIMDRegister.h b/modules/juce_dsp/containers/juce_SIMDRegister.h index 1eb4964a73..42840ee39b 100644 --- a/modules/juce_dsp/containers/juce_SIMDRegister.h +++ b/modules/juce_dsp/containers/juce_SIMDRegister.h @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + #ifndef DOXYGEN // This class is needed internally. template @@ -395,13 +400,12 @@ struct CmplxSIMDOps > } #endif -//============================================================================== -// Extend some common used global functions to SIMDRegister types -} // close namespace dsp +} // namespace dsp +// Extend some common used global functions to SIMDRegister types template inline dsp::SIMDRegister JUCE_VECTOR_CALLTYPE jmin (dsp::SIMDRegister a, dsp::SIMDRegister b) { return dsp::SIMDRegister::min (a, b); } template inline dsp::SIMDRegister JUCE_VECTOR_CALLTYPE jmax (dsp::SIMDRegister a, dsp::SIMDRegister b) { return dsp::SIMDRegister::max (a, b); } -namespace dsp { +} // namespace juce diff --git a/modules/juce_dsp/containers/juce_SIMDRegister_test.cpp b/modules/juce_dsp/containers/juce_SIMDRegister_test.cpp index 38e0df9724..49bd48eaee 100644 --- a/modules/juce_dsp/containers/juce_SIMDRegister_test.cpp +++ b/modules/juce_dsp/containers/juce_SIMDRegister_test.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ namespace SIMDRegister_test_internal { @@ -667,3 +671,6 @@ public: }; static SIMDRegisterUnitTests SIMDRegisterUnitTests; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/filter_design/juce_FilterDesign.cpp b/modules/juce_dsp/filter_design/juce_FilterDesign.cpp index 38e296e51e..f961fcabaa 100644 --- a/modules/juce_dsp/filter_design/juce_FilterDesign.cpp +++ b/modules/juce_dsp/filter_design/juce_FilterDesign.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ template typename FIR::Coefficients::Ptr @@ -616,3 +620,6 @@ typename FilterDesign::IIRPolyphaseAllpassStructure template struct FilterDesign; template struct FilterDesign; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/filter_design/juce_FilterDesign.h b/modules/juce_dsp/filter_design/juce_FilterDesign.h index abc19aff2c..5ab6aa9d36 100644 --- a/modules/juce_dsp/filter_design/juce_FilterDesign.h +++ b/modules/juce_dsp/filter_design/juce_FilterDesign.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** This class provides a set of functions which generates FIR::Coefficients @@ -257,3 +261,6 @@ private: FloatType stopbandAttenuationdB); FilterDesign() = delete; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/frequency/juce_Convolution.cpp b/modules/juce_dsp/frequency/juce_Convolution.cpp index 8dd3f21b2e..e09dc73df9 100644 --- a/modules/juce_dsp/frequency/juce_Convolution.cpp +++ b/modules/juce_dsp/frequency/juce_Convolution.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** This class is the convolution engine itself, processing only one channel at a time of input signal. @@ -1141,3 +1145,6 @@ void Convolution::processSamples (const AudioBlock& input, AudioBlock (size)); } + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/frequency/juce_FFT.h b/modules/juce_dsp/frequency/juce_FFT.h index 6b0ece8955..7879684d7c 100644 --- a/modules/juce_dsp/frequency/juce_FFT.h +++ b/modules/juce_dsp/frequency/juce_FFT.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Performs a fast fourier transform. @@ -111,3 +115,6 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FFT) }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/frequency/juce_FFT_test.cpp b/modules/juce_dsp/frequency/juce_FFT_test.cpp index 056560dc97..0bf3b1c156 100644 --- a/modules/juce_dsp/frequency/juce_FFT_test.cpp +++ b/modules/juce_dsp/frequency/juce_FFT_test.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ struct FFTUnitTest : public UnitTest { @@ -204,3 +208,6 @@ struct FFTUnitTest : public UnitTest }; static FFTUnitTest fftUnitTest; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/frequency/juce_Windowing.cpp b/modules/juce_dsp/frequency/juce_Windowing.cpp index bf3fa0531f..0c563d54a4 100644 --- a/modules/juce_dsp/frequency/juce_Windowing.cpp +++ b/modules/juce_dsp/frequency/juce_Windowing.cpp @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + template static inline FloatType ncos (size_t order, size_t i, size_t size) noexcept { @@ -184,3 +189,6 @@ const char* WindowingFunction::getWindowingMethodName (WindowingMetho template struct WindowingFunction; template struct WindowingFunction; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/frequency/juce_Windowing.h b/modules/juce_dsp/frequency/juce_Windowing.h index 09aa720867..81c9ea247c 100644 --- a/modules/juce_dsp/frequency/juce_Windowing.h +++ b/modules/juce_dsp/frequency/juce_Windowing.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** A class which provides multiple windowing functions useful for filter design @@ -71,3 +75,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WindowingFunction) }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/juce_dsp.cpp b/modules/juce_dsp/juce_dsp.cpp index fd9dea4cc1..1545ee54c5 100644 --- a/modules/juce_dsp/juce_dsp.cpp +++ b/modules/juce_dsp/juce_dsp.cpp @@ -49,42 +49,36 @@ #include #endif -namespace juce -{ - namespace dsp - { - #include "processors/juce_FIRFilter.cpp" - #include "processors/juce_IIRFilter.cpp" - #include "processors/juce_Oversampling.cpp" - #include "maths/juce_SpecialFunctions.cpp" - #include "maths/juce_Matrix.cpp" - #include "maths/juce_LookupTable.cpp" - #include "frequency/juce_FFT.cpp" - #include "frequency/juce_Convolution.cpp" - #include "frequency/juce_Windowing.cpp" - #include "filter_design/juce_FilterDesign.cpp" +#include "processors/juce_FIRFilter.cpp" +#include "processors/juce_IIRFilter.cpp" +#include "processors/juce_Oversampling.cpp" +#include "maths/juce_SpecialFunctions.cpp" +#include "maths/juce_Matrix.cpp" +#include "maths/juce_LookupTable.cpp" +#include "frequency/juce_FFT.cpp" +#include "frequency/juce_Convolution.cpp" +#include "frequency/juce_Windowing.cpp" +#include "filter_design/juce_FilterDesign.cpp" - #if JUCE_USE_SIMD - #if defined(__i386__) || defined(__amd64__) || defined(_M_X64) || defined(_X86_) || defined(_M_IX86) - #ifdef __AVX2__ - #include "native/juce_avx_SIMDNativeOps.cpp" - #else - #include "native/juce_sse_SIMDNativeOps.cpp" - #endif - #elif defined(__arm__) || defined(_M_ARM) || defined (__arm64__) || defined (__aarch64__) - #include "native/juce_neon_SIMDNativeOps.cpp" - #else - #error "SIMD register support not implemented for this platform" - #endif - #endif +#if JUCE_USE_SIMD +#if defined(__i386__) || defined(__amd64__) || defined(_M_X64) || defined(_X86_) || defined(_M_IX86) + #ifdef __AVX2__ + #include "native/juce_avx_SIMDNativeOps.cpp" + #else + #include "native/juce_sse_SIMDNativeOps.cpp" + #endif +#elif defined(__arm__) || defined(_M_ARM) || defined (__arm64__) || defined (__aarch64__) + #include "native/juce_neon_SIMDNativeOps.cpp" +#else + #error "SIMD register support not implemented for this platform" +#endif +#endif - #if JUCE_UNIT_TESTS - #include "maths/juce_Matrix_test.cpp" - #if JUCE_USE_SIMD - #include "containers/juce_SIMDRegister_test.cpp" - #endif - #include "frequency/juce_FFT_test.cpp" - #include "processors/juce_FIRFilter_test.cpp" - #endif - } -} +#if JUCE_UNIT_TESTS +#include "maths/juce_Matrix_test.cpp" +#if JUCE_USE_SIMD +#include "containers/juce_SIMDRegister_test.cpp" +#endif +#include "frequency/juce_FFT_test.cpp" +#include "processors/juce_FIRFilter_test.cpp" +#endif diff --git a/modules/juce_dsp/juce_dsp.h b/modules/juce_dsp/juce_dsp.h index d0c803b128..4566489153 100644 --- a/modules/juce_dsp/juce_dsp.h +++ b/modules/juce_dsp/juce_dsp.h @@ -167,12 +167,13 @@ #endif //============================================================================== +#undef Complex // apparently some C libraries actually define these symbols (!) +#undef Factor + namespace juce { namespace dsp { - #undef Complex // apparently some C libraries actually define these symbols (!) - #undef Factor template using Complex = ::std::complex; @@ -190,48 +191,48 @@ namespace juce inline void snapToZero (long double& x) noexcept { JUCE_SNAP_TO_ZERO (x); } #endif } - - //============================================================================== - #if JUCE_USE_SIMD - #include "native/juce_fallback_SIMDNativeOps.h" - - // include the correct native file for this build target CPU - #if defined(__i386__) || defined(__amd64__) || defined(_M_X64) || defined(_X86_) || defined(_M_IX86) - #ifdef __AVX2__ - #include "native/juce_avx_SIMDNativeOps.h" - #else - #include "native/juce_sse_SIMDNativeOps.h" - #endif - #elif defined(__arm__) || defined(_M_ARM) || defined (__arm64__) || defined (__aarch64__) - #include "native/juce_neon_SIMDNativeOps.h" - #else - #error "SIMD register support not implemented for this platform" - #endif - - #include "containers/juce_SIMDRegister.h" - #endif - - #include "maths/juce_SpecialFunctions.h" - #include "maths/juce_Matrix.h" - #include "maths/juce_Polynomial.h" - #include "maths/juce_FastMathApproximations.h" - #include "maths/juce_LookupTable.h" - #include "containers/juce_AudioBlock.h" - #include "processors/juce_ProcessContext.h" - #include "processors/juce_ProcessorWrapper.h" - #include "processors/juce_ProcessorChain.h" - #include "processors/juce_ProcessorDuplicator.h" - #include "processors/juce_Bias.h" - #include "processors/juce_Gain.h" - #include "processors/juce_WaveShaper.h" - #include "processors/juce_IIRFilter.h" - #include "processors/juce_FIRFilter.h" - #include "processors/juce_Oscillator.h" - #include "processors/juce_StateVariableFilter.h" - #include "processors/juce_Oversampling.h" - #include "frequency/juce_FFT.h" - #include "frequency/juce_Convolution.h" - #include "frequency/juce_Windowing.h" - #include "filter_design/juce_FilterDesign.h" } } + +//============================================================================== +#if JUCE_USE_SIMD + #include "native/juce_fallback_SIMDNativeOps.h" + + // include the correct native file for this build target CPU + #if defined(__i386__) || defined(__amd64__) || defined(_M_X64) || defined(_X86_) || defined(_M_IX86) + #ifdef __AVX2__ + #include "native/juce_avx_SIMDNativeOps.h" + #else + #include "native/juce_sse_SIMDNativeOps.h" + #endif + #elif defined(__arm__) || defined(_M_ARM) || defined (__arm64__) || defined (__aarch64__) + #include "native/juce_neon_SIMDNativeOps.h" + #else + #error "SIMD register support not implemented for this platform" + #endif + + #include "containers/juce_SIMDRegister.h" +#endif + +#include "maths/juce_SpecialFunctions.h" +#include "maths/juce_Matrix.h" +#include "maths/juce_Polynomial.h" +#include "maths/juce_FastMathApproximations.h" +#include "maths/juce_LookupTable.h" +#include "containers/juce_AudioBlock.h" +#include "processors/juce_ProcessContext.h" +#include "processors/juce_ProcessorWrapper.h" +#include "processors/juce_ProcessorChain.h" +#include "processors/juce_ProcessorDuplicator.h" +#include "processors/juce_Bias.h" +#include "processors/juce_Gain.h" +#include "processors/juce_WaveShaper.h" +#include "processors/juce_IIRFilter.h" +#include "processors/juce_FIRFilter.h" +#include "processors/juce_Oscillator.h" +#include "processors/juce_StateVariableFilter.h" +#include "processors/juce_Oversampling.h" +#include "frequency/juce_FFT.h" +#include "frequency/juce_Convolution.h" +#include "frequency/juce_Windowing.h" +#include "filter_design/juce_FilterDesign.h" diff --git a/modules/juce_dsp/maths/juce_FastMathApproximations.h b/modules/juce_dsp/maths/juce_FastMathApproximations.h index 0b59afea8c..3be0473c23 100644 --- a/modules/juce_dsp/maths/juce_FastMathApproximations.h +++ b/modules/juce_dsp/maths/juce_FastMathApproximations.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** This class contains various fast mathematical function approximations. @@ -254,3 +258,6 @@ struct FastMathApproximations values[i] = FastMathApproximations::logNPlusOne (values[i]); } }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_LookupTable.cpp b/modules/juce_dsp/maths/juce_LookupTable.cpp index 8d0a6e0bf7..21fe2563bb 100644 --- a/modules/juce_dsp/maths/juce_LookupTable.cpp +++ b/modules/juce_dsp/maths/juce_LookupTable.cpp @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + template LookupTable::LookupTable() { @@ -147,3 +152,6 @@ template class LookupTable; template class LookupTableTransform; template class LookupTableTransform; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_LookupTable.h b/modules/juce_dsp/maths/juce_LookupTable.h index f6dba351db..a4d4061f69 100644 --- a/modules/juce_dsp/maths/juce_LookupTable.h +++ b/modules/juce_dsp/maths/juce_LookupTable.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Class for efficiently approximating expensive arithmetic operations. @@ -319,3 +323,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookupTableTransform) }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_Matrix.cpp b/modules/juce_dsp/maths/juce_Matrix.cpp index 19fa3a57a2..d91859ad09 100644 --- a/modules/juce_dsp/maths/juce_Matrix.cpp +++ b/modules/juce_dsp/maths/juce_Matrix.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ template Matrix Matrix::identity (size_t size) @@ -309,3 +313,6 @@ String Matrix::toString() const template class Matrix; template class Matrix; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_Matrix.h b/modules/juce_dsp/maths/juce_Matrix.h index 756b573970..1d49594741 100644 --- a/modules/juce_dsp/maths/juce_Matrix.h +++ b/modules/juce_dsp/maths/juce_Matrix.h @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + /** General matrix and vectors class, meant for classic math manipulation such as additions, multiplications, and linear systems of equations solving. @@ -243,3 +248,6 @@ private: //============================================================================== JUCE_LEAK_DETECTOR (Matrix) }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_Matrix_test.cpp b/modules/juce_dsp/maths/juce_Matrix_test.cpp index e81bfa4d7f..e9f3357f63 100644 --- a/modules/juce_dsp/maths/juce_Matrix_test.cpp +++ b/modules/juce_dsp/maths/juce_Matrix_test.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ struct LinearAlgebraUnitTest : public UnitTest { @@ -163,3 +167,6 @@ struct LinearAlgebraUnitTest : public UnitTest }; static LinearAlgebraUnitTest linearAlgebraUnitTest; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_Polynomial.h b/modules/juce_dsp/maths/juce_Polynomial.h index 6a4d0e2c2a..4099436615 100644 --- a/modules/juce_dsp/maths/juce_Polynomial.h +++ b/modules/juce_dsp/maths/juce_Polynomial.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** A class representing a polynomial @@ -160,3 +164,6 @@ private: JUCE_LEAK_DETECTOR (Polynomial) }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_SpecialFunctions.cpp b/modules/juce_dsp/maths/juce_SpecialFunctions.cpp index 6874ef020a..55da31118b 100644 --- a/modules/juce_dsp/maths/juce_SpecialFunctions.cpp +++ b/modules/juce_dsp/maths/juce_SpecialFunctions.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ double SpecialFunctions::besselI0 (double x) noexcept { @@ -133,3 +137,6 @@ Complex SpecialFunctions::asne (Complex w, double k) noexcept return 2.0 / double_Pi * std::asin (last); } + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/maths/juce_SpecialFunctions.h b/modules/juce_dsp/maths/juce_SpecialFunctions.h index 834416d969..275aac21e5 100644 --- a/modules/juce_dsp/maths/juce_SpecialFunctions.h +++ b/modules/juce_dsp/maths/juce_SpecialFunctions.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Contains miscellaneous filter design and windowing functions. @@ -57,3 +61,6 @@ struct SpecialFunctions */ static Complex asne (Complex w, double k) noexcept; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.cpp b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.cpp index 3780fd5375..25d47499d0 100644 --- a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.cpp +++ b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.cpp @@ -24,31 +24,36 @@ ============================================================================== */ +namespace juce +{ + namespace dsp + { + DEFINE_AVX_SIMD_CONST (int32_t, float, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_AVX_SIMD_CONST (int32_t, float, kEvenHighBit) = { static_cast(0x80000000), 0, static_cast(0x80000000), 0, static_cast(0x80000000), 0, static_cast(0x80000000), 0 }; + DEFINE_AVX_SIMD_CONST (float, float, kOne) = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; -DEFINE_AVX_SIMD_CONST (int32_t, float, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_AVX_SIMD_CONST (int32_t, float, kEvenHighBit) = { static_cast(0x80000000), 0, static_cast(0x80000000), 0, static_cast(0x80000000), 0, static_cast(0x80000000), 0 }; -DEFINE_AVX_SIMD_CONST (float, float, kOne) = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; + DEFINE_AVX_SIMD_CONST (int64_t, double, kAllBitsSet) = { -1, -1, -1, -1 }; + DEFINE_AVX_SIMD_CONST (int64_t, double, kEvenHighBit) = { static_cast (0x8000000000000000), 0, static_cast (0x8000000000000000), 0 }; + DEFINE_AVX_SIMD_CONST (double, double, kOne) = { 1.0, 1.0, 1.0, 1.0 }; -DEFINE_AVX_SIMD_CONST (int64_t, double, kAllBitsSet) = { -1, -1, -1, -1 }; -DEFINE_AVX_SIMD_CONST (int64_t, double, kEvenHighBit) = { static_cast (0x8000000000000000), 0, static_cast (0x8000000000000000), 0 }; -DEFINE_AVX_SIMD_CONST (double, double, kOne) = { 1.0, 1.0, 1.0, 1.0 }; + DEFINE_AVX_SIMD_CONST (int8_t, int8_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_AVX_SIMD_CONST (int8_t, int8_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_AVX_SIMD_CONST (uint8_t, uint8_t, kAllBitsSet) = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + DEFINE_AVX_SIMD_CONST (uint8_t, uint8_t, kHighBit) = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; -DEFINE_AVX_SIMD_CONST (uint8_t, uint8_t, kAllBitsSet) = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -DEFINE_AVX_SIMD_CONST (uint8_t, uint8_t, kHighBit) = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; + DEFINE_AVX_SIMD_CONST (int16_t, int16_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_AVX_SIMD_CONST (int16_t, int16_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_AVX_SIMD_CONST (uint16_t, uint16_t, kAllBitsSet) = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; + DEFINE_AVX_SIMD_CONST (uint16_t, uint16_t, kHighBit) = { 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000 }; -DEFINE_AVX_SIMD_CONST (uint16_t, uint16_t, kAllBitsSet) = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -DEFINE_AVX_SIMD_CONST (uint16_t, uint16_t, kHighBit) = { 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000 }; + DEFINE_AVX_SIMD_CONST (int32_t, int32_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_AVX_SIMD_CONST (int32_t, int32_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_AVX_SIMD_CONST (uint32_t, uint32_t, kAllBitsSet) = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; + DEFINE_AVX_SIMD_CONST (uint32_t, uint32_t, kHighBit) = { 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; -DEFINE_AVX_SIMD_CONST (uint32_t, uint32_t, kAllBitsSet) = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; -DEFINE_AVX_SIMD_CONST (uint32_t, uint32_t, kHighBit) = { 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; + DEFINE_AVX_SIMD_CONST (int64_t, int64_t, kAllBitsSet) = { -1LL, -1LL, -1LL, -1LL }; -DEFINE_AVX_SIMD_CONST (int64_t, int64_t, kAllBitsSet) = { -1LL, -1LL, -1LL, -1LL }; - -DEFINE_AVX_SIMD_CONST (uint64_t, uint64_t, kAllBitsSet) = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; -DEFINE_AVX_SIMD_CONST (uint64_t, uint64_t, kHighBit) = { 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL }; + DEFINE_AVX_SIMD_CONST (uint64_t, uint64_t, kAllBitsSet) = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; + DEFINE_AVX_SIMD_CONST (uint64_t, uint64_t, kHighBit) = { 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL }; + } +} diff --git a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h index c3f6506e95..c5894209f7 100644 --- a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ #ifndef DOXYGEN @@ -558,3 +562,6 @@ struct SIMDNativeOps }; #endif + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h b/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h index 78c11ddf61..4701beb981 100644 --- a/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** A template specialisation to find corresponding mask type for primitives. */ namespace SIMDInternal @@ -211,3 +215,6 @@ struct SIMDFallbackOps return retval; } }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/native/juce_neon_SIMDNativeOps.cpp b/modules/juce_dsp/native/juce_neon_SIMDNativeOps.cpp index d52f7505bd..8193545391 100644 --- a/modules/juce_dsp/native/juce_neon_SIMDNativeOps.cpp +++ b/modules/juce_dsp/native/juce_neon_SIMDNativeOps.cpp @@ -24,16 +24,21 @@ ============================================================================== */ - -DEFINE_NEON_SIMD_CONST (int32_t, float, kAllBitsSet) = { -1, -1, -1, -1 }; -DEFINE_NEON_SIMD_CONST (int32_t, float, kEvenHighBit) = { static_cast(0x80000000), 0, static_cast(0x80000000), 0 }; -DEFINE_NEON_SIMD_CONST (float, float, kOne) = { 1.0f, 1.0f, 1.0f, 1.0f }; - -DEFINE_NEON_SIMD_CONST (int8_t, int8_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_NEON_SIMD_CONST (uint8_t, uint8_t, kAllBitsSet) = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -DEFINE_NEON_SIMD_CONST (int16_t, int16_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_NEON_SIMD_CONST (uint16_t, uint16_t, kAllBitsSet) = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -DEFINE_NEON_SIMD_CONST (int32_t, int32_t, kAllBitsSet) = { -1, -1, -1, -1 }; -DEFINE_NEON_SIMD_CONST (uint32_t, uint32_t, kAllBitsSet) = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; -DEFINE_NEON_SIMD_CONST (int64_t, int64_t, kAllBitsSet) = { -1, -1 }; -DEFINE_NEON_SIMD_CONST (uint64_t, uint64_t, kAllBitsSet) = { 0xffffffffffffffff, 0xffffffffffffffff }; +namespace juce +{ + namespace dsp + { + DEFINE_NEON_SIMD_CONST (int32_t, float, kAllBitsSet) = { -1, -1, -1, -1 }; + DEFINE_NEON_SIMD_CONST (int32_t, float, kEvenHighBit) = { static_cast(0x80000000), 0, static_cast(0x80000000), 0 }; + DEFINE_NEON_SIMD_CONST (float, float, kOne) = { 1.0f, 1.0f, 1.0f, 1.0f }; + + DEFINE_NEON_SIMD_CONST (int8_t, int8_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_NEON_SIMD_CONST (uint8_t, uint8_t, kAllBitsSet) = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + DEFINE_NEON_SIMD_CONST (int16_t, int16_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_NEON_SIMD_CONST (uint16_t, uint16_t, kAllBitsSet) = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; + DEFINE_NEON_SIMD_CONST (int32_t, int32_t, kAllBitsSet) = { -1, -1, -1, -1 }; + DEFINE_NEON_SIMD_CONST (uint32_t, uint32_t, kAllBitsSet) = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; + DEFINE_NEON_SIMD_CONST (int64_t, int64_t, kAllBitsSet) = { -1, -1 }; + DEFINE_NEON_SIMD_CONST (uint64_t, uint64_t, kAllBitsSet) = { 0xffffffffffffffff, 0xffffffffffffffff }; + } +} diff --git a/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h b/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h index de8bc9d602..55a23e107b 100644 --- a/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + #ifndef DOXYGEN #ifdef _MSC_VER @@ -384,3 +389,6 @@ struct SIMDNativeOps }; #endif + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.cpp b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.cpp index c3af98e6e0..e12923121e 100644 --- a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.cpp +++ b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.cpp @@ -24,31 +24,36 @@ ============================================================================== */ +namespace juce +{ + namespace dsp + { + DEFINE_SSE_SIMD_CONST (int32_t, float, kAllBitsSet) = { -1, -1, -1, -1 }; + DEFINE_SSE_SIMD_CONST (int32_t, float, kEvenHighBit) = { static_cast(0x80000000), 0, static_cast(0x80000000), 0 }; + DEFINE_SSE_SIMD_CONST (float, float, kOne) = { 1.0f, 1.0f, 1.0f, 1.0f }; -DEFINE_SSE_SIMD_CONST (int32_t, float, kAllBitsSet) = { -1, -1, -1, -1 }; -DEFINE_SSE_SIMD_CONST (int32_t, float, kEvenHighBit) = { static_cast(0x80000000), 0, static_cast(0x80000000), 0 }; -DEFINE_SSE_SIMD_CONST (float, float, kOne) = { 1.0f, 1.0f, 1.0f, 1.0f }; + DEFINE_SSE_SIMD_CONST (int64_t, double, kAllBitsSet) = { -1LL, -1LL }; + DEFINE_SSE_SIMD_CONST (int64_t, double, kEvenHighBit) = { static_cast(0x8000000000000000), 0 }; + DEFINE_SSE_SIMD_CONST (double, double, kOne) = { 1.0, 1.0 }; -DEFINE_SSE_SIMD_CONST (int64_t, double, kAllBitsSet) = { -1LL, -1LL }; -DEFINE_SSE_SIMD_CONST (int64_t, double, kEvenHighBit) = { static_cast(0x8000000000000000), 0 }; -DEFINE_SSE_SIMD_CONST (double, double, kOne) = { 1.0, 1.0 }; + DEFINE_SSE_SIMD_CONST (int8_t, int8_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_SSE_SIMD_CONST (int8_t, int8_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_SSE_SIMD_CONST (uint8_t, uint8_t, kAllBitsSet) = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + DEFINE_SSE_SIMD_CONST (uint8_t, uint8_t, kHighBit) = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; -DEFINE_SSE_SIMD_CONST (uint8_t, uint8_t, kAllBitsSet) = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -DEFINE_SSE_SIMD_CONST (uint8_t, uint8_t, kHighBit) = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; + DEFINE_SSE_SIMD_CONST (int16_t, int16_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; -DEFINE_SSE_SIMD_CONST (int16_t, int16_t, kAllBitsSet) = { -1, -1, -1, -1, -1, -1, -1, -1 }; + DEFINE_SSE_SIMD_CONST (uint16_t, uint16_t, kAllBitsSet) = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; + DEFINE_SSE_SIMD_CONST (uint16_t, uint16_t, kHighBit) = { 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000 }; -DEFINE_SSE_SIMD_CONST (uint16_t, uint16_t, kAllBitsSet) = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -DEFINE_SSE_SIMD_CONST (uint16_t, uint16_t, kHighBit) = { 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000 }; + DEFINE_SSE_SIMD_CONST (int32_t, int32_t, kAllBitsSet) = { -1, -1, -1, -1 }; -DEFINE_SSE_SIMD_CONST (int32_t, int32_t, kAllBitsSet) = { -1, -1, -1, -1 }; + DEFINE_SSE_SIMD_CONST (uint32_t, uint32_t, kAllBitsSet) = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; + DEFINE_SSE_SIMD_CONST (uint32_t, uint32_t, kHighBit) = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; -DEFINE_SSE_SIMD_CONST (uint32_t, uint32_t, kAllBitsSet) = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; -DEFINE_SSE_SIMD_CONST (uint32_t, uint32_t, kHighBit) = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; + DEFINE_SSE_SIMD_CONST (int64_t, int64_t, kAllBitsSet) = { -1, -1 }; -DEFINE_SSE_SIMD_CONST (int64_t, int64_t, kAllBitsSet) = { -1, -1 }; - -DEFINE_SSE_SIMD_CONST (uint64_t, uint64_t, kAllBitsSet) = { 0xffffffffffffffff, 0xffffffffffffffff }; -DEFINE_SSE_SIMD_CONST (uint64_t, uint64_t, kHighBit) = { 0x8000000000000000, 0x8000000000000000 }; + DEFINE_SSE_SIMD_CONST (uint64_t, uint64_t, kAllBitsSet) = { 0xffffffffffffffff, 0xffffffffffffffff }; + DEFINE_SSE_SIMD_CONST (uint64_t, uint64_t, kHighBit) = { 0x8000000000000000, 0x8000000000000000 }; + } +} diff --git a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h index 847403334e..3b2c741fbd 100644 --- a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + #ifndef DOXYGEN #ifdef _MSC_VER @@ -738,3 +743,6 @@ struct SIMDNativeOps }; #endif + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_Bias.h b/modules/juce_dsp/processors/juce_Bias.h index 7913965126..1937af9573 100644 --- a/modules/juce_dsp/processors/juce_Bias.h +++ b/modules/juce_dsp/processors/juce_Bias.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Adds a DC offset (voltage bias) to the audio samples. @@ -137,3 +141,6 @@ private: bias.reset (sampleRate, rampDurationSeconds); } }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_FIRFilter.cpp b/modules/juce_dsp/processors/juce_FIRFilter.cpp index c0008b2bbe..abcf5d27a9 100644 --- a/modules/juce_dsp/processors/juce_FIRFilter.cpp +++ b/modules/juce_dsp/processors/juce_FIRFilter.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ template double FIR::Coefficients::Coefficients::getMagnitudeForFrequency (double frequency, double theSampleRate) const noexcept @@ -153,3 +157,6 @@ void FIR::Coefficients::Coefficients::normalise() noexcept //============================================================================== template struct FIR::Coefficients; template struct FIR::Coefficients; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_FIRFilter.h b/modules/juce_dsp/processors/juce_FIRFilter.h index 902ff437df..08912dbfb1 100644 --- a/modules/juce_dsp/processors/juce_FIRFilter.h +++ b/modules/juce_dsp/processors/juce_FIRFilter.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Classes for FIR filter processing. @@ -274,3 +278,6 @@ namespace FIR Array coefficients; }; } + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_FIRFilter_test.cpp b/modules/juce_dsp/processors/juce_FIRFilter_test.cpp index b1fc1ddfc9..437611ceac 100644 --- a/modules/juce_dsp/processors/juce_FIRFilter_test.cpp +++ b/modules/juce_dsp/processors/juce_FIRFilter_test.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ class FIRFilterTest : public UnitTest { @@ -201,3 +205,6 @@ public: }; static FIRFilterTest firFilterUnitTest; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_Gain.h b/modules/juce_dsp/processors/juce_Gain.h index cfa2b1dcf8..e8e206f333 100644 --- a/modules/juce_dsp/processors/juce_Gain.h +++ b/modules/juce_dsp/processors/juce_Gain.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Applies a gain to audio samples as single samples or AudioBlocks. @@ -126,3 +130,6 @@ private: LinearSmoothedValue gain; double sampleRate = 0, rampDurationSeconds = 0; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_IIRFilter.cpp b/modules/juce_dsp/processors/juce_IIRFilter.cpp index beb7664e68..bebcf701a5 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter.cpp +++ b/modules/juce_dsp/processors/juce_IIRFilter.cpp @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ template IIR::Coefficients::Coefficients() @@ -482,3 +486,6 @@ void IIR::Coefficients::getPhaseForFrequencyArray (double* frequenc template struct IIR::Coefficients; template struct IIR::Coefficients; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_IIRFilter.h b/modules/juce_dsp/processors/juce_IIRFilter.h index 2c5e5980fd..63a311b940 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter.h +++ b/modules/juce_dsp/processors/juce_IIRFilter.h @@ -24,10 +24,13 @@ ============================================================================== */ - /** Classes for IIR filter processing. */ +namespace juce +{ +namespace dsp +{ namespace IIR { template @@ -276,5 +279,8 @@ namespace IIR static constexpr NumericType inverseRootTwo = static_cast (0.70710678118654752440L); }; - #include "juce_IIRFilter_Impl.h" -} +} // namespace IIR +} // namespace dsp +} // namespace juce + +#include "juce_IIRFilter_Impl.h" diff --git a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h index c096f5d114..5ef75be08c 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h +++ b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h @@ -24,6 +24,13 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ +namespace IIR +{ + #ifndef DOXYGEN //============================================================================== @@ -214,3 +221,7 @@ void Filter::check() } #endif + +} // namespace IIR +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_Oscillator.h b/modules/juce_dsp/processors/juce_Oscillator.h index 9230658951..03f64f4ba8 100644 --- a/modules/juce_dsp/processors/juce_Oscillator.h +++ b/modules/juce_dsp/processors/juce_Oscillator.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Generates a signal based on a user-supplied function. @@ -153,3 +157,6 @@ private: LinearSmoothedValue frequency {static_cast (440.0)}; NumericType sampleRate = 48000.0, pos = 0.0; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_Oversampling.cpp b/modules/juce_dsp/processors/juce_Oversampling.cpp index a6349966ac..c039f484b3 100644 --- a/modules/juce_dsp/processors/juce_Oversampling.cpp +++ b/modules/juce_dsp/processors/juce_Oversampling.cpp @@ -24,8 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ -//=============================================================================== /** Abstract class for the provided oversampling engines used internally in the Oversampling class. */ @@ -710,3 +713,6 @@ void Oversampling::processSamplesDown (dsp::AudioBlock & template class Oversampling; template class Oversampling; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_Oversampling.h b/modules/juce_dsp/processors/juce_Oversampling.h index 8b6da27c0c..159f0a5dce 100644 --- a/modules/juce_dsp/processors/juce_Oversampling.h +++ b/modules/juce_dsp/processors/juce_Oversampling.h @@ -24,6 +24,11 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ + template class OversamplingEngine; @@ -136,3 +141,6 @@ private: //=============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Oversampling) }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_ProcessContext.h b/modules/juce_dsp/processors/juce_ProcessContext.h index 8c41f7c686..3016ccdccb 100644 --- a/modules/juce_dsp/processors/juce_ProcessContext.h +++ b/modules/juce_dsp/processors/juce_ProcessContext.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** This structure is passed into a DSP algorithm's prepare() method, and contains @@ -153,3 +157,6 @@ private: const AudioBlockType& inputBlock; AudioBlockType& outputBlock; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_ProcessorChain.h b/modules/juce_dsp/processors/juce_ProcessorChain.h index fa16f60d35..004380176d 100644 --- a/modules/juce_dsp/processors/juce_ProcessorChain.h +++ b/modules/juce_dsp/processors/juce_ProcessorChain.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ #ifndef DOXYGEN namespace ProcessorHelpers // Internal helper classes used in building the ProcessorChain @@ -112,3 +116,6 @@ namespace ProcessorHelpers // Internal helper classes used in building the Proc */ template using ProcessorChain = ProcessorHelpers::Chain; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_ProcessorDuplicator.h b/modules/juce_dsp/processors/juce_ProcessorDuplicator.h index f66f6a082f..cd561bb388 100644 --- a/modules/juce_dsp/processors/juce_ProcessorDuplicator.h +++ b/modules/juce_dsp/processors/juce_ProcessorDuplicator.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Converts a mono processor class into a multi-channel version by duplicating it @@ -88,3 +92,6 @@ private: juce::OwnedArray processors; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_ProcessorWrapper.h b/modules/juce_dsp/processors/juce_ProcessorWrapper.h index 2e9fe98dd5..9df2b2090d 100644 --- a/modules/juce_dsp/processors/juce_ProcessorWrapper.h +++ b/modules/juce_dsp/processors/juce_ProcessorWrapper.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Acts as a polymorphic base class for processors. @@ -69,3 +73,6 @@ struct ProcessorWrapper : public ProcessorBase ProcessorType processor; }; + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_StateVariableFilter.h b/modules/juce_dsp/processors/juce_StateVariableFilter.h index 437f6995cf..a35bc3dfb2 100644 --- a/modules/juce_dsp/processors/juce_StateVariableFilter.h +++ b/modules/juce_dsp/processors/juce_StateVariableFilter.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** An IIR filter that can perform low, band and high-pass filtering on an audio @@ -201,3 +205,6 @@ namespace StateVariableFilter NumericType h = static_cast (1.0 / (1.0 + R2 * g + g * g)); }; } + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_dsp/processors/juce_WaveShaper.h b/modules/juce_dsp/processors/juce_WaveShaper.h index 7dd5aeb387..1681901165 100644 --- a/modules/juce_dsp/processors/juce_WaveShaper.h +++ b/modules/juce_dsp/processors/juce_WaveShaper.h @@ -24,6 +24,10 @@ ============================================================================== */ +namespace juce +{ +namespace dsp +{ /** Applies waveshaping to audio samples as single samples or AudioBlocks. @@ -63,3 +67,6 @@ struct WaveShaper //============================================================================== template static WaveShaper, Functor> CreateWaveShaper (Functor functionToUse) { return {functionToUse}; } + +} // namespace dsp +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp b/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp index 76253f347c..2b4613e82c 100644 --- a/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp +++ b/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class ActionBroadcaster::ActionMessage : public MessageManager::MessageBase { public: @@ -87,3 +90,5 @@ void ActionBroadcaster::sendActionMessage (const String& message) const for (int i = actionListeners.size(); --i >= 0;) (new ActionMessage (this, message, actionListeners.getUnchecked(i)))->post(); } + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_ActionBroadcaster.h b/modules/juce_events/broadcasters/juce_ActionBroadcaster.h index 8a2d559011..3267d86139 100644 --- a/modules/juce_events/broadcasters/juce_ActionBroadcaster.h +++ b/modules/juce_events/broadcasters/juce_ActionBroadcaster.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Manages a list of ActionListeners, and can send them messages. @@ -75,3 +75,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ActionBroadcaster) }; + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_ActionListener.h b/modules/juce_events/broadcasters/juce_ActionListener.h index 0571eaf05f..c16449f7df 100644 --- a/modules/juce_events/broadcasters/juce_ActionListener.h +++ b/modules/juce_events/broadcasters/juce_ActionListener.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -42,3 +42,5 @@ public: */ virtual void actionListenerCallback (const String& message) = 0; }; + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp b/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp index 15659057f5..8d9a20e5a9 100644 --- a/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp +++ b/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class AsyncUpdater::AsyncUpdaterMessage : public CallbackMessage { public: @@ -86,3 +89,5 @@ bool AsyncUpdater::isUpdatePending() const noexcept { return activeMessage->shouldDeliver.value != 0; } + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_AsyncUpdater.h b/modules/juce_events/broadcasters/juce_AsyncUpdater.h index 3b61f21088..7a94a63d63 100644 --- a/modules/juce_events/broadcasters/juce_AsyncUpdater.h +++ b/modules/juce_events/broadcasters/juce_AsyncUpdater.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -104,3 +104,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AsyncUpdater) }; + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp b/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp index c7b4cbfae8..a816c3d8ff 100644 --- a/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp +++ b/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + ChangeBroadcaster::ChangeBroadcaster() noexcept { broadcastCallback.owner = this; @@ -92,3 +95,5 @@ void ChangeBroadcaster::ChangeBroadcasterCallback::handleAsyncUpdate() jassert (owner != nullptr); owner->callListeners(); } + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h b/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h index 7750e1278c..beef4e85a0 100644 --- a/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h +++ b/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -97,3 +97,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ChangeBroadcaster) }; + +} // namespace juce diff --git a/modules/juce_events/broadcasters/juce_ChangeListener.h b/modules/juce_events/broadcasters/juce_ChangeListener.h index 37aabd0d60..aacaf223cd 100644 --- a/modules/juce_events/broadcasters/juce_ChangeListener.h +++ b/modules/juce_events/broadcasters/juce_ChangeListener.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class ChangeBroadcaster; @@ -56,3 +57,5 @@ public: private: virtual int changeListenerCallback (void*) { return 0; } #endif }; + +} // namespace juce diff --git a/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp b/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp index a0e69161ba..9e7070e4d0 100644 --- a/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp +++ b/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + enum { magicMastSlaveConnectionHeader = 0x712baf04 }; static const char* startMessage = "__ipc_st"; @@ -260,3 +263,5 @@ bool ChildProcessSlave::initialiseFromCommandLine (const String& commandLine, return connection != nullptr; } + +} // namespace juce diff --git a/modules/juce_events/interprocess/juce_ConnectedChildProcess.h b/modules/juce_events/interprocess/juce_ConnectedChildProcess.h index d1eaadc29d..8f6cc8cc1e 100644 --- a/modules/juce_events/interprocess/juce_ConnectedChildProcess.h +++ b/modules/juce_events/interprocess/juce_ConnectedChildProcess.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -184,3 +185,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcessMaster) }; + +} // namespace juce diff --git a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp index 353beeaac2..6f98aed632 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp +++ b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct InterprocessConnection::ConnectionThread : public Thread { ConnectionThread (InterprocessConnection& c) : Thread ("JUCE IPC"), owner (c) {} @@ -361,3 +364,5 @@ void InterprocessConnection::runThread() break; } } + +} // namespace juce diff --git a/modules/juce_events/interprocess/juce_InterprocessConnection.h b/modules/juce_events/interprocess/juce_InterprocessConnection.h index 6f9048bc7c..83cd910f31 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnection.h +++ b/modules/juce_events/interprocess/juce_InterprocessConnection.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class InterprocessConnectionServer; class MemoryBlock; @@ -203,3 +204,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InterprocessConnection) }; + +} // namespace juce diff --git a/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp b/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp index 196d90978e..6c9022bd46 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp +++ b/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + InterprocessConnectionServer::InterprocessConnectionServer() : Thread ("Juce IPC server") { @@ -74,3 +77,5 @@ void InterprocessConnectionServer::run() newConnection->initialiseWithSocket (clientSocket.release()); } } + +} // namespace juce diff --git a/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h b/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h index f731a379a2..552dd1c180 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h +++ b/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -100,3 +100,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InterprocessConnectionServer) }; + +} // namespace juce diff --git a/modules/juce_events/juce_events.cpp b/modules/juce_events/juce_events.cpp index 50d8fdd69a..bee0e3dff2 100644 --- a/modules/juce_events/juce_events.cpp +++ b/modules/juce_events/juce_events.cpp @@ -54,9 +54,6 @@ #endif //============================================================================== -namespace juce -{ - #include "messages/juce_ApplicationBase.cpp" #include "messages/juce_DeletedAtShutdown.cpp" #include "messages/juce_MessageListener.cpp" @@ -103,5 +100,3 @@ namespace juce #include "native/juce_android_Messaging.cpp" #endif - -} diff --git a/modules/juce_events/juce_events.h b/modules/juce_events/juce_events.h index a09ece17d3..b451c40d6f 100644 --- a/modules/juce_events/juce_events.h +++ b/modules/juce_events/juce_events.h @@ -62,9 +62,6 @@ #include #endif -namespace juce -{ - #include "messages/juce_MessageManager.h" #include "messages/juce_Message.h" #include "messages/juce_MessageListener.h" @@ -89,7 +86,6 @@ namespace juce #include "native/juce_linux_EventLoop.h" #endif - #if JUCE_WINDOWS #if JUCE_EVENTS_INCLUDE_WIN32_MESSAGE_WINDOW #include "native/juce_win32_HiddenMessageWindow.h" @@ -98,5 +94,3 @@ namespace juce #include "native/juce_win32_WinRTWrapper.h" #endif #endif - -} diff --git a/modules/juce_events/messages/juce_ApplicationBase.cpp b/modules/juce_events/messages/juce_ApplicationBase.cpp index be929bee3e..cbd549f8b0 100644 --- a/modules/juce_events/messages/juce_ApplicationBase.cpp +++ b/modules/juce_events/messages/juce_ApplicationBase.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = 0; JUCEApplicationBase* JUCEApplicationBase::appInstance = nullptr; @@ -326,3 +329,5 @@ int JUCEApplicationBase::shutdownApp() multipleInstanceHandler = nullptr; return getApplicationReturnValue(); } + +} // namespace juce diff --git a/modules/juce_events/messages/juce_ApplicationBase.h b/modules/juce_events/messages/juce_ApplicationBase.h index c9ffc5f0b9..88950fd7c0 100644 --- a/modules/juce_events/messages/juce_ApplicationBase.h +++ b/modules/juce_events/messages/juce_ApplicationBase.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -308,3 +308,5 @@ private: #define JUCE_TRY #define JUCE_CATCH_EXCEPTION #endif + +} // namespace juce diff --git a/modules/juce_events/messages/juce_CallbackMessage.h b/modules/juce_events/messages/juce_CallbackMessage.h index 249b204c01..303c1b438a 100644 --- a/modules/juce_events/messages/juce_CallbackMessage.h +++ b/modules/juce_events/messages/juce_CallbackMessage.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -68,3 +68,5 @@ private: // messages still in the system event queue. These aren't harmful, but can cause annoying assertions. JUCE_DECLARE_NON_COPYABLE (CallbackMessage) }; + +} // namespace juce diff --git a/modules/juce_events/messages/juce_DeletedAtShutdown.cpp b/modules/juce_events/messages/juce_DeletedAtShutdown.cpp index 897632a28b..feede821f1 100644 --- a/modules/juce_events/messages/juce_DeletedAtShutdown.cpp +++ b/modules/juce_events/messages/juce_DeletedAtShutdown.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + static SpinLock deletedAtShutdownLock; // use a spin lock because it can be statically initialised static Array& getDeletedAtShutdownObjects() @@ -87,3 +90,5 @@ void DeletedAtShutdown::deleteAll() #if JUCE_MSVC #pragma warning (pop) #endif + +} // namespace juce diff --git a/modules/juce_events/messages/juce_DeletedAtShutdown.h b/modules/juce_events/messages/juce_DeletedAtShutdown.h index a0284f80dd..9b28a49eda 100644 --- a/modules/juce_events/messages/juce_DeletedAtShutdown.h +++ b/modules/juce_events/messages/juce_DeletedAtShutdown.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -59,3 +59,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE (DeletedAtShutdown) }; + +} // namespace juce diff --git a/modules/juce_events/messages/juce_Initialisation.h b/modules/juce_events/messages/juce_Initialisation.h index e911807bd1..db2988a709 100644 --- a/modules/juce_events/messages/juce_Initialisation.h +++ b/modules/juce_events/messages/juce_Initialisation.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Initialises Juce's GUI classes. @@ -196,3 +196,5 @@ public: #endif #endif #endif + +} // namespace juce diff --git a/modules/juce_events/messages/juce_Message.h b/modules/juce_events/messages/juce_Message.h index 52033be77a..c0abb238ce 100644 --- a/modules/juce_events/messages/juce_Message.h +++ b/modules/juce_events/messages/juce_Message.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class MessageListener; @@ -57,3 +58,5 @@ private: // messages still in the system event queue. These aren't harmful, but can cause annoying assertions. JUCE_DECLARE_NON_COPYABLE (Message) }; + +} // namespace juce diff --git a/modules/juce_events/messages/juce_MessageListener.cpp b/modules/juce_events/messages/juce_MessageListener.cpp index 671cbe27d0..e1e8dcf637 100644 --- a/modules/juce_events/messages/juce_MessageListener.cpp +++ b/modules/juce_events/messages/juce_MessageListener.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + Message::Message() noexcept {} Message::~Message() {} @@ -45,3 +48,5 @@ void MessageListener::postMessage (Message* const message) const message->recipient = const_cast (this); message->post(); } + +} // namespace juce diff --git a/modules/juce_events/messages/juce_MessageListener.h b/modules/juce_events/messages/juce_MessageListener.h index 9e787864eb..8c8fe9bd50 100644 --- a/modules/juce_events/messages/juce_MessageListener.h +++ b/modules/juce_events/messages/juce_MessageListener.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -64,3 +64,5 @@ private: WeakReference::Master masterReference; friend class WeakReference; }; + +} // namespace juce diff --git a/modules/juce_events/messages/juce_MessageManager.cpp b/modules/juce_events/messages/juce_MessageManager.cpp index 2d9fb60d7b..563852e54a 100644 --- a/modules/juce_events/messages/juce_MessageManager.cpp +++ b/modules/juce_events/messages/juce_MessageManager.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + MessageManager::MessageManager() noexcept : messageThreadId (Thread::getCurrentThreadId()) { @@ -380,3 +383,5 @@ static int numScopedInitInstances = 0; ScopedJuceInitialiser_GUI::ScopedJuceInitialiser_GUI() { if (numScopedInitInstances++ == 0) initialiseJuce_GUI(); } ScopedJuceInitialiser_GUI::~ScopedJuceInitialiser_GUI() { if (--numScopedInitInstances == 0) shutdownJuce_GUI(); } + +} // namespace juce diff --git a/modules/juce_events/messages/juce_MessageManager.h b/modules/juce_events/messages/juce_MessageManager.h index e0734f8e3d..e4cb3fc4fd 100644 --- a/modules/juce_events/messages/juce_MessageManager.h +++ b/modules/juce_events/messages/juce_MessageManager.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class MessageManagerLock; class ThreadPoolJob; @@ -376,3 +377,5 @@ private: JUCE_DECLARE_NON_COPYABLE (MessageManagerLock) }; + +} // namespace juce diff --git a/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h b/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h index 37d181e01c..ccc00b11b9 100644 --- a/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h +++ b/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MAC || JUCE_WINDOWS || defined (DOXYGEN) @@ -52,3 +53,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_events/messages/juce_NotificationType.h b/modules/juce_events/messages/juce_NotificationType.h index 1ad3f35dbe..168ac5c681 100644 --- a/modules/juce_events/messages/juce_NotificationType.h +++ b/modules/juce_events/messages/juce_NotificationType.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -34,3 +35,5 @@ enum NotificationType sendNotificationSync, /**< Requests a synchronous notification. */ sendNotificationAsync, /**< Requests an asynchronous notification. */ }; + +} // namespace juce diff --git a/modules/juce_events/native/juce_android_Messaging.cpp b/modules/juce_events/native/juce_android_Messaging.cpp index 922704ddd7..9cb4dfbfce 100644 --- a/modules/juce_events/native/juce_android_Messaging.cpp +++ b/modules/juce_events/native/juce_android_Messaging.cpp @@ -20,7 +20,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "()V") \ METHOD (post, "post", "(Ljava/lang/Runnable;)Z") \ @@ -141,3 +143,5 @@ void MessageManager::stopDispatchLoop() (new QuitCallback())->post(); quitMessagePosted = true; } + +} // namespace juce diff --git a/modules/juce_events/native/juce_ios_MessageManager.mm b/modules/juce_events/native/juce_ios_MessageManager.mm index cf5ce1b5ae..47aed5f498 100644 --- a/modules/juce_events/native/juce_ios_MessageManager.mm +++ b/modules/juce_events/native/juce_ios_MessageManager.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + void MessageManager::runDispatchLoop() { jassert (isThisTheMessageThread()); // must only be called by the message thread @@ -96,3 +99,5 @@ void MessageManager::broadcastMessage (const String&) { // N/A on current iOS } + +} // namespace juce diff --git a/modules/juce_events/native/juce_linux_EventLoop.h b/modules/juce_events/native/juce_linux_EventLoop.h index 46df2bdfd4..ce99bd7ff0 100644 --- a/modules/juce_events/native/juce_linux_EventLoop.h +++ b/modules/juce_events/native/juce_linux_EventLoop.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ namespace LinuxEventLoop { @@ -50,3 +51,5 @@ namespace LinuxEventLoop void setWindowSystemFdInternal (int fd, CallbackFunctionBase* readCallback) noexcept; } + +} // namespace juce diff --git a/modules/juce_events/native/juce_linux_Messaging.cpp b/modules/juce_events/native/juce_linux_Messaging.cpp index 0a88349755..35cf97aef2 100644 --- a/modules/juce_events/native/juce_linux_Messaging.cpp +++ b/modules/juce_events/native/juce_linux_Messaging.cpp @@ -22,22 +22,23 @@ #include -enum FdType { +enum FdType +{ INTERNAL_QUEUE_FD, WINDOW_SYSTEM_FD, FD_COUNT, }; +namespace juce +{ + //============================================================================== class InternalMessageQueue { public: InternalMessageQueue() - : fdCount (1), - loopCount (0), - bytesInSocket (0) { - int ret = ::socketpair (AF_LOCAL, SOCK_STREAM, 0, fd); + auto ret = ::socketpair (AF_LOCAL, SOCK_STREAM, 0, fd); ignoreUnused (ret); jassert (ret == 0); auto internalQueueCb = [this] (int _fd) @@ -115,11 +116,10 @@ public: { const int i = loopCount++; loopCount %= fdCount; + if (readCallback[i] != nullptr && readCallback[i]->active) - { if ((*readCallback[i]) (pfds[i].fd)) return true; - } } return false; @@ -140,9 +140,9 @@ private: int fd[2]; pollfd pfds[FD_COUNT]; ScopedPointer readCallback[FD_COUNT]; - int fdCount; - int loopCount; - int bytesInSocket; + int fdCount = 1; + int loopCount = 0; + int bytesInSocket = 0; int getWriteHandle() const noexcept { return fd[0]; } int getReadHandle() const noexcept { return fd[1]; } @@ -196,12 +196,10 @@ namespace LinuxErrorHandling void MessageManager::doPlatformSpecificInitialisation() { if (JUCEApplicationBase::isStandaloneApp()) - { LinuxErrorHandling::installKeyboardBreakHandler(); - } // Create the internal message queue - InternalMessageQueue* queue = InternalMessageQueue::getInstance(); + auto* queue = InternalMessageQueue::getInstance(); ignoreUnused (queue); } @@ -212,7 +210,7 @@ void MessageManager::doPlatformSpecificShutdown() bool MessageManager::postMessageToSystemQueue (MessageManager::MessageBase* const message) { - if (InternalMessageQueue* queue = InternalMessageQueue::getInstanceWithoutCreating()) + if (auto* queue = InternalMessageQueue::getInstanceWithoutCreating()) { queue->postMessage (message); return true; @@ -221,9 +219,9 @@ bool MessageManager::postMessageToSystemQueue (MessageManager::MessageBase* cons return false; } -void MessageManager::broadcastMessage (const String& /* value */) +void MessageManager::broadcastMessage (const String&) { - /* TODO */ + // TODO } // this function expects that it will NEVER be called simultaneously for two concurrent threads @@ -234,12 +232,12 @@ bool MessageManager::dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMes if (LinuxErrorHandling::keyboardBreakOccurred) JUCEApplicationBase::getInstance()->quit(); - if (InternalMessageQueue* queue = InternalMessageQueue::getInstanceWithoutCreating()) + if (auto* queue = InternalMessageQueue::getInstanceWithoutCreating()) { if (queue->dispatchNextEvent()) break; - else if (returnIfNoPendingMessages) + if (returnIfNoPendingMessages) return false; // wait for 2000ms for next events if necessary @@ -251,16 +249,17 @@ bool MessageManager::dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMes } //============================================================================== - - void LinuxEventLoop::setWindowSystemFdInternal (int fd, LinuxEventLoop::CallbackFunctionBase* readCallback) noexcept { - if (InternalMessageQueue* queue = InternalMessageQueue::getInstanceWithoutCreating()) + if (auto* queue = InternalMessageQueue::getInstanceWithoutCreating()) queue->setWindowSystemFd (fd, readCallback); } void LinuxEventLoop::removeWindowSystemFd() noexcept { - if (InternalMessageQueue* queue = InternalMessageQueue::getInstanceWithoutCreating()) + if (auto* queue = InternalMessageQueue::getInstanceWithoutCreating()) queue->removeWindowSystemFd(); } + + +} // namespace juce diff --git a/modules/juce_events/native/juce_mac_MessageManager.mm b/modules/juce_events/native/juce_mac_MessageManager.mm index 95e9a59dcc..27456e63a9 100644 --- a/modules/juce_events/native/juce_mac_MessageManager.mm +++ b/modules/juce_events/native/juce_mac_MessageManager.mm @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + typedef void (*AppFocusChangeCallback)(); AppFocusChangeCallback appFocusChangeCallback = nullptr; @@ -423,3 +426,5 @@ private: MountedVolumeListChangeDetector::MountedVolumeListChangeDetector() { pimpl = new Pimpl (*this); } MountedVolumeListChangeDetector::~MountedVolumeListChangeDetector() {} #endif + +} // namespace juce diff --git a/modules/juce_events/native/juce_osx_MessageQueue.h b/modules/juce_events/native/juce_osx_MessageQueue.h index 9a23c15c42..32f24fde79 100644 --- a/modules/juce_events/native/juce_osx_MessageQueue.h +++ b/modules/juce_events/native/juce_osx_MessageQueue.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /* An internal message pump class used in OSX and iOS. */ @@ -100,3 +101,5 @@ private: static_cast (info)->runLoopCallback(); } }; + +} // namespace juce diff --git a/modules/juce_events/native/juce_win32_HiddenMessageWindow.h b/modules/juce_events/native/juce_win32_HiddenMessageWindow.h index 80328fb202..9135d99bd6 100644 --- a/modules/juce_events/native/juce_win32_HiddenMessageWindow.h +++ b/modules/juce_events/native/juce_win32_HiddenMessageWindow.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== class HiddenMessageWindow @@ -80,7 +81,7 @@ public: private: static LONG_PTR getImprobableWindowNumber() noexcept { - static LONG_PTR number = (LONG_PTR) Random::getSystemRandom().nextInt64(); + static auto number = (LONG_PTR) Random().nextInt64(); return number; } }; @@ -130,3 +131,5 @@ private: systemDeviceChanged(); } }; + +} // namespace juce diff --git a/modules/juce_events/native/juce_win32_Messaging.cpp b/modules/juce_events/native/juce_win32_Messaging.cpp index f55e5401a9..458f489b17 100644 --- a/modules/juce_events/native/juce_win32_Messaging.cpp +++ b/modules/juce_events/native/juce_win32_Messaging.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + extern HWND juce_messageWindowHandle; typedef bool (*CheckEventBlockedByModalComps) (const MSG&); @@ -225,3 +228,5 @@ struct MountedVolumeListChangeDetector::Pimpl : private DeviceChangeDetector MountedVolumeListChangeDetector::MountedVolumeListChangeDetector() { pimpl = new Pimpl (*this); } MountedVolumeListChangeDetector::~MountedVolumeListChangeDetector() {} + +} // namespace juce diff --git a/modules/juce_events/native/juce_win32_WinRTWrapper.cpp b/modules/juce_events/native/juce_win32_WinRTWrapper.cpp index 39cb99cae7..e8d848da42 100644 --- a/modules/juce_events/native/juce_win32_WinRTWrapper.cpp +++ b/modules/juce_events/native/juce_win32_WinRTWrapper.cpp @@ -20,4 +20,7 @@ ============================================================================== */ -juce_ImplementSingleton (WinRTWrapper) +namespace juce +{ + juce_ImplementSingleton (WinRTWrapper) +} diff --git a/modules/juce_events/native/juce_win32_WinRTWrapper.h b/modules/juce_events/native/juce_win32_WinRTWrapper.h index 8f2503daaf..4a48e04285 100644 --- a/modules/juce_events/native/juce_win32_WinRTWrapper.h +++ b/modules/juce_events/native/juce_win32_WinRTWrapper.h @@ -20,7 +20,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class WinRTWrapper : public DeletedAtShutdown { @@ -63,13 +64,9 @@ public: String hStringToString (HSTRING hstr) { - const wchar_t* str = nullptr; if (isInitialised()) - { - str = getHStringRawBuffer (hstr, nullptr); - if (str != nullptr) + if (const wchar_t* str = getHStringRawBuffer (hstr, nullptr)) return String (str); - } return {}; } @@ -130,3 +127,5 @@ private: WindowsGetStringRawBufferFuncPtr getHStringRawBuffer = nullptr; RoGetActivationFactoryFuncPtr roGetActivationFactory = nullptr; }; + +} // namespace juce diff --git a/modules/juce_events/timers/juce_MultiTimer.cpp b/modules/juce_events/timers/juce_MultiTimer.cpp index e9ace0a9d5..3f73eb3d7b 100644 --- a/modules/juce_events/timers/juce_MultiTimer.cpp +++ b/modules/juce_events/timers/juce_MultiTimer.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + struct MultiTimerCallback : public Timer { MultiTimerCallback (const int tid, MultiTimer& mt) noexcept @@ -101,3 +104,5 @@ int MultiTimer::getTimerInterval (const int timerID) const noexcept return 0; } + +} // namespace juce diff --git a/modules/juce_events/timers/juce_MultiTimer.h b/modules/juce_events/timers/juce_MultiTimer.h index 87848458d5..8921b68443 100644 --- a/modules/juce_events/timers/juce_MultiTimer.h +++ b/modules/juce_events/timers/juce_MultiTimer.h @@ -20,8 +20,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -119,3 +119,5 @@ private: Timer* getCallback (int) const noexcept; MultiTimer& operator= (const MultiTimer&); }; + +} // namespace juce diff --git a/modules/juce_events/timers/juce_Timer.cpp b/modules/juce_events/timers/juce_Timer.cpp index da2ea738ee..ae6e48fb5e 100644 --- a/modules/juce_events/timers/juce_Timer.cpp +++ b/modules/juce_events/timers/juce_Timer.cpp @@ -20,6 +20,9 @@ ============================================================================== */ +namespace juce +{ + class Timer::TimerThread : private Thread, private DeletedAtShutdown, private AsyncUpdater @@ -364,3 +367,5 @@ void JUCE_CALLTYPE Timer::callAfterDelay (int milliseconds, std::function @@ -692,3 +695,5 @@ Graphics::ScopedSaveState::~ScopedSaveState() { context.restoreState(); } + +} // namespace juce diff --git a/modules/juce_graphics/contexts/juce_GraphicsContext.h b/modules/juce_graphics/contexts/juce_GraphicsContext.h index 1e2e40053b..8351003c0d 100644 --- a/modules/juce_graphics/contexts/juce_GraphicsContext.h +++ b/modules/juce_graphics/contexts/juce_GraphicsContext.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -742,3 +742,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Graphics) }; + +} // namespace juce diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h b/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h index 92ca194393..a9828e3051 100644 --- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h +++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -97,3 +97,5 @@ public: virtual void drawGlyph (int glyphNumber, const AffineTransform&) = 0; virtual bool drawTextLayout (const AttributedString&, const Rectangle&) { return false; } }; + +} // namespace juce diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp index a9900f03a0..868ccf7355 100644 --- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + // this will throw an assertion if you try to draw something that's not // possible in postscript #define WARN_ABOUT_NON_POSTSCRIPT_OPERATIONS 0 @@ -533,3 +536,5 @@ void LowLevelGraphicsPostScriptRenderer::drawGlyph (int glyphNumber, const Affin font.getTypeface()->getOutlineForGlyph (glyphNumber, p); fillPath (p, AffineTransform::scale (font.getHeight() * font.getHorizontalScale(), font.getHeight()).followedBy (transform)); } + +} // namespace juce diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h index 463df4dba7..889702bca3 100644 --- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h +++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -116,3 +116,5 @@ protected: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LowLevelGraphicsPostScriptRenderer) }; + +} // namespace juce diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index c884113714..a32e907710 100644 --- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image& image) : RenderingHelpers::StackBasedLowLevelGraphicsContext (new RenderingHelpers::SoftwareRendererSavedState (image, image.getBounds())) @@ -38,3 +41,5 @@ LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image& } LowLevelGraphicsSoftwareRenderer::~LowLevelGraphicsSoftwareRenderer() {} + +} // namespace juce diff --git a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h index 648970f91a..06ecca5e0a 100644 --- a/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h +++ b/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -52,3 +52,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LowLevelGraphicsSoftwareRenderer) }; + +} // namespace juce diff --git a/modules/juce_graphics/effects/juce_DropShadowEffect.cpp b/modules/juce_graphics/effects/juce_DropShadowEffect.cpp index 5e68ac0dfe..6557c9dd85 100644 --- a/modules/juce_graphics/effects/juce_DropShadowEffect.cpp +++ b/modules/juce_graphics/effects/juce_DropShadowEffect.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static inline void blurDataTriplets (uint8* d, int num, const int delta) noexcept { uint32 last = d[0]; @@ -182,3 +185,5 @@ void DropShadowEffect::applyEffect (Image& image, Graphics& g, float scaleFactor g.setOpacity (alpha); g.drawImageAt (image, 0, 0); } + +} // namespace juce diff --git a/modules/juce_graphics/effects/juce_DropShadowEffect.h b/modules/juce_graphics/effects/juce_DropShadowEffect.h index 9fefe9a365..3de0f97a62 100644 --- a/modules/juce_graphics/effects/juce_DropShadowEffect.h +++ b/modules/juce_graphics/effects/juce_DropShadowEffect.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -106,3 +106,5 @@ private: JUCE_LEAK_DETECTOR (DropShadowEffect) }; + +} // namespace juce diff --git a/modules/juce_graphics/effects/juce_GlowEffect.cpp b/modules/juce_graphics/effects/juce_GlowEffect.cpp index e3af9ed032..4e1ee32c59 100644 --- a/modules/juce_graphics/effects/juce_GlowEffect.cpp +++ b/modules/juce_graphics/effects/juce_GlowEffect.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + GlowEffect::GlowEffect() {} GlowEffect::~GlowEffect() {} @@ -51,3 +54,5 @@ void GlowEffect::applyEffect (Image& image, Graphics& g, float scaleFactor, floa g.setOpacity (alpha); g.drawImageAt (image, offset.x, offset.y, false); } + +} // namespace juce diff --git a/modules/juce_graphics/effects/juce_GlowEffect.h b/modules/juce_graphics/effects/juce_GlowEffect.h index 2489516825..428ebad709 100644 --- a/modules/juce_graphics/effects/juce_GlowEffect.h +++ b/modules/juce_graphics/effects/juce_GlowEffect.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -71,3 +71,5 @@ private: JUCE_LEAK_DETECTOR (GlowEffect) }; + +} // namespace juce diff --git a/modules/juce_graphics/effects/juce_ImageEffectFilter.h b/modules/juce_graphics/effects/juce_ImageEffectFilter.h index 3d5d11afdd..e06222d92c 100644 --- a/modules/juce_graphics/effects/juce_ImageEffectFilter.h +++ b/modules/juce_graphics/effects/juce_ImageEffectFilter.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -66,3 +66,5 @@ public: virtual ~ImageEffectFilter() {} }; + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_AttributedString.cpp b/modules/juce_graphics/fonts/juce_AttributedString.cpp index 944a9be920..000223d966 100644 --- a/modules/juce_graphics/fonts/juce_AttributedString.cpp +++ b/modules/juce_graphics/fonts/juce_AttributedString.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace { int getLength (const Array& atts) noexcept @@ -349,3 +352,5 @@ void AttributedString::draw (Graphics& g, const Rectangle& area) const } } } + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_AttributedString.h b/modules/juce_graphics/fonts/juce_AttributedString.h index 98d15a99fb..f0cac6a062 100644 --- a/modules/juce_graphics/fonts/juce_AttributedString.h +++ b/modules/juce_graphics/fonts/juce_AttributedString.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -203,3 +203,5 @@ private: JUCE_LEAK_DETECTOR (AttributedString) }; + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_CustomTypeface.cpp b/modules/juce_graphics/fonts/juce_CustomTypeface.cpp index 26d5d9506b..acc1456aa6 100644 --- a/modules/juce_graphics/fonts/juce_CustomTypeface.cpp +++ b/modules/juce_graphics/fonts/juce_CustomTypeface.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class CustomTypeface::GlyphInfo { public: @@ -406,3 +409,5 @@ EdgeTable* CustomTypeface::getEdgeTableForGlyph (int glyphNumber, const AffineTr return nullptr; } + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_CustomTypeface.h b/modules/juce_graphics/fonts/juce_CustomTypeface.h index 0de1862f9f..36dda6d5cd 100644 --- a/modules/juce_graphics/fonts/juce_CustomTypeface.h +++ b/modules/juce_graphics/fonts/juce_CustomTypeface.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -161,3 +161,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CustomTypeface) }; + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_Font.cpp b/modules/juce_graphics/fonts/juce_Font.cpp index 8d43600250..40e7f1bdea 100644 --- a/modules/juce_graphics/fonts/juce_Font.cpp +++ b/modules/juce_graphics/fonts/juce_Font.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace FontValues { static float limitFontHeight (const float height) noexcept @@ -715,3 +718,5 @@ Font Font::fromString (const String& fontDescription) return Font (name, style, height); } + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_Font.h b/modules/juce_graphics/fonts/juce_Font.h index 27fb61a976..cacea2d219 100644 --- a/modules/juce_graphics/fonts/juce_Font.h +++ b/modules/juce_graphics/fonts/juce_Font.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -474,3 +474,5 @@ private: JUCE_LEAK_DETECTOR (Font) }; + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp index adf8d7e03d..f0d05460c5 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + PositionedGlyph::PositionedGlyph() noexcept : character (0), glyph (0), x (0), y (0), w (0), whitespace (false) { @@ -813,3 +816,5 @@ int GlyphArrangement::findGlyphIndexAt (const float x, const float y) const return -1; } + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.h b/modules/juce_graphics/fonts/juce_GlyphArrangement.h index 42bcde4ef2..711e6a06fd 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.h +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -323,3 +323,5 @@ private: JUCE_LEAK_DETECTOR (GlyphArrangement) }; + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_TextLayout.cpp b/modules/juce_graphics/fonts/juce_TextLayout.cpp index 895316607a..5987bb19a6 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.cpp +++ b/modules/juce_graphics/fonts/juce_TextLayout.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + TextLayout::Glyph::Glyph (const int glyph, Point anch, float w) noexcept : glyphCode (glyph), anchor (anch), width (w) { @@ -583,3 +586,5 @@ void TextLayout::recalculateSize() height = 0; } } + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_TextLayout.h b/modules/juce_graphics/fonts/juce_TextLayout.h index 5a1510e654..d5b2016276 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.h +++ b/modules/juce_graphics/fonts/juce_TextLayout.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -191,3 +191,5 @@ private: JUCE_LEAK_DETECTOR (TextLayout) }; + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_Typeface.cpp b/modules/juce_graphics/fonts/juce_Typeface.cpp index 1ce9a78fdf..d712e2d810 100644 --- a/modules/juce_graphics/fonts/juce_Typeface.cpp +++ b/modules/juce_graphics/fonts/juce_Typeface.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct FontStyleHelpers { static const char* getStyleName (const bool bold, @@ -260,3 +263,5 @@ void Typeface::applyVerticalHintingTransform (float fontSize, Path& path) return hintingParams->applyVerticalHintingTransform (fontSize, path); } } + +} // namespace juce diff --git a/modules/juce_graphics/fonts/juce_Typeface.h b/modules/juce_graphics/fonts/juce_Typeface.h index 3669fc16ac..82a2eb8f6d 100644 --- a/modules/juce_graphics/fonts/juce_Typeface.h +++ b/modules/juce_graphics/fonts/juce_Typeface.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -157,3 +157,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Typeface) }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_AffineTransform.cpp b/modules/juce_graphics/geometry/juce_AffineTransform.cpp index b111ed5b1c..59115696db 100644 --- a/modules/juce_graphics/geometry/juce_AffineTransform.cpp +++ b/modules/juce_graphics/geometry/juce_AffineTransform.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AffineTransform::AffineTransform() noexcept : mat00 (1.0f), mat01 (0), mat02 (0), mat10 (0), mat11 (1.0f), mat12 (0) @@ -262,3 +265,5 @@ float AffineTransform::getScaleFactor() const noexcept { return (std::abs (mat00) + std::abs (mat11)) / 2.0f; } + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_AffineTransform.h b/modules/juce_graphics/geometry/juce_AffineTransform.h index 24fcf51568..a11561bafd 100644 --- a/modules/juce_graphics/geometry/juce_AffineTransform.h +++ b/modules/juce_graphics/geometry/juce_AffineTransform.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -275,3 +275,5 @@ public: float mat00, mat01, mat02; float mat10, mat11, mat12; }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_BorderSize.h b/modules/juce_graphics/geometry/juce_BorderSize.h index 7dbfb8ce57..8678c2eb44 100644 --- a/modules/juce_graphics/geometry/juce_BorderSize.h +++ b/modules/juce_graphics/geometry/juce_BorderSize.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -149,3 +149,5 @@ private: //============================================================================== ValueType top, left, bottom, right; }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_EdgeTable.cpp b/modules/juce_graphics/geometry/juce_EdgeTable.cpp index ea35e47521..141613c844 100644 --- a/modules/juce_graphics/geometry/juce_EdgeTable.cpp +++ b/modules/juce_graphics/geometry/juce_EdgeTable.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + const int juce_edgeTableDefaultEdgesPerLine = 32; //============================================================================== @@ -831,3 +834,5 @@ bool EdgeTable::isEmpty() noexcept return bounds.getHeight() == 0; } + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_EdgeTable.h b/modules/juce_graphics/geometry/juce_EdgeTable.h index f32e61e127..76c318ed1d 100644 --- a/modules/juce_graphics/geometry/juce_EdgeTable.h +++ b/modules/juce_graphics/geometry/juce_EdgeTable.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -216,3 +216,5 @@ private: JUCE_LEAK_DETECTOR (EdgeTable) }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_Line.h b/modules/juce_graphics/geometry/juce_Line.h index 7143fe3082..d8db97a4e6 100644 --- a/modules/juce_graphics/geometry/juce_Line.h +++ b/modules/juce_graphics/geometry/juce_Line.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -424,3 +424,5 @@ private: return isZeroToOne (along2); } }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_Path.cpp b/modules/juce_graphics/geometry/juce_Path.cpp index 38b0d53cc0..849d4a0835 100644 --- a/modules/juce_graphics/geometry/juce_Path.cpp +++ b/modules/juce_graphics/geometry/juce_Path.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + // tests that some coordinates aren't NaNs #define JUCE_CHECK_COORDS_ARE_VALID(x, y) \ jassert (x == x && y == y); @@ -1631,3 +1634,5 @@ bool Path::Iterator::next() noexcept } #undef JUCE_CHECK_COORDS_ARE_VALID + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_Path.h b/modules/juce_graphics/geometry/juce_Path.h index 03dc768949..1a4962ac6d 100644 --- a/modules/juce_graphics/geometry/juce_Path.h +++ b/modules/juce_graphics/geometry/juce_Path.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -829,3 +829,5 @@ private: JUCE_LEAK_DETECTOR (Path) }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_PathIterator.cpp b/modules/juce_graphics/geometry/juce_PathIterator.cpp index d56cd436a1..ca239d4f95 100644 --- a/modules/juce_graphics/geometry/juce_PathIterator.cpp +++ b/modules/juce_graphics/geometry/juce_PathIterator.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MSVC && JUCE_DEBUG #pragma optimize ("t", on) #endif @@ -279,3 +282,5 @@ bool PathFlatteningIterator::next() #if JUCE_MSVC && JUCE_DEBUG #pragma optimize ("", on) // resets optimisations to the project defaults #endif + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_PathIterator.h b/modules/juce_graphics/geometry/juce_PathIterator.h index 96c70a8525..d37b5407d6 100644 --- a/modules/juce_graphics/geometry/juce_PathIterator.h +++ b/modules/juce_graphics/geometry/juce_PathIterator.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -106,3 +106,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PathFlatteningIterator) }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_PathStrokeType.cpp b/modules/juce_graphics/geometry/juce_PathStrokeType.cpp index dbab9c7bbe..8069a696d2 100644 --- a/modules/juce_graphics/geometry/juce_PathStrokeType.cpp +++ b/modules/juce_graphics/geometry/juce_PathStrokeType.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + PathStrokeType::PathStrokeType (float strokeThickness) noexcept : thickness (strokeThickness), jointStyle (mitered), endStyle (butt) { @@ -738,3 +741,5 @@ void PathStrokeType::createStrokeWithArrowheads (Path& destPath, PathStrokeHelpers::createStroke (thickness, jointStyle, endStyle, destPath, sourcePath, transform, extraAccuracy, &head); } + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_PathStrokeType.h b/modules/juce_graphics/geometry/juce_PathStrokeType.h index de804b1436..c84412dd98 100644 --- a/modules/juce_graphics/geometry/juce_PathStrokeType.h +++ b/modules/juce_graphics/geometry/juce_PathStrokeType.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -201,3 +201,5 @@ private: JUCE_LEAK_DETECTOR (PathStrokeType) }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_Point.h b/modules/juce_graphics/geometry/juce_Point.h index 69915c31a5..2b66ae8475 100644 --- a/modules/juce_graphics/geometry/juce_Point.h +++ b/modules/juce_graphics/geometry/juce_Point.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -239,3 +239,5 @@ public: /** Multiplies the point's coordinates by a scalar value. */ template Point operator* (ValueType value, Point p) noexcept { return p * value; } + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index dca99f300f..eb5d937be3 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -977,3 +977,5 @@ private: static int ceilAsInt (float n) noexcept { return n < (float) std::numeric_limits::max() ? (int) std::ceil (n) : std::numeric_limits::max(); } static int ceilAsInt (double n) noexcept { return n < (double) std::numeric_limits::max() ? (int) std::ceil (n) : std::numeric_limits::max(); } }; + +} // namespace juce diff --git a/modules/juce_graphics/geometry/juce_RectangleList.h b/modules/juce_graphics/geometry/juce_RectangleList.h index e611fcb8fe..55512fda1d 100644 --- a/modules/juce_graphics/geometry/juce_RectangleList.h +++ b/modules/juce_graphics/geometry/juce_RectangleList.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -649,3 +649,5 @@ private: //============================================================================== Array rects; }; + +} // namespace juce diff --git a/modules/juce_graphics/image_formats/juce_GIFLoader.cpp b/modules/juce_graphics/image_formats/juce_GIFLoader.cpp index 5d8c205e16..80a101e644 100644 --- a/modules/juce_graphics/image_formats/juce_GIFLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_GIFLoader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER Image juce_loadWithCoreImage (InputStream& input); #else @@ -444,3 +447,5 @@ bool GIFImageFormat::writeImageToStream (const Image& /*sourceImage*/, OutputStr jassertfalse; // writing isn't implemented for GIFs! return false; } + +} // namespace juce diff --git a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp index ff5c1629d6..793d10ba64 100644 --- a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4365) @@ -449,3 +452,5 @@ bool JPEGImageFormat::writeImageToStream (const Image& image, OutputStream& out) return true; } + +} // namespace juce diff --git a/modules/juce_graphics/image_formats/juce_PNGLoader.cpp b/modules/juce_graphics/image_formats/juce_PNGLoader.cpp index dbf35059eb..ee06273171 100644 --- a/modules/juce_graphics/image_formats/juce_PNGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_PNGLoader.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4390 4611 4365 4267) @@ -598,3 +601,5 @@ bool PNGImageFormat::writeImageToStream (const Image& image, OutputStream& out) return true; } + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index 7028b65e91..1b206f5a22 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ImagePixelData::ImagePixelData (const Image::PixelFormat format, const int w, const int h) : pixelFormat (format), width (w), height (h) { @@ -673,3 +676,5 @@ void Image::moveImageSection (int dx, int dy, } } } + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h index a2c436d251..eefaa98d1f 100644 --- a/modules/juce_graphics/images/juce_Image.h +++ b/modules/juce_graphics/images/juce_Image.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class ImageType; class ImagePixelData; @@ -542,3 +543,5 @@ public: ImagePixelData::Ptr create (Image::PixelFormat, int width, int height, bool clearImage) const override; int getTypeID() const override; }; + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_ImageCache.cpp b/modules/juce_graphics/images/juce_ImageCache.cpp index 50c3203f4b..e565f5e5e6 100644 --- a/modules/juce_graphics/images/juce_ImageCache.cpp +++ b/modules/juce_graphics/images/juce_ImageCache.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct ImageCache::Pimpl : private Timer, private DeletedAtShutdown { @@ -163,3 +166,5 @@ void ImageCache::releaseUnusedImages() { Pimpl::getInstance()->releaseUnusedImages(); } + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_ImageCache.h b/modules/juce_graphics/images/juce_ImageCache.h index fa5b5710c7..753ce750de 100644 --- a/modules/juce_graphics/images/juce_ImageCache.h +++ b/modules/juce_graphics/images/juce_ImageCache.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -122,3 +122,5 @@ private: JUCE_DECLARE_NON_COPYABLE (ImageCache) }; + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp b/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp index a56cab1ebe..e7408c2f0c 100644 --- a/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp +++ b/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ImageConvolutionKernel::ImageConvolutionKernel (const int size_) : values ((size_t) (size_ * size_)), size (size_) @@ -290,3 +293,5 @@ void ImageConvolutionKernel::applyToImage (Image& destImage, } } } + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_ImageConvolutionKernel.h b/modules/juce_graphics/images/juce_ImageConvolutionKernel.h index cc399d9653..c3495a2684 100644 --- a/modules/juce_graphics/images/juce_ImageConvolutionKernel.h +++ b/modules/juce_graphics/images/juce_ImageConvolutionKernel.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ImageConvolutionKernel) }; + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_ImageFileFormat.cpp b/modules/juce_graphics/images/juce_ImageFileFormat.cpp index 669a39be47..12ad6afb2e 100644 --- a/modules/juce_graphics/images/juce_ImageFileFormat.cpp +++ b/modules/juce_graphics/images/juce_ImageFileFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct DefaultImageFormats { static ImageFileFormat** get() @@ -105,3 +108,5 @@ Image ImageFileFormat::loadFrom (const void* rawData, const size_t numBytes) return Image(); } + +} // namespace juce diff --git a/modules/juce_graphics/images/juce_ImageFileFormat.h b/modules/juce_graphics/images/juce_ImageFileFormat.h index e558906af7..ec7138836a 100644 --- a/modules/juce_graphics/images/juce_ImageFileFormat.h +++ b/modules/juce_graphics/images/juce_ImageFileFormat.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -212,3 +212,5 @@ public: Image decodeImage (InputStream&) override; bool writeImageToStream (const Image&, OutputStream&) override; }; + +} // namespace juce diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp index 6884981880..373c9f4e4d 100644 --- a/modules/juce_graphics/juce_graphics.cpp +++ b/modules/juce_graphics/juce_graphics.cpp @@ -106,9 +106,6 @@ #endif //============================================================================== -namespace juce -{ - #include "colour/juce_Colour.cpp" #include "colour/juce_ColourGradient.cpp" #include "colour/juce_Colours.cpp" @@ -167,7 +164,6 @@ namespace juce #include "native/juce_android_IconHelpers.cpp" #endif -} //============================================================================== #if JUCE_USE_FREETYPE && JUCE_USE_FREETYPE_AMALGAMATED diff --git a/modules/juce_graphics/juce_graphics.h b/modules/juce_graphics/juce_graphics.h index c823b10f10..29b19b1370 100644 --- a/modules/juce_graphics/juce_graphics.h +++ b/modules/juce_graphics/juce_graphics.h @@ -92,14 +92,14 @@ //============================================================================== namespace juce { - -class Image; -class AffineTransform; -class Path; -class Font; -class Graphics; -class FillType; -class LowLevelGraphicsContext; + class Image; + class AffineTransform; + class Path; + class Font; + class Graphics; + class FillType; + class LowLevelGraphicsContext; +} #include "geometry/juce_AffineTransform.h" #include "geometry/juce_Point.h" @@ -145,5 +145,3 @@ class LowLevelGraphicsContext; #if JUCE_DIRECT2D && JUCE_WINDOWS #include "native/juce_win32_Direct2DGraphicsContext.h" #endif - -} diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h index 67b9b561c0..e552758b2c 100644 --- a/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MSVC #pragma warning (push) @@ -2685,3 +2686,5 @@ protected: #if JUCE_MSVC #pragma warning (pop) #endif + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_android_Fonts.cpp b/modules/juce_graphics/native/juce_android_Fonts.cpp index 5bfe92da6f..a5ffa6b7d8 100644 --- a/modules/juce_graphics/native/juce_android_Fonts.cpp +++ b/modules/juce_graphics/native/juce_android_Fonts.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct DefaultFontNames { DefaultFontNames() @@ -402,3 +405,5 @@ bool TextLayout::createNativeLayout (const AttributedString&) } #endif + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_android_GraphicsContext.cpp b/modules/juce_graphics/native/juce_android_GraphicsContext.cpp index 2f36d872e5..77dabe2e3f 100644 --- a/modules/juce_graphics/native/juce_android_GraphicsContext.cpp +++ b/modules/juce_graphics/native/juce_android_GraphicsContext.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace GraphicsHelpers { jobject createPaint (Graphics::ResamplingQuality quality) @@ -60,3 +63,5 @@ ImagePixelData::Ptr NativeImageType::create (Image::PixelFormat format, int widt { return SoftwareImageType().create (format, width, height, clearImage); } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_android_IconHelpers.cpp b/modules/juce_graphics/native/juce_android_IconHelpers.cpp index 287005422c..3a11f8e344 100644 --- a/modules/juce_graphics/native/juce_android_IconHelpers.cpp +++ b/modules/juce_graphics/native/juce_android_IconHelpers.cpp @@ -24,7 +24,7 @@ ============================================================================== */ -Image JUCE_API getIconFromApplication (const String&, const int) +namespace juce { - return Image(); + Image JUCE_API getIconFromApplication (const String&, int) { return {}; } } diff --git a/modules/juce_graphics/native/juce_freetype_Fonts.cpp b/modules/juce_graphics/native/juce_freetype_Fonts.cpp index 1f01b77c96..a813ec61b1 100644 --- a/modules/juce_graphics/native/juce_freetype_Fonts.cpp +++ b/modules/juce_graphics/native/juce_freetype_Fonts.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct FTLibWrapper : public ReferenceCountedObject { FTLibWrapper() : library (0) @@ -455,3 +458,5 @@ private: JUCE_DECLARE_NON_COPYABLE (FreeTypeTypeface) }; + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_linux_Fonts.cpp b/modules/juce_graphics/native/juce_linux_Fonts.cpp index 24b98669e6..06cd9401a6 100644 --- a/modules/juce_graphics/native/juce_linux_Fonts.cpp +++ b/modules/juce_graphics/native/juce_linux_Fonts.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static XmlElement* findFontsConfFile() { static const char* pathsToSearch[] = { "/etc/fonts/fonts.conf", @@ -190,3 +193,5 @@ Typeface::Ptr Font::getDefaultTypefaceForFont (const Font& font) f.setTypefaceName (defaultNames.getRealFontName (font.getTypefaceName())); return Typeface::createSystemTypefaceFor (f); } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_linux_IconHelpers.cpp b/modules/juce_graphics/native/juce_linux_IconHelpers.cpp index 287005422c..3a11f8e344 100644 --- a/modules/juce_graphics/native/juce_linux_IconHelpers.cpp +++ b/modules/juce_graphics/native/juce_linux_IconHelpers.cpp @@ -24,7 +24,7 @@ ============================================================================== */ -Image JUCE_API getIconFromApplication (const String&, const int) +namespace juce { - return Image(); + Image JUCE_API getIconFromApplication (const String&, int) { return {}; } } diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h index 4b81cf1002..5db0407439 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== class CoreGraphicsContext : public LowLevelGraphicsContext @@ -110,3 +111,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CoreGraphicsContext) }; + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index fa97d97a58..63e7f89259 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -24,9 +24,9 @@ ============================================================================== */ -#include "juce_mac_CoreGraphicsContext.h" +namespace juce +{ -//============================================================================== class CoreGraphicsImage : public ImagePixelData { public: @@ -919,3 +919,5 @@ Image juce_createImageFromUIImage (UIImage* img) return retval; } #endif + +} diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h b/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h index f60b158a1f..6d04d73ea7 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== namespace @@ -59,5 +59,7 @@ extern CGImageRef juce_createCoreGraphicsImage (const Image&, CGColorSpaceRef, b extern CGContextRef juce_getImageContext (const Image&); #if JUCE_IOS -extern Image juce_createImageFromUIImage (UIImage*); + extern Image juce_createImageFromUIImage (UIImage*); #endif + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm index 61c9cf8c2f..19b3b38f3f 100644 --- a/modules/juce_graphics/native/juce_mac_Fonts.mm +++ b/modules/juce_graphics/native/juce_mac_Fonts.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #ifndef JUCE_CORETEXT_AVAILABLE #define JUCE_CORETEXT_AVAILABLE 1 #endif @@ -1245,3 +1248,5 @@ bool TextLayout::createNativeLayout (const AttributedString& text) ignoreUnused (text); return false; } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_mac_IconHelpers.cpp b/modules/juce_graphics/native/juce_mac_IconHelpers.cpp index 0f3b740b06..03aa559c5e 100644 --- a/modules/juce_graphics/native/juce_mac_IconHelpers.cpp +++ b/modules/juce_graphics/native/juce_mac_IconHelpers.cpp @@ -24,9 +24,13 @@ ============================================================================== */ +namespace juce +{ + Image getIconFromIcnsFile (const File& icnsFile, const int size) { FileInputStream stream (icnsFile); + if (! stream.openedOk()) return {}; @@ -44,6 +48,7 @@ Image getIconFromIcnsFile (const File& icnsFile, const int size) return {}; const auto dataSize = juce::ByteOrder::bigEndianInt (headerSection); + if (dataSize <= 0) return {}; @@ -66,6 +71,7 @@ Image getIconFromIcnsFile (const File& icnsFile, const int size) break; const auto sectionSize = ByteOrder::bigEndianInt (headerSection); + if (sectionSize <= 0) break; @@ -81,6 +87,7 @@ Image getIconFromIcnsFile (const File& icnsFile, const int size) const auto lastImageIndex = images.size() - 1; const auto lastWidth = images.getReference (lastImageIndex).getWidth(); + if (lastWidth > maxWidth) { maxWidthIndex = lastImageIndex; @@ -122,16 +129,22 @@ Image JUCE_API getIconFromApplication (const String& applicationPath, const int hostIcon = getIconFromIcnsFile (icnsFile, size); CFRelease (iconPath); } + CFRelease (iconURL); } } } + CFRelease (appBundle); } + CFRelease (url); } + CFRelease (pathCFString); } return hostIcon; } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp index 40f848e58d..b9f7d592ff 100644 --- a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp +++ b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + template D2D1_RECT_F rectangleToRectF (const Rectangle& r) { @@ -823,3 +826,5 @@ bool Direct2DLowLevelGraphicsContext::drawTextLayout (const AttributedString& te pimpl->renderingTarget->SetTransform (D2D1::IdentityMatrix()); return true; } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.h b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.h index 2c923a76ed..fb8714dbf1 100644 --- a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.h +++ b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #ifndef _WINDEF_ class HWND__; // Forward or never @@ -101,3 +102,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Direct2DLowLevelGraphicsContext) }; + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp b/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp index 739fc539ae..d007ebb6bc 100644 --- a/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp +++ b/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_DIRECTWRITE namespace DirectWriteTypeLayout { @@ -453,3 +456,5 @@ bool TextLayout::createNativeLayout (const AttributedString& text) return false; } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp b/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp index fb30ddb42d..2643d1a169 100644 --- a/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp +++ b/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_USE_DIRECTWRITE namespace { @@ -320,3 +323,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_win32_Fonts.cpp b/modules/juce_graphics/native/juce_win32_Fonts.cpp index d8198341cd..b6159c3f94 100644 --- a/modules/juce_graphics/native/juce_win32_Fonts.cpp +++ b/modules/juce_graphics/native/juce_win32_Fonts.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /* This is some quick-and-dirty code to extract the typeface name from a lump of TTF file data. It's needed because although win32 will happily load a TTF file from in-memory data, it won't tell you the name of the damned font that it just loaded.. and in order to actually use the font, @@ -644,3 +647,5 @@ void Typeface::scanFolderForFonts (const File&) { jassertfalse; // not implemented on this platform } + +} // namespace juce diff --git a/modules/juce_graphics/native/juce_win32_IconHelpers.cpp b/modules/juce_graphics/native/juce_win32_IconHelpers.cpp index 287005422c..3a11f8e344 100644 --- a/modules/juce_graphics/native/juce_win32_IconHelpers.cpp +++ b/modules/juce_graphics/native/juce_win32_IconHelpers.cpp @@ -24,7 +24,7 @@ ============================================================================== */ -Image JUCE_API getIconFromApplication (const String&, const int) +namespace juce { - return Image(); + Image JUCE_API getIconFromApplication (const String&, int) { return {}; } } diff --git a/modules/juce_graphics/placement/juce_Justification.h b/modules/juce_graphics/placement/juce_Justification.h index a70ea25184..8c8fb8362b 100644 --- a/modules/juce_graphics/placement/juce_Justification.h +++ b/modules/juce_graphics/placement/juce_Justification.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -186,3 +186,5 @@ private: //============================================================================== int flags; }; + +} // namespace juce diff --git a/modules/juce_graphics/placement/juce_RectanglePlacement.cpp b/modules/juce_graphics/placement/juce_RectanglePlacement.cpp index 1d1143636e..6f718c0948 100644 --- a/modules/juce_graphics/placement/juce_RectanglePlacement.cpp +++ b/modules/juce_graphics/placement/juce_RectanglePlacement.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + RectanglePlacement::RectanglePlacement (const RectanglePlacement& other) noexcept : flags (other.flags) { @@ -127,3 +130,5 @@ AffineTransform RectanglePlacement::getTransformToFit (const Rectangle& s .scaled (scaleX, scaleY) .translated (newX, newY); } + +} // namespace juce diff --git a/modules/juce_graphics/placement/juce_RectanglePlacement.h b/modules/juce_graphics/placement/juce_RectanglePlacement.h index 1d6aefd748..84eec1db0f 100644 --- a/modules/juce_graphics/placement/juce_RectanglePlacement.h +++ b/modules/juce_graphics/placement/juce_RectanglePlacement.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -169,3 +169,5 @@ private: //============================================================================== int flags; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/application/juce_Application.cpp b/modules/juce_gui_basics/application/juce_Application.cpp index a365031d2e..efa5242bbd 100644 --- a/modules/juce_gui_basics/application/juce_Application.cpp +++ b/modules/juce_gui_basics/application/juce_Application.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + JUCEApplication::JUCEApplication() {} JUCEApplication::~JUCEApplication() {} @@ -98,3 +101,5 @@ bool JUCEApplication::initialiseApp() return false; } + +} // namespace juce diff --git a/modules/juce_gui_basics/application/juce_Application.h b/modules/juce_gui_basics/application/juce_Application.h index 9ade8bbe9d..423f8ce5c6 100644 --- a/modules/juce_gui_basics/application/juce_Application.h +++ b/modules/juce_gui_basics/application/juce_Application.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -188,3 +188,5 @@ private: JUCE_DECLARE_NON_COPYABLE (JUCEApplication) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp b/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp index 4076462db9..fa76bc1d3d 100644 --- a/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ArrowButton::ArrowButton (const String& name, float arrowDirectionInRadians, Colour arrowColour) : Button (name), colour (arrowColour) { @@ -45,3 +48,5 @@ void ArrowButton::paintButton (Graphics& g, bool /*isMouseOverButton*/, bool isB g.setColour (colour); g.fillPath (p); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ArrowButton.h b/modules/juce_gui_basics/buttons/juce_ArrowButton.h index c05a0c5f65..8ff4d7f476 100644 --- a/modules/juce_gui_basics/buttons/juce_ArrowButton.h +++ b/modules/juce_gui_basics/buttons/juce_ArrowButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -60,3 +60,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ArrowButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_Button.cpp b/modules/juce_gui_basics/buttons/juce_Button.cpp index 9ece5dd0c6..e82b83897d 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.cpp +++ b/modules/juce_gui_basics/buttons/juce_Button.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class Button::CallbackHelper : public Timer, public ApplicationCommandManagerListener, public Value::Listener, @@ -692,3 +695,5 @@ void Button::repeatTimerCallback() callbackHelper->stopTimer(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_Button.h b/modules/juce_gui_basics/buttons/juce_Button.h index 9ba29f157c..79de48cc27 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.h +++ b/modules/juce_gui_basics/buttons/juce_Button.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -518,3 +518,5 @@ private: /** This typedef is just for compatibility with old code and VC6 - newer code should use Button::Listener instead. */ typedef Button::Listener ButtonListener; #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp b/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp index 3fa94c0c85..f4b01ef3ef 100644 --- a/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DrawableButton::DrawableButton (const String& name, const DrawableButton::ButtonStyle buttonStyle) : Button (name), style (buttonStyle) { @@ -219,3 +222,5 @@ Drawable* DrawableButton::getDownImage() const noexcept return getOverImage(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_DrawableButton.h b/modules/juce_gui_basics/buttons/juce_DrawableButton.h index 44124c2b58..8e261373c9 100644 --- a/modules/juce_gui_basics/buttons/juce_DrawableButton.h +++ b/modules/juce_gui_basics/buttons/juce_DrawableButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -187,3 +187,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DrawableButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp index 5d76c4310a..acafad1ac8 100644 --- a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + HyperlinkButton::HyperlinkButton (const String& linkText, const URL& linkURL) : Button (linkText), @@ -109,3 +112,5 @@ void HyperlinkButton::paintButton (Graphics& g, justification.getOnlyHorizontalFlags() | Justification::verticallyCentred, true); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h index 746dd4e284..1b67e17d08 100644 --- a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h +++ b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -111,3 +111,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HyperlinkButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ImageButton.cpp b/modules/juce_gui_basics/buttons/juce_ImageButton.cpp index 7bd3fb5f17..e89f5736d5 100644 --- a/modules/juce_gui_basics/buttons/juce_ImageButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_ImageButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ImageButton::ImageButton (const String& text_) : Button (text_), scaleImageToFit (true), @@ -192,3 +195,5 @@ bool ImageButton::hitTest (int x, int y) && alphaThreshold < im.getPixelAt (((x - imageBounds.getX()) * im.getWidth()) / imageBounds.getWidth(), ((y - imageBounds.getY()) * im.getHeight()) / imageBounds.getHeight()).getAlpha()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ImageButton.h b/modules/juce_gui_basics/buttons/juce_ImageButton.h index d24de290ce..c867973d7c 100644 --- a/modules/juce_gui_basics/buttons/juce_ImageButton.h +++ b/modules/juce_gui_basics/buttons/juce_ImageButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -156,3 +156,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ImageButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp b/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp index 733b1a41e6..3e7f91a59d 100644 --- a/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ShapeButton::ShapeButton (const String& t, Colour n, Colour o, Colour d) : Button (t), normalColour (n), overColour (o), downColour (d), @@ -129,3 +132,5 @@ void ShapeButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButto g.strokePath (shape, PathStrokeType (outlineWidth), trans); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ShapeButton.h b/modules/juce_gui_basics/buttons/juce_ShapeButton.h index 60372a3bf0..193d886fd4 100644 --- a/modules/juce_gui_basics/buttons/juce_ShapeButton.h +++ b/modules/juce_gui_basics/buttons/juce_ShapeButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -121,3 +121,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ShapeButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_TextButton.cpp b/modules/juce_gui_basics/buttons/juce_TextButton.cpp index 59e80696de..d7d4fb46cd 100644 --- a/modules/juce_gui_basics/buttons/juce_TextButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_TextButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + TextButton::TextButton() : Button (String()) { } @@ -71,3 +74,5 @@ int TextButton::getBestWidthForHeight (int buttonHeight) { return getLookAndFeel().getTextButtonWidthToFitText (*this, buttonHeight); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_TextButton.h b/modules/juce_gui_basics/buttons/juce_TextButton.h index b5f6d346ba..1631af52cb 100644 --- a/modules/juce_gui_basics/buttons/juce_TextButton.h +++ b/modules/juce_gui_basics/buttons/juce_TextButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -109,3 +109,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp b/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp index a9a3c84f99..a43e45d1e7 100644 --- a/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ToggleButton::ToggleButton() : Button (String()) { @@ -54,3 +57,5 @@ void ToggleButton::colourChanged() { repaint(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ToggleButton.h b/modules/juce_gui_basics/buttons/juce_ToggleButton.h index 500946ec61..afe3dcf2aa 100644 --- a/modules/juce_gui_basics/buttons/juce_ToggleButton.h +++ b/modules/juce_gui_basics/buttons/juce_ToggleButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -85,3 +85,5 @@ protected: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToggleButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp b/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp index e09bd913ac..d4f60ac8c0 100644 --- a/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ToolbarButton::ToolbarButton (const int iid, const String& buttonText, Drawable* const normalIm, Drawable* const toggledOnIm) : ToolbarItemComponent (iid, buttonText, true), @@ -107,3 +110,5 @@ void ToolbarButton::buttonStateChanged() { setCurrentImage (getImageToUse()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/buttons/juce_ToolbarButton.h b/modules/juce_gui_basics/buttons/juce_ToolbarButton.h index 20a4322bc6..ce2190e038 100644 --- a/modules/juce_gui_basics/buttons/juce_ToolbarButton.h +++ b/modules/juce_gui_basics/buttons/juce_ToolbarButton.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -93,3 +93,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToolbarButton) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h b/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h index 65c3e4b705..cae26668d5 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A type used to hold the unique ID for an application command. @@ -87,3 +87,5 @@ namespace StandardApplicationCommandIDs redo = 0x1009 }; } + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp b/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp index 388113d6c6..6599fdd9f5 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ApplicationCommandInfo::ApplicationCommandInfo (const CommandID cid) noexcept : commandID (cid), flags (0) { @@ -60,3 +63,5 @@ void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, ModifierKeys { defaultKeypresses.add (KeyPress (keyCode, modifiers, 0)); } + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h b/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h index c6cb9927ee..63358df6a5 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -185,3 +185,5 @@ struct JUCE_API ApplicationCommandInfo */ int flags; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp index 7379a9b48b..acd785a369 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ApplicationCommandManager::ApplicationCommandManager() : firstTarget (nullptr) { @@ -312,3 +315,5 @@ void ApplicationCommandManager::globalFocusChanged (Component*) { commandStatusChanged(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h index 9baf3da991..396002134b 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -348,3 +348,5 @@ public: */ virtual void applicationCommandListChanged() = 0; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp index fa25e12444..17cd9a0a56 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ApplicationCommandTarget::CommandMessage : public MessageManager::MessageBase { public: @@ -186,3 +189,5 @@ ApplicationCommandTarget::InvocationInfo::InvocationInfo (const CommandID comman millisecsSinceKeyPressed (0) { } + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h index f37414180f..bec7308406 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -241,3 +241,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ApplicationCommandTarget) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp index 2293d58351..0a0232843b 100644 --- a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp +++ b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager& cm) : commandManager (cm) { @@ -412,3 +415,5 @@ void KeyPressMappingSet::globalFocusChanged (Component* focusedComponent) if (focusedComponent != nullptr) focusedComponent->keyStateChanged (false); } + +} // namespace juce diff --git a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h index 75e3ca5f3f..d850739bfa 100644 --- a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h +++ b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -241,3 +241,5 @@ private: KeyPressMappingSet& operator= (const KeyPressMappingSet&); JUCE_LEAK_DETECTOR (KeyPressMappingSet) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_CachedComponentImage.h b/modules/juce_gui_basics/components/juce_CachedComponentImage.h index fda4f550ee..7e2b5485d7 100644 --- a/modules/juce_gui_basics/components/juce_CachedComponentImage.h +++ b/modules/juce_gui_basics/components/juce_CachedComponentImage.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -67,3 +67,5 @@ public: */ virtual void releaseResources() = 0; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index cdd9d634fc..d69a2bbf73 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Component* Component::currentlyFocusedComponent = nullptr; @@ -3039,3 +3042,5 @@ bool Component::BailOutChecker::shouldBailOut() const noexcept { return safePointer == nullptr; } + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index 961609dee2..9c9c55a566 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -2372,3 +2372,5 @@ protected: virtual ComponentPeer* createNewPeer (int styleFlags, void* nativeWindowToAttachTo); #endif }; + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_ComponentListener.cpp b/modules/juce_gui_basics/components/juce_ComponentListener.cpp index 0c45b3f300..4f27a5109b 100644 --- a/modules/juce_gui_basics/components/juce_ComponentListener.cpp +++ b/modules/juce_gui_basics/components/juce_ComponentListener.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + void ComponentListener::componentMovedOrResized (Component&, bool, bool) {} void ComponentListener::componentBroughtToFront (Component&) {} void ComponentListener::componentVisibilityChanged (Component&) {} @@ -31,3 +34,5 @@ void ComponentListener::componentChildrenChanged (Component&) {} void ComponentListener::componentParentHierarchyChanged (Component&) {} void ComponentListener::componentNameChanged (Component&) {} void ComponentListener::componentBeingDeleted (Component&) {} + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_ComponentListener.h b/modules/juce_gui_basics/components/juce_ComponentListener.h index 9c24fb1b59..cc657b83a3 100644 --- a/modules/juce_gui_basics/components/juce_ComponentListener.h +++ b/modules/juce_gui_basics/components/juce_ComponentListener.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ public: */ virtual void componentBeingDeleted (Component& component); }; + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_Desktop.cpp b/modules/juce_gui_basics/components/juce_Desktop.cpp index 9317213fe2..edaf72f98b 100644 --- a/modules/juce_gui_basics/components/juce_Desktop.cpp +++ b/modules/juce_gui_basics/components/juce_Desktop.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Desktop::Desktop() : mouseSources (new MouseInputSource::SourceList()), mouseClickCounter (0), mouseWheelCounter (0), @@ -425,3 +428,5 @@ void Desktop::setGlobalScaleFactor (float newScaleFactor) noexcept displays->refresh(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_Desktop.h b/modules/juce_gui_basics/components/juce_Desktop.h index 502ca0fd97..a7486bfc7b 100644 --- a/modules/juce_gui_basics/components/juce_Desktop.h +++ b/modules/juce_gui_basics/components/juce_Desktop.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -470,3 +470,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Desktop) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp b/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp index d0cbb13f5b..b08f24014b 100644 --- a/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp +++ b/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ModalComponentManager::ModalItem : public ComponentMovementWatcher { public: @@ -311,3 +314,5 @@ ModalComponentManager::Callback* ModalCallbackFunction::create (std::function(), Point (100.0f, 0.0f), Point (0.0f, 100.0f)) { @@ -327,3 +330,5 @@ Path DrawableComposite::getOutlineAsPath() const p.applyTransform (getTransform()); return p; } + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableComposite.h b/modules/juce_gui_basics/drawables/juce_DrawableComposite.h index 00217e4f9c..b98bb62375 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableComposite.h +++ b/modules/juce_gui_basics/drawables/juce_DrawableComposite.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -159,3 +159,5 @@ private: DrawableComposite& operator= (const DrawableComposite&); JUCE_LEAK_DETECTOR (DrawableComposite) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp b/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp index c8f1770955..c7675afce2 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DrawableImage::DrawableImage() : opacity (1.0f), overlayColour (0x00000000) @@ -295,3 +298,5 @@ Path DrawableImage::getOutlineAsPath() const { return {}; // not applicable for images } + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableImage.h b/modules/juce_gui_basics/drawables/juce_DrawableImage.h index 818012e444..d1277174ab 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableImage.h +++ b/modules/juce_gui_basics/drawables/juce_DrawableImage.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -136,3 +136,5 @@ private: DrawableImage& operator= (const DrawableImage&); JUCE_LEAK_DETECTOR (DrawableImage) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp b/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp index 975a053851..a581e980f4 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DrawablePath::DrawablePath() { } @@ -570,3 +573,5 @@ ValueTree DrawablePath::createValueTree (ComponentBuilder::ImageProvider* imageP return tree; } + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawablePath.h b/modules/juce_gui_basics/drawables/juce_DrawablePath.h index 1dd33f7aee..66254d44c0 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawablePath.h +++ b/modules/juce_gui_basics/drawables/juce_DrawablePath.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -141,3 +141,5 @@ private: DrawablePath& operator= (const DrawablePath&); JUCE_LEAK_DETECTOR (DrawablePath) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp b/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp index 4bd0c70ecf..52a24ecd92 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DrawableRectangle::DrawableRectangle() { } @@ -183,3 +186,5 @@ ValueTree DrawableRectangle::createValueTree (ComponentBuilder::ImageProvider* i return tree; } + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h b/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h index f34e77b794..fbb3f77ccb 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h +++ b/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -99,3 +99,5 @@ private: DrawableRectangle& operator= (const DrawableRectangle&); JUCE_LEAK_DETECTOR (DrawableRectangle) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp b/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp index 9c23c44a7c..e93130a71a 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DrawableShape::DrawableShape() : strokeType (0.0f), mainFill (Colours::black), @@ -496,3 +499,5 @@ Path DrawableShape::getOutlineAsPath() const outline.applyTransform (getTransform()); return outline; } + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableShape.h b/modules/juce_gui_basics/drawables/juce_DrawableShape.h index 2cb7e3712a..10a89dd1d9 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableShape.h +++ b/modules/juce_gui_basics/drawables/juce_DrawableShape.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -187,3 +187,5 @@ private: DrawableShape& operator= (const DrawableShape&); }; + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableText.cpp b/modules/juce_gui_basics/drawables/juce_DrawableText.cpp index 3bfddce9d7..de6d7c2a2c 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableText.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawableText.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DrawableText::DrawableText() : colour (Colours::black), justification (Justification::centredLeft) @@ -372,3 +375,5 @@ Path DrawableText::getOutlineAsPath() const return pathOfAllGlyphs; } + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_DrawableText.h b/modules/juce_gui_basics/drawables/juce_DrawableText.h index 1033b0b665..637659ed8d 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableText.h +++ b/modules/juce_gui_basics/drawables/juce_DrawableText.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -155,3 +155,5 @@ private: DrawableText& operator= (const DrawableText&); JUCE_LEAK_DETECTOR (DrawableText) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp index 3f71281009..a2aaef12da 100644 --- a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp +++ b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class SVGState { public: @@ -1728,3 +1731,5 @@ Path Drawable::parseSVGPath (const String& svgPath) state.parsePathString (p, svgPath); return p; } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp index 5e9268fe94..b83d356253 100644 --- a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DirectoryContentsDisplayComponent::DirectoryContentsDisplayComponent (DirectoryContentsList& l) : directoryContentsList (l) { @@ -64,3 +67,5 @@ void DirectoryContentsDisplayComponent::sendDoubleClickMessage (const File& file listeners.callChecked (checker, &FileBrowserListener::fileDoubleClicked, file); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h index 77279ed5a2..d01427f682 100644 --- a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -110,3 +110,5 @@ protected: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryContentsDisplayComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp index 27a32cfa37..7db6e282ce 100644 --- a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DirectoryContentsList::DirectoryContentsList (const FileFilter* f, TimeSliceThread& t) : fileFilter (f), thread (t), fileTypeFlags (File::ignoreHiddenFiles | File::findFiles), @@ -258,3 +261,5 @@ bool DirectoryContentsList::addFile (const File& file, const bool isDir, return false; } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h index 33e062ff7a..50877c395b 100644 --- a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h +++ b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -219,3 +219,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryContentsList) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp index c7030fb88f..eb367095ba 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + FileBrowserComponent::FileBrowserComponent (int flags_, const File& initialFileOrDirectory, const FileFilter* fileFilter_, @@ -606,3 +609,5 @@ void FileBrowserComponent::timerCallback() refresh(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h index eb26c52556..148adeaebc 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -285,3 +285,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileBrowserComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserListener.h b/modules/juce_gui_basics/filebrowser/juce_FileBrowserListener.h index fe7776bcaf..45506a19d4 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserListener.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserListener.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -53,3 +53,5 @@ public: /** Callback when the browser's root folder changes. */ virtual void browserRootChanged (const File& newRoot) = 0; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp b/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp index 0e3995c757..024bafead1 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + FileChooser::FileChooser (const String& chooserBoxTitle, const File& currentFileOrDirectory, const String& fileFilters, @@ -150,3 +153,5 @@ File FileChooser::getResult() const //============================================================================== FilePreviewComponent::FilePreviewComponent() {} FilePreviewComponent::~FilePreviewComponent() {} + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooser.h b/modules/juce_gui_basics/filebrowser/juce_FileChooser.h index 82a31abb56..4584acc659 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooser.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -201,3 +201,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileChooser) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp index 642860daf3..22de557db7 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class FileChooserDialogBox::ContentComponent : public Component { public: @@ -269,3 +272,5 @@ void FileChooserDialogBox::createNewFolderConfirmed (const String& nameFromDialo content->chooserComponent.refresh(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h index feb82bdeaa..0ccd01df29 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -153,3 +153,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileChooserDialogBox) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp index 4e201007c4..65fc283103 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Image juce_createIconForFile (const File& file); @@ -255,3 +258,5 @@ void FileListComponent::returnKeyPressed (int currentSelectedRow) { sendDoubleClickMessage (directoryContentsList.getFile (currentSelectedRow)); } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileListComponent.h b/modules/juce_gui_basics/filebrowser/juce_FileListComponent.h index 3dbf93efc7..770e666c20 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileListComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileListComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -89,3 +89,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileListComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h b/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h index 74e99c6e2c..4781531371 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -61,3 +61,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilePreviewComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp index 0bee475fc3..e74e7f769c 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + FileSearchPathListComponent::FileSearchPathListComponent() : addButton ("+"), removeButton ("-"), @@ -266,3 +269,5 @@ void FileSearchPathListComponent::buttonClicked (Button* button) changed(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.h b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.h index 5119d96782..07c285378f 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -112,3 +112,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileSearchPathListComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp index 15bc43a44a..febfba3685 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Image juce_createIconForFile (const File&); //============================================================================== @@ -321,3 +324,5 @@ void FileTreeComponent::setItemHeight (int newHeight) root->treeHasChanged(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.h b/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.h index 46d2b21097..1a9a6cf2f3 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -100,3 +100,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileTreeComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp index fee3d6c964..11b718fd31 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + FilenameComponent::FilenameComponent (const String& name, const File& currentFile, const bool canEditFilename, @@ -268,3 +271,5 @@ void FilenameComponent::handleAsyncUpdate() Component::BailOutChecker checker (this); listeners.callChecked (checker, &FilenameComponentListener::filenameComponentChanged, this); } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h index d3768f738f..72706db6d3 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -229,3 +229,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilenameComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.cpp index c1d3e699d9..0de138337c 100644 --- a/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ImagePreviewComponent::ImagePreviewComponent() { } @@ -114,3 +117,5 @@ void ImagePreviewComponent::paint (Graphics& g) Justification::centredTop, numLines); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.h b/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.h index 0af35fefd0..df96266468 100644 --- a/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_ImagePreviewComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -62,3 +62,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ImagePreviewComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index 828632769c..9787ca6622 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -132,16 +132,16 @@ #include //============================================================================== -namespace juce -{ - #define ASSERT_MESSAGE_MANAGER_IS_LOCKED \ jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager()); #define ASSERT_MESSAGE_MANAGER_IS_LOCKED_OR_OFFSCREEN \ jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager() || getPeer() == nullptr); -extern bool juce_areThereAnyAlwaysOnTopWindows(); +namespace juce +{ + extern bool juce_areThereAnyAlwaysOnTopWindows(); +} #include "components/juce_Component.cpp" #include "components/juce_ComponentListener.cpp" @@ -311,5 +311,3 @@ extern bool juce_areThereAnyAlwaysOnTopWindows(); #include "native/juce_android_FileChooser.cpp" #endif - -} diff --git a/modules/juce_gui_basics/juce_gui_basics.h b/modules/juce_gui_basics/juce_gui_basics.h index 2597c67028..5ddb188b3e 100644 --- a/modules/juce_gui_basics/juce_gui_basics.h +++ b/modules/juce_gui_basics/juce_gui_basics.h @@ -112,55 +112,55 @@ //============================================================================== namespace juce { - -class Component; -class LookAndFeel; -class MouseInputSource; -class MouseInputSourceInternal; -class ComponentPeer; -class MarkerList; -class RelativeRectangle; -class MouseEvent; -struct MouseWheelDetails; -struct PenDetails; -class ToggleButton; -class TextButton; -class AlertWindow; -class TextLayout; -class ScrollBar; -class ComboBox; -class Button; -class FilenameComponent; -class DocumentWindow; -class ResizableWindow; -class GroupComponent; -class MenuBarComponent; -class DropShadower; -class GlyphArrangement; -class PropertyComponent; -class TableHeaderComponent; -class Toolbar; -class ToolbarItemComponent; -class PopupMenu; -class ProgressBar; -class FileBrowserComponent; -class DirectoryContentsDisplayComponent; -class FilePreviewComponent; -class ImageButton; -class CallOutBox; -class Drawable; -class DrawablePath; -class DrawableComposite; -class CaretComponent; -class BubbleComponent; -class KeyPressMappingSet; -class ApplicationCommandManagerListener; -class DrawableButton; - -#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS - class FlexBox; - class Grid; -#endif + class Component; + class LookAndFeel; + class MouseInputSource; + class MouseInputSourceInternal; + class ComponentPeer; + class MarkerList; + class RelativeRectangle; + class MouseEvent; + struct MouseWheelDetails; + struct PenDetails; + class ToggleButton; + class TextButton; + class AlertWindow; + class TextLayout; + class ScrollBar; + class ComboBox; + class Button; + class FilenameComponent; + class DocumentWindow; + class ResizableWindow; + class GroupComponent; + class MenuBarComponent; + class DropShadower; + class GlyphArrangement; + class PropertyComponent; + class TableHeaderComponent; + class Toolbar; + class ToolbarItemComponent; + class PopupMenu; + class ProgressBar; + class FileBrowserComponent; + class DirectoryContentsDisplayComponent; + class FilePreviewComponent; + class ImageButton; + class CallOutBox; + class Drawable; + class DrawablePath; + class DrawableComposite; + class CaretComponent; + class BubbleComponent; + class KeyPressMappingSet; + class ApplicationCommandManagerListener; + class DrawableButton; + + #if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS + class FlexBox; + class Grid; + #endif +} #include "mouse/juce_MouseCursor.h" #include "mouse/juce_MouseListener.h" @@ -297,19 +297,11 @@ class DrawableButton; // these classes are C++11-only #if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS -#include "layout/juce_FlexItem.h" -#include "layout/juce_FlexBox.h" -#endif - -#if JUCE_HAS_CONSTEXPR -#include "layout/juce_GridItem.h" -#include "layout/juce_Grid.h" - -constexpr Grid::Px operator"" _px (long double px) { return Grid::Px { px }; } -constexpr Grid::Px operator"" _px (unsigned long long px) { return Grid::Px { px }; } - -constexpr Grid::Fr operator"" _fr (unsigned long long fr) { return Grid::Fr { fr }; } + #include "layout/juce_FlexItem.h" + #include "layout/juce_FlexBox.h" + #if JUCE_HAS_CONSTEXPR + #include "layout/juce_GridItem.h" + #include "layout/juce_Grid.h" + #endif #endif - -} diff --git a/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp b/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp index fce9c35bc3..c1e0d1e931 100644 --- a/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp +++ b/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + CaretComponent::CaretComponent (Component* const keyFocusOwner) : owner (keyFocusOwner) { @@ -58,3 +61,5 @@ bool CaretComponent::shouldBeShown() const return owner == nullptr || (owner->hasKeyboardFocus (false) && ! owner->isCurrentlyBlockedByAnotherModalComponent()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_CaretComponent.h b/modules/juce_gui_basics/keyboard/juce_CaretComponent.h index acee48a28e..b21cc7b5c3 100644 --- a/modules/juce_gui_basics/keyboard/juce_CaretComponent.h +++ b/modules/juce_gui_basics/keyboard/juce_CaretComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -76,3 +76,5 @@ private: JUCE_DECLARE_NON_COPYABLE (CaretComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_KeyListener.cpp b/modules/juce_gui_basics/keyboard/juce_KeyListener.cpp index 38e9de545e..43c5bdb7a9 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyListener.cpp +++ b/modules/juce_gui_basics/keyboard/juce_KeyListener.cpp @@ -24,7 +24,12 @@ ============================================================================== */ +namespace juce +{ + bool KeyListener::keyStateChanged (const bool, Component*) { return false; } + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_KeyListener.h b/modules/juce_gui_basics/keyboard/juce_KeyListener.h index 1dc7b10cbd..f3cc762102 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyListener.h +++ b/modules/juce_gui_basics/keyboard/juce_KeyListener.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -72,3 +72,5 @@ public: */ virtual bool keyStateChanged (bool isKeyDown, Component* originatingComponent); }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp b/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp index 502a6a47f8..eec2a85bc9 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp +++ b/modules/juce_gui_basics/keyboard/juce_KeyPress.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + KeyPress::KeyPress() noexcept : keyCode (0), textCharacter (0) { @@ -302,3 +305,5 @@ String KeyPress::getTextDescriptionWithIcons() const return getTextDescription(); #endif } + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_KeyPress.h b/modules/juce_gui_basics/keyboard/juce_KeyPress.h index 7e4c20bb5e..5f0300485d 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyPress.h +++ b/modules/juce_gui_basics/keyboard/juce_KeyPress.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -269,3 +269,5 @@ private: JUCE_LEAK_DETECTOR (KeyPress) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp b/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp index 13afbd4027..7ca108be03 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp +++ b/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace KeyboardFocusHelpers { // This will sort a set of components, so that they are ordered in terms of @@ -127,3 +130,5 @@ Component* KeyboardFocusTraverser::getDefaultComponent (Component* parentCompone return comps.getFirst(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.h b/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.h index 856677cc7e..c6d88f0c48 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.h +++ b/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -85,3 +85,5 @@ public: */ virtual Component* getDefaultComponent (Component* parentComponent); }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp index 7fbb587429..5133ed23c6 100644 --- a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp +++ b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ModifierKeys::ModifierKeys() noexcept : flags (0) {} ModifierKeys::ModifierKeys (int rawFlags) noexcept : flags (rawFlags) {} ModifierKeys::ModifierKeys (const ModifierKeys& other) noexcept : flags (other.flags) {} @@ -51,3 +54,5 @@ int ModifierKeys::getNumMouseButtonsDown() const noexcept return num; } + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h index 3337b9adb4..61c02604b3 100644 --- a/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h +++ b/modules/juce_gui_basics/keyboard/juce_ModifierKeys.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -219,3 +219,5 @@ private: static ModifierKeys currentModifiers; static void updateCurrentModifiers() noexcept; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_SystemClipboard.h b/modules/juce_gui_basics/keyboard/juce_SystemClipboard.h index dbe6bdabd2..b00135dbaf 100644 --- a/modules/juce_gui_basics/keyboard/juce_SystemClipboard.h +++ b/modules/juce_gui_basics/keyboard/juce_SystemClipboard.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -44,3 +44,5 @@ public: */ static String getTextFromClipboard(); }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_TextEditorKeyMapper.h b/modules/juce_gui_basics/keyboard/juce_TextEditorKeyMapper.h index e8fd74f96f..05594ac45d 100644 --- a/modules/juce_gui_basics/keyboard/juce_TextEditorKeyMapper.h +++ b/modules/juce_gui_basics/keyboard/juce_TextEditorKeyMapper.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** This class is used to invoke a range of text-editor navigation methods on @@ -118,3 +118,5 @@ struct TextEditorKeyMapper return false; } }; + +} // namespace juce diff --git a/modules/juce_gui_basics/keyboard/juce_TextInputTarget.h b/modules/juce_gui_basics/keyboard/juce_TextInputTarget.h index e63a84a613..9d198be134 100644 --- a/modules/juce_gui_basics/keyboard/juce_TextInputTarget.h +++ b/modules/juce_gui_basics/keyboard/juce_TextInputTarget.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -91,3 +91,5 @@ public: */ virtual VirtualKeyboardType getKeyboardType() { return textKeyboard; } }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_AnimatedPosition.h b/modules/juce_gui_basics/layout/juce_AnimatedPosition.h index 7f75916fd1..7b4b320f4e 100644 --- a/modules/juce_gui_basics/layout/juce_AnimatedPosition.h +++ b/modules/juce_gui_basics/layout/juce_AnimatedPosition.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -205,3 +205,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AnimatedPosition) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_AnimatedPositionBehaviours.h b/modules/juce_gui_basics/layout/juce_AnimatedPositionBehaviours.h index 481e2be7ee..3be77da9be 100644 --- a/modules/juce_gui_basics/layout/juce_AnimatedPositionBehaviours.h +++ b/modules/juce_gui_basics/layout/juce_AnimatedPositionBehaviours.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Contains classes for different types of physics behaviours - these classes @@ -153,3 +153,5 @@ namespace AnimatedPositionBehaviours double targetSnapPosition; }; } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp index d322f4ae91..936660d221 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ComponentAnimator::AnimationTask { public: @@ -345,3 +348,5 @@ void ComponentAnimator::timerCallback() if (tasks.size() == 0) stopTimer(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentAnimator.h b/modules/juce_gui_basics/layout/juce_ComponentAnimator.h index 5a9441b7c6..85fdb1e775 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentAnimator.h +++ b/modules/juce_gui_basics/layout/juce_ComponentAnimator.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -157,3 +157,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentAnimator) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp index b34240c575..158cbe61f2 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ComponentBoundsConstrainer::ComponentBoundsConstrainer() noexcept {} ComponentBoundsConstrainer::~ComponentBoundsConstrainer() {} @@ -290,3 +293,5 @@ void ComponentBoundsConstrainer::checkBounds (Rectangle& bounds, jassert (! bounds.isEmpty()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h index e9d0a94937..16b8a44269 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h +++ b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -192,3 +192,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentBoundsConstrainer) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp b/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp index bd5b6c52db..f735f35efa 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace ComponentBuilderHelpers { static String getStateId (const ValueTree& state) @@ -281,3 +284,5 @@ void ComponentBuilder::updateChildComponents (Component& parent, const ValueTree componentsInOrder.getUnchecked(i)->toBehind (componentsInOrder.getUnchecked (i + 1)); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentBuilder.h b/modules/juce_gui_basics/layout/juce_ComponentBuilder.h index fc389b68a7..8d8d7debfd 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBuilder.h +++ b/modules/juce_gui_basics/layout/juce_ComponentBuilder.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -242,3 +242,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentBuilder) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.cpp b/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.cpp index c42f004b32..6e5cfe94e3 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ComponentMovementWatcher::ComponentMovementWatcher (Component* const comp) : component (comp), lastPeerID (0), @@ -139,3 +142,5 @@ void ComponentMovementWatcher::unregister() registeredParentComps.clear(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.h b/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.h index 0a1c55bd9f..583ae4e32f 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.h +++ b/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** An object that watches for any movement of a component or any of its parent components. @@ -91,3 +91,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentMovementWatcher) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp index 175699812e..f5dad1d1b1 100644 --- a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp +++ b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct ConcertinaPanel::PanelSizes { struct Panel @@ -451,3 +454,5 @@ void ConcertinaPanel::panelHeaderDoubleClicked (Component* component) if (! expandPanelFully (component, true)) setPanelSize (component, 0, true); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.h b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.h index 4670fd2ed6..aea9dbff62 100644 --- a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.h +++ b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -141,3 +141,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ConcertinaPanel) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_FlexBox.cpp b/modules/juce_gui_basics/layout/juce_FlexBox.cpp index fb042d3727..d647b15a3c 100644 --- a/modules/juce_gui_basics/layout/juce_FlexBox.cpp +++ b/modules/juce_gui_basics/layout/juce_FlexBox.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct FlexBoxLayoutCalculation { using Coord = double; @@ -851,3 +854,5 @@ FlexItem FlexItem::withHeight (float newHeight) const noexcept { auto fi = FlexItem FlexItem::withMargin (Margin m) const noexcept { auto fi = *this; fi.margin = m; return fi; } FlexItem FlexItem::withOrder (int newOrder) const noexcept { auto fi = *this; fi.order = newOrder; return fi; } FlexItem FlexItem::withAlignSelf (AlignSelf a) const noexcept { auto fi = *this; fi.alignSelf = a; return fi; } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_FlexBox.h b/modules/juce_gui_basics/layout/juce_FlexBox.h index 35b26e9fdf..b2c3e0929d 100644 --- a/modules/juce_gui_basics/layout/juce_FlexBox.h +++ b/modules/juce_gui_basics/layout/juce_FlexBox.h @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ /** Represents a FlexBox container, which contains and manages the layout of a set @@ -102,3 +104,5 @@ public: private: JUCE_LEAK_DETECTOR (FlexBox) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_FlexItem.h b/modules/juce_gui_basics/layout/juce_FlexItem.h index 3565c98990..b52c3b6f48 100644 --- a/modules/juce_gui_basics/layout/juce_FlexItem.h +++ b/modules/juce_gui_basics/layout/juce_FlexItem.h @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ /** Describes the properties of an item inside a FlexBox container. @@ -161,3 +163,5 @@ public: /** Returns a copy of this object with a new alignSelf value. */ FlexItem withAlignSelf (AlignSelf newAlignSelf) const noexcept; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_Grid.cpp b/modules/juce_gui_basics/layout/juce_Grid.cpp index f3c97ec303..74338d1d3a 100644 --- a/modules/juce_gui_basics/layout/juce_Grid.cpp +++ b/modules/juce_gui_basics/layout/juce_Grid.cpp @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ struct Grid::SizeCalculation { @@ -1023,3 +1025,5 @@ void Grid::performLayout (juce::Rectangle targetArea) c->setBounds (item->currentBounds.toNearestInt()); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_Grid.h b/modules/juce_gui_basics/layout/juce_Grid.h index 21d8cdbd42..bf8d8fd7d4 100644 --- a/modules/juce_gui_basics/layout/juce_Grid.h +++ b/modules/juce_gui_basics/layout/juce_Grid.h @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ /** Container that handles geometry for grid layouts (fixed columns and rows) using a set of declarative rules. @@ -172,3 +174,9 @@ private: struct AutoPlacement; struct BoxAlignment; }; + +constexpr Grid::Px operator"" _px (long double px) { return Grid::Px { px }; } +constexpr Grid::Px operator"" _px (unsigned long long px) { return Grid::Px { px }; } +constexpr Grid::Fr operator"" _fr (unsigned long long fr) { return Grid::Fr { fr }; } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_GridItem.cpp b/modules/juce_gui_basics/layout/juce_GridItem.cpp index 63101d9aa2..72088fb70b 100644 --- a/modules/juce_gui_basics/layout/juce_GridItem.cpp +++ b/modules/juce_gui_basics/layout/juce_GridItem.cpp @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ GridItem::Property::Property() noexcept : isAuto (true) { @@ -180,3 +182,5 @@ GridItem GridItem::withOrder (int newOrder) const noexcept gi.order = newOrder; return gi; } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_GridItem.h b/modules/juce_gui_basics/layout/juce_GridItem.h index e529079465..f57ab79810 100644 --- a/modules/juce_gui_basics/layout/juce_GridItem.h +++ b/modules/juce_gui_basics/layout/juce_GridItem.h @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ /** Defines an item in a Grid @@ -221,3 +223,5 @@ public: /** Returns a copy of this object with a new order. */ GridItem withOrder (int newOrder) const noexcept; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp b/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp index 52ccda6bd9..99084d0993 100644 --- a/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp +++ b/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct GridTests : public juce::UnitTest { GridTests() : juce::UnitTest ("Grid class") {} @@ -255,3 +258,5 @@ struct GridTests : public juce::UnitTest }; static GridTests gridUnitTests; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_GroupComponent.cpp b/modules/juce_gui_basics/layout/juce_GroupComponent.cpp index 172d3d7ef2..c632377069 100644 --- a/modules/juce_gui_basics/layout/juce_GroupComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_GroupComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + GroupComponent::GroupComponent (const String& name, const String& labelText) : Component (name), @@ -66,3 +69,5 @@ void GroupComponent::paint (Graphics& g) void GroupComponent::enablementChanged() { repaint(); } void GroupComponent::colourChanged() { repaint(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_GroupComponent.h b/modules/juce_gui_basics/layout/juce_GroupComponent.h index f8f3a2f05d..47ef9245db 100644 --- a/modules/juce_gui_basics/layout/juce_GroupComponent.h +++ b/modules/juce_gui_basics/layout/juce_GroupComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_DECLARE_NON_COPYABLE (GroupComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp b/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp index 65c7454200..94d0c88a91 100644 --- a/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp +++ b/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + MultiDocumentPanelWindow::MultiDocumentPanelWindow (Colour backgroundColour) : DocumentWindow (String(), backgroundColour, DocumentWindow::maximiseButton | DocumentWindow::closeButton, false) @@ -507,3 +510,5 @@ void MultiDocumentPanel::updateOrder() if (components != oldList) activeDocumentChanged(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.h b/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.h index b55f3de30b..a19c37c14f 100644 --- a/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.h +++ b/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class MultiDocumentPanel; @@ -300,3 +301,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MultiDocumentPanel) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.cpp b/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.cpp index ee4b1ee6bf..df67914306 100644 --- a/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ResizableBorderComponent::Zone::Zone() noexcept : zone (0) {} @@ -201,3 +204,5 @@ void ResizableBorderComponent::updateMouseZone (const MouseEvent& e) setMouseCursor (newZone.getMouseCursor()); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.h b/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.h index 612fd26eb5..53ec37e166 100644 --- a/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.h +++ b/modules/juce_gui_basics/layout/juce_ResizableBorderComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -191,3 +191,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableBorderComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.cpp b/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.cpp index 5e7ef095dc..7b3735cf06 100644 --- a/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ResizableCornerComponent::ResizableCornerComponent (Component* const componentToResize, ComponentBoundsConstrainer* const constrainer_) : component (componentToResize), @@ -99,3 +102,5 @@ bool ResizableCornerComponent::hitTest (int x, int y) return y >= yAtX - getHeight() / 4; } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.h b/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.h index 14b36f22b6..ae1f8264c9 100644 --- a/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.h +++ b/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A component that resizes a parent component when dragged. @@ -87,3 +87,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableCornerComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.cpp b/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.cpp index 9c3a78d02b..a4c8441be2 100644 --- a/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ResizableEdgeComponent::ResizableEdgeComponent (Component* const componentToResize, ComponentBoundsConstrainer* const constrainer_, Edge edge_) @@ -107,3 +110,5 @@ void ResizableEdgeComponent::mouseUp (const MouseEvent&) if (constrainer != nullptr) constrainer->resizeEnd(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.h b/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.h index 4d8b45e266..2063375c8f 100644 --- a/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.h +++ b/modules/juce_gui_basics/layout/juce_ResizableEdgeComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -95,3 +95,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableEdgeComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ScrollBar.cpp b/modules/juce_gui_basics/layout/juce_ScrollBar.cpp index e3aa126fdd..c84b71c126 100644 --- a/modules/juce_gui_basics/layout/juce_ScrollBar.cpp +++ b/modules/juce_gui_basics/layout/juce_ScrollBar.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ScrollBar::ScrollbarButton : public Button { public: @@ -428,3 +431,5 @@ bool ScrollBar::keyPressed (const KeyPress& key) return false; } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_ScrollBar.h b/modules/juce_gui_basics/layout/juce_ScrollBar.h index f94e905c21..34996d6a8e 100644 --- a/modules/juce_gui_basics/layout/juce_ScrollBar.h +++ b/modules/juce_gui_basics/layout/juce_ScrollBar.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -402,3 +402,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the ScrollBar::Listener class directly. */ typedef ScrollBar::Listener ScrollBarListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp b/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp index 64d2174714..75a52fa4f8 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp +++ b/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + StretchableLayoutManager::StretchableLayoutManager() : totalSize (0) { @@ -342,3 +345,5 @@ int StretchableLayoutManager::sizeToRealSize (double size, int totalSpace) return roundToInt (size); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.h b/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.h index 2e86faaa96..e6b72ed40f 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.h +++ b/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -256,3 +256,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StretchableLayoutManager) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.cpp b/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.cpp index c23baabe9b..dd009a7b81 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.cpp +++ b/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + StretchableLayoutResizerBar::StretchableLayoutResizerBar (StretchableLayoutManager* layout_, const int index, const bool vertical) @@ -73,3 +76,5 @@ void StretchableLayoutResizerBar::hasBeenMoved() if (Component* parent = getParentComponent()) parent->resized(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.h b/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.h index 87b18cfd2a..e1a20509f8 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.h +++ b/modules/juce_gui_basics/layout/juce_StretchableLayoutResizerBar.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -100,3 +100,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StretchableLayoutResizerBar) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.cpp b/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.cpp index 7fada6a5b3..bf56dea75a 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.cpp +++ b/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + StretchableObjectResizer::StretchableObjectResizer() {} StretchableObjectResizer::~StretchableObjectResizer() {} @@ -116,3 +119,5 @@ void StretchableObjectResizer::resizeToFit (const double targetSize) break; } } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.h b/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.h index c7e368fd06..32543b115f 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.h +++ b/modules/juce_gui_basics/layout/juce_StretchableObjectResizer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -97,3 +97,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StretchableObjectResizer) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp index 2e83ec0564..0031a1882d 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + TabBarButton::TabBarButton (const String& name, TabbedButtonBar& owner_) : Button (name), owner (owner_), overlapPixels (0), extraCompPlacement (afterText) { @@ -585,3 +588,5 @@ void TabbedButtonBar::currentTabChanged (const int, const String&) void TabbedButtonBar::popupMenuClickOnTab (const int, const String&) { } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h index cb46a0e332..a788408c93 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class TabbedButtonBar; @@ -366,3 +367,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TabbedButtonBar) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp index 1e731df3df..d6349e32f1 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace TabbedComponentHelpers { const Identifier deleteComponentId ("deleteByTabComp_"); @@ -314,3 +317,5 @@ void TabbedComponent::changeCallback (const int newCurrentTabIndex, const String void TabbedComponent::currentTabChanged (const int, const String&) {} void TabbedComponent::popupMenuClickOnTab (const int, const String&) {} + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.h b/modules/juce_gui_basics/layout/juce_TabbedComponent.h index 0dac8a02c1..f62846e656 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedComponent.h +++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -221,3 +221,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TabbedComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_Viewport.cpp b/modules/juce_gui_basics/layout/juce_Viewport.cpp index aaebbb3249..a1f746aa12 100644 --- a/modules/juce_gui_basics/layout/juce_Viewport.cpp +++ b/modules/juce_gui_basics/layout/juce_Viewport.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Viewport::Viewport (const String& name) : Component (name) { // content holder is used to clip the contents so they don't overlap the scrollbars @@ -578,3 +581,5 @@ bool Viewport::respondsToKey (const KeyPress& key) { return isUpDownKeyPress (key) || isLeftRightKeyPress (key); } + +} // namespace juce diff --git a/modules/juce_gui_basics/layout/juce_Viewport.h b/modules/juce_gui_basics/layout/juce_Viewport.h index 7da6dfd272..32fe809b2e 100644 --- a/modules/juce_gui_basics/layout/juce_Viewport.h +++ b/modules/juce_gui_basics/layout/juce_Viewport.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -306,3 +306,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Viewport) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp index 4fd176651f..d2faffbaab 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + static Typeface::Ptr getTypefaceForFontFromLookAndFeel (const Font& font) { return LookAndFeel::getDefaultLookAndFeel().getTypefaceForFont (font); @@ -150,3 +152,5 @@ bool LookAndFeel::isUsingNativeAlertWindows() return useNativeAlertWindows; #endif } + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h index 81267298a0..997180a517 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** This class is used to hold a few look and feel base classes which are associated @@ -229,3 +230,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp index d885965656..837bdfb11b 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + LookAndFeel_V1::LookAndFeel_V1() { setColour (TextButton::buttonColourId, Colour (0xffbbbbff)); @@ -567,3 +570,5 @@ void LookAndFeel_V1::positionDocumentWindowButtons (DocumentWindow&, if (minimiseButton != nullptr) minimiseButton->setBounds (x, titleBarY - 2, buttonW, titleBarH); } + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h index f9f7089403..45950042d1 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -97,3 +98,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V1) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp index 4622efd7b4..14510a9003 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace LookAndFeelHelpers { static Colour createBaseColour (Colour buttonColour, @@ -3018,3 +3021,5 @@ void LookAndFeel_V2::drawGlassLozenge (Graphics& g, g.setColour (colour.darker().withMultipliedAlpha (1.5f)); g.strokePath (outline, PathStrokeType (outlineThickness)); } + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h index 268f22a6d7..af0b365888 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -373,3 +373,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V2) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp index b0090d8e31..25dffe0b29 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + LookAndFeel_V3::LookAndFeel_V3() { setColour (TreeView::selectedItemBackgroundColourId, Colour (0x301111ee)); @@ -637,3 +640,5 @@ Path LookAndFeel_V3::getCrossShape (const float height) p.scaleToFit (0, 0, height * 2.0f, height, true); return p; } + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.h index dc0be9ca5c..7a3bdcb4d8 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -92,3 +93,5 @@ private: Image backgroundTexture; Colour backgroundTextureBaseColour; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp index 304a321f50..e888e91c55 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ Colour LookAndFeel_V4::ColourScheme::getUIColour (UIColour index) const noexcept { @@ -1429,3 +1431,5 @@ void LookAndFeel_V4::initialiseColours() for (int i = 0; i < numElementsInArray (coloursToUse); i += 2) setColour ((int) coloursToUse [i], Colour ((uint32) coloursToUse [i + 1])); } + +} // namespace juce diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h index 76b1371f98..2c03e0f894 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ class JUCE_API LookAndFeel_V4 : public LookAndFeel_V3 { @@ -238,3 +238,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V4) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/menus/juce_MenuBarComponent.cpp b/modules/juce_gui_basics/menus/juce_MenuBarComponent.cpp index bc9515b5be..b24072acdf 100644 --- a/modules/juce_gui_basics/menus/juce_MenuBarComponent.cpp +++ b/modules/juce_gui_basics/menus/juce_MenuBarComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + MenuBarComponent::MenuBarComponent (MenuBarModel* m) : model (nullptr), itemUnderMouse (-1), @@ -352,3 +355,5 @@ void MenuBarComponent::timerCallback() stopTimer(); updateItemUnderMouse (getMouseXYRelative()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/menus/juce_MenuBarComponent.h b/modules/juce_gui_basics/menus/juce_MenuBarComponent.h index 96a00c8f53..82f9a4e089 100644 --- a/modules/juce_gui_basics/menus/juce_MenuBarComponent.h +++ b/modules/juce_gui_basics/menus/juce_MenuBarComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -115,3 +115,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MenuBarComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/menus/juce_MenuBarModel.cpp b/modules/juce_gui_basics/menus/juce_MenuBarModel.cpp index e5be870ab8..fcc06afe98 100644 --- a/modules/juce_gui_basics/menus/juce_MenuBarModel.cpp +++ b/modules/juce_gui_basics/menus/juce_MenuBarModel.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + MenuBarModel::MenuBarModel() noexcept : manager (nullptr) { @@ -93,3 +96,5 @@ void MenuBarModel::handleMenuBarActivate (bool isActive) void MenuBarModel::menuBarActivated (bool) {} void MenuBarModel::Listener::menuBarActivated (MenuBarModel*, bool) {} + +} // namespace juce diff --git a/modules/juce_gui_basics/menus/juce_MenuBarModel.h b/modules/juce_gui_basics/menus/juce_MenuBarModel.h index 01e6023d60..a4b7d9c0ec 100644 --- a/modules/juce_gui_basics/menus/juce_MenuBarModel.h +++ b/modules/juce_gui_basics/menus/juce_MenuBarModel.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -189,3 +189,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the MenuBarModel::Listener class directly. */ typedef MenuBarModel::Listener MenuBarModelListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index 738aedb2f1..a36feeb25e 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace PopupMenuSettings { const int scrollZone = 24; @@ -1844,3 +1847,5 @@ PopupMenu::Item& PopupMenu::MenuItemIterator::getItem() const noexcept jassert (currentItem != nullptr); return *(currentItem); } + +} // namespace juce diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.h b/modules/juce_gui_basics/menus/juce_PopupMenu.h index 276fb62a43..10ecd898fc 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.h +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Creates and displays a popup-menu. @@ -750,3 +750,5 @@ private: JUCE_LEAK_DETECTOR (PopupMenu) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp b/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp index b2595731a7..13ce260eb6 100644 --- a/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp +++ b/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + BubbleComponent::BubbleComponent() : allowablePlacements (above | below | left | right) { @@ -144,3 +147,5 @@ void BubbleComponent::setPosition (Rectangle rectangleToPointTo, setBounds (targetX - arrowTip.x, targetY - arrowTip.y, totalW, totalH); } + +} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_BubbleComponent.h b/modules/juce_gui_basics/misc/juce_BubbleComponent.h index 4b03495c2b..fe253274fc 100644 --- a/modules/juce_gui_basics/misc/juce_BubbleComponent.h +++ b/modules/juce_gui_basics/misc/juce_BubbleComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -181,3 +181,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BubbleComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_DropShadower.cpp b/modules/juce_gui_basics/misc/juce_DropShadower.cpp index 42cac3e67b..8f4fcb0724 100644 --- a/modules/juce_gui_basics/misc/juce_DropShadower.cpp +++ b/modules/juce_gui_basics/misc/juce_DropShadower.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class DropShadower::ShadowWindow : public Component { public: @@ -216,3 +219,5 @@ void DropShadower::updateShadows() shadowWindows.clear(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_DropShadower.h b/modules/juce_gui_basics/misc/juce_DropShadower.h index d201430b7e..9137609869 100644 --- a/modules/juce_gui_basics/misc/juce_DropShadower.h +++ b/modules/juce_gui_basics/misc/juce_DropShadower.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -76,3 +76,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DropShadower) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp index 387c481283..7ab23c3edd 100644 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp +++ b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /* ============================================================================== @@ -354,3 +357,5 @@ void JUCESplashScreen::mouseUp (const MouseEvent&) } // END SECTION A + +} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h index fc733568be..ab58d9db17 100644 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h +++ b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h @@ -38,7 +38,8 @@ // BEGIN SECTION A -#pragma once +namespace juce +{ /** The standard JUCE splash screen component. @@ -70,3 +71,5 @@ private: }; // END SECTION A + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_ComponentDragger.cpp b/modules/juce_gui_basics/mouse/juce_ComponentDragger.cpp index d5c9f37092..5f01eb8c98 100644 --- a/modules/juce_gui_basics/mouse/juce_ComponentDragger.cpp +++ b/modules/juce_gui_basics/mouse/juce_ComponentDragger.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ComponentDragger::ComponentDragger() {} ComponentDragger::~ComponentDragger() {} @@ -61,3 +64,5 @@ void ComponentDragger::dragComponent (Component* const componentToDrag, const Mo componentToDrag->setBounds (bounds); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_ComponentDragger.h b/modules/juce_gui_basics/mouse/juce_ComponentDragger.h index ab6141cdcd..dedf284f7e 100644 --- a/modules/juce_gui_basics/mouse/juce_ComponentDragger.h +++ b/modules/juce_gui_basics/mouse/juce_ComponentDragger.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -96,3 +96,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentDragger) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp b/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp index 14bf227fe8..4fc7e112d8 100644 --- a/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp +++ b/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + bool juce_performDragDropFiles (const StringArray&, const bool copyFiles, bool& shouldStop); bool juce_performDragDropText (const String&, bool& shouldStop); @@ -526,3 +529,5 @@ void FileDragAndDropTarget::fileDragExit (const StringArray&) {} void TextDragAndDropTarget::textDragEnter (const String&, int, int) {} void TextDragAndDropTarget::textDragMove (const String&, int, int) {} void TextDragAndDropTarget::textDragExit (const String&) {} + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h b/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h index 05793358ea..437037d38c 100644 --- a/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h +++ b/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -212,3 +212,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DragAndDropContainer) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_DragAndDropTarget.h b/modules/juce_gui_basics/mouse/juce_DragAndDropTarget.h index 886948e9ff..b7be4d4868 100644 --- a/modules/juce_gui_basics/mouse/juce_DragAndDropTarget.h +++ b/modules/juce_gui_basics/mouse/juce_DragAndDropTarget.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -149,3 +149,5 @@ private: virtual int itemDropped (const String&, Component*, int, int) { return 0; } #endif }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_FileDragAndDropTarget.h b/modules/juce_gui_basics/mouse/juce_FileDragAndDropTarget.h index 465e234c91..e6491dcce5 100644 --- a/modules/juce_gui_basics/mouse/juce_FileDragAndDropTarget.h +++ b/modules/juce_gui_basics/mouse/juce_FileDragAndDropTarget.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ /** Components derived from this class can have files dropped onto them by an external application. @@ -100,3 +101,5 @@ public: */ virtual void filesDropped (const StringArray& files, int x, int y) = 0; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_LassoComponent.h b/modules/juce_gui_basics/mouse/juce_LassoComponent.h index 77663e5e09..f2c278b118 100644 --- a/modules/juce_gui_basics/mouse/juce_LassoComponent.h +++ b/modules/juce_gui_basics/mouse/juce_LassoComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -219,3 +219,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LassoComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp b/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp index 7716e519af..dad75c06d5 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct CustomMouseCursorInfo { CustomMouseCursorInfo (const Image& im, int hsX, int hsY) noexcept @@ -213,3 +216,5 @@ void MouseCursor::hideWaitCursor() { Desktop::getInstance().getMainMouseSource().revealCursor(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseCursor.h b/modules/juce_gui_basics/mouse/juce_MouseCursor.h index 0856fd6560..4ad39b1de6 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseCursor.h +++ b/modules/juce_gui_basics/mouse/juce_MouseCursor.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -178,3 +178,5 @@ private: JUCE_LEAK_DETECTOR (MouseCursor) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseEvent.cpp b/modules/juce_gui_basics/mouse/juce_MouseEvent.cpp index 7990995645..126d0ada07 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseEvent.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseEvent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + MouseEvent::MouseEvent (MouseInputSource inputSource, Point pos, ModifierKeys modKeys, @@ -136,3 +139,5 @@ static int doubleClickTimeOutMs = 400; int MouseEvent::getDoubleClickTimeout() noexcept { return doubleClickTimeOutMs; } void MouseEvent::setDoubleClickTimeout (const int newTime) noexcept { doubleClickTimeOutMs = newTime; } + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseEvent.h b/modules/juce_gui_basics/mouse/juce_MouseEvent.h index 44a7a49f1a..4643cc368a 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseEvent.h +++ b/modules/juce_gui_basics/mouse/juce_MouseEvent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -437,3 +438,5 @@ struct PenDetails */ float tiltY; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.cpp b/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.cpp index 6ac495c0ea..45b35219a0 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + MouseInactivityDetector::MouseInactivityDetector (Component& c) : targetComp (c), delayMs (1500), toleranceDistance (15), isActive (true) { @@ -70,3 +73,5 @@ void MouseInactivityDetector::setActive (bool b) : &Listener::mouseBecameInactive); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.h b/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.h index 790c44b3a6..f8c6a5e555 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.h +++ b/modules/juce_gui_basics/mouse/juce_MouseInactivityDetector.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MouseInactivityDetector) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp b/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp index 3717e06678..541d542183 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class MouseInputSourceInternal : private AsyncUpdater { public: @@ -748,3 +751,5 @@ struct MouseInputSource::SourceList : public Timer OwnedArray sources; Array sourceArray; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseInputSource.h b/modules/juce_gui_basics/mouse/juce_MouseInputSource.h index 3a8d51ad2b..b7e62e511c 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseInputSource.h +++ b/modules/juce_gui_basics/mouse/juce_MouseInputSource.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -252,3 +252,5 @@ private: JUCE_LEAK_DETECTOR (MouseInputSource) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseListener.cpp b/modules/juce_gui_basics/mouse/juce_MouseListener.cpp index abe9ff512c..984a436f29 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseListener.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseListener.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + void MouseListener::mouseEnter (const MouseEvent&) {} void MouseListener::mouseExit (const MouseEvent&) {} void MouseListener::mouseDown (const MouseEvent&) {} @@ -32,3 +35,5 @@ void MouseListener::mouseDrag (const MouseEvent&) {} void MouseListener::mouseMove (const MouseEvent&) {} void MouseListener::mouseDoubleClick (const MouseEvent&) {} void MouseListener::mouseWheelMove (const MouseEvent&, const MouseWheelDetails&) {} + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_MouseListener.h b/modules/juce_gui_basics/mouse/juce_MouseListener.h index fd467ba82b..859b91dec2 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseListener.h +++ b/modules/juce_gui_basics/mouse/juce_MouseListener.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -161,3 +161,5 @@ private: virtual int mouseWheelMove (const MouseEvent&, float, float) { return 0; } #endif }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h b/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h index c78c970727..19211b0157 100644 --- a/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h +++ b/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Manages a list of selectable items. @@ -319,3 +319,5 @@ private: JUCE_LEAK_DETECTOR (SelectedItemSet) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_TextDragAndDropTarget.h b/modules/juce_gui_basics/mouse/juce_TextDragAndDropTarget.h index 9cba6b2611..088065c249 100644 --- a/modules/juce_gui_basics/mouse/juce_TextDragAndDropTarget.h +++ b/modules/juce_gui_basics/mouse/juce_TextDragAndDropTarget.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -101,3 +101,5 @@ public: */ virtual void textDropped (const String& text, int x, int y) = 0; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/mouse/juce_TooltipClient.h b/modules/juce_gui_basics/mouse/juce_TooltipClient.h index 1219822a68..9f8c0b9152 100644 --- a/modules/juce_gui_basics/mouse/juce_TooltipClient.h +++ b/modules/juce_gui_basics/mouse/juce_TooltipClient.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -81,3 +81,5 @@ protected: private: String tooltipString; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_MultiTouchMapper.h b/modules/juce_gui_basics/native/juce_MultiTouchMapper.h index 5cca8b5416..ed27ec1977 100644 --- a/modules/juce_gui_basics/native/juce_MultiTouchMapper.h +++ b/modules/juce_gui_basics/native/juce_MultiTouchMapper.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ template class MultiTouchMapper @@ -62,8 +63,8 @@ public: bool areAnyTouchesActive() const noexcept { - for (int i = currentTouches.size(); --i >= 0;) - if (currentTouches.getUnchecked(i) != 0) + for (auto& t : currentTouches) + if (t != 0) return true; return false; @@ -74,3 +75,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MultiTouchMapper) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_android_FileChooser.cpp b/modules/juce_gui_basics/native/juce_android_FileChooser.cpp index aa8ed4f72c..27fb00d238 100644 --- a/modules/juce_gui_basics/native/juce_android_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_android_FileChooser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + void FileChooser::showPlatformDialog (Array& /*results*/, const String& /*title*/, const File& /*currentFileOrDirectory*/, @@ -45,3 +48,5 @@ bool FileChooser::isPlatformDialogAvailable() { return false; } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index ba5ac8a7f4..9240440be1 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -24,8 +24,6 @@ ============================================================================== */ -} // (juce namespace) - extern juce::JUCEApplicationBase* juce_CreateApplication(); // (from START_JUCE_APPLICATION) namespace juce @@ -1064,3 +1062,5 @@ const int KeyPress::playKey = extendedKeyModifier + 45; const int KeyPress::stopKey = extendedKeyModifier + 46; const int KeyPress::fastForwardKey = extendedKeyModifier + 47; const int KeyPress::rewindKey = extendedKeyModifier + 48; + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index 113eacc859..d935d3ceee 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class UIViewComponentPeer; // The way rotation works changed in iOS8.. @@ -95,7 +98,7 @@ namespace Orientations } //============================================================================== -} // (juce namespace) +} // namespace juce using namespace juce; @@ -327,8 +330,7 @@ static bool isKioskModeView (JuceUIViewController* c) MultiTouchMapper UIViewComponentPeer::currentTouches; - -} // (juce namespace) +} // namespace juce //============================================================================== //============================================================================== @@ -1169,3 +1171,5 @@ const int KeyPress::playKey = 0x30000; const int KeyPress::stopKey = 0x30001; const int KeyPress::fastForwardKey = 0x30002; const int KeyPress::rewindKey = 0x30003; + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_ios_Windowing.mm b/modules/juce_gui_basics/native/juce_ios_Windowing.mm index a82990358d..7007bcaefa 100644 --- a/modules/juce_gui_basics/native/juce_ios_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_ios_Windowing.mm @@ -24,18 +24,19 @@ ============================================================================== */ -extern bool isIOSAppActive; - -struct AppInactivityCallback // NB: careful, this declaration is duplicated in other modules +namespace juce { - virtual ~AppInactivityCallback() {} - virtual void appBecomingInactive() = 0; -}; + extern bool isIOSAppActive; -// This is an internal list of callbacks (but currently used between modules) -Array appBecomingInactiveCallbacks; + struct AppInactivityCallback // NB: careful, this declaration is duplicated in other modules + { + virtual ~AppInactivityCallback() {} + virtual void appBecomingInactive() = 0; + }; -} // (juce namespace) + // This is an internal list of callbacks (but currently used between modules) + Array appBecomingInactiveCallbacks; +} @interface JuceAppStartupDelegate : NSObject { @@ -478,3 +479,5 @@ void Desktop::Displays::findDisplays (float masterScale) displays.add (d); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp index 8a485abc22..ceab192946 100644 --- a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static bool exeIsAvailable (const char* const executable) { ChildProcess child; @@ -206,3 +209,5 @@ void FileChooser::showPlatformDialog (Array& results, previousWorkingDirectory.setAsCurrentWorkingDirectory(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_linux_X11.cpp b/modules/juce_gui_basics/native/juce_linux_X11.cpp index af009643d8..e9625b65df 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11.cpp +++ b/modules/juce_gui_basics/native/juce_linux_X11.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + typedef void (*WindowMessageReceiveCallback) (XEvent&); WindowMessageReceiveCallback dispatchWindowMessage = nullptr; @@ -333,3 +336,5 @@ GetXProperty::~GetXProperty() if (data != nullptr) XFree (data); } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_linux_X11.h b/modules/juce_gui_basics/native/juce_linux_X11.h index 00c55bf126..f4235a7b9e 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11.h +++ b/modules/juce_gui_basics/native/juce_linux_X11.h @@ -24,13 +24,6 @@ ============================================================================== */ -#pragma once - -// Hack to forward declare _XDisplay outside the -// juce namespace - -} - struct _XDisplay; namespace juce @@ -142,3 +135,5 @@ struct GetXProperty }; #undef ATOM_TYPE + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_linux_X11_Clipboard.cpp b/modules/juce_gui_basics/native/juce_linux_X11_Clipboard.cpp index 9c8e92b5bd..8c3427b097 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11_Clipboard.cpp +++ b/modules/juce_gui_basics/native/juce_linux_X11_Clipboard.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + extern ::Window juce_messageWindowHandle; namespace ClipboardHelpers @@ -273,3 +276,5 @@ String SystemClipboard::getTextFromClipboard() return content; } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp index 9d5ca6e53b..0182cf4776 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_DEBUG && ! defined (JUCE_DEBUG_XERRORS) #define JUCE_DEBUG_XERRORS 1 #endif @@ -4358,3 +4361,5 @@ bool DragAndDropContainer::performExternalDragDropOfText (const String& text, Co jassertfalse; return false; } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index f0f99d8d86..333850c5d7 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MAC struct FileChooserDelegateClass : public ObjCClass @@ -273,3 +276,5 @@ void FileChooser::showPlatformDialog (Array&, } #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index 8b5812cbee..2da59ea343 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class JuceMainMenuHandler : private MenuBarModel::Listener, private DeletedAtShutdown { @@ -724,3 +727,5 @@ NSMenu* createNSMenu (const PopupMenu& menu, const String& name, jassertfalse; // calling this before making sure the OSX main menu stuff was initialised? return nil; } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm b/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm index 36e05219d8..5cd37e0fb4 100644 --- a/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm +++ b/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm @@ -24,12 +24,15 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MAC //============================================================================== namespace MouseCursorHelpers { - NSImage* createNSImage (const Image&, float scaleFactor = 1.f); + NSImage* createNSImage (const Image&, float scaleFactor = 1.0f); NSImage* createNSImage (const Image& image, float scaleFactor) { JUCE_AUTORELEASEPOOL @@ -207,3 +210,5 @@ void MouseCursor::showInAllWindows() const void MouseCursor::showInWindow (ComponentPeer*) const {} #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 3b0244b5ca..1102b0c6dc 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -24,14 +24,16 @@ ============================================================================== */ -typedef void (*AppFocusChangeCallback)(); -extern AppFocusChangeCallback appFocusChangeCallback; -typedef bool (*CheckEventBlockedByModalComps) (NSEvent*); -extern CheckEventBlockedByModalComps isEventBlockedByModalComps; +namespace juce +{ + typedef void (*AppFocusChangeCallback)(); + extern AppFocusChangeCallback appFocusChangeCallback; + typedef bool (*CheckEventBlockedByModalComps) (NSEvent*); + extern CheckEventBlockedByModalComps isEventBlockedByModalComps; +} //============================================================================== #if ! (defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7) -} // (juce namespace) @interface NSEvent (JuceDeviceDelta) - (CGFloat) scrollingDeltaX; @@ -40,9 +42,11 @@ extern CheckEventBlockedByModalComps isEventBlockedByModalComps; - (BOOL) isDirectionInvertedFromDevice; @end -namespace juce { #endif +namespace juce +{ + //============================================================================== static CGFloat getMainScreenHeight() noexcept { @@ -2193,3 +2197,5 @@ const int KeyPress::playKey = 0x30000; const int KeyPress::stopKey = 0x30001; const int KeyPress::fastForwardKey = 0x30002; const int KeyPress::rewindKey = 0x30003; + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm index 3a6e57390d..47b9490544 100644 --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm @@ -24,13 +24,9 @@ ============================================================================== */ -} // namespace juce - -#include "../../juce_core/native/juce_osx_ObjCHelpers.h" - -namespace juce { +namespace juce +{ -//============================================================================== void LookAndFeel::playAlertSound() { NSBeep(); @@ -619,3 +615,5 @@ bool Desktop::isOSXDarkModeActive() return [[[NSUserDefaults standardUserDefaults] stringForKey: nsStringLiteral ("AppleInterfaceStyle")] isEqualToString: nsStringLiteral ("Dark")]; } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp b/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp index 53de33836c..5db2b1266a 100644 --- a/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp +++ b/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace DragAndDropHelpers { //============================================================================== @@ -282,3 +285,5 @@ bool DragAndDropContainer::performExternalDragDropOfText (const String& text, Co return DragAndDropHelpers::performDragDrop (&format, &medium, DROPEFFECT_COPY | DROPEFFECT_MOVE); } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp index ae2de01ea8..bb352b23b0 100644 --- a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace FileChooserHelpers { struct FileChooserCallbackInfo @@ -296,3 +299,5 @@ void FileChooser::showPlatformDialog (Array& results, const String& title_ results.add (File (String (files.get()))); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 12602fa149..c6f97e2f52 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -24,6 +24,13 @@ ============================================================================== */ +#if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client + #include +#endif + +namespace juce +{ + #undef GetSystemMetrics // multimon overrides this for some reason and causes a mess.. // these are in the windows SDK, but need to be repeated here for GCC.. @@ -41,10 +48,6 @@ #define WM_APPCOMMAND 0x0319 #endif -#if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client - #include -#endif - extern void juce_repeatLastProcessPriority(); extern void juce_checkCurrentlyFocusedTopLevelWindow(); // in juce_TopLevelWindow.cpp extern bool juce_isRunningInWine(); @@ -4173,3 +4176,5 @@ void MouseCursor::showInAllWindows() const { showInWindow (nullptr); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_MarkerList.cpp b/modules/juce_gui_basics/positioning/juce_MarkerList.cpp index ee61180f07..7651dceedc 100644 --- a/modules/juce_gui_basics/positioning/juce_MarkerList.cpp +++ b/modules/juce_gui_basics/positioning/juce_MarkerList.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + MarkerList::MarkerList() { } @@ -278,3 +281,5 @@ void MarkerList::ValueTreeWrapper::readFrom (const MarkerList& markerList, UndoM for (int i = 0; i < markerList.getNumMarkers(); ++i) setMarker (*markerList.getMarker(i), undoManager); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_MarkerList.h b/modules/juce_gui_basics/positioning/juce_MarkerList.h index 8d6da7f7e0..c73f1f5ab9 100644 --- a/modules/juce_gui_basics/positioning/juce_MarkerList.h +++ b/modules/juce_gui_basics/positioning/juce_MarkerList.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -180,3 +180,5 @@ private: JUCE_LEAK_DETECTOR (MarkerList) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp index ce79716939..fcb803bafb 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + const String RelativeCoordinate::Strings::parent ("parent"); const String RelativeCoordinate::Strings::left ("left"); const String RelativeCoordinate::Strings::right ("right"); @@ -147,3 +150,5 @@ String RelativeCoordinate::toString() const { return term.toString(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h index 507dfcd499..55d3edfded 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -175,3 +175,5 @@ private: //============================================================================== Expression term; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp b/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp index 7260710de1..9afd38ee78 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct MarkerListScope : public Expression::Scope { MarkerListScope (Component& comp) : component (comp) {} @@ -317,3 +320,5 @@ void RelativeCoordinatePositionerBase::unregisterListeners() sourceComponents.clear(); sourceMarkerLists.clear(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.h b/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.h index 74abf43601..038f9dec65 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.h +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -88,3 +88,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RelativeCoordinatePositionerBase) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp b/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp index 92ad11fc4a..3d9f6ed919 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + RelativeParallelogram::RelativeParallelogram() { } @@ -134,3 +137,5 @@ Rectangle RelativeParallelogram::getBoundingBox (const Point* cons const Point points[] = { p[0], p[1], p[2], p[1] + (p[2] - p[0]) }; return Rectangle::findAreaContainingPoints (points, 4); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.h b/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.h index 38ab861eac..afd88c9f0c 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.h +++ b/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -61,3 +61,5 @@ public: //============================================================================== RelativePoint topLeft, topRight, bottomLeft; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativePoint.cpp b/modules/juce_gui_basics/positioning/juce_RelativePoint.cpp index 5f9228c202..51895b2983 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativePoint.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativePoint.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace RelativePointHelpers { inline void skipComma (String::CharPointerType& s) @@ -95,3 +98,5 @@ bool RelativePoint::isDynamic() const { return x.isDynamic() || y.isDynamic(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativePoint.h b/modules/juce_gui_basics/positioning/juce_RelativePoint.h index cb874f6e2a..7bf446690b 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativePoint.h +++ b/modules/juce_gui_basics/positioning/juce_RelativePoint.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -86,3 +86,5 @@ public: // The actual X and Y coords... RelativeCoordinate x, y; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativePointPath.cpp b/modules/juce_gui_basics/positioning/juce_RelativePointPath.cpp index 5f36d46ef8..ee57e48895 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativePointPath.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativePointPath.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + RelativePointPath::RelativePointPath() : usesNonZeroWinding (true), containsDynamicPoints (false) @@ -292,3 +295,5 @@ RelativePointPath::ElementBase* RelativePointPath::CubicTo::clone() const { return new CubicTo (controlPoints[0], controlPoints[1], controlPoints[2]); } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativePointPath.h b/modules/juce_gui_basics/positioning/juce_RelativePointPath.h index ff628db343..6e648a5fe1 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativePointPath.h +++ b/modules/juce_gui_basics/positioning/juce_RelativePointPath.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -187,3 +187,5 @@ private: RelativePointPath& operator= (const RelativePointPath&); JUCE_LEAK_DETECTOR (RelativePointPath) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeRectangle.cpp b/modules/juce_gui_basics/positioning/juce_RelativeRectangle.cpp index d2b73580e5..574be97676 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeRectangle.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeRectangle.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace RelativeRectangleHelpers { inline void skipComma (String::CharPointerType& s) @@ -262,3 +265,5 @@ void RelativeRectangle::applyToComponent (Component& component) const component.setBounds (resolve (nullptr).getSmallestIntegerContainer()); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/positioning/juce_RelativeRectangle.h b/modules/juce_gui_basics/positioning/juce_RelativeRectangle.h index b634adc659..4113769de7 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeRectangle.h +++ b/modules/juce_gui_basics/positioning/juce_RelativeRectangle.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -103,3 +103,5 @@ public: // The actual rectangle coords... RelativeCoordinate left, right, top, bottom; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp index bbf568a638..0e5dbdc08f 100644 --- a/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + BooleanPropertyComponent::BooleanPropertyComponent (const String& name, const String& buttonTextWhenTrue, const String& buttonTextWhenFalse) @@ -85,3 +88,5 @@ void BooleanPropertyComponent::buttonClicked (Button*) { setState (! getState()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.h b/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.h index 37e112c682..061541a70d 100644 --- a/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -107,3 +107,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BooleanPropertyComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp index 00343f65a8..3d3a1b0ffa 100644 --- a/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ButtonPropertyComponent::ButtonPropertyComponent (const String& name, const bool triggerOnMouseDown) : PropertyComponent (name) @@ -46,3 +49,5 @@ void ButtonPropertyComponent::buttonClicked (Button*) { buttonClicked(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.h b/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.h index 64390c805a..1415b8cd1c 100644 --- a/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -74,3 +74,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ButtonPropertyComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp index 7c26d26362..c788ae3920 100644 --- a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ChoicePropertyComponent::RemapperValueSource : public Value::ValueSource, private Value::Listener { @@ -152,3 +155,5 @@ void ChoicePropertyComponent::comboBoxChanged (ComboBox*) setIndex (newIndex); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h index c9ffe6d092..600a23cc7f 100644 --- a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -119,3 +119,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChoicePropertyComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_PropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_PropertyComponent.cpp index 81ee114e9b..19136a5e76 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_PropertyComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + PropertyComponent::PropertyComponent (const String& name, const int preferredHeight_) : Component (name), preferredHeight (preferredHeight_) { @@ -50,3 +53,5 @@ void PropertyComponent::enablementChanged() { repaint(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_PropertyComponent.h b/modules/juce_gui_basics/properties/juce_PropertyComponent.h index c6e2ec6e29..263b3b5cf3 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_PropertyComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -139,3 +139,5 @@ protected: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PropertyComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp index a12c436a89..c2e5842d5a 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp +++ b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct PropertyPanel::SectionComponent : public Component { SectionComponent (const String& sectionTitle, @@ -374,3 +377,5 @@ const String& PropertyPanel::getMessageWhenEmpty() const noexcept { return messageWhenEmpty; } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_PropertyPanel.h b/modules/juce_gui_basics/properties/juce_PropertyPanel.h index 24150eb1f7..49ab8fde4e 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyPanel.h +++ b/modules/juce_gui_basics/properties/juce_PropertyPanel.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -173,3 +173,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PropertyPanel) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp index 4db6859a7d..439ef36cf5 100644 --- a/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + SliderPropertyComponent::SliderPropertyComponent (const String& name, const double rangeMin, const double rangeMax, @@ -82,3 +85,5 @@ void SliderPropertyComponent::sliderValueChanged (Slider*) if (getValue() != slider.getValue()) setValue (slider.getValue()); } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.h b/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.h index 9a30dbbc29..944d6c1b9c 100644 --- a/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -105,3 +105,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderPropertyComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp index 3193f110bf..290b8fd478 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class TextPropertyComponent::LabelComp : public Label, public FileDragAndDropTarget { @@ -181,3 +184,5 @@ void TextPropertyComponent::setInterestedInFileDrag (bool isInterested) if (textEditor != nullptr) textEditor->setInterestedInFileDrag (isInterested); } + +} // namespace juce diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h index 5a10ca6f5e..2d208e32a7 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -153,3 +153,5 @@ private: /** This typedef is just for compatibility with old code and VC6 - newer code should use TextPropertyComponent::Listener instead. */ typedef TextPropertyComponent::Listener TextPropertyComponentListener; #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.cpp b/modules/juce_gui_basics/widgets/juce_ComboBox.cpp index a601c86b0e..a3f5dd6485 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ComboBox::ComboBox (const String& name) : Component (name), lastCurrentId (0), @@ -651,3 +654,5 @@ void ComboBox::clear (const bool dontSendChange) void ComboBox::setSelectedItemIndex (const int index, const bool dontSendChange) { setSelectedItemIndex (index, dontSendChange ? dontSendNotification : sendNotification); } void ComboBox::setSelectedId (const int newItemId, const bool dontSendChange) { setSelectedId (newItemId, dontSendChange ? dontSendNotification : sendNotification); } void ComboBox::setText (const String& newText, const bool dontSendChange) { setText (newText, dontSendChange ? dontSendNotification : sendNotification); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.h b/modules/juce_gui_basics/widgets/juce_ComboBox.h index 09d02984f9..2092287629 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.h +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -448,3 +448,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the ComboBox::Listener class directly. */ typedef ComboBox::Listener ComboBoxListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ImageComponent.cpp b/modules/juce_gui_basics/widgets/juce_ImageComponent.cpp index 77d2a98074..3dac30c5f6 100644 --- a/modules/juce_gui_basics/widgets/juce_ImageComponent.cpp +++ b/modules/juce_gui_basics/widgets/juce_ImageComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ImageComponent::ImageComponent (const String& name) : Component (name), placement (RectanglePlacement::centred) @@ -77,3 +80,5 @@ void ImageComponent::paint (Graphics& g) g.setOpacity (1.0f); g.drawImage (image, getLocalBounds().toFloat(), placement); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ImageComponent.h b/modules/juce_gui_basics/widgets/juce_ImageComponent.h index 3957d58f64..3872634729 100644 --- a/modules/juce_gui_basics/widgets/juce_ImageComponent.h +++ b/modules/juce_gui_basics/widgets/juce_ImageComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -74,3 +74,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ImageComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_Label.cpp b/modules/juce_gui_basics/widgets/juce_Label.cpp index 7304090f07..403c7d3a45 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.cpp +++ b/modules/juce_gui_basics/widgets/juce_Label.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + Label::Label (const String& name, const String& labelText) : Component (name), textValue (labelText), @@ -472,3 +475,5 @@ void Label::textEditorFocusLost (TextEditor& ed) { textEditorTextChanged (ed); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_Label.h b/modules/juce_gui_basics/widgets/juce_Label.h index 7b0aa30d63..34104cdf0d 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.h +++ b/modules/juce_gui_basics/widgets/juce_Label.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -351,3 +351,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the Label::Listener class directly. */ typedef Label::Listener LabelListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.cpp b/modules/juce_gui_basics/widgets/juce_ListBox.cpp index 9c303a9809..7f39a4eca8 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ListBox.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ListBox::RowComponent : public Component, public TooltipClient { @@ -950,3 +953,5 @@ void ListBoxModel::listWasScrolled() {} var ListBoxModel::getDragSourceDescription (const SparseSet&) { return {}; } String ListBoxModel::getTooltipForRow (int) { return {}; } MouseCursor ListBoxModel::getMouseCursorForRow (int) { return MouseCursor::NormalCursor; } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.h b/modules/juce_gui_basics/widgets/juce_ListBox.h index 31275dc68f..191af7824f 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.h +++ b/modules/juce_gui_basics/widgets/juce_ListBox.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -598,3 +598,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ListBox) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ProgressBar.cpp b/modules/juce_gui_basics/widgets/juce_ProgressBar.cpp index c0ed84250a..67f3e4885d 100644 --- a/modules/juce_gui_basics/widgets/juce_ProgressBar.cpp +++ b/modules/juce_gui_basics/widgets/juce_ProgressBar.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ProgressBar::ProgressBar (double& progress_) : progress (progress_), displayPercentage (true), @@ -111,3 +114,5 @@ void ProgressBar::timerCallback() repaint(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ProgressBar.h b/modules/juce_gui_basics/widgets/juce_ProgressBar.h index 5ce9410a34..8837fdff00 100644 --- a/modules/juce_gui_basics/widgets/juce_ProgressBar.h +++ b/modules/juce_gui_basics/widgets/juce_ProgressBar.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -133,3 +133,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProgressBar) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_Slider.cpp b/modules/juce_gui_basics/widgets/juce_Slider.cpp index 3ed9282792..f667139da9 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.cpp +++ b/modules/juce_gui_basics/widgets/juce_Slider.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class Slider::Pimpl : private AsyncUpdater, private Button::Listener, private Label::Listener, @@ -1621,3 +1624,5 @@ void Slider::mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& wheel if (! (isEnabled() && pimpl->mouseWheelMove (e, wheel))) Component::mouseWheelMove (e, wheel); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_Slider.h b/modules/juce_gui_basics/widgets/juce_Slider.h index 63e583ab6c..ae60454c96 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.h +++ b/modules/juce_gui_basics/widgets/juce_Slider.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -940,3 +940,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the Slider::Listener class directly. */ typedef Slider::Listener SliderListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp index 296888af0e..b939a4ba75 100644 --- a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp +++ b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class TableHeaderComponent::DragOverlayComp : public Component { public: @@ -893,3 +896,5 @@ void TableHeaderComponent::showColumnChooserMenu (const int columnIdClicked) void TableHeaderComponent::Listener::tableColumnDraggingChanged (TableHeaderComponent*, int) { } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h index 51ad376a0f..bccb5bbfe2 100644 --- a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h +++ b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -455,3 +455,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the TableHeaderComponent::Listener class directly. */ typedef TableHeaderComponent::Listener TableHeaderListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TableListBox.cpp b/modules/juce_gui_basics/widgets/juce_TableListBox.cpp index 220d50e917..784bdbeba1 100644 --- a/modules/juce_gui_basics/widgets/juce_TableListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_TableListBox.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class TableListBox::RowComp : public Component, public TooltipClient { @@ -483,3 +486,5 @@ Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code that recycles the components return nullptr; } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TableListBox.h b/modules/juce_gui_basics/widgets/juce_TableListBox.h index 7b36e0707b..050d831012 100644 --- a/modules/juce_gui_basics/widgets/juce_TableListBox.h +++ b/modules/juce_gui_basics/widgets/juce_TableListBox.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -345,3 +345,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableListBox) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp index 133af341f7..3e9ee97234 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + // a word or space that can't be broken down any further struct TextAtom { @@ -2519,3 +2522,5 @@ void TextEditor::coalesceSimilarSections() } } } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.h b/modules/juce_gui_basics/widgets/juce_TextEditor.h index 30a6465141..9a3960eb24 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.h +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -770,3 +770,5 @@ private: /** This typedef is just for compatibility with old code - newer code should use the TextEditor::Listener class directly. */ typedef TextEditor::Listener TextEditorListener; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp index 258d0e6961..aa5126ae11 100644 --- a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp +++ b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + const char* const Toolbar::toolbarDragDescriptor = "_toolbarItem_"; //============================================================================== @@ -811,3 +814,5 @@ void Toolbar::showCustomisationDialog (ToolbarItemFactory& factory, const int op (new CustomisationDialog (factory, *this, optionFlags)) ->enterModalState (true, nullptr, true); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_Toolbar.h b/modules/juce_gui_basics/widgets/juce_Toolbar.h index 1065886358..4950dd5b3d 100644 --- a/modules/juce_gui_basics/widgets/juce_Toolbar.h +++ b/modules/juce_gui_basics/widgets/juce_Toolbar.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class ToolbarItemComponent; class ToolbarItemFactory; @@ -326,3 +327,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Toolbar) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.cpp b/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.cpp index 707d63d2c5..154ef827e9 100644 --- a/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.cpp +++ b/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ToolbarItemFactory::ToolbarItemFactory() {} ToolbarItemFactory::~ToolbarItemFactory() {} @@ -235,3 +238,5 @@ void ToolbarItemComponent::setEditingMode (const ToolbarEditingMode newMode) resized(); } } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.h b/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.h index 76248b59f2..662ca6bc2c 100644 --- a/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.h +++ b/modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -201,3 +201,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToolbarItemComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ToolbarItemFactory.h b/modules/juce_gui_basics/widgets/juce_ToolbarItemFactory.h index f9d1520044..d6c4fdde8d 100644 --- a/modules/juce_gui_basics/widgets/juce_ToolbarItemFactory.h +++ b/modules/juce_gui_basics/widgets/juce_ToolbarItemFactory.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -104,3 +104,5 @@ public: */ virtual ToolbarItemComponent* createItem (int itemId) = 0; }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp b/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp index c0b47edb96..474e4742a8 100644 --- a/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp +++ b/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ToolbarItemPalette::ToolbarItemPalette (ToolbarItemFactory& tbf, Toolbar& bar) : factory (tbf), toolbar (bar) { @@ -106,3 +109,5 @@ void ToolbarItemPalette::resized() itemHolder->setSize (maxX, y + height + 8); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.h b/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.h index 8321657d00..a281baa258 100644 --- a/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.h +++ b/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -72,3 +72,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToolbarItemPalette) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TreeView.cpp b/modules/juce_gui_basics/widgets/juce_TreeView.cpp index 68874a224b..c34e7ec5f0 100644 --- a/modules/juce_gui_basics/widgets/juce_TreeView.cpp +++ b/modules/juce_gui_basics/widgets/juce_TreeView.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class TreeView::ContentComponent : public Component, public TooltipClient, public AsyncUpdater @@ -1905,3 +1908,5 @@ TreeViewItem::OpennessRestorer::~OpennessRestorer() if (oldOpenness != nullptr) treeViewItem.restoreOpennessState (*oldOpenness); } + +} // namespace juce diff --git a/modules/juce_gui_basics/widgets/juce_TreeView.h b/modules/juce_gui_basics/widgets/juce_TreeView.h index e2f407c9c5..1db4dacd37 100644 --- a/modules/juce_gui_basics/widgets/juce_TreeView.h +++ b/modules/juce_gui_basics/widgets/juce_TreeView.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class TreeView; @@ -934,3 +935,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeView) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp index 87983568c5..b019f7d34f 100644 --- a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static juce_wchar getDefaultPasswordChar() noexcept { #if JUCE_LINUX @@ -721,3 +724,5 @@ bool AlertWindow::showNativeDialogBox (const String& title, return true; } #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_AlertWindow.h b/modules/juce_gui_basics/windows/juce_AlertWindow.h index cd8426cb76..e3f3ce5692 100644 --- a/modules/juce_gui_basics/windows/juce_AlertWindow.h +++ b/modules/juce_gui_basics/windows/juce_AlertWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A window that displays a message and has buttons for the user to react to it. @@ -486,3 +486,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AlertWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_CallOutBox.cpp b/modules/juce_gui_basics/windows/juce_CallOutBox.cpp index 6ab46c14d3..d867b8748b 100644 --- a/modules/juce_gui_basics/windows/juce_CallOutBox.cpp +++ b/modules/juce_gui_basics/windows/juce_CallOutBox.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + CallOutBox::CallOutBox (Component& c, const Rectangle& area, Component* const parent) : arrowSize (16.0f), content (c), dismissalMouseClicksAreAlwaysConsumed (false) { @@ -259,3 +262,5 @@ void CallOutBox::timerCallback() toFront (true); stopTimer(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_CallOutBox.h b/modules/juce_gui_basics/windows/juce_CallOutBox.h index 728b14af61..0a52efbf3f 100644 --- a/modules/juce_gui_basics/windows/juce_CallOutBox.h +++ b/modules/juce_gui_basics/windows/juce_CallOutBox.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -182,3 +182,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CallOutBox) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp index 19e3361990..feb9aacd04 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static uint32 lastUniquePeerID = 1; //============================================================================== @@ -574,3 +577,5 @@ void ComponentPeer::setRepresentedFile (const File&) //============================================================================== int ComponentPeer::getCurrentRenderingEngine() const { return 0; } void ComponentPeer::setCurrentRenderingEngine (int index) { jassert (index == 0); ignoreUnused (index); } + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.h b/modules/juce_gui_basics/windows/juce_ComponentPeer.h index 65e46e69cc..819cc8d93f 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.h +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -378,3 +378,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentPeer) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_DialogWindow.cpp b/modules/juce_gui_basics/windows/juce_DialogWindow.cpp index b03824d6dd..0c6af0d1ee 100644 --- a/modules/juce_gui_basics/windows/juce_DialogWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_DialogWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + DialogWindow::DialogWindow (const String& name, Colour colour, const bool escapeCloses, const bool onDesktop) : DocumentWindow (name, colour, DocumentWindow::closeButton, onDesktop), @@ -174,3 +177,5 @@ int DialogWindow::showModalDialog (const String& dialogTitle, return o.runModal(); } #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_DialogWindow.h b/modules/juce_gui_basics/windows/juce_DialogWindow.h index 0ee09dfa44..f0df0a9654 100644 --- a/modules/juce_gui_basics/windows/juce_DialogWindow.h +++ b/modules/juce_gui_basics/windows/juce_DialogWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -258,3 +258,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DialogWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp b/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp index ad5d6e7865..c81be075a2 100644 --- a/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class DocumentWindow::ButtonListenerProxy : public Button::Listener { public: @@ -360,3 +363,5 @@ void DocumentWindow::userTriedToCloseWindow() { closeButtonPressed(); } + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_DocumentWindow.h b/modules/juce_gui_basics/windows/juce_DocumentWindow.h index 493f30141c..d6da6cd363 100644 --- a/modules/juce_gui_basics/windows/juce_DocumentWindow.h +++ b/modules/juce_gui_basics/windows/juce_DocumentWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -291,3 +291,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DocumentWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_NativeMessageBox.h b/modules/juce_gui_basics/windows/juce_NativeMessageBox.h index 2aa4d49e9f..347dac1161 100644 --- a/modules/juce_gui_basics/windows/juce_NativeMessageBox.h +++ b/modules/juce_gui_basics/windows/juce_NativeMessageBox.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -203,3 +204,5 @@ private: NativeMessageBox() JUCE_DELETED_FUNCTION; JUCE_DECLARE_NON_COPYABLE (NativeMessageBox) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp index 00ee3c687d..9807ba2fcb 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ResizableWindow::ResizableWindow (const String& name, bool shouldAddToDesktop) : TopLevelWindow (name, shouldAddToDesktop) { @@ -644,3 +647,5 @@ void ResizableWindow::addAndMakeVisible (Component* const child, int zOrder) Component::addAndMakeVisible (child, zOrder); } #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index df44baf66f..fd81cc933e 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -406,3 +406,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp b/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp index 57b3ba79a7..eba08a01f1 100644 --- a/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + ThreadWithProgressWindow::ThreadWithProgressWindow (const String& title, const bool hasProgressBar, const bool hasCancelButton, @@ -114,3 +117,5 @@ bool ThreadWithProgressWindow::runThread (const int priority) return ! wasCancelledByUser; } #endif + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.h b/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.h index 78e913a909..d996157bea 100644 --- a/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.h +++ b/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -170,3 +170,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadWithProgressWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp b/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp index 565ad0acca..65db7ff941 100644 --- a/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + TooltipWindow::TooltipWindow (Component* parentComp, int delayMs) : Component ("tooltip"), millisecondsBeforeTipAppears (delayMs) @@ -175,3 +178,5 @@ void TooltipWindow::timerCallback() } } } + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_TooltipWindow.h b/modules/juce_gui_basics/windows/juce_TooltipWindow.h index b4a6656b5f..7ef54a5a31 100644 --- a/modules/juce_gui_basics/windows/juce_TooltipWindow.h +++ b/modules/juce_gui_basics/windows/juce_TooltipWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -140,3 +140,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TooltipWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp b/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp index c32ea2a372..1f0e135243 100644 --- a/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Keeps track of the active top level window. */ class TopLevelWindowManager : private Timer, private DeletedAtShutdown @@ -353,3 +356,5 @@ TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() noexcept return best; } + +} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_TopLevelWindow.h b/modules/juce_gui_basics/windows/juce_TopLevelWindow.h index 9ee8d93765..51b146d721 100644 --- a/modules/juce_gui_basics/windows/juce_TopLevelWindow.h +++ b/modules/juce_gui_basics/windows/juce_TopLevelWindow.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -160,3 +160,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TopLevelWindow) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp index 11555a2f03..778dde8f44 100644 --- a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp @@ -24,8 +24,8 @@ ============================================================================== */ -#include "juce_CPlusPlusCodeTokeniserFunctions.h" - +namespace juce +{ //============================================================================== CPlusPlusCodeTokeniser::CPlusPlusCodeTokeniser() {} @@ -71,3 +71,5 @@ bool CPlusPlusCodeTokeniser::isReservedKeyword (const String& token) noexcept { return CppTokeniserFunctions::isReservedKeyword (token.getCharPointer(), token.length()); } + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.h b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.h index 88111a8e85..0eaa420460 100644 --- a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.h +++ b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -67,3 +67,5 @@ private: //============================================================================== JUCE_LEAK_DETECTOR (CPlusPlusCodeTokeniser) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h index f4ddfdf5e7..9eb2d8d0d4 100644 --- a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h +++ b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** Class containing some basic functions for simple tokenising of C++ code. @@ -661,3 +661,5 @@ struct CppTokeniserFunctions return mo.toString(); } }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp b/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp index 57bc14a2e2..713b933cf2 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class CodeDocumentLine { public: @@ -990,3 +993,5 @@ void CodeDocument::remove (const int startPos, const int endPos, const bool undo listeners.call (&CodeDocument::Listener::codeDocumentTextDeleted, startPos, endPos); } } + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CodeDocument.h b/modules/juce_gui_extra/code_editor/juce_CodeDocument.h index f0fbd1a009..7c18a00f63 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeDocument.h +++ b/modules/juce_gui_extra/code_editor/juce_CodeDocument.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class CodeDocumentLine; @@ -413,3 +414,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CodeDocument) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp index c001c9b4e8..5d9feeb415 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class CodeEditorComponent::CodeEditorLine { public: @@ -1642,3 +1645,5 @@ String CodeEditorComponent::State::toString() const { return String (lastTopLine) + ":" + String (lastCaretPos) + ":" + String (lastSelectionEnd); } + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h index e0a1265c31..ffa33c4eab 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ class CodeTokeniser; @@ -430,3 +431,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CodeEditorComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_CodeTokeniser.h b/modules/juce_gui_extra/code_editor/juce_CodeTokeniser.h index 18834c725a..5e5e1ab3e0 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeTokeniser.h +++ b/modules/juce_gui_extra/code_editor/juce_CodeTokeniser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -54,3 +54,5 @@ public: private: JUCE_LEAK_DETECTOR (CodeTokeniser) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp b/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp index d4d10478e4..f01bdff66f 100644 --- a/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp +++ b/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct LuaTokeniserFunctions { static bool isReservedKeyword (String::CharPointerType token, const int tokenLength) noexcept @@ -233,3 +236,5 @@ CodeEditorComponent::ColourScheme LuaTokeniser::getDefaultColourScheme() return cs; } + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.h b/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.h index 35f63eef5f..5628cfa59f 100644 --- a/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.h +++ b/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -60,3 +60,5 @@ private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LuaTokeniser) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.cpp b/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.cpp index 974b7ce55a..192598db5a 100644 --- a/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.cpp +++ b/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + XmlTokeniser::XmlTokeniser() {} XmlTokeniser::~XmlTokeniser() {} @@ -166,3 +169,5 @@ int XmlTokeniser::readNextToken (CodeDocument::Iterator& source) return tokenType_identifier; } + +} // namespace juce diff --git a/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.h b/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.h index 20d06fba3d..9fb3f87918 100644 --- a/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.h +++ b/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -58,3 +58,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (XmlTokeniser) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp index 4c34585ca9..2edffd32c0 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + FileBasedDocument::FileBasedDocument (const String& fileExtension_, const String& fileWildcard_, const String& openFileDialogTitle_, @@ -259,3 +262,5 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool w return userCancelledSave; } #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.h b/modules/juce_gui_extra/documents/juce_FileBasedDocument.h index 1191f93c2a..42e39270d5 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.h +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -290,3 +290,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileBasedDocument) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/embedding/juce_ActiveXControlComponent.h b/modules/juce_gui_extra/embedding/juce_ActiveXControlComponent.h index ed1ce9734a..b4a8f9cba9 100644 --- a/modules/juce_gui_extra/embedding/juce_ActiveXControlComponent.h +++ b/modules/juce_gui_extra/embedding/juce_ActiveXControlComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_WINDOWS || DOXYGEN @@ -123,3 +124,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/embedding/juce_NSViewComponent.h b/modules/juce_gui_extra/embedding/juce_NSViewComponent.h index 896722bde8..2db7fe5c93 100644 --- a/modules/juce_gui_extra/embedding/juce_NSViewComponent.h +++ b/modules/juce_gui_extra/embedding/juce_NSViewComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_MAC || DOXYGEN @@ -85,3 +86,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/embedding/juce_UIViewComponent.h b/modules/juce_gui_extra/embedding/juce_UIViewComponent.h index 4558bbd9a7..d478aef286 100644 --- a/modules/juce_gui_extra/embedding/juce_UIViewComponent.h +++ b/modules/juce_gui_extra/embedding/juce_UIViewComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_IOS || DOXYGEN @@ -84,3 +85,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h index 8456e3d8d7..e3935e451c 100644 --- a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h +++ b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ /** @internal */ bool juce_handleXEmbedEvent (ComponentPeer*, void*); @@ -109,3 +110,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp index f89e0a86ec..457081d807 100644 --- a/modules/juce_gui_extra/juce_gui_extra.cpp +++ b/modules/juce_gui_extra/juce_gui_extra.cpp @@ -83,9 +83,6 @@ #endif //============================================================================== -namespace juce -{ - #include "documents/juce_FileBasedDocument.cpp" #include "code_editor/juce_CodeDocument.cpp" #include "code_editor/juce_CodeEditorComponent.cpp" @@ -102,13 +99,6 @@ namespace juce #include "misc/juce_LiveConstantEditor.cpp" #include "misc/juce_AnimatedAppComponent.cpp" -} - -using namespace juce; - -namespace juce -{ - //============================================================================== #if JUCE_MAC || JUCE_IOS @@ -159,10 +149,12 @@ namespace juce #endif #if JUCE_WEB_BROWSER - bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; } - void WebBrowserComponent::pageFinishedLoading (const String&) {} - bool WebBrowserComponent::pageLoadHadNetworkError (const String&) { return true; } - void WebBrowserComponent::windowCloseRequest() {} - void WebBrowserComponent::newWindowAttemptingToLoad (const String&) {} -#endif +namespace juce +{ + bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; } + void WebBrowserComponent::pageFinishedLoading (const String&) {} + bool WebBrowserComponent::pageLoadHadNetworkError (const String&) { return true; } + void WebBrowserComponent::windowCloseRequest() {} + void WebBrowserComponent::newWindowAttemptingToLoad (const String&) {} } +#endif diff --git a/modules/juce_gui_extra/juce_gui_extra.h b/modules/juce_gui_extra/juce_gui_extra.h index c1162ba751..e01397a1f0 100644 --- a/modules/juce_gui_extra/juce_gui_extra.h +++ b/modules/juce_gui_extra/juce_gui_extra.h @@ -74,9 +74,6 @@ #endif //============================================================================== -namespace juce -{ - #include "documents/juce_FileBasedDocument.h" #include "code_editor/juce_CodeDocument.h" #include "code_editor/juce_CodeEditorComponent.h" @@ -100,5 +97,3 @@ namespace juce #include "misc/juce_WebBrowserComponent.h" #include "misc/juce_LiveConstantEditor.h" #include "misc/juce_AnimatedAppComponent.h" - -} diff --git a/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.cpp b/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.cpp index 6f461d066f..424b973197 100644 --- a/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AnimatedAppComponent::AnimatedAppComponent() : lastUpdateTime (Time::getCurrentTime()), totalUpdates (0) { @@ -48,3 +51,5 @@ void AnimatedAppComponent::timerCallback() repaint(); lastUpdateTime = Time::getCurrentTime(); } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.h b/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.h index eeb29e1525..9d84552772 100644 --- a/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.h +++ b/modules/juce_gui_extra/misc/juce_AnimatedAppComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -72,3 +72,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AnimatedAppComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_AppleRemote.h b/modules/juce_gui_extra/misc/juce_AppleRemote.h index c784e7129d..1f27dc9d15 100644 --- a/modules/juce_gui_extra/misc/juce_AppleRemote.h +++ b/modules/juce_gui_extra/misc/juce_AppleRemote.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== #if JUCE_MAC || DOXYGEN @@ -112,3 +112,5 @@ private: }; #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.cpp b/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.cpp index 556dae356d..a3aa074024 100644 --- a/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + BubbleMessageComponent::BubbleMessageComponent (int fadeOutLengthMs) : fadeOutLength (fadeOutLengthMs), mouseClickCounter (0), expiryTime (0), deleteAfterUse (false) @@ -118,3 +121,5 @@ void BubbleMessageComponent::hide (const bool fadeOut) if (deleteAfterUse) delete this; } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.h b/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.h index d63e107206..785d542a96 100644 --- a/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.h +++ b/modules/juce_gui_extra/misc/juce_BubbleMessageComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -126,3 +126,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BubbleMessageComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_ColourSelector.cpp b/modules/juce_gui_extra/misc/juce_ColourSelector.cpp index 662fa0dc18..f41c64f849 100644 --- a/modules/juce_gui_extra/misc/juce_ColourSelector.cpp +++ b/modules/juce_gui_extra/misc/juce_ColourSelector.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class ColourSelector::ColourComponentSlider : public Slider { public: @@ -43,7 +46,6 @@ public: return (double) text.getHexValue32(); } -private: JUCE_DECLARE_NON_COPYABLE (ColourComponentSlider) }; @@ -64,7 +66,6 @@ public: g.drawEllipse (2.0f, 2.0f, getWidth() - 4.0f, getHeight() - 4.0f, 1.0f); } -private: JUCE_DECLARE_NON_COPYABLE (ColourSpaceMarker) }; @@ -570,3 +571,5 @@ void ColourSelector::setSwatchColour (int, const Colour&) { jassertfalse; // if you've overridden getNumSwatches(), you also need to implement this method } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_ColourSelector.h b/modules/juce_gui_extra/misc/juce_ColourSelector.h index 6d9aa2ef90..83c2fe622d 100644 --- a/modules/juce_gui_extra/misc/juce_ColourSelector.h +++ b/modules/juce_gui_extra/misc/juce_ColourSelector.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -167,3 +167,5 @@ private: ColourSelector (bool); #endif }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp index 4b87b07595..c619b24120 100644 --- a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class KeyMappingEditorComponent::ChangeKeyButton : public Button { public: @@ -468,3 +471,5 @@ String KeyMappingEditorComponent::getDescriptionForKeyPress (const KeyPress& key { return key.getTextDescription(); } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h index e4207bc0be..e206c1e68b 100644 --- a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h +++ b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -130,3 +130,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (KeyMappingEditorComponent) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp index e87c817d98..f98cb43918 100644 --- a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp +++ b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_ENABLE_LIVE_CONSTANT_EDITOR namespace LiveConstantEditor @@ -500,3 +503,5 @@ Component* createBoolSlider (LivePropertyEditorBase& editor) { return new Bo } #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h index 4d44a740b2..9121a5828f 100644 --- a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h +++ b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_ENABLE_LIVE_CONSTANT_EDITOR && ! DOXYGEN @@ -309,3 +310,5 @@ namespace LiveConstantEditor #define JUCE_LIVE_CONSTANT(initialValue) \ (initialValue) #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_PreferencesPanel.cpp b/modules/juce_gui_extra/misc/juce_PreferencesPanel.cpp index e6f612e37f..cb35ef5165 100644 --- a/modules/juce_gui_extra/misc/juce_PreferencesPanel.cpp +++ b/modules/juce_gui_extra/misc/juce_PreferencesPanel.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + PreferencesPanel::PreferencesPanel() : buttonSize (70) { @@ -150,3 +153,5 @@ void PreferencesPanel::buttonClicked (Button*) } } } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_PreferencesPanel.h b/modules/juce_gui_extra/misc/juce_PreferencesPanel.h index 6000ed3d13..99de995008 100644 --- a/modules/juce_gui_extra/misc/juce_PreferencesPanel.h +++ b/modules/juce_gui_extra/misc/juce_PreferencesPanel.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -143,3 +143,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PreferencesPanel) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp index d7470f6c92..580b79aa74 100644 --- a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp +++ b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + RecentlyOpenedFilesList::RecentlyOpenedFilesList() : maxNumberOfItems (10) { @@ -145,3 +148,5 @@ void RecentlyOpenedFilesList::registerRecentFileNatively (const File& file) ignoreUnused (file); #endif } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h index fadcaf71e1..02a24fe00b 100644 --- a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h +++ b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -160,3 +160,5 @@ private: JUCE_LEAK_DETECTOR (RecentlyOpenedFilesList) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_SplashScreen.cpp b/modules/juce_gui_extra/misc/juce_SplashScreen.cpp index 654669091a..a33477d817 100644 --- a/modules/juce_gui_extra/misc/juce_SplashScreen.cpp +++ b/modules/juce_gui_extra/misc/juce_SplashScreen.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + SplashScreen::SplashScreen (const String& title, const Image& image, bool useDropShadow) : Component (title), backgroundImage (image), @@ -95,3 +98,5 @@ void SplashScreen::timerCallback() || Desktop::getInstance().getMouseButtonClickCounter() > clickCountToDelete) delete this; } + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_SplashScreen.h b/modules/juce_gui_extra/misc/juce_SplashScreen.h index 62dfc5aace..bf16e5d0aa 100644 --- a/modules/juce_gui_extra/misc/juce_SplashScreen.h +++ b/modules/juce_gui_extra/misc/juce_SplashScreen.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** A component for showing a splash screen while your app starts up. @@ -151,3 +151,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SplashScreen) }; + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp index 33ae308285..72c6c983fc 100644 --- a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC SystemTrayIconComponent::SystemTrayIconComponent() @@ -36,3 +39,5 @@ SystemTrayIconComponent::~SystemTrayIconComponent() } #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h index c3f3930bf1..6dd877ddd2 100644 --- a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h +++ b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC || DOXYGEN @@ -100,3 +101,5 @@ private: #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h b/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h index f26a7309bd..67a055f82e 100644 --- a/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h +++ b/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_WEB_BROWSER || DOXYGEN @@ -149,3 +150,5 @@ private: #endif + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp index c236b4b3fa..7fc51d7cc7 100644 --- a/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_) : browser (nullptr), blankPageShown (false), @@ -121,3 +124,5 @@ void WebBrowserComponent::focusGained (FocusChangeType) void WebBrowserComponent::clearCookies() { } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_ios_UIViewComponent.mm b/modules/juce_gui_extra/native/juce_ios_UIViewComponent.mm index 933f25ccf1..6a954fd102 100644 --- a/modules/juce_gui_extra/native/juce_ios_UIViewComponent.mm +++ b/modules/juce_gui_extra/native/juce_ios_UIViewComponent.mm @@ -24,14 +24,16 @@ ============================================================================== */ +namespace juce +{ + class UIViewComponent::Pimpl : public ComponentMovementWatcher { public: - Pimpl (UIView* const v, Component& comp) + Pimpl (UIView* v, Component& comp) : ComponentMovementWatcher (&comp), view (v), - owner (comp), - currentPeer (nullptr) + owner (comp) { [view retain]; @@ -47,11 +49,11 @@ public: void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) override { - Component* const topComp = owner.getTopLevelComponent(); + auto* topComp = owner.getTopLevelComponent(); if (topComp->getPeer() != nullptr) { - const Point pos (topComp->getLocalPoint (&owner, Point())); + auto pos = topComp->getLocalPoint (&owner, Point()); [view setFrame: CGRectMake ((float) pos.x, (float) pos.y, (float) owner.getWidth(), (float) owner.getHeight())]; @@ -60,7 +62,7 @@ public: void componentPeerChanged() override { - ComponentPeer* const peer = owner.getPeer(); + auto* peer = owner.getPeer(); if (currentPeer != peer) { @@ -95,7 +97,7 @@ public: private: Component& owner; - ComponentPeer* currentPeer; + ComponentPeer* currentPeer = nullptr; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl) }; @@ -127,3 +129,5 @@ void UIViewComponent::resizeToFitView() } void UIViewComponent::paint (Graphics&) {} + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_linux_X11_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_linux_X11_SystemTrayIcon.cpp index 35eed37330..c60b9347d6 100644 --- a/modules/juce_gui_extra/native/juce_linux_X11_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_linux_X11_SystemTrayIcon.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + class SystemTrayIconComponent::Pimpl { public: @@ -143,3 +145,5 @@ void* SystemTrayIconComponent::getNativeHandle() const { return getWindowHandle(); } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp index 07c64fbe23..6a8f0da89d 100644 --- a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + extern int juce_gtkWebkitMain (int argc, const char* argv[]); class CommandReceiver @@ -821,3 +823,5 @@ int juce_gtkWebkitMain (int argc, const char* argv[]) String (argv[3]).getIntValue()); return child.entry(); } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp index d50a7704d3..916b453333 100644 --- a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + bool juce_handleXEmbedEvent (ComponentPeer*, void*); Window juce_getCurrentFocusWindow (ComponentPeer*); @@ -672,10 +674,12 @@ unsigned long XEmbedComponent::getHostWindowID() { return pimp //============================================================================== bool juce_handleXEmbedEvent (ComponentPeer* p, void* e) { - return ::XEmbedComponent::Pimpl::dispatchX11Event (p, reinterpret_cast (e)); + return XEmbedComponent::Pimpl::dispatchX11Event (p, reinterpret_cast (e)); } unsigned long juce_getCurrentFocusWindow (ComponentPeer* peer) { - return (unsigned long) ::XEmbedComponent::Pimpl::getCurrentFocusWindow (peer); + return (unsigned long) XEmbedComponent::Pimpl::getCurrentFocusWindow (peer); } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm b/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm index b1283c052d..bc07d33172 100644 --- a/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm +++ b/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + AppleRemoteDevice::AppleRemoteDevice() : device (nullptr), queue (nullptr), @@ -262,3 +265,5 @@ void AppleRemoteDevice::handleCallbackInternal() ++buttonNum; } } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h b/modules/juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h index 9d38512439..c57277db6b 100644 --- a/modules/juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h +++ b/modules/juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -341,3 +341,5 @@ void* getCarbonWindow (Component* possibleCarbonComponent) return nullptr; } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm index d996650918..47dc7e87e3 100644 --- a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct NSViewResizeWatcher { NSViewResizeWatcher() : callback (nil) {} @@ -240,3 +243,5 @@ ReferenceCountedObject* NSViewComponent::attachViewToComponent (Component& comp, { return new NSViewAttachment ((NSView*) view, comp); } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp index 49cde5eb2f..c7d893fa98 100644 --- a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace MouseCursorHelpers { extern NSImage* createNSImage (const Image&, float scaleFactor = 1.f); @@ -274,3 +277,5 @@ void SystemTrayIconComponent::showDropdownMenu (const PopupMenu& menu) if (pimpl != nullptr) pimpl->showMenu (menu); } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm index 186445ceeb..03078226ba 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -26,6 +26,9 @@ #if JUCE_MAC +namespace juce +{ + struct WebViewKeyEquivalentResponder : public ObjCClass { WebViewKeyEquivalentResponder() : ObjCClass ("WebViewKeyEquivalentResponder_") @@ -152,8 +155,6 @@ private: #else -} // (juce namespace) - //============================================================================== @interface WebViewTapDetector : NSObject { @@ -168,7 +169,7 @@ private: - (BOOL) gestureRecognizer: (UIGestureRecognizer*) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer*) otherGestureRecognizer { - ignoreUnused (gestureRecognizer, otherGestureRecognizer); + juce::ignoreUnused (gestureRecognizer, otherGestureRecognizer); return YES; } @@ -198,17 +199,18 @@ private: - (BOOL) webView: (UIWebView*) webView shouldStartLoadWithRequest: (NSURLRequest*) request navigationType: (UIWebViewNavigationType) navigationType { - ignoreUnused (webView, navigationType); - return ownerComponent->pageAboutToLoad (nsStringToJuce (request.URL.absoluteString)); + juce::ignoreUnused (webView, navigationType); + return ownerComponent->pageAboutToLoad (juce::nsStringToJuce (request.URL.absoluteString)); } - (void) webViewDidFinishLoad: (UIWebView*) webView { - ownerComponent->pageFinishedLoading (nsStringToJuce (webView.request.URL.absoluteString)); + ownerComponent->pageFinishedLoading (juce::nsStringToJuce (webView.request.URL.absoluteString)); } @end -namespace juce { +namespace juce +{ #endif @@ -485,3 +487,5 @@ void WebBrowserComponent::clearCookies() [[NSUserDefaults standardUserDefaults] synchronize]; } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp b/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp index 188385b632..f0eec0ea44 100644 --- a/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_ActiveXComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + extern int64 getMouseEventTime(); JUCE_DECLARE_UUID_GETTER (IOleObject, "00000112-0000-0000-C000-000000000046") @@ -451,3 +454,5 @@ LRESULT juce_offerEventToActiveXControl (::MSG& msg) return S_FALSE; } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp index 7e3f9e2a64..b1667be77b 100644 --- a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + extern void* getUser32Function (const char*); namespace IconConverters @@ -236,3 +239,5 @@ void* SystemTrayIconComponent::getNativeHandle() const { return pimpl != nullptr ? &(pimpl->iconData) : nullptr; } + +} // namespace juce diff --git a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp index 5831a9cc0d..77ba594e24 100644 --- a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + JUCE_DECLARE_UUID_GETTER (DWebBrowserEvents2, "34A715A0-6587-11D0-924A-0020AFC7AC4D") JUCE_DECLARE_UUID_GETTER (IConnectionPointContainer, "B196B284-BAB4-101A-B69C-00AA00341D07") JUCE_DECLARE_UUID_GETTER (IWebBrowser2, "D30C1661-CDAF-11D0-8A3E-00C04FC9E26E") @@ -420,3 +423,5 @@ void WebBrowserComponent::clearCookies() FindCloseUrlCache (urlCacheHandle); } } + +} // namespace juce diff --git a/modules/juce_opengl/geometry/juce_Draggable3DOrientation.h b/modules/juce_opengl/geometry/juce_Draggable3DOrientation.h index 125f65f429..8b11dff6f6 100644 --- a/modules/juce_opengl/geometry/juce_Draggable3DOrientation.h +++ b/modules/juce_opengl/geometry/juce_Draggable3DOrientation.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -154,3 +154,5 @@ private: return QuaternionType::fromAngle (2.0f * std::asin (d), rotationAxis); } }; + +} // namespace juce diff --git a/modules/juce_opengl/geometry/juce_Matrix3D.h b/modules/juce_opengl/geometry/juce_Matrix3D.h index a68e900b23..5bf7bdcf59 100644 --- a/modules/juce_opengl/geometry/juce_Matrix3D.h +++ b/modules/juce_opengl/geometry/juce_Matrix3D.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -150,3 +151,5 @@ public: /** The 4x4 matrix values. These are stored in the standard OpenGL order. */ Type mat[16]; }; + +} // namespace juce diff --git a/modules/juce_opengl/geometry/juce_Quaternion.h b/modules/juce_opengl/geometry/juce_Quaternion.h index fa80ed93dc..9fac1bd7f7 100644 --- a/modules/juce_opengl/geometry/juce_Quaternion.h +++ b/modules/juce_opengl/geometry/juce_Quaternion.h @@ -24,10 +24,8 @@ ============================================================================== */ -#pragma once - -#include "juce_Vector3D.h" -#include "juce_Matrix3D.h" +namespace juce +{ //============================================================================== /** @@ -95,3 +93,5 @@ public: /** The scalar part of the quaternion. */ Type scalar; }; + +} // namespace juce diff --git a/modules/juce_opengl/geometry/juce_Vector3D.h b/modules/juce_opengl/geometry/juce_Vector3D.h index 52d60063c4..ba292075f6 100644 --- a/modules/juce_opengl/geometry/juce_Vector3D.h +++ b/modules/juce_opengl/geometry/juce_Vector3D.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -77,3 +78,5 @@ public: Type x, y, z; }; + +} // namespace juce diff --git a/modules/juce_opengl/juce_opengl.cpp b/modules/juce_opengl/juce_opengl.cpp index 593931b3d8..60021bfbbd 100644 --- a/modules/juce_opengl/juce_opengl.cpp +++ b/modules/juce_opengl/juce_opengl.cpp @@ -84,12 +84,10 @@ #endif #endif +//============================================================================== namespace juce { -//============================================================================== -#include "native/juce_OpenGLExtensions.h" - void OpenGLExtensionFunctions::initialise() { #if JUCE_WINDOWS || JUCE_LINUX @@ -251,6 +249,8 @@ private: OpenGLTargetSaver& operator= (const OpenGLTargetSaver&); }; +} // namespace juce + //============================================================================== #include "opengl/juce_OpenGLFrameBuffer.cpp" #include "opengl/juce_OpenGLGraphicsContext.cpp" @@ -291,5 +291,3 @@ private: #include "opengl/juce_OpenGLContext.cpp" #include "utils/juce_OpenGLAppComponent.cpp" - -} diff --git a/modules/juce_opengl/juce_opengl.h b/modules/juce_opengl/juce_opengl.h index 7db74fbfa3..a0094d2fc4 100644 --- a/modules/juce_opengl/juce_opengl.h +++ b/modules/juce_opengl/juce_opengl.h @@ -164,14 +164,14 @@ //============================================================================== namespace juce { + class OpenGLTexture; + class OpenGLFrameBuffer; + class OpenGLShaderProgram; +} -class OpenGLTexture; -class OpenGLFrameBuffer; -class OpenGLShaderProgram; - -#include "geometry/juce_Quaternion.h" -#include "geometry/juce_Matrix3D.h" #include "geometry/juce_Vector3D.h" +#include "geometry/juce_Matrix3D.h" +#include "geometry/juce_Quaternion.h" #include "geometry/juce_Draggable3DOrientation.h" #include "native/juce_MissingGLDefinitions.h" #include "opengl/juce_OpenGLHelpers.h" @@ -181,11 +181,7 @@ class OpenGLShaderProgram; #include "opengl/juce_OpenGLContext.h" #include "opengl/juce_OpenGLFrameBuffer.h" #include "opengl/juce_OpenGLGraphicsContext.h" -#include "opengl/juce_OpenGLHelpers.h" #include "opengl/juce_OpenGLImage.h" -#include "opengl/juce_OpenGLRenderer.h" #include "opengl/juce_OpenGLShaderProgram.h" #include "opengl/juce_OpenGLTexture.h" #include "utils/juce_OpenGLAppComponent.h" - -} diff --git a/modules/juce_opengl/native/juce_MissingGLDefinitions.h b/modules/juce_opengl/native/juce_MissingGLDefinitions.h index d628556221..dac8bff321 100644 --- a/modules/juce_opengl/native/juce_MissingGLDefinitions.h +++ b/modules/juce_opengl/native/juce_MissingGLDefinitions.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** These are important openGL values that aren't defined by default by the GL headers on various platforms. */ @@ -156,3 +159,5 @@ enum MissingOpenGLDefinitions typedef pointer_sized_int GLsizeiptr; typedef pointer_sized_int GLintptr; #endif + +} // namespace juce diff --git a/modules/juce_opengl/native/juce_OpenGLExtensions.h b/modules/juce_opengl/native/juce_OpenGLExtensions.h index 30362501be..23b03af2f1 100644 --- a/modules/juce_opengl/native/juce_OpenGLExtensions.h +++ b/modules/juce_opengl/native/juce_OpenGLExtensions.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ /** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux. @see OpenGLExtensionFunctions @@ -154,3 +154,5 @@ struct OpenGLExtensionFunctions #undef JUCE_DECLARE_GL_FUNCTION }; + +} // namespace juce diff --git a/modules/juce_opengl/native/juce_OpenGL_android.h b/modules/juce_opengl/native/juce_OpenGL_android.h index 776fe5647b..60f9fdc43d 100644 --- a/modules/juce_opengl/native/juce_OpenGL_android.h +++ b/modules/juce_opengl/native/juce_OpenGL_android.h @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getParent, "getParent", "()Landroid/view/ViewParent;") \ METHOD (layout, "layout", "(IIII)V" ) \ @@ -306,3 +308,5 @@ bool OpenGLHelpers::isContextActive() { return eglGetCurrentContext() != EGL_NO_CONTEXT; } + +} // namespace juce diff --git a/modules/juce_opengl/native/juce_OpenGL_ios.h b/modules/juce_opengl/native/juce_OpenGL_ios.h index ff810c34fb..a079a4d842 100644 --- a/modules/juce_opengl/native/juce_OpenGL_ios.h +++ b/modules/juce_opengl/native/juce_OpenGL_ios.h @@ -24,8 +24,6 @@ ============================================================================== */ -} // (juce namespace) - @interface JuceGLView : UIView { } @@ -309,3 +307,5 @@ bool OpenGLHelpers::isContextActive() { return [EAGLContext currentContext] != nil; } + +} // namespace juce diff --git a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h index dc287b947d..c1b17d46ce 100644 --- a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h +++ b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + extern XContext windowHandleXContext; //============================================================================== @@ -249,3 +252,5 @@ bool OpenGLHelpers::isContextActive() return false; } + +} // namespace juce diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index 706486ebe5..4b61efd4bf 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class OpenGLContext::NativeContext { public: @@ -255,3 +258,5 @@ void componentPeerAboutToChange (Component& comp, bool shouldSuspend) for (auto* child : comp.getChildren()) componentPeerAboutToChange (*child, shouldSuspend); } + +} // namespace juce diff --git a/modules/juce_opengl/native/juce_OpenGL_win32.h b/modules/juce_opengl/native/juce_OpenGL_win32.h index 40c9dedeb4..7cbd732b4b 100644 --- a/modules/juce_opengl/native/juce_OpenGL_win32.h +++ b/modules/juce_opengl/native/juce_OpenGL_win32.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + extern ComponentPeer* createNonRepaintingEmbeddedWindowsPeer (Component&, void* parent); //============================================================================== @@ -266,3 +269,5 @@ bool OpenGLHelpers::isContextActive() { return wglGetCurrentContext() != 0; } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 495ea985d2..b57a50793a 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_IOS struct AppInactivityCallback // NB: this is a duplicate of an internal declaration in juce_core { @@ -1244,3 +1247,5 @@ void OpenGLContext::NativeContext::surfaceDestroyed (jobject holder) cachedImage->pause(); } #endif + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.h b/modules/juce_opengl/opengl/juce_OpenGLContext.h index fe6627d35e..a1b9c05436 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.h +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -344,3 +344,5 @@ private: template void OpenGLContext::executeOnGLThread (T&& f, bool shouldBlock) { execute (new AsyncWorkerFunctor (f), shouldBlock); } #endif + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp index 38cd7c6fab..c7e4a2a4b6 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class OpenGLFrameBuffer::Pimpl { public: @@ -347,3 +350,5 @@ bool OpenGLFrameBuffer::writePixels (const PixelARGB* data, const Rectangle JUCE_CHECK_OPENGL_ERROR return true; } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.h b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.h index 366fd68d95..8a466ad96a 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.h +++ b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -130,3 +130,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLFrameBuffer) }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp index 56252ca487..4aaeb2ffb5 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + extern void (*clearOpenGLGlyphCache)(); // declared in juce_graphics namespace OpenGLRendering @@ -1894,3 +1897,5 @@ Result OpenGLGraphicsContextCustomShader::checkCompilation (LowLevelGraphicsCont return Result::fail (errorMessage); } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.h b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.h index 755eeb4bba..10176ec423 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.h +++ b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ /** Creates a graphics context object that will render into the given OpenGL target. The caller is responsible for deleting this object when no longer needed. @@ -92,3 +92,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLGraphicsContextCustomShader) }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp b/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp index aa7588ef28..23f3b7aeda 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + void OpenGLHelpers::resetErrorState() { while (glGetError() != GL_NO_ERROR) {} @@ -128,3 +131,5 @@ String OpenGLHelpers::translateFragmentShaderToV3 (const String& code) return code; } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLHelpers.h b/modules/juce_opengl/opengl/juce_OpenGLHelpers.h index 091856ff28..0a64e48b5e 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLHelpers.h +++ b/modules/juce_opengl/opengl/juce_OpenGLHelpers.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -69,3 +69,5 @@ public: */ static String translateFragmentShaderToV3 (const String&); }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLImage.cpp b/modules/juce_opengl/opengl/juce_OpenGLImage.cpp index 36a1e1733b..4b748a2eb6 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLImage.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLImage.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + class OpenGLFrameBufferImage : public ImagePixelData { public: @@ -200,3 +203,5 @@ OpenGLFrameBuffer* OpenGLImageType::getFrameBufferFrom (const Image& image) return nullptr; } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLImage.h b/modules/juce_opengl/opengl/juce_OpenGLImage.h index 3bac505fe0..15b70e3059 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLImage.h +++ b/modules/juce_opengl/opengl/juce_OpenGLImage.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -49,3 +49,5 @@ public: static OpenGLFrameBuffer* getFrameBufferFrom (const Image&); }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.cpp b/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.cpp index 60661520ef..567460436c 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + OpenGLPixelFormat::OpenGLPixelFormat (const int bitsPerRGBComponent, const int alphaBits_, const int depthBufferBits_, @@ -61,3 +64,5 @@ bool OpenGLPixelFormat::operator!= (const OpenGLPixelFormat& other) const noexce { return ! operator== (other); } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h b/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h index ebc5d934d2..3b6c83b9fb 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h +++ b/modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -66,3 +66,5 @@ public: uint8 multisamplingLevel; /**< The number of samples to use for full-scene multisampled anti-aliasing (if available). */ }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLRenderer.h b/modules/juce_opengl/opengl/juce_OpenGLRenderer.h index 36bf176503..67ad2b808d 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLRenderer.h +++ b/modules/juce_opengl/opengl/juce_OpenGLRenderer.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -76,3 +76,5 @@ public: */ virtual void openGLContextClosing() = 0; }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.cpp b/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.cpp index 0e41c05410..67611d5999 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + OpenGLShaderProgram::OpenGLShaderProgram (const OpenGLContext& c) noexcept : context (c) { } @@ -186,3 +189,5 @@ void OpenGLShaderProgram::Uniform::set (const GLfloat* values, GLsizei numValues void OpenGLShaderProgram::Uniform::setMatrix2 (const GLfloat* v, GLint num, GLboolean trns) const noexcept { context.extensions.glUniformMatrix2fv (uniformID, num, trns, v); } void OpenGLShaderProgram::Uniform::setMatrix3 (const GLfloat* v, GLint num, GLboolean trns) const noexcept { context.extensions.glUniformMatrix3fv (uniformID, num, trns, v); } void OpenGLShaderProgram::Uniform::setMatrix4 (const GLfloat* v, GLint num, GLboolean trns) const noexcept { context.extensions.glUniformMatrix4fv (uniformID, num, trns, v); } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.h b/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.h index 72eb94b308..4efbf6fbfb 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.h +++ b/modules/juce_opengl/opengl/juce_OpenGLShaderProgram.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -198,3 +199,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLShaderProgram) }; + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp b/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp index b6254ac01d..d29adccc72 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + static int getAllowedTextureSize (int x) { #if JUCE_OPENGL_ALLOW_NON_POWER_OF_TWO_TEXTURES @@ -185,3 +188,5 @@ void OpenGLTexture::unbind() const { glBindTexture (GL_TEXTURE_2D, 0); } + +} // namespace juce diff --git a/modules/juce_opengl/opengl/juce_OpenGLTexture.h b/modules/juce_opengl/opengl/juce_OpenGLTexture.h index 2794cba03a..8ced3f2faf 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLTexture.h +++ b/modules/juce_opengl/opengl/juce_OpenGLTexture.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -98,3 +99,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLTexture) }; + +} // namespace juce diff --git a/modules/juce_opengl/utils/juce_OpenGLAppComponent.cpp b/modules/juce_opengl/utils/juce_OpenGLAppComponent.cpp index a6bdb9c489..752c43e147 100644 --- a/modules/juce_opengl/utils/juce_OpenGLAppComponent.cpp +++ b/modules/juce_opengl/utils/juce_OpenGLAppComponent.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + OpenGLAppComponent::OpenGLAppComponent() { setOpaque (true); @@ -63,3 +66,5 @@ void OpenGLAppComponent::openGLContextClosing() { shutdown(); } + +} // namespace juce diff --git a/modules/juce_opengl/utils/juce_OpenGLAppComponent.h b/modules/juce_opengl/utils/juce_OpenGLAppComponent.h index 351bd6ea18..ba23d04da8 100644 --- a/modules/juce_opengl/utils/juce_OpenGLAppComponent.h +++ b/modules/juce_opengl/utils/juce_OpenGLAppComponent.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -92,3 +92,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLAppComponent) }; + +} // namespace juce diff --git a/modules/juce_osc/juce_osc.cpp b/modules/juce_osc/juce_osc.cpp index 738ef2ba83..6e026de4df 100644 --- a/modules/juce_osc/juce_osc.cpp +++ b/modules/juce_osc/juce_osc.cpp @@ -35,8 +35,6 @@ #include "juce_osc.h" -namespace juce -{ #include "osc/juce_OSCTypes.cpp" #include "osc/juce_OSCTimeTag.cpp" #include "osc/juce_OSCArgument.cpp" @@ -45,4 +43,3 @@ namespace juce #include "osc/juce_OSCBundle.cpp" #include "osc/juce_OSCReceiver.cpp" #include "osc/juce_OSCSender.cpp" -} diff --git a/modules/juce_osc/juce_osc.h b/modules/juce_osc/juce_osc.h index 6fb4e2879c..79b772e07d 100644 --- a/modules/juce_osc/juce_osc.h +++ b/modules/juce_osc/juce_osc.h @@ -56,9 +56,6 @@ //============================================================================== -namespace juce -{ - #include "osc/juce_OSCTypes.h" #include "osc/juce_OSCTimeTag.h" #include "osc/juce_OSCArgument.h" @@ -67,5 +64,3 @@ namespace juce #include "osc/juce_OSCBundle.h" #include "osc/juce_OSCReceiver.h" #include "osc/juce_OSCSender.h" - -} diff --git a/modules/juce_osc/osc/juce_OSCAddress.cpp b/modules/juce_osc/osc/juce_OSCAddress.cpp index 888a3f1010..3e70c9e068 100644 --- a/modules/juce_osc/osc/juce_OSCAddress.cpp +++ b/modules/juce_osc/osc/juce_OSCAddress.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace { //============================================================================== @@ -777,3 +780,5 @@ public: static OSCPatternMatcherTests OSCPatternMatcherUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCAddress.h b/modules/juce_osc/osc/juce_OSCAddress.h index b1b8555af3..2ef578f681 100644 --- a/modules/juce_osc/osc/juce_OSCAddress.h +++ b/modules/juce_osc/osc/juce_OSCAddress.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -146,3 +146,5 @@ private: String asString; bool wasInitialisedWithWildcards; }; + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCArgument.cpp b/modules/juce_osc/osc/juce_OSCArgument.cpp index 1bde638129..6dabbf277d 100644 --- a/modules/juce_osc/osc/juce_OSCArgument.cpp +++ b/modules/juce_osc/osc/juce_OSCArgument.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + OSCArgument::OSCArgument (int32 value) noexcept : type (OSCTypes::int32), intValue (value) { @@ -226,3 +229,5 @@ public: static OSCArgumentTests OSCArgumentUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCArgument.h b/modules/juce_osc/osc/juce_OSCArgument.h index 67e2a741ba..579227f047 100644 --- a/modules/juce_osc/osc/juce_OSCArgument.h +++ b/modules/juce_osc/osc/juce_OSCArgument.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -109,3 +109,5 @@ private: String stringValue; MemoryBlock blob; }; + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCBundle.cpp b/modules/juce_osc/osc/juce_OSCBundle.cpp index d2dcaf1ecf..e2041834d6 100644 --- a/modules/juce_osc/osc/juce_OSCBundle.cpp +++ b/modules/juce_osc/osc/juce_OSCBundle.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + OSCBundle::OSCBundle() { } @@ -237,3 +240,5 @@ public: static OSCBundleElementTests OSCBundleElementUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCBundle.h b/modules/juce_osc/osc/juce_OSCBundle.h index 1ab529860e..b3b0d4861e 100644 --- a/modules/juce_osc/osc/juce_OSCBundle.h +++ b/modules/juce_osc/osc/juce_OSCBundle.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -129,3 +130,5 @@ private: Array elements; OSCTimeTag timeTag; }; + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCMessage.cpp b/modules/juce_osc/osc/juce_OSCMessage.cpp index b62b61e8bc..6bb21cef21 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.cpp +++ b/modules/juce_osc/osc/juce_OSCMessage.cpp @@ -24,7 +24,9 @@ ============================================================================== */ -//============================================================================== +namespace juce +{ + OSCMessage::OSCMessage (const OSCAddressPattern& ap) noexcept : addressPattern (ap) { } @@ -197,3 +199,5 @@ public: static OSCMessageTests OSCMessageUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCMessage.h b/modules/juce_osc/osc/juce_OSCMessage.h index bcc4b7cb5b..1d2f7fcf7e 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.h +++ b/modules/juce_osc/osc/juce_OSCMessage.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -169,3 +169,5 @@ private: addArguments (std::forward (arg1), std::forward (args)...); } #endif + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCReceiver.cpp b/modules/juce_osc/osc/juce_OSCReceiver.cpp index 35da262ef0..3ee4110aef 100644 --- a/modules/juce_osc/osc/juce_OSCReceiver.cpp +++ b/modules/juce_osc/osc/juce_OSCReceiver.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace { //============================================================================== @@ -1156,3 +1159,5 @@ public: static OSCInputStreamTests OSCInputStreamUnitTests; #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCReceiver.h b/modules/juce_osc/osc/juce_OSCReceiver.h index 63871192bc..d9ad9ffb39 100644 --- a/modules/juce_osc/osc/juce_OSCReceiver.h +++ b/modules/juce_osc/osc/juce_OSCReceiver.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== /** @@ -209,3 +210,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OSCReceiver) }; + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCSender.cpp b/modules/juce_osc/osc/juce_OSCSender.cpp index c0fe39854c..dc98d8b993 100644 --- a/modules/juce_osc/osc/juce_OSCSender.cpp +++ b/modules/juce_osc/osc/juce_OSCSender.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + namespace { //============================================================================== @@ -844,3 +847,5 @@ static OSCRoundTripTests OSCRoundTripUnitTests; //============================================================================== #endif // JUCE_UNIT_TESTS + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCSender.h b/modules/juce_osc/osc/juce_OSCSender.h index 3da6df1691..7ec4bdc73b 100644 --- a/modules/juce_osc/osc/juce_OSCSender.h +++ b/modules/juce_osc/osc/juce_OSCSender.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -153,3 +153,5 @@ private: return sendToIPAddress (targetIPAddress, targetPortNumber, OSCMessage (address, std::forward (args)...)); } #endif // JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCTimeTag.cpp b/modules/juce_osc/osc/juce_OSCTimeTag.cpp index cfc7c95203..431062fdc8 100644 --- a/modules/juce_osc/osc/juce_OSCTimeTag.cpp +++ b/modules/juce_osc/osc/juce_OSCTimeTag.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + const OSCTimeTag OSCTimeTag::immediately; static const uint64 millisecondsBetweenOscAndJuceEpochs = 2208988800000ULL; @@ -147,3 +150,5 @@ public: static OSCTimeTagTests OSCTimeTagUnitTests; #endif + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCTimeTag.h b/modules/juce_osc/osc/juce_OSCTimeTag.h index 02f9973a4a..17a5feb72d 100644 --- a/modules/juce_osc/osc/juce_OSCTimeTag.h +++ b/modules/juce_osc/osc/juce_OSCTimeTag.h @@ -24,8 +24,8 @@ ============================================================================== */ -#pragma once - +namespace juce +{ //============================================================================== /** @@ -81,3 +81,5 @@ private: //============================================================================== uint64 rawTimeTag; }; + +} // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCTypes.cpp b/modules/juce_osc/osc/juce_OSCTypes.cpp index 18d7233de0..a78f21e28e 100644 --- a/modules/juce_osc/osc/juce_OSCTypes.cpp +++ b/modules/juce_osc/osc/juce_OSCTypes.cpp @@ -24,7 +24,10 @@ ============================================================================== */ -const OSCType OSCTypes::int32 = 'i'; -const OSCType OSCTypes::float32 = 'f'; -const OSCType OSCTypes::string = 's'; -const OSCType OSCTypes::blob = 'b'; +namespace juce +{ + const OSCType OSCTypes::int32 = 'i'; + const OSCType OSCTypes::float32 = 'f'; + const OSCType OSCTypes::string = 's'; + const OSCType OSCTypes::blob = 'b'; +} diff --git a/modules/juce_osc/osc/juce_OSCTypes.h b/modules/juce_osc/osc/juce_OSCTypes.h index 295b99056a..83dbee30af 100644 --- a/modules/juce_osc/osc/juce_OSCTypes.h +++ b/modules/juce_osc/osc/juce_OSCTypes.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ //============================================================================== @@ -95,3 +96,5 @@ struct OSCInternalError : public OSCException { OSCInternalError (const String& desc) : OSCException (desc) {} }; + +} // namespace juce diff --git a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.cpp b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.cpp index 39a8cb17f8..ed5bb817ab 100644 --- a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.cpp @@ -24,12 +24,15 @@ ============================================================================== */ +namespace juce +{ InAppPurchases::InAppPurchases() #if JUCE_ANDROID || JUCE_IOS : pimpl (new Pimpl (*this)) #endif {} + InAppPurchases::~InAppPurchases() {} bool InAppPurchases::isInAppPurchasesSupported() const @@ -128,3 +131,5 @@ void InAppPurchases::cancelDownloads (const Array& downloads) ignoreUnused (downloads); #endif } + +} // namespace juce diff --git a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h index 45695d86a3..157d44c853 100644 --- a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h +++ b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Provides in-app purchase functionality. @@ -269,3 +272,5 @@ private: ScopedPointer pimpl; #endif }; + +} // namespace juce diff --git a/modules/juce_product_unlocking/juce_product_unlocking.cpp b/modules/juce_product_unlocking/juce_product_unlocking.cpp index 4e78809c61..7bab6c406d 100644 --- a/modules/juce_product_unlocking/juce_product_unlocking.cpp +++ b/modules/juce_product_unlocking/juce_product_unlocking.cpp @@ -48,25 +48,22 @@ #import #endif -namespace juce -{ - #if JUCE_IN_APP_PURCHASES - #if JUCE_ANDROID - #include "native/juce_android_InAppPurchases.cpp" - #elif JUCE_IOS - #include "native/juce_ios_InAppPurchases.cpp" - #endif - - #include "in_app_purchases/juce_InAppPurchases.cpp" - #endif - - #include "marketplace/juce_OnlineUnlockStatus.cpp" - - #if JUCE_MODULE_AVAILABLE_juce_data_structures - #include "marketplace/juce_TracktionMarketplaceStatus.cpp" - #endif - - #if JUCE_MODULE_AVAILABLE_juce_gui_extra - #include "marketplace/juce_OnlineUnlockForm.cpp" - #endif -} +#if JUCE_IN_APP_PURCHASES + #if JUCE_ANDROID + #include "native/juce_android_InAppPurchases.cpp" + #elif JUCE_IOS + #include "native/juce_ios_InAppPurchases.cpp" + #endif + + #include "in_app_purchases/juce_InAppPurchases.cpp" +#endif + +#include "marketplace/juce_OnlineUnlockStatus.cpp" + +#if JUCE_MODULE_AVAILABLE_juce_data_structures + #include "marketplace/juce_TracktionMarketplaceStatus.cpp" +#endif + +#if JUCE_MODULE_AVAILABLE_juce_gui_extra + #include "marketplace/juce_OnlineUnlockForm.cpp" +#endif diff --git a/modules/juce_product_unlocking/juce_product_unlocking.h b/modules/juce_product_unlocking/juce_product_unlocking.h index 85884e2df0..9e6cae807f 100644 --- a/modules/juce_product_unlocking/juce_product_unlocking.h +++ b/modules/juce_product_unlocking/juce_product_unlocking.h @@ -77,19 +77,17 @@ #include #endif -namespace juce -{ - #if JUCE_IN_APP_PURCHASES - #include "in_app_purchases/juce_InAppPurchases.h" - #endif - - #if JUCE_MODULE_AVAILABLE_juce_data_structures - #include "marketplace/juce_OnlineUnlockStatus.h" - #include "marketplace/juce_TracktionMarketplaceStatus.h" - #endif - #include "marketplace/juce_KeyFileGeneration.h" - - #if JUCE_MODULE_AVAILABLE_juce_gui_extra - #include "marketplace/juce_OnlineUnlockForm.h" - #endif -} +#if JUCE_IN_APP_PURCHASES + #include "in_app_purchases/juce_InAppPurchases.h" +#endif + +#if JUCE_MODULE_AVAILABLE_juce_data_structures + #include "marketplace/juce_OnlineUnlockStatus.h" + #include "marketplace/juce_TracktionMarketplaceStatus.h" +#endif + +#include "marketplace/juce_KeyFileGeneration.h" + +#if JUCE_MODULE_AVAILABLE_juce_gui_extra + #include "marketplace/juce_OnlineUnlockForm.h" +#endif diff --git a/modules/juce_product_unlocking/marketplace/juce_KeyFileGeneration.h b/modules/juce_product_unlocking/marketplace/juce_KeyFileGeneration.h index fbf8b659c7..7e06c6e798 100644 --- a/modules/juce_product_unlocking/marketplace/juce_KeyFileGeneration.h +++ b/modules/juce_product_unlocking/marketplace/juce_KeyFileGeneration.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Contains static utilities for generating key-files that can be unlocked by the OnlineUnlockStatus class. @@ -107,3 +110,5 @@ public: return 0; } }; + +} // namespace juce diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp index 4476997147..debb2384c3 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + struct Spinner : public Component, private Timer { Spinner() { startTimer (1000 / 50); } @@ -283,3 +286,5 @@ void OnlineUnlockForm::dismiss() { delete this; } + +} // namespace juce diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.h b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.h index c4b20010a8..bc9dd492a5 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.h +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** Acts as a GUI which asks the user for their details, and calls the approriate methods on your OnlineUnlockStatus object to attempt to register the app. @@ -88,3 +91,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OnlineUnlockForm) }; + +} // namespace juce diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp index d4001fd084..39affbf700 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /* Note: there's a bit of light obfuscation in this code, just to make things a bit more annoying for crackers who try to reverse-engineer your binaries, but nothing particularly foolproof. @@ -485,3 +488,5 @@ String KeyGeneration::generateExpiringKeyFile (const String& appName, return KeyFileUtils::createKeyFile (comment, xml, privateKey); } + +} // namespace juce diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.h b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.h index 7a72e079dd..0085d570ad 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.h +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** A base class for online unlocking systems. @@ -258,3 +261,5 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OnlineUnlockStatus) }; + +} // namespace juce diff --git a/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.cpp b/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.cpp index 2131c2d096..b30e263163 100644 --- a/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + TracktionMarketplaceStatus::TracktionMarketplaceStatus() {} URL TracktionMarketplaceStatus::getServerAuthenticationURL() @@ -54,3 +57,5 @@ String TracktionMarketplaceStatus::readReplyFromWebserver (const String& email, return url.readEntireTextStream(); } + +} // namespace juce diff --git a/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.h b/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.h index 06566b83a2..c93cd5328c 100644 --- a/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.h +++ b/modules/juce_product_unlocking/marketplace/juce_TracktionMarketplaceStatus.h @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + /** An implementation of the OnlineUnlockStatus class which talks to the Tracktion Marketplace server. @@ -51,3 +54,5 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TracktionMarketplaceStatus) }; + +} // namespace juce diff --git a/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp b/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp index f9d4a25d20..da61ce003d 100644 --- a/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (isBillingSupported, "isBillingSupported", "(ILjava/lang/String;Ljava/lang/String;)I") \ @@ -931,3 +933,5 @@ void juce_inAppPurchaseCompleted (void* intentData) { InAppPurchases::Pimpl::inAppPurchaseCompleted (static_cast (intentData)); } + +} // namespace juce diff --git a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp index 8ff5b98628..aa7415b9f5 100644 --- a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp @@ -24,6 +24,9 @@ ============================================================================== */ +namespace juce +{ + template <> struct ContainerDeletePolicy { static void destroy (NSObject* o) { [o release]; } }; template <> struct ContainerDeletePolicy { static void destroy (NSObject* o) { [o release]; } }; template <> struct ContainerDeletePolicy> { static void destroy (NSObject* o) { [o release]; } }; @@ -677,3 +680,5 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver OwnedArray pendingDownloadsTransactions; Array restoredPurchases; }; + +} // namespace juce diff --git a/modules/juce_video/capture/juce_CameraDevice.cpp b/modules/juce_video/capture/juce_CameraDevice.cpp index 91955d59ee..97568e1b79 100644 --- a/modules/juce_video/capture/juce_CameraDevice.cpp +++ b/modules/juce_video/capture/juce_CameraDevice.cpp @@ -24,6 +24,8 @@ ============================================================================== */ +namespace juce +{ #if JUCE_MAC || JUCE_IOS #include "../native/juce_mac_CameraDevice.h" @@ -99,3 +101,5 @@ CameraDevice* CameraDevice::openDevice (int index, return nullptr; } + +} // namespace juce diff --git a/modules/juce_video/capture/juce_CameraDevice.h b/modules/juce_video/capture/juce_CameraDevice.h index 2e4f81a701..18a19b5f7a 100644 --- a/modules/juce_video/capture/juce_CameraDevice.h +++ b/modules/juce_video/capture/juce_CameraDevice.h @@ -24,7 +24,8 @@ ============================================================================== */ -#pragma once +namespace juce +{ #if JUCE_USE_CAMERA || DOXYGEN @@ -164,3 +165,5 @@ private: #endif #endif + +} // namespace juce diff --git a/modules/juce_video/juce_video.cpp b/modules/juce_video/juce_video.cpp index 6edb8a60d6..bec17ed285 100644 --- a/modules/juce_video/juce_video.cpp +++ b/modules/juce_video/juce_video.cpp @@ -67,15 +67,8 @@ #endif //============================================================================== -using namespace juce; - -namespace juce -{ - #include "playback/juce_VideoComponent.cpp" #if JUCE_USE_CAMERA #include "capture/juce_CameraDevice.cpp" #endif - -} diff --git a/modules/juce_video/juce_video.h b/modules/juce_video/juce_video.h index 8d76427fea..4fe138e0f0 100644 --- a/modules/juce_video/juce_video.h +++ b/modules/juce_video/juce_video.h @@ -57,9 +57,6 @@ //============================================================================== #include -//============================================================================= -#include "../juce_gui_extra/juce_gui_extra.h" - //============================================================================= /** Config: JUCE_USE_CAMERA Enables web-cam support using the CameraDevice class (Mac and Windows). @@ -73,10 +70,5 @@ #endif //============================================================================= -namespace juce -{ - #include "playback/juce_VideoComponent.h" #include "capture/juce_CameraDevice.h" - -} diff --git a/modules/juce_video/playback/juce_VideoComponent.cpp b/modules/juce_video/playback/juce_VideoComponent.cpp index 0d0552d1b4..135048b037 100644 --- a/modules/juce_video/playback/juce_VideoComponent.cpp +++ b/modules/juce_video/playback/juce_VideoComponent.cpp @@ -22,6 +22,9 @@ ============================================================================== */ +namespace juce +{ + #if JUCE_MAC || JUCE_IOS || JUCE_MSVC #if JUCE_MAC || JUCE_IOS @@ -116,3 +119,5 @@ void VideoComponent::timerCallback() } #endif + +} // namespace juce diff --git a/modules/juce_video/playback/juce_VideoComponent.h b/modules/juce_video/playback/juce_VideoComponent.h index 1980e1c897..ea08878039 100644 --- a/modules/juce_video/playback/juce_VideoComponent.h +++ b/modules/juce_video/playback/juce_VideoComponent.h @@ -25,6 +25,8 @@ #ifndef JUCE_VIDEOCOMPONENT_H_INCLUDED #define JUCE_VIDEOCOMPONENT_H_INCLUDED +namespace juce +{ //============================================================================== /** @@ -130,3 +132,5 @@ private: #endif + +} // namespace juce