From 0853a9b6867f15b766aec140c3f76f5136ed333e Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Wed, 15 Jun 2011 20:32:29 +0100 Subject: [PATCH] Removed const-ness from some return types to take advantage of future c++0x advantages. --- .../Source/Utility/jucer_ValueSourceHelpers.h | 2 +- .../Source/InternalFilters.h | 8 +-- src/application/juce_Application.h | 5 +- .../juce_ApplicationCommandManager.cpp | 6 +- .../juce_ApplicationCommandManager.h | 6 +- .../audio_file_formats/juce_AudioCDBurner.h | 12 ++-- .../audio_file_formats/juce_AudioCDReader.h | 2 +- .../audio_file_formats/juce_AudioFormat.cpp | 2 +- .../audio_file_formats/juce_AudioFormat.h | 2 +- .../juce_AudioFormatManager.cpp | 2 +- .../juce_AudioFormatManager.h | 2 +- .../juce_AudioFormatReader.h | 2 +- .../juce_AudioFormatWriter.h | 5 +- .../juce_FlacAudioFormat.cpp | 2 +- .../audio_file_formats/juce_FlacAudioFormat.h | 2 +- .../juce_OggVorbisAudioFormat.cpp | 2 +- .../juce_OggVorbisAudioFormat.h | 6 +- src/audio/devices/juce_AudioDeviceManager.cpp | 16 ++--- src/audio/devices/juce_AudioDeviceManager.h | 24 +++---- src/audio/devices/juce_AudioIODevice.h | 4 +- src/audio/devices/juce_AudioIODeviceType.h | 2 +- src/audio/dsp/juce_Decibels.h | 6 +- src/audio/midi/juce_MidiInput.h | 13 ++-- src/audio/midi/juce_MidiOutput.h | 2 +- .../plugin_client/RTAS/juce_RTAS_Wrapper.cpp | 2 +- .../formats/juce_AudioUnitPluginFormat.h | 8 +-- .../formats/juce_AudioUnitPluginFormat.mm | 6 +- .../formats/juce_DirectXPluginFormat.h | 6 +- .../formats/juce_LADSPAPluginFormat.h | 6 +- .../formats/juce_VSTPluginFormat.cpp | 6 +- .../formats/juce_VSTPluginFormat.h | 8 +-- .../plugin_host/juce_AudioPluginFormat.h | 10 +-- .../plugin_host/juce_KnownPluginList.cpp | 2 +- .../plugin_host/juce_PluginDescription.cpp | 2 +- .../plugin_host/juce_PluginDescription.h | 2 +- src/audio/synthesisers/juce_Synthesiser.h | 4 +- src/containers/juce_DynamicObject.cpp | 8 +-- src/containers/juce_DynamicObject.h | 8 +-- src/containers/juce_Value.cpp | 2 +- src/containers/juce_Value.h | 2 +- src/containers/juce_ValueTree.cpp | 4 +- src/containers/juce_ValueTree.h | 2 +- src/core/juce_PlatformUtilities.h | 12 ++-- src/core/juce_SystemStats.cpp | 2 +- src/core/juce_SystemStats.h | 12 ++-- src/events/juce_InterprocessConnection.cpp | 2 +- src/events/juce_InterprocessConnection.h | 2 +- src/gui/components/buttons/juce_Button.h | 2 +- .../juce_CPlusPlusCodeTokeniser.cpp | 2 +- .../code_editor/juce_CPlusPlusCodeTokeniser.h | 2 +- .../code_editor/juce_CodeDocument.cpp | 8 +-- .../code_editor/juce_CodeDocument.h | 10 +-- .../code_editor/juce_CodeTokeniser.h | 2 +- src/gui/components/controls/juce_Label.cpp | 2 +- src/gui/components/controls/juce_Label.h | 2 +- src/gui/components/controls/juce_Slider.cpp | 2 +- src/gui/components/controls/juce_Slider.h | 2 +- .../controls/juce_TableHeaderComponent.cpp | 4 +- .../controls/juce_TableHeaderComponent.h | 4 +- src/gui/components/controls/juce_Toolbar.cpp | 2 +- src/gui/components/controls/juce_Toolbar.h | 2 +- .../layout/juce_ComponentBuilder.cpp | 2 +- .../components/layout/juce_ComponentBuilder.h | 4 +- .../components/layout/juce_GroupComponent.cpp | 2 +- .../components/layout/juce_GroupComponent.h | 2 +- .../layout/juce_TabbedButtonBar.cpp | 2 +- .../components/layout/juce_TabbedButtonBar.h | 2 +- .../layout/juce_TabbedComponent.cpp | 2 +- .../components/layout/juce_TabbedComponent.h | 2 +- .../mouse/juce_DragAndDropContainer.cpp | 2 +- .../mouse/juce_DragAndDropContainer.h | 2 +- .../mouse/juce_MouseInputSource.cpp | 8 +-- .../components/mouse/juce_MouseInputSource.h | 4 +- .../positioning/juce_MarkerList.cpp | 6 +- .../components/positioning/juce_MarkerList.h | 6 +- .../juce_RelativeCoordinatePositioner.cpp | 6 +- .../juce_RelativeCoordinatePositioner.h | 4 +- .../positioning/juce_RelativePointPath.cpp | 10 +-- .../positioning/juce_RelativePointPath.h | 12 ++-- .../positioning/juce_RelativeRectangle.cpp | 4 +- .../positioning/juce_RelativeRectangle.h | 2 +- .../juce_ChoicePropertyComponent.cpp | 2 +- .../special/juce_DirectShowComponent.h | 2 +- .../special/juce_QuickTimeMovieComponent.h | 2 +- .../components/windows/juce_ComponentPeer.cpp | 2 +- .../components/windows/juce_ComponentPeer.h | 2 +- .../juce_LowLevelGraphicsSoftwareRenderer.cpp | 64 +++++++++---------- src/gui/graphics/drawables/juce_Drawable.cpp | 2 +- src/gui/graphics/drawables/juce_Drawable.h | 6 +- .../drawables/juce_DrawableComposite.cpp | 10 +-- .../drawables/juce_DrawableComposite.h | 10 +-- .../graphics/drawables/juce_DrawableImage.cpp | 8 +-- .../graphics/drawables/juce_DrawableImage.h | 10 +-- .../graphics/drawables/juce_DrawablePath.cpp | 14 ++-- .../graphics/drawables/juce_DrawablePath.h | 10 +-- .../drawables/juce_DrawableRectangle.cpp | 6 +- .../drawables/juce_DrawableRectangle.h | 8 +-- .../graphics/drawables/juce_DrawableShape.cpp | 6 +- .../graphics/drawables/juce_DrawableShape.h | 6 +- .../graphics/drawables/juce_DrawableText.cpp | 4 +- .../graphics/drawables/juce_DrawableText.h | 4 +- src/gui/graphics/drawables/juce_SVGParser.cpp | 12 ++-- src/gui/graphics/fonts/juce_Font.cpp | 4 +- src/gui/graphics/fonts/juce_Typeface.cpp | 2 +- src/gui/graphics/fonts/juce_Typeface.h | 4 +- src/gui/graphics/imaging/juce_CameraDevice.h | 6 +- src/io/files/juce_File.cpp | 6 +- src/io/files/juce_File.h | 6 +- src/io/network/juce_MACAddress.cpp | 2 +- src/io/network/juce_MACAddress.h | 2 +- src/io/streams/juce_MemoryInputStream.cpp | 2 +- src/maths/juce_Expression.cpp | 54 ++++++++-------- src/maths/juce_Expression.h | 4 +- src/memory/juce_MemoryBlock.cpp | 4 +- src/memory/juce_MemoryBlock.h | 4 +- src/native/android/juce_android_Audio.cpp | 6 +- .../android/juce_android_CameraDevice.cpp | 6 +- src/native/android/juce_android_Fonts.cpp | 2 +- src/native/android/juce_android_Midi.cpp | 4 +- .../android/juce_android_SystemStats.cpp | 12 ++-- src/native/android/juce_android_Windowing.cpp | 2 +- src/native/common/juce_posix_SharedCode.h | 2 +- src/native/linux/juce_linux_Audio.cpp | 8 +-- src/native/linux/juce_linux_AudioCDReader.cpp | 2 +- src/native/linux/juce_linux_Fonts.cpp | 12 ++-- src/native/linux/juce_linux_JackAudio.cpp | 8 +-- src/native/linux/juce_linux_Messaging.cpp | 2 +- src/native/linux/juce_linux_Midi.cpp | 8 +-- src/native/linux/juce_linux_Network.cpp | 6 +- src/native/linux/juce_linux_SystemStats.cpp | 12 ++-- src/native/mac/juce_ios_Audio.cpp | 6 +- src/native/mac/juce_mac_AudioCDBurner.mm | 14 ++-- src/native/mac/juce_mac_AudioCDReader.mm | 2 +- src/native/mac/juce_mac_CameraDevice.mm | 6 +- src/native/mac/juce_mac_CoreAudio.cpp | 16 ++--- src/native/mac/juce_mac_CoreMidi.cpp | 12 ++-- src/native/mac/juce_mac_Files.mm | 4 +- src/native/mac/juce_mac_Fonts.mm | 2 +- .../mac/juce_mac_NSViewComponentPeer.mm | 4 +- src/native/mac/juce_mac_Strings.mm | 6 +- src/native/mac/juce_mac_SystemStats.mm | 10 +-- src/native/windows/juce_win32_ASIO.cpp | 10 +-- .../windows/juce_win32_AudioCDReader.cpp | 10 +-- .../windows/juce_win32_CameraDevice.cpp | 6 +- .../juce_win32_DirectShowComponent.cpp | 2 +- src/native/windows/juce_win32_DirectSound.cpp | 24 +++---- src/native/windows/juce_win32_Files.cpp | 2 +- src/native/windows/juce_win32_Fonts.cpp | 2 +- src/native/windows/juce_win32_Midi.cpp | 4 +- .../windows/juce_win32_PlatformUtils.cpp | 6 +- src/native/windows/juce_win32_SystemStats.cpp | 12 ++-- src/native/windows/juce_win32_WASAPI.cpp | 10 +-- src/native/windows/juce_win32_Windowing.cpp | 8 +-- src/text/juce_LocalisedStrings.h | 2 +- 154 files changed, 472 insertions(+), 473 deletions(-) diff --git a/extras/Introjucer/Source/Utility/jucer_ValueSourceHelpers.h b/extras/Introjucer/Source/Utility/jucer_ValueSourceHelpers.h index 7d3db1a998..a7ea1a121b 100644 --- a/extras/Introjucer/Source/Utility/jucer_ValueSourceHelpers.h +++ b/extras/Introjucer/Source/Utility/jucer_ValueSourceHelpers.h @@ -42,7 +42,7 @@ public: } void valueChanged (Value&) { sendChangeMessage (true); } - const var getValue() const { return (Type) sourceValue.getValue(); } + var getValue() const { return (Type) sourceValue.getValue(); } void setValue (const var& newValue) { diff --git a/extras/audio plugin host/Source/InternalFilters.h b/extras/audio plugin host/Source/InternalFilters.h index b928134128..1570e29677 100644 --- a/extras/audio plugin host/Source/InternalFilters.h +++ b/extras/audio plugin host/Source/InternalFilters.h @@ -55,13 +55,13 @@ public: void getAllTypes (OwnedArray & results); //============================================================================== - const String getName() const { return "Internal"; } + String getName() const { return "Internal"; } bool fileMightContainThisPluginType (const String&) { return false; } - const FileSearchPath getDefaultLocationsToSearch() { return FileSearchPath(); } + FileSearchPath getDefaultLocationsToSearch() { return FileSearchPath(); } void findAllTypesForFile (OwnedArray &, const String&) {} bool doesPluginStillExist (const PluginDescription&) { return true; } - const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } - const StringArray searchPathsForPlugins (const FileSearchPath&, bool) { return StringArray(); } + String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } + StringArray searchPathsForPlugins (const FileSearchPath&, bool) { return StringArray(); } AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); private: diff --git a/src/application/juce_Application.h b/src/application/juce_Application.h index 8864441563..2ff03bb657 100644 --- a/src/application/juce_Application.h +++ b/src/application/juce_Application.h @@ -239,9 +239,8 @@ public: */ int getApplicationReturnValue() const noexcept { return appReturnValue; } - /** Returns the application's command line params. - */ - const String getCommandLineParameters() const noexcept { return commandLineParameters; } + /** Returns the application's command line parameters. */ + const String& getCommandLineParameters() const noexcept { return commandLineParameters; } /** Returns true if this executable is running as an app (as opposed to being a plugin or other kind of shared library. */ diff --git a/src/application/juce_ApplicationCommandManager.cpp b/src/application/juce_ApplicationCommandManager.cpp index e1bc1cb111..ab6c3d059f 100644 --- a/src/application/juce_ApplicationCommandManager.cpp +++ b/src/application/juce_ApplicationCommandManager.cpp @@ -139,14 +139,14 @@ const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const return nullptr; } -const String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) const noexcept +String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) const noexcept { const ApplicationCommandInfo* const ci = getCommandForID (commandID); return ci != nullptr ? ci->shortName : String::empty; } -const String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const noexcept +String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const noexcept { const ApplicationCommandInfo* const ci = getCommandForID (commandID); @@ -164,7 +164,7 @@ StringArray ApplicationCommandManager::getCommandCategories() const return s; } -const Array ApplicationCommandManager::getCommandsInCategory (const String& categoryName) const +Array ApplicationCommandManager::getCommandsInCategory (const String& categoryName) const { Array results; diff --git a/src/application/juce_ApplicationCommandManager.h b/src/application/juce_ApplicationCommandManager.h index 5a07757f6b..2cb41d0ceb 100644 --- a/src/application/juce_ApplicationCommandManager.h +++ b/src/application/juce_ApplicationCommandManager.h @@ -176,7 +176,7 @@ public: An empty string is returned if no command with this ID has been registered. @see getDescriptionOfCommand */ - const String getNameOfCommand (CommandID commandID) const noexcept; + String getNameOfCommand (CommandID commandID) const noexcept; /** Returns the description field for a command. @@ -185,7 +185,7 @@ public: @see getNameOfCommand */ - const String getDescriptionOfCommand (CommandID commandID) const noexcept; + String getDescriptionOfCommand (CommandID commandID) const noexcept; /** Returns the list of categories. @@ -200,7 +200,7 @@ public: @see getCommandCategories() */ - const Array getCommandsInCategory (const String& categoryName) const; + Array getCommandsInCategory (const String& categoryName) const; //============================================================================== /** Returns the manager's internal set of key mappings. diff --git a/src/audio/audio_file_formats/juce_AudioCDBurner.h b/src/audio/audio_file_formats/juce_AudioCDBurner.h index 9868c7a81c..985051034e 100644 --- a/src/audio/audio_file_formats/juce_AudioCDBurner.h +++ b/src/audio/audio_file_formats/juce_AudioCDBurner.h @@ -43,7 +43,7 @@ public: Use openDevice() to open one of the items from this list. */ - static const StringArray findAvailableDevices(); + static StringArray findAvailableDevices(); /** Tries to open one of the optical drives. @@ -92,7 +92,7 @@ public: Note that if there's no media present in the drive, this value may be unavailable! @see setWriteSpeed, getWriteSpeed */ - const Array getAvailableWriteSpeeds() const; + Array getAvailableWriteSpeeds() const; //============================================================================== /** Tries to enable or disable buffer underrun safety on devices that support it. @@ -144,10 +144,10 @@ public: @param writeSpeed one of the write speeds from getAvailableWriteSpeeds(), or 0 or less to mean the fastest speed. */ - const String burn (BurnProgressListener* listener, - bool ejectDiscAfterwards, - bool performFakeBurnForTesting, - int writeSpeed); + String burn (BurnProgressListener* listener, + bool ejectDiscAfterwards, + bool performFakeBurnForTesting, + int writeSpeed); /** If a burn operation is currently in progress, this tells it to stop as soon as possible. diff --git a/src/audio/audio_file_formats/juce_AudioCDReader.h b/src/audio/audio_file_formats/juce_AudioCDReader.h index 29c65d6fe6..18930c31de 100644 --- a/src/audio/audio_file_formats/juce_AudioCDReader.h +++ b/src/audio/audio_file_formats/juce_AudioCDReader.h @@ -59,7 +59,7 @@ public: @see createReaderForCD */ - static const StringArray getAvailableCDNames(); + static StringArray getAvailableCDNames(); /** Tries to create an AudioFormatReader that can read from an Audio CD. diff --git a/src/audio/audio_file_formats/juce_AudioFormat.cpp b/src/audio/audio_file_formats/juce_AudioFormat.cpp index cd15e5c95c..7909197b0f 100644 --- a/src/audio/audio_file_formats/juce_AudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_AudioFormat.cpp @@ -54,7 +54,7 @@ bool AudioFormat::canHandleFile (const File& f) const String& AudioFormat::getFormatName() const { return formatName; } const StringArray& AudioFormat::getFileExtensions() const { return fileExtensions; } bool AudioFormat::isCompressed() { return false; } -const StringArray AudioFormat::getQualityOptions() { return StringArray(); } +StringArray AudioFormat::getQualityOptions() { return StringArray(); } END_JUCE_NAMESPACE diff --git a/src/audio/audio_file_formats/juce_AudioFormat.h b/src/audio/audio_file_formats/juce_AudioFormat.h index 5f001b0387..e67ae5facf 100644 --- a/src/audio/audio_file_formats/juce_AudioFormat.h +++ b/src/audio/audio_file_formats/juce_AudioFormat.h @@ -93,7 +93,7 @@ public: When calling createWriterFor(), an index from this array is passed in to tell the format which option is required. */ - virtual const StringArray getQualityOptions(); + virtual StringArray getQualityOptions(); //============================================================================== /** Tries to create an object that can read from a stream containing audio diff --git a/src/audio/audio_file_formats/juce_AudioFormatManager.cpp b/src/audio/audio_file_formats/juce_AudioFormatManager.cpp index a4c31120e9..566b2ae1ae 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatManager.cpp +++ b/src/audio/audio_file_formats/juce_AudioFormatManager.cpp @@ -123,7 +123,7 @@ AudioFormat* AudioFormatManager::findFormatForFileExtension (const String& fileE return nullptr; } -const String AudioFormatManager::getWildcardForAllFormats() const +String AudioFormatManager::getWildcardForAllFormats() const { StringArray allExtensions; diff --git a/src/audio/audio_file_formats/juce_AudioFormatManager.h b/src/audio/audio_file_formats/juce_AudioFormatManager.h index 092141d655..068f68b4e0 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatManager.h +++ b/src/audio/audio_file_formats/juce_AudioFormatManager.h @@ -106,7 +106,7 @@ public: E.g. if might return "*.wav;*.aiff" if it just knows about wavs and aiffs. */ - const String getWildcardForAllFormats() const; + String getWildcardForAllFormats() const; //============================================================================== /** Searches through the known formats to try to create a suitable reader for diff --git a/src/audio/audio_file_formats/juce_AudioFormatReader.h b/src/audio/audio_file_formats/juce_AudioFormatReader.h index c4c6fd3b38..0636cf13e4 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatReader.h +++ b/src/audio/audio_file_formats/juce_AudioFormatReader.h @@ -66,7 +66,7 @@ public: E.g. "AIFF" */ - const String getFormatName() const noexcept { return formatName; } + const String& getFormatName() const noexcept { return formatName; } //============================================================================== /** Reads samples from the stream. diff --git a/src/audio/audio_file_formats/juce_AudioFormatWriter.h b/src/audio/audio_file_formats/juce_AudioFormatWriter.h index f8925a9426..2a58961e46 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatWriter.h +++ b/src/audio/audio_file_formats/juce_AudioFormatWriter.h @@ -77,7 +77,7 @@ public: E.g. "AIFF file" */ - const String getFormatName() const noexcept { return formatName; } + const String& getFormatName() const noexcept { return formatName; } //============================================================================== /** Writes a set of samples to the audio stream. @@ -192,8 +192,9 @@ public: */ void setThumbnailToUpdate (AudioThumbnail* thumbnailToUpdate); - /** @internal */ + #ifndef DOXYGEN class Buffer; // (only public for VC6 compatibility) + #endif private: friend class ScopedPointer; diff --git a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp index c4bfa36653..3091c9af99 100644 --- a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp @@ -536,7 +536,7 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, return nullptr; } -const StringArray FlacAudioFormat::getQualityOptions() +StringArray FlacAudioFormat::getQualityOptions() { const char* options[] = { "0 (Fastest)", "1", "2", "3", "4", "5 (Default)","6", "7", "8 (Highest quality)", 0 }; return StringArray (options); diff --git a/src/audio/audio_file_formats/juce_FlacAudioFormat.h b/src/audio/audio_file_formats/juce_FlacAudioFormat.h index 3c67c67128..1bbe01c906 100644 --- a/src/audio/audio_file_formats/juce_FlacAudioFormat.h +++ b/src/audio/audio_file_formats/juce_FlacAudioFormat.h @@ -54,7 +54,7 @@ public: bool canDoStereo(); bool canDoMono(); bool isCompressed(); - const StringArray getQualityOptions(); + StringArray getQualityOptions(); //============================================================================== AudioFormatReader* createReaderFor (InputStream* sourceStream, diff --git a/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp b/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp index 60d41b124e..f8ec68cb8d 100644 --- a/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp @@ -453,7 +453,7 @@ AudioFormatWriter* OggVorbisAudioFormat::createWriterFor (OutputStream* out, return w->ok ? w.release() : nullptr; } -const StringArray OggVorbisAudioFormat::getQualityOptions() +StringArray OggVorbisAudioFormat::getQualityOptions() { const char* options[] = { "64 kbps", "80 kbps", "96 kbps", "112 kbps", "128 kbps", "160 kbps", "192 kbps", "224 kbps", "256 kbps", "320 kbps", "500 kbps", 0 }; diff --git a/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.h b/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.h index 550750fcca..9896e60d25 100644 --- a/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.h +++ b/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.h @@ -49,12 +49,12 @@ public: ~OggVorbisAudioFormat(); //============================================================================== - const Array getPossibleSampleRates(); - const Array getPossibleBitDepths(); + const Array getPossibleSampleRates(); + const Array getPossibleBitDepths(); bool canDoStereo(); bool canDoMono(); bool isCompressed(); - const StringArray getQualityOptions(); + StringArray getQualityOptions(); //============================================================================== /** Tries to estimate the quality level of an ogg file based on its size. diff --git a/src/audio/devices/juce_AudioDeviceManager.cpp b/src/audio/devices/juce_AudioDeviceManager.cpp index 451dbaa069..6b3a10c386 100644 --- a/src/audio/devices/juce_AudioDeviceManager.cpp +++ b/src/audio/devices/juce_AudioDeviceManager.cpp @@ -114,12 +114,12 @@ void AudioDeviceManager::createAudioDeviceTypes (OwnedArray & } //============================================================================== -const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, - const int numOutputChannelsNeeded, - const XmlElement* const e, - const bool selectDefaultDeviceOnFailure, - const String& preferredDefaultDeviceName, - const AudioDeviceSetup* preferredSetupOptions) +String AudioDeviceManager::initialise (const int numInputChannelsNeeded, + const int numOutputChannelsNeeded, + const XmlElement* const e, + const bool selectDefaultDeviceOnFailure, + const String& preferredDefaultDeviceName, + const AudioDeviceSetup* preferredSetupOptions) { scanDevicesIfNeeded(); @@ -322,8 +322,8 @@ AudioIODeviceType* AudioDeviceManager::getCurrentDeviceTypeObject() const return availableDeviceTypes[0]; } -const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup, - const bool treatAsChosenDevice) +String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup, + const bool treatAsChosenDevice) { jassert (&newSetup != ¤tSetup); // this will have no effect diff --git a/src/audio/devices/juce_AudioDeviceManager.h b/src/audio/devices/juce_AudioDeviceManager.h index 3f6bb6b19f..c4b22aca05 100644 --- a/src/audio/devices/juce_AudioDeviceManager.h +++ b/src/audio/devices/juce_AudioDeviceManager.h @@ -191,12 +191,12 @@ public: @returns an error message if anything went wrong, or an empty string if it worked ok. */ - const String initialise (int numInputChannelsNeeded, - int numOutputChannelsNeeded, - const XmlElement* savedState, - bool selectDefaultDeviceOnFailure, - const String& preferredDefaultDeviceName = String::empty, - const AudioDeviceSetup* preferredSetupOptions = 0); + String initialise (int numInputChannelsNeeded, + int numOutputChannelsNeeded, + const XmlElement* savedState, + bool selectDefaultDeviceOnFailure, + const String& preferredDefaultDeviceName = String::empty, + const AudioDeviceSetup* preferredSetupOptions = 0); /** Returns some XML representing the current state of the manager. @@ -234,8 +234,8 @@ public: @see getAudioDeviceSetup */ - const String setAudioDeviceSetup (const AudioDeviceSetup& newSetup, - bool treatAsChosenDevice); + String setAudioDeviceSetup (const AudioDeviceSetup& newSetup, + bool treatAsChosenDevice); /** Returns the currently-active audio device. */ @@ -244,7 +244,7 @@ public: /** Returns the type of audio device currently in use. @see setCurrentAudioDeviceType */ - const String getCurrentAudioDeviceType() const { return currentDeviceType; } + String getCurrentAudioDeviceType() const { return currentDeviceType; } /** Returns the currently active audio device type object. Don't keep a copy of this pointer - it's owned by the device manager and could @@ -375,7 +375,7 @@ public: @see setDefaultMidiOutput, getDefaultMidiOutput */ - const String getDefaultMidiOutputName() const { return defaultMidiOutputName; } + String getDefaultMidiOutputName() const { return defaultMidiOutputName; } /** Returns the current default midi output device. @@ -496,8 +496,8 @@ private: void audioDeviceStoppedInt(); void handleIncomingMidiMessageInt (MidiInput*, const MidiMessage&); - const String restartDevice (int blockSizeToUse, double sampleRateToUse, - const BigInteger& ins, const BigInteger& outs); + String restartDevice (int blockSizeToUse, double sampleRateToUse, + const BigInteger& ins, const BigInteger& outs); void stopDevice(); void updateXml(); diff --git a/src/audio/devices/juce_AudioIODevice.h b/src/audio/devices/juce_AudioIODevice.h index 45ea0c5d81..1273658e07 100644 --- a/src/audio/devices/juce_AudioIODevice.h +++ b/src/audio/devices/juce_AudioIODevice.h @@ -152,12 +152,12 @@ public: /** Returns the names of all the available output channels on this device. To find out which of these are currently in use, call getActiveOutputChannels(). */ - virtual const StringArray getOutputChannelNames() = 0; + virtual StringArray getOutputChannelNames() = 0; /** Returns the names of all the available input channels on this device. To find out which of these are currently in use, call getActiveInputChannels(). */ - virtual const StringArray getInputChannelNames() = 0; + virtual StringArray getInputChannelNames() = 0; //============================================================================== /** Returns the number of sample-rates this device supports. diff --git a/src/audio/devices/juce_AudioIODeviceType.h b/src/audio/devices/juce_AudioIODeviceType.h index 7cb0457cfc..4fe99ba4c1 100644 --- a/src/audio/devices/juce_AudioIODeviceType.h +++ b/src/audio/devices/juce_AudioIODeviceType.h @@ -89,7 +89,7 @@ public: into inputs and outputs, this indicates whether to use the input or output name to refer to a pair of devices. */ - virtual const StringArray getDeviceNames (bool wantInputNames = false) const = 0; + virtual StringArray getDeviceNames (bool wantInputNames = false) const = 0; /** Returns the name of the default device. diff --git a/src/audio/dsp/juce_Decibels.h b/src/audio/dsp/juce_Decibels.h index b722d28896..f139be006f 100644 --- a/src/audio/dsp/juce_Decibels.h +++ b/src/audio/dsp/juce_Decibels.h @@ -67,9 +67,9 @@ public: be "-INF dB". */ template - static const String toString (const Type decibels, - const int decimalPlaces = 2, - const Type minusInfinityDb = (Type) defaultMinusInfinitydB) + static String toString (const Type decibels, + const int decimalPlaces = 2, + const Type minusInfinityDb = (Type) defaultMinusInfinitydB) { String s; diff --git a/src/audio/midi/juce_MidiInput.h b/src/audio/midi/juce_MidiInput.h index fa572d205b..12b3acdbe4 100644 --- a/src/audio/midi/juce_MidiInput.h +++ b/src/audio/midi/juce_MidiInput.h @@ -102,7 +102,7 @@ public: @see getDefaultDeviceIndex, openDevice */ - static const StringArray getDevices(); + static StringArray getDevices(); /** Returns the index of the default midi input device to use. @@ -125,7 +125,7 @@ public: static MidiInput* openDevice (int deviceIndex, MidiInputCallback* callback); -#if JUCE_LINUX || JUCE_MAC || DOXYGEN + #if JUCE_LINUX || JUCE_MAC || DOXYGEN /** This will try to create a new midi input device (Not available on Windows). This will attempt to create a new midi input device with the specified name, @@ -138,20 +138,19 @@ public: */ static MidiInput* createNewDevice (const String& deviceName, MidiInputCallback* callback); -#endif + #endif //============================================================================== /** Destructor. */ virtual ~MidiInput(); - /** Returns the name of this device. - */ - virtual const String getName() const noexcept { return name; } + /** Returns the name of this device. */ + const String& getName() const noexcept { return name; } /** Allows you to set a custom name for the device, in case you don't like the name it was given when created. */ - virtual void setName (const String& newName) noexcept { name = newName; } + void setName (const String& newName) noexcept { name = newName; } //============================================================================== /** Starts the device running. diff --git a/src/audio/midi/juce_MidiOutput.h b/src/audio/midi/juce_MidiOutput.h index fc5739523e..ead287c71f 100644 --- a/src/audio/midi/juce_MidiOutput.h +++ b/src/audio/midi/juce_MidiOutput.h @@ -52,7 +52,7 @@ public: @see getDefaultDeviceIndex, openDevice */ - static const StringArray getDevices(); + static StringArray getDevices(); /** Returns the index of the default midi output device to use. diff --git a/src/audio/plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/src/audio/plugin_client/RTAS/juce_RTAS_Wrapper.cpp index e509c44986..b222ab2a2b 100644 --- a/src/audio/plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/src/audio/plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -949,7 +949,7 @@ private: return new JucePlugInProcess(); } - static const String createRTASName() + static String createRTASName() { return String (JucePlugin_Name) + "\n" + String (JucePlugin_Name).substring (0, 4); diff --git a/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.h b/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.h index e6618a14c0..4bd18ef474 100644 --- a/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.h +++ b/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.h @@ -42,14 +42,14 @@ public: ~AudioUnitPluginFormat(); //============================================================================== - const String getName() const { return "AudioUnit"; } + String getName() const { return "AudioUnit"; } void findAllTypesForFile (OwnedArray & results, const String& fileOrIdentifier); AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); - const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); - const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); + String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); + StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); bool doesPluginStillExist (const PluginDescription& desc); - const FileSearchPath getDefaultLocationsToSearch(); + FileSearchPath getDefaultLocationsToSearch(); private: //============================================================================== diff --git a/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.mm b/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.mm index 660b858d44..a556cc7690 100644 --- a/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.mm +++ b/src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.mm @@ -1493,7 +1493,7 @@ AudioPluginInstance* AudioUnitPluginFormat::createInstanceFromDescription (const return nullptr; } -const StringArray AudioUnitPluginFormat::searchPathsForPlugins (const FileSearchPath& /*directoriesToSearch*/, +StringArray AudioUnitPluginFormat::searchPathsForPlugins (const FileSearchPath& /*directoriesToSearch*/, const bool /*recursive*/) { StringArray result; @@ -1538,7 +1538,7 @@ bool AudioUnitPluginFormat::fileMightContainThisPluginType (const String& fileOr && f.isDirectory(); } -const String AudioUnitPluginFormat::getNameOfPluginFromIdentifier (const String& fileOrIdentifier) +String AudioUnitPluginFormat::getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { ComponentDescription desc; String name, version, manufacturer; @@ -1558,7 +1558,7 @@ bool AudioUnitPluginFormat::doesPluginStillExist (const PluginDescription& desc) return File (desc.fileOrIdentifier).exists(); } -const FileSearchPath AudioUnitPluginFormat::getDefaultLocationsToSearch() +FileSearchPath AudioUnitPluginFormat::getDefaultLocationsToSearch() { return FileSearchPath ("/(Default AudioUnit locations)"); } diff --git a/src/audio/plugin_host/formats/juce_DirectXPluginFormat.h b/src/audio/plugin_host/formats/juce_DirectXPluginFormat.h index 41d7bc82d7..bc9af2304e 100644 --- a/src/audio/plugin_host/formats/juce_DirectXPluginFormat.h +++ b/src/audio/plugin_host/formats/juce_DirectXPluginFormat.h @@ -46,12 +46,12 @@ public: ~DirectXPluginFormat(); //============================================================================== - const String getName() const { return "DirectX"; } + String getName() const { return "DirectX"; } void findAllTypesForFile (OwnedArray & results, const String& fileOrIdentifier); AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); - const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } - const FileSearchPath getDefaultLocationsToSearch(); + String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } + FileSearchPath getDefaultLocationsToSearch(); private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectXPluginFormat); diff --git a/src/audio/plugin_host/formats/juce_LADSPAPluginFormat.h b/src/audio/plugin_host/formats/juce_LADSPAPluginFormat.h index 45d9f3e742..c2c8687daa 100644 --- a/src/audio/plugin_host/formats/juce_LADSPAPluginFormat.h +++ b/src/audio/plugin_host/formats/juce_LADSPAPluginFormat.h @@ -46,12 +46,12 @@ public: ~LADSPAPluginFormat(); //============================================================================== - const String getName() const { return "LADSPA"; } + String getName() const { return "LADSPA"; } void findAllTypesForFile (OwnedArray & results, const String& fileOrIdentifier); AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); - const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } - const FileSearchPath getDefaultLocationsToSearch(); + String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } + FileSearchPath getDefaultLocationsToSearch(); private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LADSPAPluginFormat); diff --git a/src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp b/src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp index 77f27a31e0..9a3d026aa0 100644 --- a/src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp +++ b/src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp @@ -2877,7 +2877,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti #endif } -const String VSTPluginFormat::getNameOfPluginFromIdentifier (const String& fileOrIdentifier) +String VSTPluginFormat::getNameOfPluginFromIdentifier (const String& fileOrIdentifier) { return fileOrIdentifier; } @@ -2887,7 +2887,7 @@ bool VSTPluginFormat::doesPluginStillExist (const PluginDescription& desc) return File (desc.fileOrIdentifier).exists(); } -const StringArray VSTPluginFormat::searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive) +StringArray VSTPluginFormat::searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive) { StringArray results; @@ -2919,7 +2919,7 @@ void VSTPluginFormat::recursiveFileSearch (StringArray& results, const File& dir } } -const FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() +FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() { #if JUCE_MAC return FileSearchPath ("~/Library/Audio/Plug-Ins/VST;/Library/Audio/Plug-Ins/VST"); diff --git a/src/audio/plugin_host/formats/juce_VSTPluginFormat.h b/src/audio/plugin_host/formats/juce_VSTPluginFormat.h index bce535e4f2..f0904b6231 100644 --- a/src/audio/plugin_host/formats/juce_VSTPluginFormat.h +++ b/src/audio/plugin_host/formats/juce_VSTPluginFormat.h @@ -43,14 +43,14 @@ public: ~VSTPluginFormat(); //============================================================================== - const String getName() const { return "VST"; } + String getName() const { return "VST"; } void findAllTypesForFile (OwnedArray & results, const String& fileOrIdentifier); AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); bool fileMightContainThisPluginType (const String& fileOrIdentifier); - const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); - const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); + String getNameOfPluginFromIdentifier (const String& fileOrIdentifier); + StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, bool recursive); bool doesPluginStillExist (const PluginDescription& desc); - const FileSearchPath getDefaultLocationsToSearch(); + FileSearchPath getDefaultLocationsToSearch(); private: //============================================================================== diff --git a/src/audio/plugin_host/juce_AudioPluginFormat.h b/src/audio/plugin_host/juce_AudioPluginFormat.h index c991048420..18aa267ade 100644 --- a/src/audio/plugin_host/juce_AudioPluginFormat.h +++ b/src/audio/plugin_host/juce_AudioPluginFormat.h @@ -50,7 +50,7 @@ public: E.g. "VST", "AudioUnit", etc. */ - virtual const String getName() const = 0; + virtual String getName() const = 0; /** This tries to create descriptions for all the plugin types available in a binary module file. @@ -80,7 +80,7 @@ public: /** Returns a readable version of the name of the plugin that this identifier refers to. */ - virtual const String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) = 0; + virtual String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) = 0; /** Checks whether this plugin could possibly be loaded. @@ -94,15 +94,15 @@ public: The path might be ignored, e.g. by AUs, which are found by the OS rather than manually. */ - virtual const StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, - bool recursive) = 0; + virtual StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, + bool recursive) = 0; /** Returns the typical places to look for this kind of plugin. Note that if this returns no paths, it means that the format can't be scanned-for (i.e. it's an internal format that doesn't live in files) */ - virtual const FileSearchPath getDefaultLocationsToSearch() = 0; + virtual FileSearchPath getDefaultLocationsToSearch() = 0; protected: diff --git a/src/audio/plugin_host/juce_KnownPluginList.cpp b/src/audio/plugin_host/juce_KnownPluginList.cpp index ff592c1299..eae96a20e0 100644 --- a/src/audio/plugin_host/juce_KnownPluginList.cpp +++ b/src/audio/plugin_host/juce_KnownPluginList.cpp @@ -95,7 +95,7 @@ void KnownPluginList::removeType (const int index) namespace { - const Time getPluginFileModTime (const String& fileOrIdentifier) + Time getPluginFileModTime (const String& fileOrIdentifier) { if (fileOrIdentifier.startsWithChar ('/') || fileOrIdentifier[1] == ':') return File (fileOrIdentifier).getLastModificationTime(); diff --git a/src/audio/plugin_host/juce_PluginDescription.cpp b/src/audio/plugin_host/juce_PluginDescription.cpp index a078a2fe25..806ea8b893 100644 --- a/src/audio/plugin_host/juce_PluginDescription.cpp +++ b/src/audio/plugin_host/juce_PluginDescription.cpp @@ -84,7 +84,7 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const && uid == other.uid; } -const String PluginDescription::createIdentifierString() const +String PluginDescription::createIdentifierString() const { return pluginFormatName + "-" + name diff --git a/src/audio/plugin_host/juce_PluginDescription.h b/src/audio/plugin_host/juce_PluginDescription.h index dc8ffec6f9..a12dc418d9 100644 --- a/src/audio/plugin_host/juce_PluginDescription.h +++ b/src/audio/plugin_host/juce_PluginDescription.h @@ -120,7 +120,7 @@ public: plugin's file location, so can be used to store a plugin ID for use across different machines. */ - const String createIdentifierString() const; + String createIdentifierString() const; //============================================================================== /** Creates an XML object containing these details. diff --git a/src/audio/synthesisers/juce_Synthesiser.h b/src/audio/synthesisers/juce_Synthesiser.h index e7fc1610c6..a1ec5dd167 100644 --- a/src/audio/synthesisers/juce_Synthesiser.h +++ b/src/audio/synthesisers/juce_Synthesiser.h @@ -108,13 +108,13 @@ public: Returns a value less than 0 if no note is playing. */ - int getCurrentlyPlayingNote() const { return currentlyPlayingNote; } + int getCurrentlyPlayingNote() const { return currentlyPlayingNote; } /** Returns the sound that this voice is currently playing. Returns 0 if it's not playing. */ - const SynthesiserSound::Ptr getCurrentlyPlayingSound() const { return currentlyPlayingSound; } + SynthesiserSound::Ptr getCurrentlyPlayingSound() const { return currentlyPlayingSound; } /** Must return true if this voice object is capable of playing the given sound. diff --git a/src/containers/juce_DynamicObject.cpp b/src/containers/juce_DynamicObject.cpp index 0a0ef2d5b1..f2a334a431 100644 --- a/src/containers/juce_DynamicObject.cpp +++ b/src/containers/juce_DynamicObject.cpp @@ -45,7 +45,7 @@ bool DynamicObject::hasProperty (const Identifier& propertyName) const return v != nullptr && ! v->isMethod(); } -const var DynamicObject::getProperty (const Identifier& propertyName) const +var DynamicObject::getProperty (const Identifier& propertyName) const { return properties [propertyName]; } @@ -65,9 +65,9 @@ bool DynamicObject::hasMethod (const Identifier& methodName) const return getProperty (methodName).isMethod(); } -const var DynamicObject::invokeMethod (const Identifier& methodName, - const var* parameters, - int numParameters) +var DynamicObject::invokeMethod (const Identifier& methodName, + const var* parameters, + int numParameters) { return properties [methodName].invokeMethod (this, parameters, numParameters); } diff --git a/src/containers/juce_DynamicObject.h b/src/containers/juce_DynamicObject.h index 5e1747971b..d899cb00f7 100644 --- a/src/containers/juce_DynamicObject.h +++ b/src/containers/juce_DynamicObject.h @@ -60,7 +60,7 @@ public: This returns a void if no such property exists. */ - virtual const var getProperty (const Identifier& propertyName) const; + virtual var getProperty (const Identifier& propertyName) const; /** Sets a named property. */ virtual void setProperty (const Identifier& propertyName, const var& newValue); @@ -85,9 +85,9 @@ public: This method is virtual to allow more dynamic invocation to used for objects where the methods may not already be set as properies. */ - virtual const var invokeMethod (const Identifier& methodName, - const var* parameters, - int numParameters); + virtual var invokeMethod (const Identifier& methodName, + const var* parameters, + int numParameters); /** Sets up a method. diff --git a/src/containers/juce_Value.cpp b/src/containers/juce_Value.cpp index f5c3c50b67..ba37293c56 100644 --- a/src/containers/juce_Value.cpp +++ b/src/containers/juce_Value.cpp @@ -77,7 +77,7 @@ public: { } - const var getValue() const + var getValue() const { return value; } diff --git a/src/containers/juce_Value.h b/src/containers/juce_Value.h index 232d69899a..5807f91e4f 100644 --- a/src/containers/juce_Value.h +++ b/src/containers/juce_Value.h @@ -178,7 +178,7 @@ public: virtual ~ValueSource(); /** Returns the current value of this object. */ - virtual const var getValue() const = 0; + virtual var getValue() const = 0; /** Changes the current value. This must also trigger a change message if the value actually changes. diff --git a/src/containers/juce_ValueTree.cpp b/src/containers/juce_ValueTree.cpp index 9931148128..3156125976 100644 --- a/src/containers/juce_ValueTree.cpp +++ b/src/containers/juce_ValueTree.cpp @@ -326,7 +326,7 @@ const var& ValueTree::SharedObject::getProperty (const Identifier& name) const return properties [name]; } -const var ValueTree::SharedObject::getProperty (const Identifier& name, const var& defaultReturnValue) const +var ValueTree::SharedObject::getProperty (const Identifier& name, const var& defaultReturnValue) const { return properties.getWithDefault (name, defaultReturnValue); } @@ -733,7 +733,7 @@ public: tree.removeListener (this); } - const var getValue() const + var getValue() const { return tree [property]; } diff --git a/src/containers/juce_ValueTree.h b/src/containers/juce_ValueTree.h index 017133c5b2..e357af135b 100644 --- a/src/containers/juce_ValueTree.h +++ b/src/containers/juce_ValueTree.h @@ -493,7 +493,7 @@ private: void sendChildOrderChangedMessage(); void sendParentChangeMessage(); const var& getProperty (const Identifier& name) const; - const var getProperty (const Identifier& name, const var& defaultReturnValue) const; + var getProperty (const Identifier& name, const var& defaultReturnValue) const; void setProperty (const Identifier& name, const var& newValue, UndoManager*); bool hasProperty (const Identifier& name) const; void removeProperty (const Identifier& name, UndoManager*); diff --git a/src/core/juce_PlatformUtilities.h b/src/core/juce_PlatformUtilities.h index ebf2cb1a54..ad074e57d6 100644 --- a/src/core/juce_PlatformUtilities.h +++ b/src/core/juce_PlatformUtilities.h @@ -55,7 +55,7 @@ public: #if JUCE_MAC || JUCE_IOS || DOXYGEN //============================================================================== /** MAC ONLY - Turns a Core CF String into a juce one. */ - static const String cfStringToJuceString (CFStringRef cfString); + static String cfStringToJuceString (CFStringRef cfString); /** MAC ONLY - Turns a juce string into a Core CF one. */ static CFStringRef juceStringToCFString (const String& s); @@ -64,12 +64,12 @@ public: static bool makeFSRefFromPath (FSRef* destFSRef, const String& path); /** MAC ONLY - Turns an FSRef into a juce string path. */ - static const String makePathFromFSRef (FSRef* file); + static String makePathFromFSRef (FSRef* file); /** MAC ONLY - Converts any decomposed unicode characters in a string into their precomposed equivalents. */ - static const String convertToPrecomposedUnicode (const String& s); + static String convertToPrecomposedUnicode (const String& s); /** MAC ONLY - Gets the type of a file from the file's resources. */ static OSType getTypeOfFile (const String& filename); @@ -96,8 +96,8 @@ public: The path is a string for the entire path of a value in the registry, e.g. "HKEY_CURRENT_USER\Software\foo\bar" */ - static const String getRegistryValue (const String& regValuePath, - const String& defaultValue = String::empty); + static String getRegistryValue (const String& regValuePath, + const String& defaultValue = String::empty); /** WIN32 ONLY - Sets a registry value as a string. @@ -156,7 +156,7 @@ public: This is needed to avoid unicode problems with the argc type params. */ - static const String JUCE_CALLTYPE getCurrentCommandLineParams(); + static String JUCE_CALLTYPE getCurrentCommandLineParams(); #endif /** Clears the floating point unit's flags. diff --git a/src/core/juce_SystemStats.cpp b/src/core/juce_SystemStats.cpp index 4ab88edad4..0ee22356a5 100644 --- a/src/core/juce_SystemStats.cpp +++ b/src/core/juce_SystemStats.cpp @@ -40,7 +40,7 @@ const SystemStats::CPUFlags& SystemStats::getCPUFlags() return cpuFlags; } -const String SystemStats::getJUCEVersion() +String SystemStats::getJUCEVersion() { // Some basic tests, to keep an eye on things and make sure these types work ok // on all platforms. Let me know if any of these assertions fail on your system! diff --git a/src/core/juce_SystemStats.h b/src/core/juce_SystemStats.h index 4dd874e0d6..7fc4b3e1d8 100644 --- a/src/core/juce_SystemStats.h +++ b/src/core/juce_SystemStats.h @@ -41,7 +41,7 @@ public: See also the JUCE_VERSION, JUCE_MAJOR_VERSION and JUCE_MINOR_VERSION macros. */ - static const String getJUCEVersion(); + static String getJUCEVersion(); //============================================================================== /** The set of possible results of the getOperatingSystemType() method. @@ -81,7 +81,7 @@ public: @returns a string describing the OS type. @see getOperatingSystemType */ - static const String getOperatingSystemName(); + static String getOperatingSystemName(); /** Returns true if the OS is 64-bit, or false for a 32-bit OS. */ @@ -91,16 +91,16 @@ public: /** Returns the current user's name, if available. @see getFullUserName() */ - static const String getLogonName(); + static String getLogonName(); /** Returns the current user's full name, if available. On some OSes, this may just return the same value as getLogonName(). @see getLogonName() */ - static const String getFullUserName(); + static String getFullUserName(); /** Returns the host-name of the computer. */ - static const String getComputerName(); + static String getComputerName(); //============================================================================== // CPU and memory information.. @@ -116,7 +116,7 @@ public: Might not be known on some systems. */ - static const String getCpuVendor(); + static String getCpuVendor(); /** Checks whether Intel MMX instructions are available. */ static bool hasMMX() noexcept { return getCPUFlags().hasMMX; } diff --git a/src/events/juce_InterprocessConnection.cpp b/src/events/juce_InterprocessConnection.cpp index 3b2310c684..256f2bafe2 100644 --- a/src/events/juce_InterprocessConnection.cpp +++ b/src/events/juce_InterprocessConnection.cpp @@ -140,7 +140,7 @@ bool InterprocessConnection::isConnected() const && isThreadRunning(); } -const String InterprocessConnection::getConnectedHostName() const +String InterprocessConnection::getConnectedHostName() const { if (pipe != nullptr) { diff --git a/src/events/juce_InterprocessConnection.h b/src/events/juce_InterprocessConnection.h index cae0141e89..03b00c5415 100644 --- a/src/events/juce_InterprocessConnection.h +++ b/src/events/juce_InterprocessConnection.h @@ -139,7 +139,7 @@ public: This will return an empty string if the other machine isn't known for some reason. */ - const String getConnectedHostName() const; + String getConnectedHostName() const; //============================================================================== /** Tries to send a message to the other end of this connection. diff --git a/src/gui/components/buttons/juce_Button.h b/src/gui/components/buttons/juce_Button.h index 0afaee7b8d..052b41b0ee 100644 --- a/src/gui/components/buttons/juce_Button.h +++ b/src/gui/components/buttons/juce_Button.h @@ -78,7 +78,7 @@ public: @see setButtonText */ - const String getButtonText() const { return text; } + const String& getButtonText() const { return text; } //============================================================================== /** Returns true if the button is currently being held down by the mouse. diff --git a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp index fcb151d809..7604fe32e1 100644 --- a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp +++ b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp @@ -567,7 +567,7 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) return result; } -const StringArray CPlusPlusCodeTokeniser::getTokenTypes() +StringArray CPlusPlusCodeTokeniser::getTokenTypes() { const char* const types[] = { diff --git a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.h b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.h index 7b5c2f90d5..b501c47c0e 100644 --- a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.h +++ b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.h @@ -60,7 +60,7 @@ public: //============================================================================== int readNextToken (CodeDocument::Iterator& source); - const StringArray getTokenTypes(); + StringArray getTokenTypes(); const Colour getDefaultColour (int tokenType); /** This is a handy method for checking whether a string is a c++ reserved keyword. */ diff --git a/src/gui/components/code_editor/juce_CodeDocument.cpp b/src/gui/components/code_editor/juce_CodeDocument.cpp index 4a4b21a496..d357950964 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.cpp +++ b/src/gui/components/code_editor/juce_CodeDocument.cpp @@ -444,7 +444,7 @@ const juce_wchar CodeDocument::Position::getCharacter() const return l == nullptr ? 0 : l->line [getIndexInLine()]; } -const String CodeDocument::Position::getLineText() const +String CodeDocument::Position::getLineText() const { const CodeDocumentLine* const l = owner->lines [line]; return l == nullptr ? String::empty : l->line; @@ -487,13 +487,13 @@ CodeDocument::~CodeDocument() { } -const String CodeDocument::getAllContent() const +String CodeDocument::getAllContent() const { return getTextBetween (Position (this, 0), Position (this, lines.size(), 0)); } -const String CodeDocument::getTextBetween (const Position& start, const Position& end) const +String CodeDocument::getTextBetween (const Position& start, const Position& end) const { if (end.getPosition() <= start.getPosition()) return String::empty; @@ -542,7 +542,7 @@ int CodeDocument::getNumCharacters() const noexcept return (lastLine == nullptr) ? 0 : lastLine->lineStartInFile + lastLine->lineLength; } -const String CodeDocument::getLine (const int lineIndex) const noexcept +String CodeDocument::getLine (const int lineIndex) const noexcept { const CodeDocumentLine* const line = lines [lineIndex]; return (line == nullptr) ? String::empty : line->line; diff --git a/src/gui/components/code_editor/juce_CodeDocument.h b/src/gui/components/code_editor/juce_CodeDocument.h index 8a96a3db29..5c3f4de825 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.h +++ b/src/gui/components/code_editor/juce_CodeDocument.h @@ -180,7 +180,7 @@ public: /** Returns the line from the document that this position is within. @see getCharacter, getLineNumber */ - const String getLineText() const; + String getLineText() const; //============================================================================== private: @@ -191,13 +191,13 @@ public: //============================================================================== /** Returns the full text of the document. */ - const String getAllContent() const; + String getAllContent() const; /** Returns a section of the document's text. */ - const String getTextBetween (const Position& start, const Position& end) const; + String getTextBetween (const Position& start, const Position& end) const; /** Returns a line from the document. */ - const String getLine (int lineIndex) const noexcept; + String getLine (int lineIndex) const noexcept; /** Returns the number of characters in the document. */ int getNumCharacters() const noexcept; @@ -240,7 +240,7 @@ public: This will be either "\n", "\r\n", or (rarely) "\r". @see setNewLineCharacters */ - const String getNewLineCharacters() const noexcept { return newLineChars; } + String getNewLineCharacters() const noexcept { return newLineChars; } /** Sets the new-line characters that the document should use. The string must be either "\n", "\r\n", or (rarely) "\r". diff --git a/src/gui/components/code_editor/juce_CodeTokeniser.h b/src/gui/components/code_editor/juce_CodeTokeniser.h index 3afb28f259..5b118e4bdd 100644 --- a/src/gui/components/code_editor/juce_CodeTokeniser.h +++ b/src/gui/components/code_editor/juce_CodeTokeniser.h @@ -55,7 +55,7 @@ public: The index in this list must match the token type numbers that are returned by readNextToken(). */ - virtual const StringArray getTokenTypes() = 0; + virtual StringArray getTokenTypes() = 0; /** Returns a suggested syntax highlighting colour for a specified token type. diff --git a/src/gui/components/controls/juce_Label.cpp b/src/gui/components/controls/juce_Label.cpp index 06b5f51932..260971233c 100644 --- a/src/gui/components/controls/juce_Label.cpp +++ b/src/gui/components/controls/juce_Label.cpp @@ -87,7 +87,7 @@ void Label::setText (const String& newText, } } -const String Label::getText (const bool returnActiveEditorContents) const +String Label::getText (const bool returnActiveEditorContents) const { return (returnActiveEditorContents && isBeingEdited()) ? editor->getText() diff --git a/src/gui/components/controls/juce_Label.h b/src/gui/components/controls/juce_Label.h index 85d02d837d..b800eb961c 100644 --- a/src/gui/components/controls/juce_Label.h +++ b/src/gui/components/controls/juce_Label.h @@ -74,7 +74,7 @@ public: the user has finished typing and pressed the return key. */ - const String getText (bool returnActiveEditorContents = false) const; + String getText (bool returnActiveEditorContents = false) const; /** Returns the text content as a Value object. You can call Value::referTo() on this object to make the label read and control diff --git a/src/gui/components/controls/juce_Slider.cpp b/src/gui/components/controls/juce_Slider.cpp index 24699e0023..6f22991d8d 100644 --- a/src/gui/components/controls/juce_Slider.cpp +++ b/src/gui/components/controls/juce_Slider.cpp @@ -653,7 +653,7 @@ void Slider::setTextValueSuffix (const String& suffix) } } -const String Slider::getTextValueSuffix() const +String Slider::getTextValueSuffix() const { return textSuffix; } diff --git a/src/gui/components/controls/juce_Slider.h b/src/gui/components/controls/juce_Slider.h index 5ab50aaca1..827d28c8b6 100644 --- a/src/gui/components/controls/juce_Slider.h +++ b/src/gui/components/controls/juce_Slider.h @@ -682,7 +682,7 @@ public: void setTextValueSuffix (const String& suffix); /** Returns the suffix that was set by setTextValueSuffix(). */ - const String getTextValueSuffix() const; + String getTextValueSuffix() const; //============================================================================== /** Allows a user-defined mapping of distance along the slider to its value. diff --git a/src/gui/components/controls/juce_TableHeaderComponent.cpp b/src/gui/components/controls/juce_TableHeaderComponent.cpp index 2e3c0e6620..1126d1ee88 100644 --- a/src/gui/components/controls/juce_TableHeaderComponent.cpp +++ b/src/gui/components/controls/juce_TableHeaderComponent.cpp @@ -105,7 +105,7 @@ int TableHeaderComponent::getNumColumns (const bool onlyCountVisibleColumns) con } } -const String TableHeaderComponent::getColumnName (const int columnId) const +String TableHeaderComponent::getColumnName (const int columnId) const { const ColumnInfo* const ci = getInfoForId (columnId); return ci != nullptr ? ci->name : String::empty; @@ -431,7 +431,7 @@ void TableHeaderComponent::reSortTable() } //============================================================================== -const String TableHeaderComponent::toString() const +String TableHeaderComponent::toString() const { String s; diff --git a/src/gui/components/controls/juce_TableHeaderComponent.h b/src/gui/components/controls/juce_TableHeaderComponent.h index fa3c89cb25..98c2609394 100644 --- a/src/gui/components/controls/juce_TableHeaderComponent.h +++ b/src/gui/components/controls/juce_TableHeaderComponent.h @@ -137,7 +137,7 @@ public: /** Returns the name for a column. @see setColumnName */ - const String getColumnName (int columnId) const; + String getColumnName (int columnId) const; /** Changes the name of a column. */ void setColumnName (int columnId, const String& newName); @@ -286,7 +286,7 @@ public: @see restoreFromString */ - const String toString() const; + String toString() const; /** Restores the state of the table, based on a string previously created with toString(). diff --git a/src/gui/components/controls/juce_Toolbar.cpp b/src/gui/components/controls/juce_Toolbar.cpp index 5f8a582bd1..a369c02c5b 100644 --- a/src/gui/components/controls/juce_Toolbar.cpp +++ b/src/gui/components/controls/juce_Toolbar.cpp @@ -398,7 +398,7 @@ void Toolbar::setStyle (const ToolbarItemStyle& newStyle) } } -const String Toolbar::toString() const +String Toolbar::toString() const { String s ("TB:"); diff --git a/src/gui/components/controls/juce_Toolbar.h b/src/gui/components/controls/juce_Toolbar.h index 52ab292d98..352037f28c 100644 --- a/src/gui/components/controls/juce_Toolbar.h +++ b/src/gui/components/controls/juce_Toolbar.h @@ -257,7 +257,7 @@ public: @see restoreFromString */ - const String toString() const; + String toString() const; /** Restores a set of items that was previously stored in a string by the toString() method. diff --git a/src/gui/components/layout/juce_ComponentBuilder.cpp b/src/gui/components/layout/juce_ComponentBuilder.cpp index 5b5b286b7e..de1bb30696 100644 --- a/src/gui/components/layout/juce_ComponentBuilder.cpp +++ b/src/gui/components/layout/juce_ComponentBuilder.cpp @@ -33,7 +33,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================= namespace ComponentBuilderHelpers { - const String getStateId (const ValueTree& state) + String getStateId (const ValueTree& state) { return state [ComponentBuilder::idProperty].toString(); } diff --git a/src/gui/components/layout/juce_ComponentBuilder.h b/src/gui/components/layout/juce_ComponentBuilder.h index 8e92beb7c2..09f2747856 100644 --- a/src/gui/components/layout/juce_ComponentBuilder.h +++ b/src/gui/components/layout/juce_ComponentBuilder.h @@ -194,12 +194,12 @@ public: The image that is returned will be owned by the caller, but it may come from the ImageCache. */ - virtual const Image getImageForIdentifier (const var& imageIdentifier) = 0; + virtual Image getImageForIdentifier (const var& imageIdentifier) = 0; /** Returns an identifier to be used to refer to a given image. This is used when a reference to an image is stored in a ValueTree. */ - virtual const var getIdentifierForImage (const Image& image) = 0; + virtual var getIdentifierForImage (const Image& image) = 0; }; //============================================================================== diff --git a/src/gui/components/layout/juce_GroupComponent.cpp b/src/gui/components/layout/juce_GroupComponent.cpp index e256c687d1..7ba9765935 100644 --- a/src/gui/components/layout/juce_GroupComponent.cpp +++ b/src/gui/components/layout/juce_GroupComponent.cpp @@ -55,7 +55,7 @@ void GroupComponent::setText (const String& newText) } } -const String GroupComponent::getText() const +String GroupComponent::getText() const { return text; } diff --git a/src/gui/components/layout/juce_GroupComponent.h b/src/gui/components/layout/juce_GroupComponent.h index f67ad8282a..94dcfd4d60 100644 --- a/src/gui/components/layout/juce_GroupComponent.h +++ b/src/gui/components/layout/juce_GroupComponent.h @@ -55,7 +55,7 @@ public: void setText (const String& newText); /** Returns the currently displayed text label. */ - const String getText() const; + String getText() const; /** Sets the positioning of the text label. diff --git a/src/gui/components/layout/juce_TabbedButtonBar.cpp b/src/gui/components/layout/juce_TabbedButtonBar.cpp index 234fea0ae9..729b279afa 100644 --- a/src/gui/components/layout/juce_TabbedButtonBar.cpp +++ b/src/gui/components/layout/juce_TabbedButtonBar.cpp @@ -272,7 +272,7 @@ int TabbedButtonBar::getNumTabs() const return tabs.size(); } -const String TabbedButtonBar::getCurrentTabName() const +String TabbedButtonBar::getCurrentTabName() const { TabInfo* tab = tabs [currentTabIndex]; return tab == nullptr ? String::empty : tab->name; diff --git a/src/gui/components/layout/juce_TabbedButtonBar.h b/src/gui/components/layout/juce_TabbedButtonBar.h index 73b7e1b2f3..c6f0ef3bad 100644 --- a/src/gui/components/layout/juce_TabbedButtonBar.h +++ b/src/gui/components/layout/juce_TabbedButtonBar.h @@ -199,7 +199,7 @@ public: This could be an empty string if none are selected. */ - const String getCurrentTabName() const; + String getCurrentTabName() const; /** Returns the index of the currently selected tab. diff --git a/src/gui/components/layout/juce_TabbedComponent.cpp b/src/gui/components/layout/juce_TabbedComponent.cpp index 2aa02a4875..ae0ce0886e 100644 --- a/src/gui/components/layout/juce_TabbedComponent.cpp +++ b/src/gui/components/layout/juce_TabbedComponent.cpp @@ -221,7 +221,7 @@ int TabbedComponent::getCurrentTabIndex() const return tabs->getCurrentTabIndex(); } -const String TabbedComponent::getCurrentTabName() const +String TabbedComponent::getCurrentTabName() const { return tabs->getCurrentTabName(); } diff --git a/src/gui/components/layout/juce_TabbedComponent.h b/src/gui/components/layout/juce_TabbedComponent.h index 55f55e9a70..1938f14d1a 100644 --- a/src/gui/components/layout/juce_TabbedComponent.h +++ b/src/gui/components/layout/juce_TabbedComponent.h @@ -162,7 +162,7 @@ public: @see addTab, TabbedButtonBar::getCurrentTabName() */ - const String getCurrentTabName() const; + String getCurrentTabName() const; /** Returns the current component that's filling the panel. diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.cpp b/src/gui/components/mouse/juce_DragAndDropContainer.cpp index 8845ff1f22..e4da477447 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.cpp +++ b/src/gui/components/mouse/juce_DragAndDropContainer.cpp @@ -425,7 +425,7 @@ bool DragAndDropContainer::isDragAndDropActive() const return dragImageComponent != nullptr; } -const String DragAndDropContainer::getCurrentDragDescription() const +String DragAndDropContainer::getCurrentDragDescription() const { return dragImageComponent != nullptr ? currentDragDesc : String::empty; diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.h b/src/gui/components/mouse/juce_DragAndDropContainer.h index dc5493f130..58dd697fd2 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.h +++ b/src/gui/components/mouse/juce_DragAndDropContainer.h @@ -103,7 +103,7 @@ public: @see startDragging */ - const String getCurrentDragDescription() const; + String getCurrentDragDescription() const; /** Utility to find the DragAndDropContainer for a given Component. diff --git a/src/gui/components/mouse/juce_MouseInputSource.cpp b/src/gui/components/mouse/juce_MouseInputSource.cpp index 981ee51dd7..976c63725a 100644 --- a/src/gui/components/mouse/juce_MouseInputSource.cpp +++ b/src/gui/components/mouse/juce_MouseInputSource.cpp @@ -306,12 +306,12 @@ public: } //============================================================================== - const Time getLastMouseDownTime() const noexcept + Time getLastMouseDownTime() const noexcept { return Time (mouseDowns[0].time); } - const Point getLastMouseDownPosition() const noexcept + Point getLastMouseDownPosition() const noexcept { return mouseDowns[0].position; } @@ -512,8 +512,8 @@ const ModifierKeys MouseInputSource::getCurrentModifiers() const { return Component* MouseInputSource::getComponentUnderMouse() const { return pimpl->getComponentUnderMouse(); } void MouseInputSource::triggerFakeMove() const { pimpl->triggerFakeMove(); } int MouseInputSource::getNumberOfMultipleClicks() const noexcept { return pimpl->getNumberOfMultipleClicks(); } -const Time MouseInputSource::getLastMouseDownTime() const noexcept { return pimpl->getLastMouseDownTime(); } -const Point MouseInputSource::getLastMouseDownPosition() const noexcept { return pimpl->getLastMouseDownPosition(); } +Time MouseInputSource::getLastMouseDownTime() const noexcept { return pimpl->getLastMouseDownTime(); } +Point MouseInputSource::getLastMouseDownPosition() const noexcept { return pimpl->getLastMouseDownPosition(); } bool MouseInputSource::hasMouseMovedSignificantlySincePressed() const noexcept { return pimpl->hasMouseMovedSignificantlySincePressed(); } bool MouseInputSource::canDoUnboundedMovement() const noexcept { return isMouse(); } void MouseInputSource::enableUnboundedMouseMovement (bool isEnabled, bool keepCursorVisibleUntilOffscreen) { pimpl->enableUnboundedMouseMovement (isEnabled, keepCursorVisibleUntilOffscreen); } diff --git a/src/gui/components/mouse/juce_MouseInputSource.h b/src/gui/components/mouse/juce_MouseInputSource.h index e7c805a457..4e5408273a 100644 --- a/src/gui/components/mouse/juce_MouseInputSource.h +++ b/src/gui/components/mouse/juce_MouseInputSource.h @@ -120,10 +120,10 @@ public: int getNumberOfMultipleClicks() const noexcept; /** Returns the time at which the last mouse-down occurred. */ - const Time getLastMouseDownTime() const noexcept; + Time getLastMouseDownTime() const noexcept; /** Returns the screen position at which the last mouse-down occurred. */ - const Point getLastMouseDownPosition() const noexcept; + Point getLastMouseDownPosition() const noexcept; /** Returns true if this mouse is currently down, and if it has been dragged more than a couple of pixels from the place it was pressed. diff --git a/src/gui/components/positioning/juce_MarkerList.cpp b/src/gui/components/positioning/juce_MarkerList.cpp index 9d31d9a2fd..b3bb1ef0d6 100644 --- a/src/gui/components/positioning/juce_MarkerList.cpp +++ b/src/gui/components/positioning/juce_MarkerList.cpp @@ -204,12 +204,12 @@ int MarkerList::ValueTreeWrapper::getNumMarkers() const return state.getNumChildren(); } -const ValueTree MarkerList::ValueTreeWrapper::getMarkerState (int index) const +ValueTree MarkerList::ValueTreeWrapper::getMarkerState (int index) const { return state.getChild (index); } -const ValueTree MarkerList::ValueTreeWrapper::getMarkerState (const String& name) const +ValueTree MarkerList::ValueTreeWrapper::getMarkerState (const String& name) const { return state.getChildWithProperty (nameProperty, name); } @@ -219,7 +219,7 @@ bool MarkerList::ValueTreeWrapper::containsMarker (const ValueTree& marker) cons return marker.isAChildOf (state); } -const MarkerList::Marker MarkerList::ValueTreeWrapper::getMarker (const ValueTree& marker) const +MarkerList::Marker MarkerList::ValueTreeWrapper::getMarker (const ValueTree& marker) const { jassert (containsMarker (marker)); diff --git a/src/gui/components/positioning/juce_MarkerList.h b/src/gui/components/positioning/juce_MarkerList.h index 4777cc3849..302b048016 100644 --- a/src/gui/components/positioning/juce_MarkerList.h +++ b/src/gui/components/positioning/juce_MarkerList.h @@ -159,10 +159,10 @@ public: ValueTree& getState() noexcept { return state; } int getNumMarkers() const; - const ValueTree getMarkerState (int index) const; - const ValueTree getMarkerState (const String& name) const; + ValueTree getMarkerState (int index) const; + ValueTree getMarkerState (const String& name) const; bool containsMarker (const ValueTree& state) const; - const MarkerList::Marker getMarker (const ValueTree& state) const; + MarkerList::Marker getMarker (const ValueTree& state) const; void setMarker (const MarkerList::Marker& marker, UndoManager* undoManager); void removeMarker (const ValueTree& state, UndoManager* undoManager); diff --git a/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp b/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp index 1733228381..392ce2be5d 100644 --- a/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp +++ b/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp @@ -36,7 +36,7 @@ RelativeCoordinatePositionerBase::ComponentScope::ComponentScope (Component& com { } -const Expression RelativeCoordinatePositionerBase::ComponentScope::getSymbolValue (const String& symbol) const +Expression RelativeCoordinatePositionerBase::ComponentScope::getSymbolValue (const String& symbol) const { switch (RelativeCoordinate::StandardStrings::getTypeOf (symbol)) { @@ -75,7 +75,7 @@ void RelativeCoordinatePositionerBase::ComponentScope::visitRelativeScope (const Expression::Scope::visitRelativeScope (scopeName, visitor); } -const String RelativeCoordinatePositionerBase::ComponentScope::getScopeUID() const +String RelativeCoordinatePositionerBase::ComponentScope::getScopeUID() const { return String::toHexString ((int) (pointer_sized_int) (void*) &component); } @@ -131,7 +131,7 @@ public: { } - const Expression getSymbolValue (const String& symbol) const + Expression getSymbolValue (const String& symbol) const { if (symbol == RelativeCoordinate::Strings::left || symbol == RelativeCoordinate::Strings::x || symbol == RelativeCoordinate::Strings::width || symbol == RelativeCoordinate::Strings::right diff --git a/src/gui/components/positioning/juce_RelativeCoordinatePositioner.h b/src/gui/components/positioning/juce_RelativeCoordinatePositioner.h index 74d8ab6df1..1bbe35b1ac 100644 --- a/src/gui/components/positioning/juce_RelativeCoordinatePositioner.h +++ b/src/gui/components/positioning/juce_RelativeCoordinatePositioner.h @@ -62,9 +62,9 @@ public: public: ComponentScope (Component& component_); - const Expression getSymbolValue (const String& symbol) const; + Expression getSymbolValue (const String& symbol) const; void visitRelativeScope (const String& scopeName, Visitor& visitor) const; - const String getScopeUID() const; + String getScopeUID() const; protected: Component& component; diff --git a/src/gui/components/positioning/juce_RelativePointPath.cpp b/src/gui/components/positioning/juce_RelativePointPath.cpp index 8dd6411a2e..a6df6d79da 100644 --- a/src/gui/components/positioning/juce_RelativePointPath.cpp +++ b/src/gui/components/positioning/juce_RelativePointPath.cpp @@ -152,7 +152,7 @@ RelativePointPath::StartSubPath::StartSubPath (const RelativePoint& pos) { } -const ValueTree RelativePointPath::StartSubPath::createTree() const +ValueTree RelativePointPath::StartSubPath::createTree() const { ValueTree v (DrawablePath::ValueTreeWrapper::Element::startSubPathElement); v.setProperty (DrawablePath::ValueTreeWrapper::point1, startPos.toString(), nullptr); @@ -181,7 +181,7 @@ RelativePointPath::CloseSubPath::CloseSubPath() { } -const ValueTree RelativePointPath::CloseSubPath::createTree() const +ValueTree RelativePointPath::CloseSubPath::createTree() const { return ValueTree (DrawablePath::ValueTreeWrapper::Element::closeSubPathElement); } @@ -208,7 +208,7 @@ RelativePointPath::LineTo::LineTo (const RelativePoint& endPoint_) { } -const ValueTree RelativePointPath::LineTo::createTree() const +ValueTree RelativePointPath::LineTo::createTree() const { ValueTree v (DrawablePath::ValueTreeWrapper::Element::lineToElement); v.setProperty (DrawablePath::ValueTreeWrapper::point1, endPoint.toString(), nullptr); @@ -239,7 +239,7 @@ RelativePointPath::QuadraticTo::QuadraticTo (const RelativePoint& controlPoint, controlPoints[1] = endPoint; } -const ValueTree RelativePointPath::QuadraticTo::createTree() const +ValueTree RelativePointPath::QuadraticTo::createTree() const { ValueTree v (DrawablePath::ValueTreeWrapper::Element::quadraticToElement); v.setProperty (DrawablePath::ValueTreeWrapper::point1, controlPoints[0].toString(), nullptr); @@ -274,7 +274,7 @@ RelativePointPath::CubicTo::CubicTo (const RelativePoint& controlPoint1, const R controlPoints[2] = endPoint; } -const ValueTree RelativePointPath::CubicTo::createTree() const +ValueTree RelativePointPath::CubicTo::createTree() const { ValueTree v (DrawablePath::ValueTreeWrapper::Element::cubicToElement); v.setProperty (DrawablePath::ValueTreeWrapper::point1, controlPoints[0].toString(), nullptr); diff --git a/src/gui/components/positioning/juce_RelativePointPath.h b/src/gui/components/positioning/juce_RelativePointPath.h index 0a5f7bea56..b0e4a4e8e1 100644 --- a/src/gui/components/positioning/juce_RelativePointPath.h +++ b/src/gui/components/positioning/juce_RelativePointPath.h @@ -84,7 +84,7 @@ public: public: ElementBase (ElementType type); virtual ~ElementBase() {} - virtual const ValueTree createTree() const = 0; + virtual ValueTree createTree() const = 0; virtual void addToPath (Path& path, Expression::Scope*) const = 0; virtual RelativePoint* getControlPoints (int& numPoints) = 0; virtual ElementBase* clone() const = 0; @@ -101,7 +101,7 @@ public: { public: StartSubPath (const RelativePoint& pos); - const ValueTree createTree() const; + ValueTree createTree() const; void addToPath (Path& path, Expression::Scope*) const; RelativePoint* getControlPoints (int& numPoints); ElementBase* clone() const; @@ -117,7 +117,7 @@ public: { public: CloseSubPath(); - const ValueTree createTree() const; + ValueTree createTree() const; void addToPath (Path& path, Expression::Scope*) const; RelativePoint* getControlPoints (int& numPoints); ElementBase* clone() const; @@ -131,7 +131,7 @@ public: { public: LineTo (const RelativePoint& endPoint); - const ValueTree createTree() const; + ValueTree createTree() const; void addToPath (Path& path, Expression::Scope*) const; RelativePoint* getControlPoints (int& numPoints); ElementBase* clone() const; @@ -147,7 +147,7 @@ public: { public: QuadraticTo (const RelativePoint& controlPoint, const RelativePoint& endPoint); - const ValueTree createTree() const; + ValueTree createTree() const; void addToPath (Path& path, Expression::Scope*) const; RelativePoint* getControlPoints (int& numPoints); ElementBase* clone() const; @@ -163,7 +163,7 @@ public: { public: CubicTo (const RelativePoint& controlPoint1, const RelativePoint& controlPoint2, const RelativePoint& endPoint); - const ValueTree createTree() const; + ValueTree createTree() const; void addToPath (Path& path, Expression::Scope*) const; RelativePoint* getControlPoints (int& numPoints); ElementBase* clone() const; diff --git a/src/gui/components/positioning/juce_RelativeRectangle.cpp b/src/gui/components/positioning/juce_RelativeRectangle.cpp index 34f6e4004f..3ed7cb575d 100644 --- a/src/gui/components/positioning/juce_RelativeRectangle.cpp +++ b/src/gui/components/positioning/juce_RelativeRectangle.cpp @@ -121,7 +121,7 @@ class RelativeRectangleLocalScope : public Expression::Scope public: RelativeRectangleLocalScope (const RelativeRectangle& rect_) : rect (rect_) {} - const Expression getSymbolValue (const String& symbol) const + Expression getSymbolValue (const String& symbol) const { switch (RelativeCoordinate::StandardStrings::getTypeOf (symbol)) { @@ -179,7 +179,7 @@ bool RelativeRectangle::isDynamic() const || dependsOnSymbolsOtherThanThis (bottom.getExpression()); } -const String RelativeRectangle::toString() const +String RelativeRectangle::toString() const { return left.toString() + ", " + top.toString() + ", " + right.toString() + ", " + bottom.toString(); } diff --git a/src/gui/components/positioning/juce_RelativeRectangle.h b/src/gui/components/positioning/juce_RelativeRectangle.h index 3b88a78bd0..a48d60122c 100644 --- a/src/gui/components/positioning/juce_RelativeRectangle.h +++ b/src/gui/components/positioning/juce_RelativeRectangle.h @@ -88,7 +88,7 @@ public: the string syntax used by the coordinates, see the RelativeCoordinate constructor notes. The string that is returned can be passed to the RelativeRectangle constructor to recreate the rectangle. */ - const String toString() const; + String toString() const; /** Renames a symbol if it is used by any of the coordinates. This calls Expression::withRenamedSymbol() on the rectangle's coordinates. diff --git a/src/gui/components/properties/juce_ChoicePropertyComponent.cpp b/src/gui/components/properties/juce_ChoicePropertyComponent.cpp index a5cee8e22f..3570b2ca7c 100644 --- a/src/gui/components/properties/juce_ChoicePropertyComponent.cpp +++ b/src/gui/components/properties/juce_ChoicePropertyComponent.cpp @@ -44,7 +44,7 @@ public: ~RemapperValueSource() {} - const var getValue() const + var getValue() const { return mappings.indexOf (sourceValue.getValue()) + 1; } diff --git a/src/gui/components/special/juce_DirectShowComponent.h b/src/gui/components/special/juce_DirectShowComponent.h index 3fcf7249b1..d8e93725bf 100644 --- a/src/gui/components/special/juce_DirectShowComponent.h +++ b/src/gui/components/special/juce_DirectShowComponent.h @@ -111,7 +111,7 @@ public: /** Returns the file path or URL from which the video file was loaded. If there isn't one, this returns an empty string. */ - const File getCurrentMoviePath() const; + File getCurrentMoviePath() const; /** Returns true if there's currently a video open. */ bool isMovieOpen() const; diff --git a/src/gui/components/special/juce_QuickTimeMovieComponent.h b/src/gui/components/special/juce_QuickTimeMovieComponent.h index 9cdab24fc8..bb7890658c 100644 --- a/src/gui/components/special/juce_QuickTimeMovieComponent.h +++ b/src/gui/components/special/juce_QuickTimeMovieComponent.h @@ -120,7 +120,7 @@ public: If there isn't one, this returns File::nonexistent */ - const File getCurrentMovieFile() const; + File getCurrentMovieFile() const; /** Returns true if there's currently a movie open. */ bool isMovieOpen() const; diff --git a/src/gui/components/windows/juce_ComponentPeer.cpp b/src/gui/components/windows/juce_ComponentPeer.cpp index 2744ec5c56..274c4f7ef3 100644 --- a/src/gui/components/windows/juce_ComponentPeer.cpp +++ b/src/gui/components/windows/juce_ComponentPeer.cpp @@ -562,7 +562,7 @@ void ComponentPeer::addMaskedRegion (int x, int y, int w, int h) } //============================================================================== -const StringArray ComponentPeer::getAvailableRenderingEngines() +StringArray ComponentPeer::getAvailableRenderingEngines() { return StringArray ("Software Renderer"); } diff --git a/src/gui/components/windows/juce_ComponentPeer.h b/src/gui/components/windows/juce_ComponentPeer.h index c739d5614e..5dbbef05ce 100644 --- a/src/gui/components/windows/juce_ComponentPeer.h +++ b/src/gui/components/windows/juce_ComponentPeer.h @@ -359,7 +359,7 @@ public: //============================================================================== - virtual const StringArray getAvailableRenderingEngines(); + virtual StringArray getAvailableRenderingEngines(); virtual int getCurrentRenderingEngine() const; virtual void setCurrentRenderingEngine (int index); diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index b00b598d8f..9da1dff4c6 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -1026,19 +1026,19 @@ public: typedef ReferenceCountedObjectPtr Ptr; - virtual const Ptr clone() const = 0; - virtual const Ptr applyClipTo (const Ptr& target) const = 0; + virtual Ptr clone() const = 0; + virtual Ptr applyClipTo (const Ptr& target) const = 0; - virtual const Ptr clipToRectangle (const Rectangle& r) = 0; - virtual const Ptr clipToRectangleList (const RectangleList& r) = 0; - virtual const Ptr excludeClipRectangle (const Rectangle& r) = 0; - virtual const Ptr clipToPath (const Path& p, const AffineTransform& transform) = 0; - virtual const Ptr clipToEdgeTable (const EdgeTable& et) = 0; - virtual const Ptr clipToImageAlpha (const Image& image, const AffineTransform& t, const bool betterQuality) = 0; - virtual const Ptr translated (const Point& delta) = 0; + virtual Ptr clipToRectangle (const Rectangle& r) = 0; + virtual Ptr clipToRectangleList (const RectangleList& r) = 0; + virtual Ptr excludeClipRectangle (const Rectangle& r) = 0; + virtual Ptr clipToPath (const Path& p, const AffineTransform& transform) = 0; + virtual Ptr clipToEdgeTable (const EdgeTable& et) = 0; + virtual Ptr clipToImageAlpha (const Image& image, const AffineTransform& t, const bool betterQuality) = 0; + virtual Ptr translated (const Point& delta) = 0; virtual bool clipRegionIntersects (const Rectangle& r) const = 0; - virtual const Rectangle getClipBounds() const = 0; + virtual Rectangle getClipBounds() const = 0; virtual void fillRectWithColour (Image::BitmapData& destData, const Rectangle& area, const PixelARGB& colour, bool replaceContents) const = 0; virtual void fillRectWithColour (Image::BitmapData& destData, const Rectangle& area, const PixelARGB& colour) const = 0; @@ -1226,23 +1226,23 @@ public: ClipRegion_EdgeTable (const Rectangle& bounds, const Path& p, const AffineTransform& t) : edgeTable (bounds, p, t) {} ClipRegion_EdgeTable (const ClipRegion_EdgeTable& other) : edgeTable (other.edgeTable) {} - const Ptr clone() const + Ptr clone() const { return new ClipRegion_EdgeTable (*this); } - const Ptr applyClipTo (const Ptr& target) const + Ptr applyClipTo (const Ptr& target) const { return target->clipToEdgeTable (edgeTable); } - const Ptr clipToRectangle (const Rectangle& r) + Ptr clipToRectangle (const Rectangle& r) { edgeTable.clipToRectangle (r); return edgeTable.isEmpty() ? nullptr : this; } - const Ptr clipToRectangleList (const RectangleList& r) + Ptr clipToRectangleList (const RectangleList& r) { RectangleList inverse (edgeTable.getMaximumBounds()); @@ -1253,26 +1253,26 @@ public: return edgeTable.isEmpty() ? nullptr : this; } - const Ptr excludeClipRectangle (const Rectangle& r) + Ptr excludeClipRectangle (const Rectangle& r) { edgeTable.excludeRectangle (r); return edgeTable.isEmpty() ? nullptr : this; } - const Ptr clipToPath (const Path& p, const AffineTransform& transform) + Ptr clipToPath (const Path& p, const AffineTransform& transform) { EdgeTable et (edgeTable.getMaximumBounds(), p, transform); edgeTable.clipToEdgeTable (et); return edgeTable.isEmpty() ? nullptr : this; } - const Ptr clipToEdgeTable (const EdgeTable& et) + Ptr clipToEdgeTable (const EdgeTable& et) { edgeTable.clipToEdgeTable (et); return edgeTable.isEmpty() ? nullptr : this; } - const Ptr clipToImageAlpha (const Image& image, const AffineTransform& transform, const bool betterQuality) + Ptr clipToImageAlpha (const Image& image, const AffineTransform& transform, const bool betterQuality) { const Image::BitmapData srcData (image, Image::BitmapData::readOnly); @@ -1317,7 +1317,7 @@ public: return edgeTable.isEmpty() ? nullptr : this; } - const Ptr translated (const Point& delta) + Ptr translated (const Point& delta) { edgeTable.translate ((float) delta.getX(), delta.getY()); return edgeTable.isEmpty() ? nullptr : this; @@ -1328,7 +1328,7 @@ public: return edgeTable.getMaximumBounds().intersects (r); } - const Rectangle getClipBounds() const + Rectangle getClipBounds() const { return edgeTable.getMaximumBounds(); } @@ -1431,50 +1431,50 @@ public: ClipRegion_RectangleList (const RectangleList& r) : clip (r) {} ClipRegion_RectangleList (const ClipRegion_RectangleList& other) : clip (other.clip) {} - const Ptr clone() const + Ptr clone() const { return new ClipRegion_RectangleList (*this); } - const Ptr applyClipTo (const Ptr& target) const + Ptr applyClipTo (const Ptr& target) const { return target->clipToRectangleList (clip); } - const Ptr clipToRectangle (const Rectangle& r) + Ptr clipToRectangle (const Rectangle& r) { clip.clipTo (r); return clip.isEmpty() ? nullptr : this; } - const Ptr clipToRectangleList (const RectangleList& r) + Ptr clipToRectangleList (const RectangleList& r) { clip.clipTo (r); return clip.isEmpty() ? nullptr : this; } - const Ptr excludeClipRectangle (const Rectangle& r) + Ptr excludeClipRectangle (const Rectangle& r) { clip.subtract (r); return clip.isEmpty() ? nullptr : this; } - const Ptr clipToPath (const Path& p, const AffineTransform& transform) + Ptr clipToPath (const Path& p, const AffineTransform& transform) { return Ptr (new ClipRegion_EdgeTable (clip))->clipToPath (p, transform); } - const Ptr clipToEdgeTable (const EdgeTable& et) + Ptr clipToEdgeTable (const EdgeTable& et) { return Ptr (new ClipRegion_EdgeTable (clip))->clipToEdgeTable (et); } - const Ptr clipToImageAlpha (const Image& image, const AffineTransform& transform, const bool betterQuality) + Ptr clipToImageAlpha (const Image& image, const AffineTransform& transform, const bool betterQuality) { return Ptr (new ClipRegion_EdgeTable (clip))->clipToImageAlpha (image, transform, betterQuality); } - const Ptr translated (const Point& delta) + Ptr translated (const Point& delta) { clip.offsetAll (delta.getX(), delta.getY()); return clip.isEmpty() ? nullptr : this; @@ -1485,7 +1485,7 @@ public: return clip.intersects (r); } - const Rectangle getClipBounds() const + Rectangle getClipBounds() const { return clip.getBounds(); } @@ -1934,12 +1934,12 @@ public: return false; } - const Rectangle getUntransformedClipBounds() const + Rectangle getUntransformedClipBounds() const { return clip != nullptr ? clip->getClipBounds() : Rectangle(); } - const Rectangle getClipBounds() const + Rectangle getClipBounds() const { if (clip != nullptr) { diff --git a/src/gui/graphics/drawables/juce_Drawable.cpp b/src/gui/graphics/drawables/juce_Drawable.cpp index df89f6e826..cf84cf1bda 100644 --- a/src/gui/graphics/drawables/juce_Drawable.cpp +++ b/src/gui/graphics/drawables/juce_Drawable.cpp @@ -230,7 +230,7 @@ Drawable::ValueTreeWrapperBase::ValueTreeWrapperBase (const ValueTree& state_) { } -const String Drawable::ValueTreeWrapperBase::getID() const +String Drawable::ValueTreeWrapperBase::getID() const { return state [ComponentBuilder::idProperty]; } diff --git a/src/gui/graphics/drawables/juce_Drawable.h b/src/gui/graphics/drawables/juce_Drawable.h index d6df1dd4b0..eb75dfd852 100644 --- a/src/gui/graphics/drawables/juce_Drawable.h +++ b/src/gui/graphics/drawables/juce_Drawable.h @@ -172,13 +172,13 @@ public: If there are any images used in this drawable, you'll need to provide a valid ImageProvider object that can be used to create storable representations of them. */ - virtual const ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const = 0; + virtual ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const = 0; /** Returns the area that this drawble covers. The result is expressed in this drawable's own coordinate space, and does not take into account any transforms that may be applied to the component. */ - virtual const Rectangle getDrawableBounds() const = 0; + virtual Rectangle getDrawableBounds() const = 0; //============================================================================== /** Internal class used to manage ValueTrees that represent Drawables. */ @@ -189,7 +189,7 @@ public: ValueTree& getState() noexcept { return state; } - const String getID() const; + String getID() const; void setID (const String& newID); ValueTree state; diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.cpp b/src/gui/graphics/drawables/juce_DrawableComposite.cpp index a65d19f67f..3bac17fbc4 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.cpp +++ b/src/gui/graphics/drawables/juce_DrawableComposite.cpp @@ -68,7 +68,7 @@ Drawable* DrawableComposite::createCopy() const } //============================================================================== -const Rectangle DrawableComposite::getDrawableBounds() const +Rectangle DrawableComposite::getDrawableBounds() const { Rectangle r; @@ -89,7 +89,7 @@ MarkerList* DrawableComposite::getMarkers (bool xAxis) return xAxis ? &markersX : &markersY; } -const RelativeRectangle DrawableComposite::getContentArea() const +RelativeRectangle DrawableComposite::getContentArea() const { jassert (markersX.getNumMarkers() >= 2 && markersX.getMarker (0)->name == contentLeftMarkerName && markersX.getMarker (1)->name == contentRightMarkerName); jassert (markersY.getNumMarkers() >= 2 && markersY.getMarker (0)->name == contentTopMarkerName && markersY.getMarker (1)->name == contentBottomMarkerName); @@ -254,7 +254,7 @@ ValueTree DrawableComposite::ValueTreeWrapper::getChildListCreating (UndoManager return state.getOrCreateChildWithName (childGroupTag, undoManager); } -const RelativeParallelogram DrawableComposite::ValueTreeWrapper::getBoundingBox() const +RelativeParallelogram DrawableComposite::ValueTreeWrapper::getBoundingBox() const { return RelativeParallelogram (state.getProperty (topLeft, "0, 0"), state.getProperty (topRight, "100, 0"), @@ -277,7 +277,7 @@ void DrawableComposite::ValueTreeWrapper::resetBoundingBoxToContentArea (UndoMan RelativePoint (content.left, content.bottom)), undoManager); } -const RelativeRectangle DrawableComposite::ValueTreeWrapper::getContentArea() const +RelativeRectangle DrawableComposite::ValueTreeWrapper::getContentArea() const { MarkerList::ValueTreeWrapper markersX (getMarkerList (true)); MarkerList::ValueTreeWrapper markersY (getMarkerList (false)); @@ -323,7 +323,7 @@ void DrawableComposite::refreshFromValueTree (const ValueTree& tree, ComponentBu builder.updateChildComponents (*this, wrapper.getChildList()); } -const ValueTree DrawableComposite::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const +ValueTree DrawableComposite::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const { ValueTree tree (valueTreeType); ValueTreeWrapper v (tree); diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.h b/src/gui/graphics/drawables/juce_DrawableComposite.h index 60d5e0fa38..25d56154e8 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.h +++ b/src/gui/graphics/drawables/juce_DrawableComposite.h @@ -72,7 +72,7 @@ public: "bottom", but this method is a shortcut that returns them all at once. @see contentLeftMarkerName, contentRightMarkerName, contentTopMarkerName, contentBottomMarkerName */ - const RelativeRectangle getContentArea() const; + RelativeRectangle getContentArea() const; /** Changes the main content area. The content area is actually defined by the markers named "left", "right", "top" and @@ -102,11 +102,11 @@ public: /** @internal */ void refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder); /** @internal */ - const ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; + ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; /** @internal */ static const Identifier valueTreeType; /** @internal */ - const Rectangle getDrawableBounds() const; + Rectangle getDrawableBounds() const; /** @internal */ void childBoundsChanged (Component*); /** @internal */ @@ -126,11 +126,11 @@ public: ValueTree getChildList() const; ValueTree getChildListCreating (UndoManager* undoManager); - const RelativeParallelogram getBoundingBox() const; + RelativeParallelogram getBoundingBox() const; void setBoundingBox (const RelativeParallelogram& newBounds, UndoManager* undoManager); void resetBoundingBoxToContentArea (UndoManager* undoManager); - const RelativeRectangle getContentArea() const; + RelativeRectangle getContentArea() const; void setContentArea (const RelativeRectangle& newArea, UndoManager* undoManager); MarkerList::ValueTreeWrapper getMarkerList (bool xAxis) const; diff --git a/src/gui/graphics/drawables/juce_DrawableImage.cpp b/src/gui/graphics/drawables/juce_DrawableImage.cpp index 0c1a718760..350554878a 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.cpp +++ b/src/gui/graphics/drawables/juce_DrawableImage.cpp @@ -145,7 +145,7 @@ void DrawableImage::paint (Graphics& g) } } -const Rectangle DrawableImage::getDrawableBounds() const +Rectangle DrawableImage::getDrawableBounds() const { return image.getBounds().toFloat(); } @@ -177,7 +177,7 @@ DrawableImage::ValueTreeWrapper::ValueTreeWrapper (const ValueTree& state_) jassert (state.hasType (valueTreeType)); } -const var DrawableImage::ValueTreeWrapper::getImageIdentifier() const +var DrawableImage::ValueTreeWrapper::getImageIdentifier() const { return state [image]; } @@ -228,7 +228,7 @@ Value DrawableImage::ValueTreeWrapper::getOverlayColourValue (UndoManager* undoM return state.getPropertyAsValue (overlay, undoManager); } -const RelativeParallelogram DrawableImage::ValueTreeWrapper::getBoundingBox() const +RelativeParallelogram DrawableImage::ValueTreeWrapper::getBoundingBox() const { return RelativeParallelogram (state.getProperty (topLeft, "0, 0"), state.getProperty (topRight, "100, 0"), @@ -277,7 +277,7 @@ void DrawableImage::refreshFromValueTree (const ValueTree& tree, ComponentBuilde } } -const ValueTree DrawableImage::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const +ValueTree DrawableImage::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const { ValueTree tree (valueTreeType); ValueTreeWrapper v (tree); diff --git a/src/gui/graphics/drawables/juce_DrawableImage.h b/src/gui/graphics/drawables/juce_DrawableImage.h index b9adefff42..49ffca1430 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.h +++ b/src/gui/graphics/drawables/juce_DrawableImage.h @@ -52,7 +52,7 @@ public: void setImage (const Image& imageToUse); /** Returns the current image. */ - const Image getImage() const { return image; } + const Image& getImage() const noexcept { return image; } /** Sets the opacity to use when drawing the image. */ void setOpacity (float newOpacity); @@ -91,11 +91,11 @@ public: /** @internal */ Drawable* createCopy() const; /** @internal */ - const Rectangle getDrawableBounds() const; + Rectangle getDrawableBounds() const; /** @internal */ void refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder); /** @internal */ - const ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; + ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; /** @internal */ static const Identifier valueTreeType; @@ -106,7 +106,7 @@ public: public: ValueTreeWrapper (const ValueTree& state); - const var getImageIdentifier() const; + var getImageIdentifier() const; void setImageIdentifier (const var& newIdentifier, UndoManager* undoManager); Value getImageIdentifierValue (UndoManager* undoManager); @@ -118,7 +118,7 @@ public: void setOverlayColour (const Colour& newColour, UndoManager* undoManager); Value getOverlayColourValue (UndoManager* undoManager); - const RelativeParallelogram getBoundingBox() const; + RelativeParallelogram getBoundingBox() const; void setBoundingBox (const RelativeParallelogram& newBounds, UndoManager* undoManager); static const Identifier opacity, overlay, image, topLeft, topRight, bottomLeft; diff --git a/src/gui/graphics/drawables/juce_DrawablePath.cpp b/src/gui/graphics/drawables/juce_DrawablePath.cpp index d8c8280e2b..a8b429567a 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.cpp +++ b/src/gui/graphics/drawables/juce_DrawablePath.cpp @@ -264,7 +264,7 @@ int DrawablePath::ValueTreeWrapper::Element::getNumControlPoints() const noexcep return 0; } -const RelativePoint DrawablePath::ValueTreeWrapper::Element::getControlPoint (const int index) const +RelativePoint DrawablePath::ValueTreeWrapper::Element::getControlPoint (const int index) const { jassert (index >= 0 && index < getNumControlPoints()); return RelativePoint (state [index == 0 ? point1 : (index == 1 ? point2 : point3)].toString()); @@ -282,7 +282,7 @@ void DrawablePath::ValueTreeWrapper::Element::setControlPoint (const int index, state.setProperty (index == 0 ? point1 : (index == 1 ? point2 : point3), point.toString(), undoManager); } -const RelativePoint DrawablePath::ValueTreeWrapper::Element::getStartPoint() const +RelativePoint DrawablePath::ValueTreeWrapper::Element::getStartPoint() const { const Identifier i (state.getType()); @@ -294,7 +294,7 @@ const RelativePoint DrawablePath::ValueTreeWrapper::Element::getStartPoint() con return getPreviousElement().getEndPoint(); } -const RelativePoint DrawablePath::ValueTreeWrapper::Element::getEndPoint() const +RelativePoint DrawablePath::ValueTreeWrapper::Element::getEndPoint() const { const Identifier i (state.getType()); if (i == startSubPathElement || i == lineToElement) return getControlPoint (0); @@ -332,7 +332,7 @@ float DrawablePath::ValueTreeWrapper::Element::getLength (Expression::Scope* sco return 0; } -const String DrawablePath::ValueTreeWrapper::Element::getModeOfEndPoint() const +String DrawablePath::ValueTreeWrapper::Element::getModeOfEndPoint() const { return state [mode].toString(); } @@ -392,7 +392,7 @@ void DrawablePath::ValueTreeWrapper::Element::convertToPathBreak (UndoManager* u namespace DrawablePathHelpers { - const Point findCubicSubdivisionPoint (float proportion, const Point points[4]) + Point findCubicSubdivisionPoint (float proportion, const Point points[4]) { const Point mid1 (points[0] + (points[1] - points[0]) * proportion), mid2 (points[1] + (points[2] - points[1]) * proportion), @@ -404,7 +404,7 @@ namespace DrawablePathHelpers return newCp1 + (newCp2 - newCp1) * proportion; } - const Point findQuadraticSubdivisionPoint (float proportion, const Point points[3]) + Point findQuadraticSubdivisionPoint (float proportion, const Point points[3]) { const Point mid1 (points[0] + (points[1] - points[0]) * proportion), mid2 (points[1] + (points[2] - points[1]) * proportion); @@ -564,7 +564,7 @@ void DrawablePath::refreshFromValueTree (const ValueTree& tree, ComponentBuilder setPath (newRelativePath); } -const ValueTree DrawablePath::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const +ValueTree DrawablePath::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const { ValueTree tree (valueTreeType); ValueTreeWrapper v (tree); diff --git a/src/gui/graphics/drawables/juce_DrawablePath.h b/src/gui/graphics/drawables/juce_DrawablePath.h index 0695fd7501..6bc855d116 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.h +++ b/src/gui/graphics/drawables/juce_DrawablePath.h @@ -73,7 +73,7 @@ public: /** @internal */ void refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder); /** @internal */ - const ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; + ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; /** @internal */ static const Identifier valueTreeType; @@ -96,17 +96,17 @@ public: const Identifier getType() const noexcept { return state.getType(); } int getNumControlPoints() const noexcept; - const RelativePoint getControlPoint (int index) const; + RelativePoint getControlPoint (int index) const; Value getControlPointValue (int index, UndoManager*) const; - const RelativePoint getStartPoint() const; - const RelativePoint getEndPoint() const; + RelativePoint getStartPoint() const; + RelativePoint getEndPoint() const; void setControlPoint (int index, const RelativePoint& point, UndoManager*); float getLength (Expression::Scope*) const; ValueTreeWrapper getParent() const; Element getPreviousElement() const; - const String getModeOfEndPoint() const; + String getModeOfEndPoint() const; void setModeOfEndPoint (const String& newMode, UndoManager*); void convertToLine (UndoManager*); diff --git a/src/gui/graphics/drawables/juce_DrawableRectangle.cpp b/src/gui/graphics/drawables/juce_DrawableRectangle.cpp index 0fe1fb9b9d..769d5ec8f1 100644 --- a/src/gui/graphics/drawables/juce_DrawableRectangle.cpp +++ b/src/gui/graphics/drawables/juce_DrawableRectangle.cpp @@ -138,7 +138,7 @@ DrawableRectangle::ValueTreeWrapper::ValueTreeWrapper (const ValueTree& state_) jassert (state.hasType (valueTreeType)); } -const RelativeParallelogram DrawableRectangle::ValueTreeWrapper::getRectangle() const +RelativeParallelogram DrawableRectangle::ValueTreeWrapper::getRectangle() const { return RelativeParallelogram (state.getProperty (topLeft, "0, 0"), state.getProperty (topRight, "100, 0"), @@ -157,7 +157,7 @@ void DrawableRectangle::ValueTreeWrapper::setCornerSize (const RelativePoint& ne state.setProperty (cornerSize, newSize.toString(), undoManager); } -const RelativePoint DrawableRectangle::ValueTreeWrapper::getCornerSize() const +RelativePoint DrawableRectangle::ValueTreeWrapper::getCornerSize() const { return RelativePoint (state [cornerSize]); } @@ -179,7 +179,7 @@ void DrawableRectangle::refreshFromValueTree (const ValueTree& tree, ComponentBu setCornerSize (v.getCornerSize()); } -const ValueTree DrawableRectangle::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const +ValueTree DrawableRectangle::createValueTree (ComponentBuilder::ImageProvider* imageProvider) const { ValueTree tree (valueTreeType); ValueTreeWrapper v (tree); diff --git a/src/gui/graphics/drawables/juce_DrawableRectangle.h b/src/gui/graphics/drawables/juce_DrawableRectangle.h index 736fdc84e7..be5f9c419f 100644 --- a/src/gui/graphics/drawables/juce_DrawableRectangle.h +++ b/src/gui/graphics/drawables/juce_DrawableRectangle.h @@ -56,7 +56,7 @@ public: const RelativeParallelogram& getRectangle() const noexcept { return bounds; } /** Returns the corner size to be used. */ - const RelativePoint getCornerSize() const { return cornerSize; } + const RelativePoint& getCornerSize() const noexcept { return cornerSize; } /** Sets a new corner size for the rectangle */ void setCornerSize (const RelativePoint& newSize); @@ -67,7 +67,7 @@ public: /** @internal */ void refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder); /** @internal */ - const ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; + ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; /** @internal */ static const Identifier valueTreeType; @@ -78,11 +78,11 @@ public: public: ValueTreeWrapper (const ValueTree& state); - const RelativeParallelogram getRectangle() const; + RelativeParallelogram getRectangle() const; void setRectangle (const RelativeParallelogram& newBounds, UndoManager*); void setCornerSize (const RelativePoint& cornerSize, UndoManager*); - const RelativePoint getCornerSize() const; + RelativePoint getCornerSize() const; Value getCornerSizeValue (UndoManager*) const; static const Identifier topLeft, topRight, bottomLeft, cornerSize; diff --git a/src/gui/graphics/drawables/juce_DrawableShape.cpp b/src/gui/graphics/drawables/juce_DrawableShape.cpp index ed04a6dd56..82b56e5de2 100644 --- a/src/gui/graphics/drawables/juce_DrawableShape.cpp +++ b/src/gui/graphics/drawables/juce_DrawableShape.cpp @@ -193,7 +193,7 @@ void DrawableShape::strokeChanged() repaint(); } -const Rectangle DrawableShape::getDrawableBounds() const +Rectangle DrawableShape::getDrawableBounds() const { if (isStrokeVisible()) return strokePath.getBounds(); @@ -415,7 +415,7 @@ DrawableShape::FillAndStrokeState::FillAndStrokeState (const ValueTree& state_) { } -const DrawableShape::RelativeFillType DrawableShape::FillAndStrokeState::getFill (const Identifier& fillOrStrokeType, ComponentBuilder::ImageProvider* imageProvider) const +DrawableShape::RelativeFillType DrawableShape::FillAndStrokeState::getFill (const Identifier& fillOrStrokeType, ComponentBuilder::ImageProvider* imageProvider) const { DrawableShape::RelativeFillType f; f.readFrom (state.getChildWithName (fillOrStrokeType), imageProvider); @@ -439,7 +439,7 @@ void DrawableShape::FillAndStrokeState::setFill (const Identifier& fillOrStrokeT newFill.writeTo (v, imageProvider, undoManager); } -const PathStrokeType DrawableShape::FillAndStrokeState::getStrokeType() const +PathStrokeType DrawableShape::FillAndStrokeState::getStrokeType() const { const String jointStyleString (state [jointStyle].toString()); const String capStyleString (state [capStyle].toString()); diff --git a/src/gui/graphics/drawables/juce_DrawableShape.h b/src/gui/graphics/drawables/juce_DrawableShape.h index 160b90f0b0..8415bb53cf 100644 --- a/src/gui/graphics/drawables/juce_DrawableShape.h +++ b/src/gui/graphics/drawables/juce_DrawableShape.h @@ -136,11 +136,11 @@ public: FillAndStrokeState (const ValueTree& state); ValueTree getFillState (const Identifier& fillOrStrokeType); - const RelativeFillType getFill (const Identifier& fillOrStrokeType, ComponentBuilder::ImageProvider*) const; + RelativeFillType getFill (const Identifier& fillOrStrokeType, ComponentBuilder::ImageProvider*) const; void setFill (const Identifier& fillOrStrokeType, const RelativeFillType& newFill, ComponentBuilder::ImageProvider*, UndoManager*); - const PathStrokeType getStrokeType() const; + PathStrokeType getStrokeType() const; void setStrokeType (const PathStrokeType& newStrokeType, UndoManager*); static const Identifier type, colour, colours, fill, stroke, path, jointStyle, capStyle, strokeWidth, @@ -148,7 +148,7 @@ public: }; /** @internal */ - const Rectangle getDrawableBounds() const; + Rectangle getDrawableBounds() const; /** @internal */ void paint (Graphics& g); /** @internal */ diff --git a/src/gui/graphics/drawables/juce_DrawableText.cpp b/src/gui/graphics/drawables/juce_DrawableText.cpp index 7acf346e7c..912a8724d2 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.cpp +++ b/src/gui/graphics/drawables/juce_DrawableText.cpp @@ -181,7 +181,7 @@ void DrawableText::paint (Graphics& g) ga.draw (g, transform); } -const Rectangle DrawableText::getDrawableBounds() const +Rectangle DrawableText::getDrawableBounds() const { return RelativeParallelogram::getBoundingBox (resolvedPoints); } @@ -307,7 +307,7 @@ void DrawableText::refreshFromValueTree (const ValueTree& tree, ComponentBuilder } } -const ValueTree DrawableText::createValueTree (ComponentBuilder::ImageProvider*) const +ValueTree DrawableText::createValueTree (ComponentBuilder::ImageProvider*) const { ValueTree tree (valueTreeType); ValueTreeWrapper v (tree); diff --git a/src/gui/graphics/drawables/juce_DrawableText.h b/src/gui/graphics/drawables/juce_DrawableText.h index f135fe57ca..e555f57f90 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.h +++ b/src/gui/graphics/drawables/juce_DrawableText.h @@ -94,11 +94,11 @@ public: /** @internal */ void refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder); /** @internal */ - const ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; + ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const; /** @internal */ static const Identifier valueTreeType; /** @internal */ - const Rectangle getDrawableBounds() const; + Rectangle getDrawableBounds() const; //============================================================================== /** Internally-used class for wrapping a DrawableText's state into a ValueTree. */ diff --git a/src/gui/graphics/drawables/juce_SVGParser.cpp b/src/gui/graphics/drawables/juce_SVGParser.cpp index 407203e0cc..e564378d4a 100644 --- a/src/gui/graphics/drawables/juce_SVGParser.cpp +++ b/src/gui/graphics/drawables/juce_SVGParser.cpp @@ -667,11 +667,11 @@ private: } } - const FillType getPathFillType (const Path& path, - const String& fill, - const String& fillOpacity, - const String& overallOpacity, - const Colour& defaultColour) const + FillType getPathFillType (const Path& path, + const String& fill, + const String& fillOpacity, + const String& overallOpacity, + const Colour& defaultColour) const { float opacity = 1.0f; @@ -785,7 +785,7 @@ private: return colour.withMultipliedAlpha (opacity); } - const PathStrokeType getStrokeFor (const XmlElement* const xml) const + PathStrokeType getStrokeFor (const XmlElement* const xml) const { const String strokeWidth (getStyleAttribute (xml, "stroke-width")); const String cap (getStyleAttribute (xml, "stroke-linecap")); diff --git a/src/gui/graphics/fonts/juce_Font.cpp b/src/gui/graphics/fonts/juce_Font.cpp index 27a424edbe..807523c79c 100644 --- a/src/gui/graphics/fonts/juce_Font.cpp +++ b/src/gui/graphics/fonts/juce_Font.cpp @@ -70,7 +70,7 @@ public: faces.insertMultiple (-1, CachedFace(), numToCache); } - const Typeface::Ptr findTypefaceFor (const Font& font) + Typeface::Ptr findTypefaceFor (const Font& font) { const int flags = font.getStyleFlags() & (Font::bold | Font::italic); const String faceName (font.getTypefaceName()); @@ -116,7 +116,7 @@ public: return face.typeface; } - const Typeface::Ptr getDefaultTypeface() const noexcept + Typeface::Ptr getDefaultTypeface() const noexcept { return defaultFace; } diff --git a/src/gui/graphics/fonts/juce_Typeface.cpp b/src/gui/graphics/fonts/juce_Typeface.cpp index bd4d9b3d43..1a6a99dde6 100644 --- a/src/gui/graphics/fonts/juce_Typeface.cpp +++ b/src/gui/graphics/fonts/juce_Typeface.cpp @@ -42,7 +42,7 @@ Typeface::~Typeface() { } -const Typeface::Ptr Typeface::getFallbackTypeface() +Typeface::Ptr Typeface::getFallbackTypeface() { const Font fallbackFont (Font::getFallbackFontName(), 10, 0); return fallbackFont.getTypeface(); diff --git a/src/gui/graphics/fonts/juce_Typeface.h b/src/gui/graphics/fonts/juce_Typeface.h index 47a3f90943..1aed491e86 100644 --- a/src/gui/graphics/fonts/juce_Typeface.h +++ b/src/gui/graphics/fonts/juce_Typeface.h @@ -64,7 +64,7 @@ public: //============================================================================== /** Creates a new system typeface. */ - static const Ptr createSystemTypefaceFor (const Font& font); + static Ptr createSystemTypefaceFor (const Font& font); //============================================================================== /** Destructor. */ @@ -128,7 +128,7 @@ protected: explicit Typeface (const String& name) noexcept; - static const Ptr getFallbackTypeface(); + static Ptr getFallbackTypeface(); private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Typeface); diff --git a/src/gui/graphics/imaging/juce_CameraDevice.h b/src/gui/graphics/imaging/juce_CameraDevice.h index f50398880e..d19ca04515 100644 --- a/src/gui/graphics/imaging/juce_CameraDevice.h +++ b/src/gui/graphics/imaging/juce_CameraDevice.h @@ -49,7 +49,7 @@ public: You can open one of these devices by calling openDevice(). */ - static const StringArray getAvailableDevices(); + static StringArray getAvailableDevices(); /** Opens a camera device. @@ -99,12 +99,12 @@ public: This may be platform-specific, e.g. ".mov" or ".avi". */ - static const String getFileExtension(); + static String getFileExtension(); /** After calling stopRecording(), this method can be called to return the timestamp of the first frame that was written to the file. */ - const Time getTimeOfFirstRecordedFrame() const; + Time getTimeOfFirstRecordedFrame() const; //============================================================================== /** diff --git a/src/io/files/juce_File.cpp b/src/io/files/juce_File.cpp index 7dc32da81e..7a72da6fa9 100644 --- a/src/io/files/juce_File.cpp +++ b/src/io/files/juce_File.cpp @@ -482,9 +482,9 @@ Result File::createDirectory() const } //============================================================================== -const Time File::getLastModificationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (m); } -const Time File::getLastAccessTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (a); } -const Time File::getCreationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (c); } +Time File::getLastModificationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (m); } +Time File::getLastAccessTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (a); } +Time File::getCreationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (c); } bool File::setLastModificationTime (const Time& t) const { return setFileTimesInternal (t.toMilliseconds(), 0, 0); } bool File::setLastAccessTime (const Time& t) const { return setFileTimesInternal (0, t.toMilliseconds(), 0); } diff --git a/src/io/files/juce_File.h b/src/io/files/juce_File.h index c2f7f2e3b5..57ebc8547d 100644 --- a/src/io/files/juce_File.h +++ b/src/io/files/juce_File.h @@ -367,21 +367,21 @@ public: @returns the time, or an invalid time if the file doesn't exist. @see setLastModificationTime, getLastAccessTime, getCreationTime */ - const Time getLastModificationTime() const; + Time getLastModificationTime() const; /** Returns the last time this file was accessed. @returns the time, or an invalid time if the file doesn't exist. @see setLastAccessTime, getLastModificationTime, getCreationTime */ - const Time getLastAccessTime() const; + Time getLastAccessTime() const; /** Returns the time that this file was created. @returns the time, or an invalid time if the file doesn't exist. @see getLastModificationTime, getLastAccessTime */ - const Time getCreationTime() const; + Time getCreationTime() const; /** Changes the modification time for this file. diff --git a/src/io/network/juce_MACAddress.cpp b/src/io/network/juce_MACAddress.cpp index b5c6203642..3927402994 100644 --- a/src/io/network/juce_MACAddress.cpp +++ b/src/io/network/juce_MACAddress.cpp @@ -53,7 +53,7 @@ MACAddress::MACAddress (const uint8 bytes[6]) memcpy (asBytes, bytes, sizeof (asBytes)); } -const String MACAddress::toString() const +String MACAddress::toString() const { String s; diff --git a/src/io/network/juce_MACAddress.h b/src/io/network/juce_MACAddress.h index d025fcde5b..3bf046eea0 100644 --- a/src/io/network/juce_MACAddress.h +++ b/src/io/network/juce_MACAddress.h @@ -62,7 +62,7 @@ public: const uint8* getBytes() const noexcept { return asBytes; } /** Returns a dash-separated string in the form "11-22-33-44-55-66" */ - const String toString() const; + String toString() const; /** Returns the address in the lower 6 bytes of an int64. diff --git a/src/io/streams/juce_MemoryInputStream.cpp b/src/io/streams/juce_MemoryInputStream.cpp index 06e422d891..231457890c 100644 --- a/src/io/streams/juce_MemoryInputStream.cpp +++ b/src/io/streams/juce_MemoryInputStream.cpp @@ -140,7 +140,7 @@ public: expect (mi.readDoubleBigEndian() == randomDouble); } - static const String createRandomWideCharString() + static String createRandomWideCharString() { juce_wchar buffer [50] = { 0 }; diff --git a/src/maths/juce_Expression.cpp b/src/maths/juce_Expression.cpp index 1afe443011..7725031f25 100644 --- a/src/maths/juce_Expression.cpp +++ b/src/maths/juce_Expression.cpp @@ -40,16 +40,16 @@ public: virtual Type getType() const noexcept = 0; virtual Term* clone() const = 0; - virtual const ReferenceCountedObjectPtr resolve (const Scope&, int recursionDepth) = 0; + virtual ReferenceCountedObjectPtr resolve (const Scope&, int recursionDepth) = 0; virtual String toString() const = 0; virtual double toDouble() const { return 0; } virtual int getInputIndexFor (const Term*) const { return -1; } virtual int getOperatorPrecedence() const { return 0; } virtual int getNumInputs() const { return 0; } virtual Term* getInput (int) const { return nullptr; } - virtual const ReferenceCountedObjectPtr negated(); + virtual ReferenceCountedObjectPtr negated(); - virtual const ReferenceCountedObjectPtr createTermToEvaluateInput (const Scope&, const Term* /*inputTerm*/, + virtual ReferenceCountedObjectPtr createTermToEvaluateInput (const Scope&, const Term* /*inputTerm*/, double /*overallTarget*/, Term* /*topLevelTerm*/) const { jassertfalse; @@ -126,9 +126,9 @@ public: Type getType() const noexcept { return constantType; } Term* clone() const { return new Constant (value, isResolutionTarget); } - const TermPtr resolve (const Scope&, int) { return this; } + TermPtr resolve (const Scope&, int) { return this; } double toDouble() const { return value; } - const TermPtr negated() { return new Constant (-value, isResolutionTarget); } + TermPtr negated() { return new Constant (-value, isResolutionTarget); } String toString() const { @@ -164,7 +164,7 @@ public: virtual double performFunction (double left, double right) const = 0; virtual void writeOperator (String& dest) const = 0; - const TermPtr resolve (const Scope& scope, int recursionDepth) + TermPtr resolve (const Scope& scope, int recursionDepth) { return new Constant (performFunction (left->resolve (scope, recursionDepth)->toDouble(), right->resolve (scope, recursionDepth)->toDouble()), false); @@ -193,7 +193,7 @@ public: protected: const TermPtr left, right; - const TermPtr createDestinationTerm (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const + TermPtr createDestinationTerm (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const { jassert (input == left || input == right); if (input != left && input != right) @@ -214,7 +214,7 @@ public: public: explicit SymbolTerm (const String& symbol_) : symbol (symbol_) {} - const TermPtr resolve (const Scope& scope, int recursionDepth) + TermPtr resolve (const Scope& scope, int recursionDepth) { checkRecursionDepth (recursionDepth); return getTermFor (scope.getSymbolValue (symbol))->resolve (scope, recursionDepth + 1); @@ -257,7 +257,7 @@ public: Term* getInput (int i) const { return getTermFor (parameters [i]); } String getName() const { return functionName; } - const TermPtr resolve (const Scope& scope, int recursionDepth) + TermPtr resolve (const Scope& scope, int recursionDepth) { checkRecursionDepth (recursionDepth); double result = 0; @@ -316,7 +316,7 @@ public: public: DotOperator (SymbolTerm* const left_, Term* const right_) : BinaryTerm (left_, right_) {} - const TermPtr resolve (const Scope& scope, int recursionDepth) + TermPtr resolve (const Scope& scope, int recursionDepth) { checkRecursionDepth (recursionDepth); @@ -430,15 +430,15 @@ public: Term* getInput (int index) const { return index == 0 ? input.getObject() : nullptr; } Term* clone() const { return new Negate (input->clone()); } - const TermPtr resolve (const Scope& scope, int recursionDepth) + TermPtr resolve (const Scope& scope, int recursionDepth) { return new Constant (-input->resolve (scope, recursionDepth)->toDouble(), false); } String getName() const { return "-"; } - const TermPtr negated() { return input; } + TermPtr negated() { return input; } - const TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input_, double overallTarget, Term* topLevelTerm) const + TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input_, double overallTarget, Term* topLevelTerm) const { (void) input_; jassert (input_ == input); @@ -473,7 +473,7 @@ public: String getName() const { return "+"; } void writeOperator (String& dest) const { dest << " + "; } - const TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const + TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) @@ -498,7 +498,7 @@ public: String getName() const { return "-"; } void writeOperator (String& dest) const { dest << " - "; } - const TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const + TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) @@ -526,7 +526,7 @@ public: void writeOperator (String& dest) const { dest << " * "; } int getOperatorPrecedence() const { return 2; } - const TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const + TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) @@ -551,7 +551,7 @@ public: void writeOperator (String& dest) const { dest << " / "; } int getOperatorPrecedence() const { return 2; } - const TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const + TermPtr createTermToEvaluateInput (const Scope& scope, const Term* input, double overallTarget, Term* topLevelTerm) const { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) @@ -665,7 +665,7 @@ public: { } - const TermPtr readUpToComma() + TermPtr readUpToComma() { if (text.isEmpty()) return new Constant (0.0, false); @@ -771,7 +771,7 @@ public: return nullptr; } - const TermPtr readExpression() + TermPtr readExpression() { TermPtr lhs (readMultiplyOrDivideExpression()); @@ -792,7 +792,7 @@ public: return lhs; } - const TermPtr readMultiplyOrDivideExpression() + TermPtr readMultiplyOrDivideExpression() { TermPtr lhs (readUnaryExpression()); @@ -813,7 +813,7 @@ public: return lhs; } - const TermPtr readUnaryExpression() + TermPtr readUnaryExpression() { char opType; if (readOperator ("+-", &opType)) @@ -832,7 +832,7 @@ public: return readPrimaryExpression(); } - const TermPtr readPrimaryExpression() + TermPtr readPrimaryExpression() { TermPtr e (readParenthesisedExpression()); if (e != nullptr) @@ -845,7 +845,7 @@ public: return readSymbolOrFunction(); } - const TermPtr readSymbolOrFunction() + TermPtr readSymbolOrFunction() { String identifier; if (readIdentifier (identifier)) @@ -904,7 +904,7 @@ public: return nullptr; } - const TermPtr readParenthesisedExpression() + TermPtr readParenthesisedExpression() { if (! readOperator ("(")) return nullptr; @@ -1089,7 +1089,7 @@ int Expression::getNumInputs() const { return term->getNumInp Expression Expression::getInput (int index) const { return Expression (term->getInput (index)); } //============================================================================== -const ReferenceCountedObjectPtr Expression::Term::negated() +ReferenceCountedObjectPtr Expression::Term::negated() { return new Helpers::Negate (this); } @@ -1121,7 +1121,7 @@ bool Expression::Symbol::operator!= (const Symbol& other) const noexcept Expression::Scope::Scope() {} Expression::Scope::~Scope() {} -const Expression Expression::Scope::getSymbolValue (const String& symbol) const +Expression Expression::Scope::getSymbolValue (const String& symbol) const { throw Helpers::EvaluationError ("Unknown symbol: " + symbol); } @@ -1163,7 +1163,7 @@ void Expression::Scope::visitRelativeScope (const String& scopeName, Visitor&) c throw Helpers::EvaluationError ("Unknown symbol: " + scopeName); } -const String Expression::Scope::getScopeUID() const +String Expression::Scope::getScopeUID() const { return String::empty; } diff --git a/src/maths/juce_Expression.h b/src/maths/juce_Expression.h index e05e2e2383..7b9043f344 100644 --- a/src/maths/juce_Expression.h +++ b/src/maths/juce_Expression.h @@ -113,7 +113,7 @@ public: virtual ~Scope(); /** Returns some kind of globally unique ID that identifies this scope. */ - virtual const String getScopeUID() const; + virtual String getScopeUID() const; /** Returns the value of a symbol. If the symbol is unknown, this can throw an Expression::EvaluationError exception. @@ -121,7 +121,7 @@ public: one, e.g. for "foo.bar", symbol = "foo" and member = "bar". @throws Expression::EvaluationError */ - virtual const Expression getSymbolValue (const String& symbol) const; + virtual Expression getSymbolValue (const String& symbol) const; /** Executes a named function. If the function name is unknown, this can throw an Expression::EvaluationError exception. diff --git a/src/memory/juce_MemoryBlock.cpp b/src/memory/juce_MemoryBlock.cpp index 6a5c9317db..1569eb0f31 100644 --- a/src/memory/juce_MemoryBlock.cpp +++ b/src/memory/juce_MemoryBlock.cpp @@ -226,7 +226,7 @@ void MemoryBlock::removeSection (size_t startByte, size_t numBytesToRemove) } } -const String MemoryBlock::toString() const +String MemoryBlock::toString() const { return String (static_cast (getData()), size); } @@ -328,7 +328,7 @@ void MemoryBlock::loadFromHexString (const String& hex) //============================================================================== const char* const MemoryBlock::encodingTable = ".ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+"; -const String MemoryBlock::toBase64Encoding() const +String MemoryBlock::toBase64Encoding() const { const size_t numChars = ((size << 3) + 5) / 6; diff --git a/src/memory/juce_MemoryBlock.h b/src/memory/juce_MemoryBlock.h index 09b46f7f4a..9a2ccaf418 100644 --- a/src/memory/juce_MemoryBlock.h +++ b/src/memory/juce_MemoryBlock.h @@ -186,7 +186,7 @@ public: //============================================================================== /** Attempts to parse the contents of the block as a zero-terminated string of 8-bit characters in the system's default encoding. */ - const String toString() const; + String toString() const; //============================================================================== /** Parses a string of hexadecimal numbers and writes this data into the memory block. @@ -216,7 +216,7 @@ public: @see fromBase64Encoding */ - const String toBase64Encoding() const; + String toBase64Encoding() const; /** Takes a string of encoded characters and turns it into binary data. diff --git a/src/native/android/juce_android_Audio.cpp b/src/native/android/juce_android_Audio.cpp index 3d32ce7adc..d7af4bf98a 100644 --- a/src/native/android/juce_android_Audio.cpp +++ b/src/native/android/juce_android_Audio.cpp @@ -79,7 +79,7 @@ public: close(); } - const StringArray getOutputChannelNames() + StringArray getOutputChannelNames() { StringArray s; s.add ("Left"); @@ -87,7 +87,7 @@ public: return s; } - const StringArray getInputChannelNames() + StringArray getInputChannelNames() { StringArray s; @@ -351,7 +351,7 @@ public: int getIndexOfDevice (AudioIODevice* device, bool asInput) const { return device != nullptr ? 0 : -1; } bool hasSeparateInputsAndOutputs() const { return false; } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { StringArray s; s.add ("Android Audio"); diff --git a/src/native/android/juce_android_CameraDevice.cpp b/src/native/android/juce_android_CameraDevice.cpp index d507cd334e..83a9ebcc24 100644 --- a/src/native/android/juce_android_CameraDevice.cpp +++ b/src/native/android/juce_android_CameraDevice.cpp @@ -69,7 +69,7 @@ Component* CameraDevice::createViewerComponent() return nullptr; } -const String CameraDevice::getFileExtension() +String CameraDevice::getFileExtension() { return ".m4a"; // TODO correct? } @@ -79,7 +79,7 @@ void CameraDevice::startRecordingToFile (const File& file, int quality) // TODO } -const Time CameraDevice::getTimeOfFirstRecordedFrame() const +Time CameraDevice::getTimeOfFirstRecordedFrame() const { // TODO return Time(); @@ -100,7 +100,7 @@ void CameraDevice::removeListener (Listener* listenerToRemove) // TODO } -const StringArray CameraDevice::getAvailableDevices() +StringArray CameraDevice::getAvailableDevices() { StringArray devs; diff --git a/src/native/android/juce_android_Fonts.cpp b/src/native/android/juce_android_Fonts.cpp index 4473018fc4..b1781a3c8b 100644 --- a/src/native/android/juce_android_Fonts.cpp +++ b/src/native/android/juce_android_Fonts.cpp @@ -190,7 +190,7 @@ private: }; //============================================================================== -const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) +Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) { return new AndroidTypeface (font); } diff --git a/src/native/android/juce_android_Midi.cpp b/src/native/android/juce_android_Midi.cpp index d329f24a71..d2ff09f5ab 100644 --- a/src/native/android/juce_android_Midi.cpp +++ b/src/native/android/juce_android_Midi.cpp @@ -29,7 +29,7 @@ //============================================================================== -const StringArray MidiOutput::getDevices() +StringArray MidiOutput::getDevices() { StringArray devices; @@ -78,7 +78,7 @@ int MidiInput::getDefaultDeviceIndex() return 0; } -const StringArray MidiInput::getDevices() +StringArray MidiInput::getDevices() { StringArray devs; diff --git a/src/native/android/juce_android_SystemStats.cpp b/src/native/android/juce_android_SystemStats.cpp index 4a6d48f16f..07a2a6a94e 100644 --- a/src/native/android/juce_android_SystemStats.cpp +++ b/src/native/android/juce_android_SystemStats.cpp @@ -30,7 +30,7 @@ //============================================================================== namespace AndroidStatsHelpers { - const String getSystemProperty (const String& name) + String getSystemProperty (const String& name) { return juceString (LocalRef ((jstring) getEnv()->CallStaticObjectMethod (android.systemClass, android.getProperty, @@ -44,7 +44,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() return Android; } -const String SystemStats::getOperatingSystemName() +String SystemStats::getOperatingSystemName() { return "Android " + AndroidStatsHelpers::getSystemProperty ("os.version"); } @@ -58,7 +58,7 @@ bool SystemStats::isOperatingSystem64Bit() #endif } -const String SystemStats::getCpuVendor() +String SystemStats::getCpuVendor() { return AndroidStatsHelpers::getSystemProperty ("os.arch"); } @@ -86,7 +86,7 @@ int SystemStats::getPageSize() } //============================================================================== -const String SystemStats::getLogonName() +String SystemStats::getLogonName() { const char* user = getenv ("USER"); @@ -100,12 +100,12 @@ const String SystemStats::getLogonName() return CharPointer_UTF8 (user); } -const String SystemStats::getFullUserName() +String SystemStats::getFullUserName() { return getLogonName(); } -const String SystemStats::getComputerName() +String SystemStats::getComputerName() { char name [256] = { 0 }; if (gethostname (name, sizeof (name) - 1) == 0) diff --git a/src/native/android/juce_android_Windowing.cpp b/src/native/android/juce_android_Windowing.cpp index 9926f710f4..ae7dfae94a 100644 --- a/src/native/android/juce_android_Windowing.cpp +++ b/src/native/android/juce_android_Windowing.cpp @@ -398,7 +398,7 @@ public: // TODO } - const StringArray getAvailableRenderingEngines() + StringArray getAvailableRenderingEngines() { StringArray s (ComponentPeer::getAvailableRenderingEngines()); s.add ("Android Canvas Renderer"); diff --git a/src/native/common/juce_posix_SharedCode.h b/src/native/common/juce_posix_SharedCode.h index 18ffc8aeb9..3dfcc52f03 100644 --- a/src/native/common/juce_posix_SharedCode.h +++ b/src/native/common/juce_posix_SharedCode.h @@ -652,7 +652,7 @@ void juce_runSystemCommand (const String& command) (void) result; } -const String juce_getOutputFromCommand (const String& command) +String juce_getOutputFromCommand (const String& command) { // slight bodge here, as we just pipe the output into a temp file and read it... const File tempFile (File::getSpecialLocation (File::tempDirectory) diff --git a/src/native/linux/juce_linux_Audio.cpp b/src/native/linux/juce_linux_Audio.cpp index e39c468add..a093c62ce3 100644 --- a/src/native/linux/juce_linux_Audio.cpp +++ b/src/native/linux/juce_linux_Audio.cpp @@ -701,8 +701,8 @@ public: close(); } - const StringArray getOutputChannelNames() { return internal.channelNamesOut; } - const StringArray getInputChannelNames() { return internal.channelNamesIn; } + StringArray getOutputChannelNames() { return internal.channelNamesOut; } + StringArray getInputChannelNames() { return internal.channelNamesIn; } int getNumSampleRates() { return internal.sampleRates.size(); } double getSampleRate (int index) { return internal.sampleRates [index]; } @@ -930,7 +930,7 @@ public: outputNames.appendNumbersToDuplicates (false, true); } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1000,7 +1000,7 @@ private: return (isInput || isOutput) && rates.size() > 0; } - /*static const String getHint (void* hint, const char* type) + /*static String getHint (void* hint, const char* type) { char* const n = snd_device_name_get_hint (hint, type); const String s ((const char*) n); diff --git a/src/native/linux/juce_linux_AudioCDReader.cpp b/src/native/linux/juce_linux_AudioCDReader.cpp index 92b3335742..f0e3c4c9b9 100644 --- a/src/native/linux/juce_linux_AudioCDReader.cpp +++ b/src/native/linux/juce_linux_AudioCDReader.cpp @@ -34,7 +34,7 @@ AudioCDReader::AudioCDReader() { } -const StringArray AudioCDReader::getAvailableCDNames() +StringArray AudioCDReader::getAvailableCDNames() { StringArray names; return names; diff --git a/src/native/linux/juce_linux_Fonts.cpp b/src/native/linux/juce_linux_Fonts.cpp index 37035ed7e6..41c1c98889 100644 --- a/src/native/linux/juce_linux_Fonts.cpp +++ b/src/native/linux/juce_linux_Fonts.cpp @@ -514,7 +514,7 @@ public: } }; -const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) +Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) { return new FreetypeTypeface (font); } @@ -530,8 +530,8 @@ StringArray Font::findAllTypefaceNames() namespace LinuxFontHelpers { - const String pickBestFont (const StringArray& names, - const char* const* choicesString) + String pickBestFont (const StringArray& names, + const char* const* choicesString) { const StringArray choices (choicesString); @@ -553,7 +553,7 @@ namespace LinuxFontHelpers return names[0]; } - const String getDefaultSansSerifFontName() + String getDefaultSansSerifFontName() { StringArray allFonts; FreeTypeInterface::getInstance()->getSansSerifNames (allFonts); @@ -562,7 +562,7 @@ namespace LinuxFontHelpers return pickBestFont (allFonts, targets); } - const String getDefaultSerifFontName() + String getDefaultSerifFontName() { StringArray allFonts; FreeTypeInterface::getInstance()->getSerifNames (allFonts); @@ -571,7 +571,7 @@ namespace LinuxFontHelpers return pickBestFont (allFonts, targets); } - const String getDefaultMonospacedFontName() + String getDefaultMonospacedFontName() { StringArray allFonts; FreeTypeInterface::getInstance()->getMonospacedNames (allFonts); diff --git a/src/native/linux/juce_linux_JackAudio.cpp b/src/native/linux/juce_linux_JackAudio.cpp index 8179400c2a..d301f60c1d 100644 --- a/src/native/linux/juce_linux_JackAudio.cpp +++ b/src/native/linux/juce_linux_JackAudio.cpp @@ -177,7 +177,7 @@ public: } } - const StringArray getChannelNames (bool forInput) const + StringArray getChannelNames (bool forInput) const { StringArray names; const char** const ports = JUCE_NAMESPACE::jack_get_ports (client, 0, 0, /* JackPortIsPhysical | */ @@ -200,8 +200,8 @@ public: return names; } - const StringArray getOutputChannelNames() { return getChannelNames (false); } - const StringArray getInputChannelNames() { return getChannelNames (true); } + StringArray getOutputChannelNames() { return getChannelNames (false); } + StringArray getInputChannelNames() { return getChannelNames (true); } int getNumSampleRates() { return client != 0 ? 1 : 0; } double getSampleRate (int index) { return client != 0 ? JUCE_NAMESPACE::jack_get_sample_rate (client) : 0; } int getNumBufferSizesAvailable() { return client != 0 ? 1 : 0; } @@ -536,7 +536,7 @@ public: } } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this return wantInputNames ? inputNames : outputNames; diff --git a/src/native/linux/juce_linux_Messaging.cpp b/src/native/linux/juce_linux_Messaging.cpp index 65df3c9aca..c857ff6b27 100644 --- a/src/native/linux/juce_linux_Messaging.cpp +++ b/src/native/linux/juce_linux_Messaging.cpp @@ -193,7 +193,7 @@ private: return true; } - const Message::Ptr popNextMessage() + Message::Ptr popNextMessage() { const ScopedLock sl (lock); diff --git a/src/native/linux/juce_linux_Midi.cpp b/src/native/linux/juce_linux_Midi.cpp index 52fc6f9579..52183290e0 100644 --- a/src/native/linux/juce_linux_Midi.cpp +++ b/src/native/linux/juce_linux_Midi.cpp @@ -215,7 +215,7 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiOutputDevice); }; -const StringArray MidiOutput::getDevices() +StringArray MidiOutput::getDevices() { StringArray devices; iterateMidiDevices (false, devices, -1); @@ -379,7 +379,7 @@ int MidiInput::getDefaultDeviceIndex() return 0; } -const StringArray MidiInput::getDevices() +StringArray MidiInput::getDevices() { StringArray devices; iterateMidiDevices (true, devices, -1); @@ -424,7 +424,7 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba // (These are just stub functions if ALSA is unavailable...) -const StringArray MidiOutput::getDevices() { return StringArray(); } +StringArray MidiOutput::getDevices() { return StringArray(); } int MidiOutput::getDefaultDeviceIndex() { return 0; } MidiOutput* MidiOutput::openDevice (int) { return nullptr; } MidiOutput* MidiOutput::createNewDevice (const String&) { return nullptr; } @@ -436,7 +436,7 @@ MidiInput::~MidiInput() {} void MidiInput::start() {} void MidiInput::stop() {} int MidiInput::getDefaultDeviceIndex() { return 0; } -const StringArray MidiInput::getDevices() { return StringArray(); } +StringArray MidiInput::getDevices() { return StringArray(); } MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return nullptr; } MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return nullptr; } diff --git a/src/native/linux/juce_linux_Network.cpp b/src/native/linux/juce_linux_Network.cpp index cb09854a86..e735891267 100644 --- a/src/native/linux/juce_linux_Network.cpp +++ b/src/native/linux/juce_linux_Network.cpp @@ -259,7 +259,7 @@ private: } } - const String responseHeader (readResponse (socketHandle, timeOutTime)); + String responseHeader (readResponse (socketHandle, timeOutTime)); if (responseHeader.isNotEmpty()) { @@ -297,7 +297,7 @@ private: } //============================================================================== - static const String readResponse (const int socketHandle, const uint32 timeOutTime) + static String readResponse (const int socketHandle, const uint32 timeOutTime) { int bytesRead = 0, numConsecutiveLFs = 0; MemoryBlock buffer (1024, true); @@ -431,7 +431,7 @@ private: return true; } - static const String findHeaderItem (const StringArray& lines, const String& itemName) + static String findHeaderItem (const StringArray& lines, const String& itemName) { for (int i = 0; i < lines.size(); ++i) if (lines[i].startsWithIgnoreCase (itemName)) diff --git a/src/native/linux/juce_linux_SystemStats.cpp b/src/native/linux/juce_linux_SystemStats.cpp index fff084f0e1..4693999123 100644 --- a/src/native/linux/juce_linux_SystemStats.cpp +++ b/src/native/linux/juce_linux_SystemStats.cpp @@ -40,7 +40,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() return Linux; } -const String SystemStats::getOperatingSystemName() +String SystemStats::getOperatingSystemName() { return "Linux"; } @@ -58,7 +58,7 @@ bool SystemStats::isOperatingSystem64Bit() //============================================================================== namespace LinuxStatsHelpers { - const String getCpuInfo (const char* const key) + String getCpuInfo (const char* const key) { StringArray lines; lines.addLines (File ("/proc/cpuinfo").loadFileAsString()); @@ -71,7 +71,7 @@ namespace LinuxStatsHelpers } } -const String SystemStats::getCpuVendor() +String SystemStats::getCpuVendor() { return LinuxStatsHelpers::getCpuInfo ("vendor_id"); } @@ -97,7 +97,7 @@ int SystemStats::getPageSize() } //============================================================================== -const String SystemStats::getLogonName() +String SystemStats::getLogonName() { const char* user = getenv ("USER"); @@ -111,12 +111,12 @@ const String SystemStats::getLogonName() return CharPointer_UTF8 (user); } -const String SystemStats::getFullUserName() +String SystemStats::getFullUserName() { return getLogonName(); } -const String SystemStats::getComputerName() +String SystemStats::getComputerName() { char name [256] = { 0 }; if (gethostname (name, sizeof (name) - 1) == 0) diff --git a/src/native/mac/juce_ios_Audio.cpp b/src/native/mac/juce_ios_Audio.cpp index 0c0e114b8b..08d296b690 100644 --- a/src/native/mac/juce_ios_Audio.cpp +++ b/src/native/mac/juce_ios_Audio.cpp @@ -54,7 +54,7 @@ public: close(); } - const StringArray getOutputChannelNames() + StringArray getOutputChannelNames() { StringArray s; s.add ("Left"); @@ -62,7 +62,7 @@ public: return s; } - const StringArray getInputChannelNames() + StringArray getInputChannelNames() { StringArray s; if (audioInputIsAvailable) @@ -538,7 +538,7 @@ public: { } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { StringArray s; s.add ("iPhone Audio"); diff --git a/src/native/mac/juce_mac_AudioCDBurner.mm b/src/native/mac/juce_mac_AudioCDBurner.mm index 5550aabc58..6bc6a2d0b6 100644 --- a/src/native/mac/juce_mac_AudioCDBurner.mm +++ b/src/native/mac/juce_mac_AudioCDBurner.mm @@ -396,7 +396,7 @@ public: bool openTray() { return [device->device isValid] && [device->device ejectMedia]; } - const Array getAvailableWriteSpeeds() const + Array getAvailableWriteSpeeds() const { Array results; @@ -476,7 +476,7 @@ namespace } } -const StringArray AudioCDBurner::findAvailableDevices() +StringArray AudioCDBurner::findAvailableDevices() { NSArray* names = findDiskBurnerDevices(); StringArray s; @@ -517,7 +517,7 @@ AudioCDBurner::DiskState AudioCDBurner::waitUntilStateChange (int timeOutMillise return newState; } -const Array AudioCDBurner::getAvailableWriteSpeeds() const +Array AudioCDBurner::getAvailableWriteSpeeds() const { return pimpl->getAvailableWriteSpeeds(); } @@ -543,10 +543,10 @@ bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) return false; } -const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, - bool ejectDiscAfterwards, - bool performFakeBurnForTesting, - int writeSpeed) +String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, + bool ejectDiscAfterwards, + bool performFakeBurnForTesting, + int writeSpeed) { String error ("Couldn't open or write to the CD device"); diff --git a/src/native/mac/juce_mac_AudioCDReader.mm b/src/native/mac/juce_mac_AudioCDReader.mm index d49ba812ad..cdfce53b17 100644 --- a/src/native/mac/juce_mac_AudioCDReader.mm +++ b/src/native/mac/juce_mac_AudioCDReader.mm @@ -116,7 +116,7 @@ namespace CDReaderHelpers } //============================================================================== -const StringArray AudioCDReader::getAvailableCDNames() +StringArray AudioCDReader::getAvailableCDNames() { Array cds; CDReaderHelpers::findDevices (cds); diff --git a/src/native/mac/juce_mac_CameraDevice.mm b/src/native/mac/juce_mac_CameraDevice.mm index 3ee25ea1c0..56425cff2b 100644 --- a/src/native/mac/juce_mac_CameraDevice.mm +++ b/src/native/mac/juce_mac_CameraDevice.mm @@ -323,7 +323,7 @@ Component* CameraDevice::createViewerComponent() return new QTCaptureViewerComp (this, static_cast (internal)); } -const String CameraDevice::getFileExtension() +String CameraDevice::getFileExtension() { return ".mov"; } @@ -367,7 +367,7 @@ void CameraDevice::startRecordingToFile (const File& file, int quality) isRecording = true; } -const Time CameraDevice::getTimeOfFirstRecordedFrame() const +Time CameraDevice::getTimeOfFirstRecordedFrame() const { QTCameraDeviceInteral* const d = static_cast (internal); if (d->callbackDelegate->firstPresentationTime != 0) @@ -398,7 +398,7 @@ void CameraDevice::removeListener (Listener* listenerToRemove) } //============================================================================== -const StringArray CameraDevice::getAvailableDevices() +StringArray CameraDevice::getAvailableDevices() { JUCE_AUTORELEASEPOOL diff --git a/src/native/mac/juce_mac_CoreAudio.cpp b/src/native/mac/juce_mac_CoreAudio.cpp index 005b13e7b2..e24a931097 100644 --- a/src/native/mac/juce_mac_CoreAudio.cpp +++ b/src/native/mac/juce_mac_CoreAudio.cpp @@ -306,7 +306,7 @@ public: } //============================================================================== - const StringArray getSources (bool input) + StringArray getSources (bool input) { StringArray s; HeapBlock types; @@ -393,10 +393,10 @@ public: } //============================================================================== - const String reopen (const BigInteger& inputChannels, - const BigInteger& outputChannels, - double newSampleRate, - int bufferSizeSamples) + String reopen (const BigInteger& inputChannels, + const BigInteger& outputChannels, + double newSampleRate, + int bufferSizeSamples) { String error; JUCE_COREAUDIOLOG ("CoreAudio reopen"); @@ -892,12 +892,12 @@ public: AudioObjectRemovePropertyListener (kAudioObjectSystemObject, &pa, hardwareListenerProc, internal); } - const StringArray getOutputChannelNames() + StringArray getOutputChannelNames() { return internal->outChanNames; } - const StringArray getInputChannelNames() + StringArray getInputChannelNames() { if (internal->inputDevice != 0) return internal->inputDevice->inChanNames; @@ -1111,7 +1111,7 @@ public: outputDeviceNames.appendNumbersToDuplicates (false, true); } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/src/native/mac/juce_mac_CoreMidi.cpp b/src/native/mac/juce_mac_CoreMidi.cpp index 405034e3e4..6f539c8cba 100644 --- a/src/native/mac/juce_mac_CoreMidi.cpp +++ b/src/native/mac/juce_mac_CoreMidi.cpp @@ -46,7 +46,7 @@ namespace CoreMidiHelpers #define CHECK_ERROR(a) CoreMidiHelpers::logError (a, __LINE__) //============================================================================== - const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) + String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) { String result; CFStringRef str = 0; @@ -108,7 +108,7 @@ namespace CoreMidiHelpers return result; } - const String getConnectedEndpointName (MIDIEndpointRef endpoint) + String getConnectedEndpointName (MIDIEndpointRef endpoint) { String result; @@ -287,7 +287,7 @@ namespace CoreMidiHelpers } //============================================================================== -const StringArray MidiOutput::getDevices() +StringArray MidiOutput::getDevices() { StringArray s; @@ -409,7 +409,7 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) } //============================================================================== -const StringArray MidiInput::getDevices() +StringArray MidiInput::getDevices() { StringArray s; @@ -556,9 +556,9 @@ void MidiInput::stop() MidiOutput::~MidiOutput() {} void MidiOutput::sendMessageNow (const MidiMessage& message) {} -const StringArray MidiOutput::getDevices() { return StringArray(); } +StringArray MidiOutput::getDevices() { return StringArray(); } MidiOutput* MidiOutput::openDevice (int index) { return nullptr; } -const StringArray MidiInput::getDevices() { return StringArray(); } +StringArray MidiInput::getDevices() { return StringArray(); } MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return nullptr; } #endif diff --git a/src/native/mac/juce_mac_Files.mm b/src/native/mac/juce_mac_Files.mm index 627f6f7761..afdbe90d74 100644 --- a/src/native/mac/juce_mac_Files.mm +++ b/src/native/mac/juce_mac_Files.mm @@ -98,7 +98,7 @@ namespace FileHelpers } #if JUCE_IOS - const String getIOSSystemLocation (NSSearchPathDirectory type) + String getIOSSystemLocation (NSSearchPathDirectory type) { return nsStringToJuce ([NSSearchPathForDirectoriesInDomains (type, NSUserDomainMask, YES) objectAtIndex: 0]); @@ -445,7 +445,7 @@ bool PlatformUtilities::makeFSRefFromPath (FSRef* destFSRef, const String& path) return FSPathMakeRef (reinterpret_cast (path.toUTF8().getAddress()), destFSRef, 0) == noErr; } -const String PlatformUtilities::makePathFromFSRef (FSRef* file) +String PlatformUtilities::makePathFromFSRef (FSRef* file) { char path [2048] = { 0 }; diff --git a/src/native/mac/juce_mac_Fonts.mm b/src/native/mac/juce_mac_Fonts.mm index 6771c87b28..1adc5ae67f 100644 --- a/src/native/mac/juce_mac_Fonts.mm +++ b/src/native/mac/juce_mac_Fonts.mm @@ -728,7 +728,7 @@ private: #endif //============================================================================== -const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) +Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) { return new MacTypeface (font); } diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index 2024286690..64eb21c947 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -173,7 +173,7 @@ public: void toFront (bool makeActiveWindow); void toBehind (ComponentPeer* other); void setIcon (const Image& newIcon); - const StringArray getAvailableRenderingEngines(); + StringArray getAvailableRenderingEngines(); int getCurrentRenderingEngine() const; void setCurrentRenderingEngine (int index); @@ -1569,7 +1569,7 @@ void NSViewComponentPeer::drawRect (NSRect r) } } -const StringArray NSViewComponentPeer::getAvailableRenderingEngines() +StringArray NSViewComponentPeer::getAvailableRenderingEngines() { StringArray s (ComponentPeer::getAvailableRenderingEngines()); diff --git a/src/native/mac/juce_mac_Strings.mm b/src/native/mac/juce_mac_Strings.mm index 3e251a736b..0c9daedf08 100644 --- a/src/native/mac/juce_mac_Strings.mm +++ b/src/native/mac/juce_mac_Strings.mm @@ -30,7 +30,7 @@ //============================================================================== namespace { - const String nsStringToJuce (NSString* s) + String nsStringToJuce (NSString* s) { return CharPointer_UTF8 ([s UTF8String]); } @@ -41,7 +41,7 @@ namespace } } -const String PlatformUtilities::cfStringToJuceString (CFStringRef cfString) +String PlatformUtilities::cfStringToJuceString (CFStringRef cfString) { if (cfString == 0) return String::empty; @@ -61,7 +61,7 @@ CFStringRef PlatformUtilities::juceStringToCFString (const String& s) return CFStringCreateWithCharacters (kCFAllocatorDefault, (const UniChar*) utf16.getAddress(), utf16.length()); } -const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) +String PlatformUtilities::convertToPrecomposedUnicode (const String& s) { #if JUCE_IOS JUCE_AUTORELEASEPOOL diff --git a/src/native/mac/juce_mac_SystemStats.mm b/src/native/mac/juce_mac_SystemStats.mm index 2e95dc4969..6c3e1272ca 100644 --- a/src/native/mac/juce_mac_SystemStats.mm +++ b/src/native/mac/juce_mac_SystemStats.mm @@ -97,7 +97,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() return MacOSX; } -const String SystemStats::getOperatingSystemName() +String SystemStats::getOperatingSystemName() { #if JUCE_IOS String s ("iOS "); @@ -143,7 +143,7 @@ int SystemStats::getMemorySizeInMegabytes() return (int) (mem / (1024 * 1024)); } -const String SystemStats::getCpuVendor() +String SystemStats::getCpuVendor() { #if JUCE_INTEL uint32 dummy = 0; @@ -173,17 +173,17 @@ int SystemStats::getCpuSpeedInMegaherz() } //============================================================================== -const String SystemStats::getLogonName() +String SystemStats::getLogonName() { return nsStringToJuce (NSUserName()); } -const String SystemStats::getFullUserName() +String SystemStats::getFullUserName() { return nsStringToJuce (NSFullUserName()); } -const String SystemStats::getComputerName() +String SystemStats::getComputerName() { char name [256] = { 0 }; if (gethostname (name, sizeof (name) - 1) == 0) diff --git a/src/native/windows/juce_win32_ASIO.cpp b/src/native/windows/juce_win32_ASIO.cpp index 74ff78a785..ff797a7bb5 100644 --- a/src/native/windows/juce_win32_ASIO.cpp +++ b/src/native/windows/juce_win32_ASIO.cpp @@ -156,8 +156,8 @@ public: } } - const StringArray getOutputChannelNames() { return outputChannelNames; } - const StringArray getInputChannelNames() { return inputChannelNames; } + StringArray getOutputChannelNames() { return outputChannelNames; } + StringArray getInputChannelNames() { return inputChannelNames; } int getNumSampleRates() { return sampleRates.size(); } double getSampleRate (int index) { return sampleRates [index]; } @@ -829,7 +829,7 @@ private: return false; } - const String initDriver() + String initDriver() { if (asioObject != nullptr) { @@ -850,7 +850,7 @@ private: return "No Driver"; } - const String openDevice() + String openDevice() { // use this in case the driver starts opening dialog boxes.. Component modalWindow (String::empty); @@ -1667,7 +1667,7 @@ public: } } - const StringArray getDeviceNames (bool /*wantInputNames*/) const + StringArray getDeviceNames (bool /*wantInputNames*/) const { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/src/native/windows/juce_win32_AudioCDReader.cpp b/src/native/windows/juce_win32_AudioCDReader.cpp index dd0478e845..033ea31e1a 100644 --- a/src/native/windows/juce_win32_AudioCDReader.cpp +++ b/src/native/windows/juce_win32_AudioCDReader.cpp @@ -966,7 +966,7 @@ const int framesPerIndexRead = 4; } //============================================================================== -const StringArray AudioCDReader::getAvailableCDNames() +StringArray AudioCDReader::getAvailableCDNames() { using namespace CDReaderHelpers; StringArray results; @@ -1533,7 +1533,7 @@ AudioCDBurner::~AudioCDBurner() pimpl.release()->releaseObjects(); } -const StringArray AudioCDBurner::findAvailableDevices() +StringArray AudioCDBurner::findAvailableDevices() { StringArray devs; CDBurnerHelpers::enumCDBurners (&devs, -1, 0); @@ -1581,7 +1581,7 @@ AudioCDBurner::DiskState AudioCDBurner::waitUntilStateChange (int timeOutMillise return newState; } -const Array AudioCDBurner::getAvailableWriteSpeeds() const +Array AudioCDBurner::getAvailableWriteSpeeds() const { Array results; const int maxSpeed = pimpl->getIntProperty (L"MaxWriteSpeed", 1); @@ -1611,8 +1611,8 @@ int AudioCDBurner::getNumAvailableAudioBlocks() const return blocksFree; } -const String AudioCDBurner::burn (AudioCDBurner::BurnProgressListener* listener, bool ejectDiscAfterwards, - bool performFakeBurnForTesting, int writeSpeed) +String AudioCDBurner::burn (AudioCDBurner::BurnProgressListener* listener, bool ejectDiscAfterwards, + bool performFakeBurnForTesting, int writeSpeed) { pimpl->setIntProperty (L"WriteSpeed", writeSpeed > 0 ? writeSpeed : -1); diff --git a/src/native/windows/juce_win32_CameraDevice.cpp b/src/native/windows/juce_win32_CameraDevice.cpp index 49e21ac16c..5382d41971 100644 --- a/src/native/windows/juce_win32_CameraDevice.cpp +++ b/src/native/windows/juce_win32_CameraDevice.cpp @@ -717,7 +717,7 @@ Component* CameraDevice::createViewerComponent() return new DShowCameraDeviceInteral::DShowCaptureViewerComp (static_cast (internal)); } -const String CameraDevice::getFileExtension() +String CameraDevice::getFileExtension() { return ".wmv"; } @@ -731,7 +731,7 @@ void CameraDevice::startRecordingToFile (const File& file, int quality) isRecording = d->createFileCaptureFilter (file, quality); } -const Time CameraDevice::getTimeOfFirstRecordedFrame() const +Time CameraDevice::getTimeOfFirstRecordedFrame() const { DShowCameraDeviceInteral* const d = (DShowCameraDeviceInteral*) internal; return d->firstRecordedTime; @@ -830,7 +830,7 @@ namespace } } -const StringArray CameraDevice::getAvailableDevices() +StringArray CameraDevice::getAvailableDevices() { StringArray devs; String dummy; diff --git a/src/native/windows/juce_win32_DirectShowComponent.cpp b/src/native/windows/juce_win32_DirectShowComponent.cpp index 3a01b1a2a0..096e026cd8 100644 --- a/src/native/windows/juce_win32_DirectShowComponent.cpp +++ b/src/native/windows/juce_win32_DirectShowComponent.cpp @@ -859,7 +859,7 @@ void DirectShowComponent::closeMovie() } //====================================================================== -const File DirectShowComponent::getCurrentMoviePath() const { return videoPath; } +File DirectShowComponent::getCurrentMoviePath() const { return videoPath; } bool DirectShowComponent::isMovieOpen() const { return videoLoaded; } double DirectShowComponent::getMovieDuration() const { return videoLoaded ? context->getDuration() : 0.0; } void DirectShowComponent::setLooping (const bool shouldLoop) { looping = shouldLoop; } diff --git a/src/native/windows/juce_win32_DirectSound.cpp b/src/native/windows/juce_win32_DirectSound.cpp index 1ea20bf8a4..9bb3ff2c0e 100644 --- a/src/native/windows/juce_win32_DirectSound.cpp +++ b/src/native/windows/juce_win32_DirectSound.cpp @@ -139,7 +139,7 @@ BEGIN_JUCE_NAMESPACE namespace { - const String getDSErrorMessage (HRESULT hr) + String getDSErrorMessage (HRESULT hr) { const char* result = nullptr; @@ -264,7 +264,7 @@ public: } } - const String open() + String open() { log ("opening dsound out device: " + name + " rate=" + String (sampleRate) + " bits=" + String (bitDepth) + " buf=" + String (bufferSizeSamples)); @@ -582,7 +582,7 @@ public: } } - const String open() + String open() { log ("opening dsound in device: " + name + " rate=" + String (sampleRate) + " bits=" + String (bitDepth) + " buf=" + String (bufferSizeSamples)); @@ -852,8 +852,8 @@ public: const BigInteger getActiveInputChannels() const { return enabledInputs; } int getOutputLatencyInSamples() { return (int) (getCurrentBufferSizeSamples() * 1.5); } int getInputLatencyInSamples() { return getOutputLatencyInSamples(); } - const StringArray getOutputChannelNames() { return outChannels; } - const StringArray getInputChannelNames() { return inChannels; } + StringArray getOutputChannelNames() { return outChannels; } + StringArray getInputChannelNames() { return inChannels; } int getNumSampleRates() { return 4; } int getDefaultBufferSize() { return 2560; } @@ -953,9 +953,9 @@ private: AudioIODeviceCallback* callback; CriticalSection startStopLock; - const String openDevice (const BigInteger& inputChannels, - const BigInteger& outputChannels, - double sampleRate_, int bufferSizeSamples_); + String openDevice (const BigInteger& inputChannels, + const BigInteger& outputChannels, + double sampleRate_, int bufferSizeSamples_); void closeDevice() { @@ -1123,7 +1123,7 @@ public: } } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1251,9 +1251,9 @@ private: }; //============================================================================== -const String DSoundAudioIODevice::openDevice (const BigInteger& inputChannels, - const BigInteger& outputChannels, - double sampleRate_, int bufferSizeSamples_) +String DSoundAudioIODevice::openDevice (const BigInteger& inputChannels, + const BigInteger& outputChannels, + double sampleRate_, int bufferSizeSamples_) { closeDevice(); totalSamplesOut = 0; diff --git a/src/native/windows/juce_win32_Files.cpp b/src/native/windows/juce_win32_Files.cpp index 84247764cc..4dfb74e483 100644 --- a/src/native/windows/juce_win32_Files.cpp +++ b/src/native/windows/juce_win32_Files.cpp @@ -56,7 +56,7 @@ namespace WindowsFileHelpers reinterpret_cast (ft)->QuadPart = time * 10000 + literal64bit (116444736000000000); } - const String getDriveFromPath (String path) + String getDriveFromPath (String path) { // (mess with the string to make sure it's not sharing its internal storage) path = (path + " ").dropLastCharacters(1); diff --git a/src/native/windows/juce_win32_Fonts.cpp b/src/native/windows/juce_win32_Fonts.cpp index 12e1a8dae7..5315832929 100644 --- a/src/native/windows/juce_win32_Fonts.cpp +++ b/src/native/windows/juce_win32_Fonts.cpp @@ -401,7 +401,7 @@ private: const MAT2 WindowsTypeface::identityMatrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; -const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) +Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) { return new WindowsTypeface (font); } diff --git a/src/native/windows/juce_win32_Midi.cpp b/src/native/windows/juce_win32_Midi.cpp index 6f8b6aadd3..3e2376ede6 100644 --- a/src/native/windows/juce_win32_Midi.cpp +++ b/src/native/windows/juce_win32_Midi.cpp @@ -226,7 +226,7 @@ Array MidiInCollector::activeMidiCollectors; //============================================================================== -const StringArray MidiInput::getDevices() +StringArray MidiInput::getDevices() { StringArray s; const int num = midiInGetNumDevs(); @@ -332,7 +332,7 @@ private: Array MidiOutHandle::activeHandles; //============================================================================== -const StringArray MidiOutput::getDevices() +StringArray MidiOutput::getDevices() { StringArray s; const int num = midiOutGetNumDevs(); diff --git a/src/native/windows/juce_win32_PlatformUtils.cpp b/src/native/windows/juce_win32_PlatformUtils.cpp index fde30e96f9..1577c321f1 100644 --- a/src/native/windows/juce_win32_PlatformUtils.cpp +++ b/src/native/windows/juce_win32_PlatformUtils.cpp @@ -70,8 +70,8 @@ namespace } } -const String PlatformUtilities::getRegistryValue (const String& regValuePath, - const String& defaultValue) +String PlatformUtilities::getRegistryValue (const String& regValuePath, + const String& defaultValue) { String valueName, result (defaultValue); HKEY k = findKeyForPath (regValuePath, false, valueName); @@ -184,7 +184,7 @@ bool juce_IsRunningInWine() } //============================================================================== -const String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() +String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() { const String commandLine (GetCommandLineW()); return String (CharacterFunctions::findEndOfToken (commandLine.getCharPointer(), diff --git a/src/native/windows/juce_win32_SystemStats.cpp b/src/native/windows/juce_win32_SystemStats.cpp index bbca2d860e..af40ef9b83 100644 --- a/src/native/windows/juce_win32_SystemStats.cpp +++ b/src/native/windows/juce_win32_SystemStats.cpp @@ -48,7 +48,7 @@ void Logger::outputDebugString (const String& text) #pragma intrinsic (__cpuid) #pragma intrinsic (__rdtsc) -const String SystemStats::getCpuVendor() +String SystemStats::getCpuVendor() { int info [4]; __cpuid (info, 0); @@ -98,7 +98,7 @@ static void juce_getCpuVendor (char* const v) memcpy (v, vendor, 16); } -const String SystemStats::getCpuVendor() +String SystemStats::getCpuVendor() { char v [16]; juce_getCpuVendor (v); @@ -161,7 +161,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() return UnknownOS; } -const String SystemStats::getOperatingSystemName() +String SystemStats::getOperatingSystemName() { const char* name = "Unknown OS"; @@ -356,7 +356,7 @@ int SystemStats::getPageSize() } //============================================================================== -const String SystemStats::getLogonName() +String SystemStats::getLogonName() { TCHAR text [256] = { 0 }; DWORD len = numElementsInArray (text) - 1; @@ -364,12 +364,12 @@ const String SystemStats::getLogonName() return String (text, len); } -const String SystemStats::getFullUserName() +String SystemStats::getFullUserName() { return getLogonName(); } -const String SystemStats::getComputerName() +String SystemStats::getComputerName() { TCHAR text [MAX_COMPUTERNAME_LENGTH + 1] = { 0 }; DWORD len = numElementsInArray (text) - 1; diff --git a/src/native/windows/juce_win32_WASAPI.cpp b/src/native/windows/juce_win32_WASAPI.cpp index a9c1bd0e01..775751d7f7 100644 --- a/src/native/windows/juce_win32_WASAPI.cpp +++ b/src/native/windows/juce_win32_WASAPI.cpp @@ -91,7 +91,7 @@ bool check (HRESULT hr) } //============================================================================== -const String getDeviceID (IMMDevice* const device) +String getDeviceID (IMMDevice* const device) { String s; WCHAR* deviceId = nullptr; @@ -678,7 +678,7 @@ public: return false; } - const StringArray getOutputChannelNames() + StringArray getOutputChannelNames() { StringArray outChannels; @@ -689,7 +689,7 @@ public: return outChannels; } - const StringArray getInputChannelNames() + StringArray getInputChannelNames() { StringArray inChannels; @@ -1047,7 +1047,7 @@ public: outputDeviceNames.appendNumbersToDuplicates (false, false); } - const StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1105,7 +1105,7 @@ private: bool hasScanned; //============================================================================== - static const String getDefaultEndpoint (IMMDeviceEnumerator* const enumerator, const bool forCapture) + static String getDefaultEndpoint (IMMDeviceEnumerator* const enumerator, const bool forCapture) { String s; IMMDevice* dev = nullptr; diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 7b260eb4dc..069a3412d4 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -1389,7 +1389,7 @@ private: handleMouseEvent (0, position, currentModifiers, getMouseEventTime()); } - const StringArray getAvailableRenderingEngines() + StringArray getAvailableRenderingEngines() { StringArray s (ComponentPeer::getAvailableRenderingEngines()); @@ -2457,7 +2457,7 @@ private: compositionInProgress = false; } - const String getCompositionString (HIMC hImc, const DWORD type) const + String getCompositionString (HIMC hImc, const DWORD type) const { jassert (hImc != 0); @@ -2492,7 +2492,7 @@ private: // Get selected/highlighted range while doing composition: // returned range is relative to beginning of TextInputTarget, not composition string - const Range getCompositionSelection (HIMC hImc, LPARAM lParam) const + Range getCompositionSelection (HIMC hImc, LPARAM lParam) const { jassert (hImc != 0); int selectionStart = 0; @@ -2533,7 +2533,7 @@ private: target->setHighlightedRegion (newSelection); } - const Array > getCompositionUnderlines (HIMC hImc, LPARAM lParam) const + Array > getCompositionUnderlines (HIMC hImc, LPARAM lParam) const { Array > result; diff --git a/src/text/juce_LocalisedStrings.h b/src/text/juce_LocalisedStrings.h index 55f0e76092..4879bc9214 100644 --- a/src/text/juce_LocalisedStrings.h +++ b/src/text/juce_LocalisedStrings.h @@ -173,7 +173,7 @@ public: The country codes are supposed to be 2-character ISO complient codes. */ - const StringArray getCountryCodes() const { return countryCodes; } + const StringArray& getCountryCodes() const { return countryCodes; } //==============================================================================