From 2fb19ffd8ff6928af8cc0b2aba1388ef60174ae2 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 21 Sep 2023 14:48:07 +0100 Subject: [PATCH] Fix some LLVM 17 compiler warnings --- examples/Assets/AudioLiveScrollingDisplay.h | 4 +- examples/Assets/DSPDemos_Common.h | 36 +++--- examples/Assets/DemoUtilities.h | 11 +- examples/Audio/AudioAppDemo.h | 2 +- examples/Audio/AudioLatencyDemo.h | 6 +- examples/Audio/AudioPlaybackDemo.h | 26 ++--- examples/Audio/AudioRecordingDemo.h | 8 +- examples/Audio/AudioSettingsDemo.h | 4 +- examples/Audio/AudioSynthesiserDemo.h | 10 +- examples/Audio/MPEDemo.h | 16 +-- examples/Audio/MidiDemo.h | 10 +- examples/Audio/PluckedStringsDemo.h | 6 +- examples/Audio/SimpleFFTDemo.h | 4 +- examples/CMake/AudioPlugin/PluginEditor.h | 2 +- examples/CMake/AudioPlugin/PluginProcessor.h | 2 +- examples/CMake/GuiApp/MainComponent.h | 2 +- examples/DSP/ConvolutionDemo.h | 2 +- examples/DSP/FIRFilterDemo.h | 2 +- examples/DSP/GainDemo.h | 2 +- examples/DSP/IIRFilterDemo.h | 2 +- examples/DSP/OscillatorDemo.h | 2 +- examples/DSP/OverdriveDemo.h | 2 +- examples/DSP/SIMDRegisterDemo.h | 2 +- examples/DSP/StateVariableFilterDemo.h | 2 +- examples/DSP/WaveShaperTanhDemo.h | 2 +- examples/DemoRunner/Source/Main.cpp | 8 +- examples/GUI/AccessibilityDemo.h | 48 ++++---- examples/GUI/AnimationAppDemo.h | 2 +- examples/GUI/AnimationDemo.h | 8 +- examples/GUI/BouncingBallWavetableDemo.h | 4 +- examples/GUI/CameraDemo.h | 2 +- examples/GUI/CodeEditorDemo.h | 4 +- examples/GUI/ComponentDemo.h | 6 +- examples/GUI/ComponentTransformsDemo.h | 2 +- examples/GUI/DialogsDemo.h | 4 +- examples/GUI/FlexBoxDemo.h | 4 +- examples/GUI/FontsDemo.h | 6 +- examples/GUI/GraphicsDemo.h | 28 ++--- examples/GUI/GridDemo.h | 2 +- examples/GUI/HelloWorldDemo.h | 2 +- examples/GUI/ImagesDemo.h | 4 +- examples/GUI/KeyMappingsDemo.h | 6 +- examples/GUI/LookAndFeelDemo.h | 8 +- examples/GUI/MDIDemo.h | 10 +- examples/GUI/MenusDemo.h | 16 +-- examples/GUI/MultiTouchDemo.h | 2 +- examples/GUI/OpenGLAppDemo.h | 2 +- examples/GUI/OpenGLDemo.h | 2 +- examples/GUI/OpenGLDemo2D.h | 6 +- examples/GUI/PropertiesDemo.h | 8 +- examples/GUI/VideoDemo.h | 16 +-- examples/GUI/WebBrowserDemo.h | 4 +- examples/GUI/WidgetsDemo.h | 34 +++--- examples/GUI/WindowsDemo.h | 14 +-- examples/Plugins/ARAPluginDemo.h | 100 ++++++++-------- examples/Plugins/AUv3SynthPluginDemo.h | 8 +- examples/Plugins/ArpeggiatorPluginDemo.h | 2 +- examples/Plugins/AudioPluginDemo.h | 12 +- examples/Plugins/DSPModulePluginDemo.h | 76 ++++++------ examples/Plugins/GainPluginDemo.h | 2 +- examples/Plugins/HostPluginDemo.h | 48 ++++---- examples/Plugins/MidiLoggerPluginDemo.h | 12 +- examples/Plugins/MultiOutSynthPluginDemo.h | 2 +- examples/Plugins/NoiseGatePluginDemo.h | 2 +- .../Plugins/ReaperEmbeddedViewPluginDemo.h | 14 +-- examples/Plugins/SamplerPluginDemo.h | 82 ++++++------- examples/Plugins/SurroundPluginDemo.h | 14 +-- examples/Utilities/AnalyticsCollectionDemo.h | 4 +- examples/Utilities/Box2DDemo.h | 12 +- examples/Utilities/ChildProcessDemo.h | 16 +-- examples/Utilities/CryptographyDemo.h | 6 +- examples/Utilities/InAppPurchasesDemo.h | 14 +-- examples/Utilities/JavaScriptDemo.h | 8 +- examples/Utilities/LiveConstantDemo.h | 4 +- examples/Utilities/MultithreadingDemo.h | 14 +-- examples/Utilities/NetworkingDemo.h | 4 +- examples/Utilities/OSCDemo.h | 20 ++-- examples/Utilities/PushNotificationsDemo.h | 16 +-- examples/Utilities/SystemInfoDemo.h | 2 +- examples/Utilities/TimersAndEventsDemo.h | 14 +-- examples/Utilities/UnitTestsDemo.h | 8 +- examples/Utilities/ValueTreesDemo.h | 10 +- examples/Utilities/XMLandJSONDemo.h | 8 +- .../Source/MainComponent.h | 4 +- extras/AudioPluginHost/Source/HostStartup.cpp | 8 +- .../Source/Plugins/ARAPlugin.h | 30 ++--- .../Source/Plugins/IOConfigurationWindow.cpp | 8 +- .../Source/Plugins/IOConfigurationWindow.h | 2 +- .../Source/Plugins/InternalPlugins.cpp | 6 +- .../Source/Plugins/InternalPlugins.h | 2 +- .../Source/Plugins/PluginGraph.h | 6 +- .../Source/UI/GraphEditorPanel.cpp | 30 ++--- .../Source/UI/GraphEditorPanel.h | 14 +-- .../Source/UI/MainHostWindow.cpp | 10 +- .../Source/UI/MainHostWindow.h | 10 +- .../AudioPluginHost/Source/UI/PluginWindow.h | 14 +-- extras/Build/juceaide/Main.cpp | 4 +- .../Source/ClientComponent.h | 12 +- extras/NetworkGraphicsDemo/Source/Demos.h | 16 +-- extras/NetworkGraphicsDemo/Source/Main.cpp | 4 +- .../Source/MasterComponent.h | 12 +- .../NetworkGraphicsDemo/Source/SharedCanvas.h | 4 +- .../StartPage/jucer_ContentComponents.h | 6 +- .../StartPage/jucer_StartPageComponent.cpp | 8 +- .../StartPage/jucer_StartPageComponent.h | 2 +- .../StartPage/jucer_StartPageTreeHolder.h | 6 +- .../UserAccount/jucer_LicenseController.h | 2 +- .../UserAccount/jucer_LicenseQueryThread.h | 4 +- .../UserAccount/jucer_LoginFormComponent.h | 6 +- .../Windows/jucer_AboutWindowComponent.h | 2 +- .../jucer_EditorColourSchemeWindowComponent.h | 12 +- .../Windows/jucer_FloatingToolWindow.h | 2 +- .../jucer_GlobalPathsWindowComponent.h | 8 +- .../Windows/jucer_PIPCreatorWindowComponent.h | 6 +- .../jucer_SVGPathDataWindowComponent.h | 4 +- .../jucer_TranslationToolWindowComponent.h | 2 +- .../Windows/jucer_UTF8WindowComponent.h | 2 +- .../Source/Application/jucer_Application.cpp | 2 +- .../Source/Application/jucer_Application.h | 4 +- .../Source/Application/jucer_AutoUpdater.cpp | 4 +- .../Source/Application/jucer_AutoUpdater.h | 4 +- .../Source/Application/jucer_MainWindow.cpp | 6 +- .../Source/Application/jucer_MainWindow.h | 12 +- .../jucer_DocumentEditorComponent.h | 4 +- .../CodeEditor/jucer_ItemPreviewComponent.h | 2 +- .../CodeEditor/jucer_OpenDocumentManager.cpp | 4 +- .../CodeEditor/jucer_OpenDocumentManager.h | 2 +- .../CodeEditor/jucer_SourceCodeEditor.cpp | 2 +- .../CodeEditor/jucer_SourceCodeEditor.h | 14 +-- .../Licenses/jucer_LicenseController.cpp | 2 +- .../Modules/jucer_AvailableModulesList.h | 2 +- .../UI/Sidebar/jucer_ExporterTreeItems.h | 12 +- .../Project/UI/Sidebar/jucer_FileTreeItems.h | 10 +- .../UI/Sidebar/jucer_ModuleTreeItems.h | 22 ++-- .../UI/Sidebar/jucer_ProjectTreeItemBase.h | 4 +- .../Source/Project/UI/Sidebar/jucer_Sidebar.h | 26 ++--- .../Project/UI/jucer_ContentViewComponent.h | 4 +- .../Project/UI/jucer_ContentViewComponents.h | 14 +-- .../UI/jucer_FileGroupInformationComponent.h | 12 +- .../Source/Project/UI/jucer_HeaderComponent.h | 10 +- .../UI/jucer_ModulesInformationComponent.h | 6 +- .../UI/jucer_ProjectContentComponent.cpp | 4 +- .../UI/jucer_ProjectContentComponent.h | 8 +- .../UI/jucer_ProjectMessagesComponent.h | 18 +-- .../Project/UI/jucer_UserAvatarComponent.h | 8 +- .../Projucer/Source/Project/jucer_Project.h | 12 +- .../jucer_ProjectExport_Android.h | 4 +- .../jucer_ProjectExport_CodeBlocks.h | 6 +- .../ProjectSaving/jucer_ProjectExport_MSVC.h | 48 ++++---- .../ProjectSaving/jucer_ProjectExport_Make.h | 10 +- .../ProjectSaving/jucer_ProjectExport_Xcode.h | 8 +- .../ProjectSaving/jucer_ProjectExporter.h | 4 +- .../Source/ProjectSaving/jucer_ProjectSaver.h | 2 +- .../Settings/jucer_AppearanceSettings.h | 2 +- .../Source/Settings/jucer_StoredSettings.h | 4 +- .../Utility/Helpers/jucer_MiscUtilities.h | 4 +- .../Utility/Helpers/jucer_NewFileWizard.cpp | 6 +- .../Helpers/jucer_ValueSourceHelpers.h | 2 +- ...ucer_ValueTreePropertyWithDefaultWrapper.h | 2 +- .../jucer_ColourPropertyComponent.h | 12 +- .../jucer_FilePathPropertyComponent.h | 8 +- .../jucer_LabelPropertyComponent.h | 4 +- .../jucer_PropertyComponentsWithEnablement.h | 12 +- .../Source/Utility/UI/jucer_IconButton.h | 2 +- .../Utility/UI/jucer_JucerTreeViewBase.cpp | 6 +- .../Utility/UI/jucer_JucerTreeViewBase.h | 10 +- .../Utility/UI/jucer_ProjucerLookAndFeel.h | 2 +- .../UI/jucer_SlidingPanelComponent.cpp | 2 +- .../Utility/UI/jucer_SlidingPanelComponent.h | 2 +- extras/UnitTestRunner/Source/Main.cpp | 4 +- .../native/juce_CoreAudio_mac.cpp | 4 +- .../juce_AudioProcessorValueTreeState.h | 2 +- modules/juce_gui_basics/layout/juce_Grid.h | 6 +- .../native/juce_MainMenu_mac.mm | 4 +- .../native/juce_PerScreenDisplayLinks_mac.h | 4 +- .../documents/juce_FileBasedDocument.cpp | 110 +++++++----------- 176 files changed, 867 insertions(+), 894 deletions(-) diff --git a/examples/Assets/AudioLiveScrollingDisplay.h b/examples/Assets/AudioLiveScrollingDisplay.h index d706170dc2..a60d277063 100644 --- a/examples/Assets/AudioLiveScrollingDisplay.h +++ b/examples/Assets/AudioLiveScrollingDisplay.h @@ -24,8 +24,8 @@ /* This component scrolls a continuous waveform showing the audio that's coming into whatever audio inputs this object is connected to. */ -class LiveScrollingAudioDisplay : public AudioVisualiserComponent, - public AudioIODeviceCallback +class LiveScrollingAudioDisplay final : public AudioVisualiserComponent, + public AudioIODeviceCallback { public: LiveScrollingAudioDisplay() : AudioVisualiserComponent (1) diff --git a/examples/Assets/DSPDemos_Common.h b/examples/Assets/DSPDemos_Common.h index 555fba1bc1..6e2bf3e836 100644 --- a/examples/Assets/DSPDemos_Common.h +++ b/examples/Assets/DSPDemos_Common.h @@ -38,7 +38,7 @@ struct DSPDemoParameterBase : public ChangeBroadcaster }; //============================================================================== -struct SliderParameter : public DSPDemoParameterBase +struct SliderParameter final : public DSPDemoParameterBase { SliderParameter (Range range, double skew, double initialValue, const String& labelName, const String& suffix = {}) @@ -66,7 +66,7 @@ private: }; //============================================================================== -struct ChoiceParameter : public DSPDemoParameterBase +struct ChoiceParameter final : public DSPDemoParameterBase { ChoiceParameter (const StringArray& options, int initialId, const String& labelName) : DSPDemoParameterBase (labelName) @@ -89,11 +89,11 @@ private: }; //============================================================================== -class AudioThumbnailComponent : public Component, - public FileDragAndDropTarget, - public ChangeBroadcaster, - private ChangeListener, - private Timer +class AudioThumbnailComponent final : public Component, + public FileDragAndDropTarget, + public ChangeBroadcaster, + private ChangeListener, + private Timer { public: AudioThumbnailComponent (AudioDeviceManager& adm, AudioFormatManager& afm) @@ -217,7 +217,7 @@ private: }; //============================================================================== -class DemoParametersComponent : public Component +class DemoParametersComponent final : public Component { public: DemoParametersComponent (const std::vector& demoParams) @@ -270,9 +270,9 @@ private: //============================================================================== template -struct DSPDemo : public AudioSource, - public ProcessorWrapper, - private ChangeListener +struct DSPDemo final : public AudioSource, + public ProcessorWrapper, + private ChangeListener { DSPDemo (AudioSource& input) : inputSource (&input) @@ -327,10 +327,10 @@ struct DSPDemo : public AudioSource, //============================================================================== template -class AudioFileReaderComponent : public Component, - private TimeSliceThread, - private Value::Listener, - private ChangeListener +class AudioFileReaderComponent final : public Component, + private TimeSliceThread, + private Value::Listener, + private ChangeListener { public: //============================================================================== @@ -496,9 +496,9 @@ public: private: //============================================================================== - class AudioPlayerHeader : public Component, - private ChangeListener, - private Value::Listener + class AudioPlayerHeader final : public Component, + private ChangeListener, + private Value::Listener { public: AudioPlayerHeader (AudioDeviceManager& adm, diff --git a/examples/Assets/DemoUtilities.h b/examples/Assets/DemoUtilities.h index b2d38fffb6..b63db25b3f 100644 --- a/examples/Assets/DemoUtilities.h +++ b/examples/Assets/DemoUtilities.h @@ -218,11 +218,7 @@ inline Path getJUCELogoPath() // 0.0 and 1.0 at a random speed struct BouncingNumber { - BouncingNumber() - : speed (0.0004 + 0.0007 * Random::getSystemRandom().nextDouble()), - phase (Random::getSystemRandom().nextDouble()) - { - } + virtual ~BouncingNumber() = default; float getValue() const { @@ -231,10 +227,11 @@ struct BouncingNumber } protected: - double speed, phase; + double speed = 0.0004 + 0.0007 * Random::getSystemRandom().nextDouble(), + phase = Random::getSystemRandom().nextDouble(); }; -struct SlowerBouncingNumber : public BouncingNumber +struct SlowerBouncingNumber final : public BouncingNumber { SlowerBouncingNumber() { diff --git a/examples/Audio/AudioAppDemo.h b/examples/Audio/AudioAppDemo.h index 933edb53c7..6ae356ace4 100644 --- a/examples/Audio/AudioAppDemo.h +++ b/examples/Audio/AudioAppDemo.h @@ -50,7 +50,7 @@ //============================================================================== -class AudioAppDemo : public AudioAppComponent +class AudioAppDemo final : public AudioAppComponent { public: //============================================================================== diff --git a/examples/Audio/AudioLatencyDemo.h b/examples/Audio/AudioLatencyDemo.h index cd47e94a35..7eea520087 100644 --- a/examples/Audio/AudioLatencyDemo.h +++ b/examples/Audio/AudioLatencyDemo.h @@ -52,8 +52,8 @@ #include "../Assets/AudioLiveScrollingDisplay.h" //============================================================================== -class LatencyTester : public AudioIODeviceCallback, - private Timer +class LatencyTester final : public AudioIODeviceCallback, + private Timer { public: LatencyTester (TextEditor& editorBox) @@ -304,7 +304,7 @@ private: }; //============================================================================== -class AudioLatencyDemo : public Component +class AudioLatencyDemo final : public Component { public: AudioLatencyDemo() diff --git a/examples/Audio/AudioPlaybackDemo.h b/examples/Audio/AudioPlaybackDemo.h index 211fadd1e1..22cf658a00 100644 --- a/examples/Audio/AudioPlaybackDemo.h +++ b/examples/Audio/AudioPlaybackDemo.h @@ -48,12 +48,12 @@ #include "../Assets/DemoUtilities.h" -class DemoThumbnailComp : public Component, - public ChangeListener, - public FileDragAndDropTarget, - public ChangeBroadcaster, - private ScrollBar::Listener, - private Timer +class DemoThumbnailComp final : public Component, + public ChangeListener, + public FileDragAndDropTarget, + public ChangeBroadcaster, + private ScrollBar::Listener, + private Timer { public: DemoThumbnailComp (AudioFormatManager& formatManager, @@ -251,13 +251,13 @@ private: }; //============================================================================== -class AudioPlaybackDemo : public Component, - #if (JUCE_ANDROID || JUCE_IOS) - private Button::Listener, - #else - private FileBrowserListener, - #endif - private ChangeListener +class AudioPlaybackDemo final : public Component, + #if (JUCE_ANDROID || JUCE_IOS) + private Button::Listener, + #else + private FileBrowserListener, + #endif + private ChangeListener { public: AudioPlaybackDemo() diff --git a/examples/Audio/AudioRecordingDemo.h b/examples/Audio/AudioRecordingDemo.h index 8084383caa..a14e90d332 100644 --- a/examples/Audio/AudioRecordingDemo.h +++ b/examples/Audio/AudioRecordingDemo.h @@ -55,7 +55,7 @@ /** A simple class that acts as an AudioIODeviceCallback and writes the incoming audio data to a WAV file. */ -class AudioRecorder : public AudioIODeviceCallback +class AudioRecorder final : public AudioIODeviceCallback { public: AudioRecorder (AudioThumbnail& thumbnailToUpdate) @@ -170,8 +170,8 @@ private: }; //============================================================================== -class RecordingThumbnail : public Component, - private ChangeListener +class RecordingThumbnail final : public Component, + private ChangeListener { public: RecordingThumbnail() @@ -230,7 +230,7 @@ private: }; //============================================================================== -class AudioRecordingDemo : public Component +class AudioRecordingDemo final : public Component { public: AudioRecordingDemo() diff --git a/examples/Audio/AudioSettingsDemo.h b/examples/Audio/AudioSettingsDemo.h index 6865a086ae..91a4a0e9e5 100644 --- a/examples/Audio/AudioSettingsDemo.h +++ b/examples/Audio/AudioSettingsDemo.h @@ -51,8 +51,8 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class AudioSettingsDemo : public Component, - public ChangeListener +class AudioSettingsDemo final : public Component, + public ChangeListener { public: AudioSettingsDemo() diff --git a/examples/Audio/AudioSynthesiserDemo.h b/examples/Audio/AudioSynthesiserDemo.h index a70b3d7e84..15aa9c352c 100644 --- a/examples/Audio/AudioSynthesiserDemo.h +++ b/examples/Audio/AudioSynthesiserDemo.h @@ -53,7 +53,7 @@ //============================================================================== /** Our demo synth sound is just a basic sine wave.. */ -struct SineWaveSound : public SynthesiserSound +struct SineWaveSound final : public SynthesiserSound { bool appliesToNote (int /*midiNoteNumber*/) override { return true; } bool appliesToChannel (int /*midiChannel*/) override { return true; } @@ -61,7 +61,7 @@ struct SineWaveSound : public SynthesiserSound //============================================================================== /** Our demo synth voice just plays a sine wave.. */ -struct SineWaveVoice : public SynthesiserVoice +struct SineWaveVoice final : public SynthesiserVoice { bool canPlaySound (SynthesiserSound* sound) override { @@ -153,7 +153,7 @@ private: //============================================================================== // This is an audio source that streams the output of our demo synth. -struct SynthAudioSource : public AudioSource +struct SynthAudioSource final : public AudioSource { SynthAudioSource (MidiKeyboardState& keyState) : keyboardState (keyState) { @@ -238,7 +238,7 @@ struct SynthAudioSource : public AudioSource }; //============================================================================== -class Callback : public AudioIODeviceCallback +class Callback final : public AudioIODeviceCallback { public: Callback (AudioSourcePlayer& playerIn, LiveScrollingAudioDisplay& displayIn) @@ -283,7 +283,7 @@ private: }; //============================================================================== -class AudioSynthesiserDemo : public Component +class AudioSynthesiserDemo final : public Component { public: AudioSynthesiserDemo() diff --git a/examples/Audio/MPEDemo.h b/examples/Audio/MPEDemo.h index dfb2a4c08c..4bfd8dc665 100644 --- a/examples/Audio/MPEDemo.h +++ b/examples/Audio/MPEDemo.h @@ -95,7 +95,7 @@ private: }; //============================================================================== -class MPESetupComponent : public Component +class MPESetupComponent final : public Component { public: //============================================================================== @@ -349,8 +349,8 @@ private: }; //============================================================================== -class ZoneLayoutComponent : public Component, - private MPEInstrument::Listener +class ZoneLayoutComponent final : public Component, + private MPEInstrument::Listener { public: //============================================================================== @@ -466,7 +466,7 @@ private: }; //============================================================================== -class MPEDemoSynthVoice : public MPESynthesiserVoice +class MPEDemoSynthVoice final : public MPESynthesiserVoice { public: //============================================================================== @@ -622,10 +622,10 @@ private: }; //============================================================================== -class MPEDemo : public Component, - private AudioIODeviceCallback, - private MidiInputCallback, - private MPEInstrument::Listener +class MPEDemo final : public Component, + private AudioIODeviceCallback, + private MidiInputCallback, + private MPEInstrument::Listener { public: //============================================================================== diff --git a/examples/Audio/MidiDemo.h b/examples/Audio/MidiDemo.h index 6287818ada..821610f47f 100644 --- a/examples/Audio/MidiDemo.h +++ b/examples/Audio/MidiDemo.h @@ -50,7 +50,7 @@ //============================================================================== -struct MidiDeviceListEntry : ReferenceCountedObject +struct MidiDeviceListEntry final : ReferenceCountedObject { explicit MidiDeviceListEntry (MidiDeviceInfo info) : deviceInfo (info) {} @@ -72,10 +72,10 @@ struct MidiDeviceListEntry : ReferenceCountedObject //============================================================================== -class MidiDemo : public Component, - private MidiKeyboardState::Listener, - private MidiInputCallback, - private AsyncUpdater +class MidiDemo final : public Component, + private MidiKeyboardState::Listener, + private MidiInputCallback, + private AsyncUpdater { public: //============================================================================== diff --git a/examples/Audio/PluckedStringsDemo.h b/examples/Audio/PluckedStringsDemo.h index e6d5e09249..18e0761907 100644 --- a/examples/Audio/PluckedStringsDemo.h +++ b/examples/Audio/PluckedStringsDemo.h @@ -172,8 +172,8 @@ private: This component represents a horizontal vibrating musical string of fixed height and variable length. The string can be excited by calling stringPlucked(). */ -class StringComponent : public Component, - private Timer +class StringComponent final : public Component, + private Timer { public: StringComponent (int lengthInPixels, Colour stringColour) @@ -249,7 +249,7 @@ private: }; //============================================================================== -class PluckedStringsDemo : public AudioAppComponent +class PluckedStringsDemo final : public AudioAppComponent { public: PluckedStringsDemo() diff --git a/examples/Audio/SimpleFFTDemo.h b/examples/Audio/SimpleFFTDemo.h index 9fef62ca67..2fdba45838 100644 --- a/examples/Audio/SimpleFFTDemo.h +++ b/examples/Audio/SimpleFFTDemo.h @@ -50,8 +50,8 @@ //============================================================================== -class SimpleFFTDemo : public AudioAppComponent, - private Timer +class SimpleFFTDemo final : public AudioAppComponent, + private Timer { public: SimpleFFTDemo() : diff --git a/examples/CMake/AudioPlugin/PluginEditor.h b/examples/CMake/AudioPlugin/PluginEditor.h index ef96e04a3a..ac7cbbc216 100644 --- a/examples/CMake/AudioPlugin/PluginEditor.h +++ b/examples/CMake/AudioPlugin/PluginEditor.h @@ -3,7 +3,7 @@ #include "PluginProcessor.h" //============================================================================== -class AudioPluginAudioProcessorEditor : public juce::AudioProcessorEditor +class AudioPluginAudioProcessorEditor final : public juce::AudioProcessorEditor { public: explicit AudioPluginAudioProcessorEditor (AudioPluginAudioProcessor&); diff --git a/examples/CMake/AudioPlugin/PluginProcessor.h b/examples/CMake/AudioPlugin/PluginProcessor.h index 61413bb185..f3398947e1 100644 --- a/examples/CMake/AudioPlugin/PluginProcessor.h +++ b/examples/CMake/AudioPlugin/PluginProcessor.h @@ -3,7 +3,7 @@ #include //============================================================================== -class AudioPluginAudioProcessor : public juce::AudioProcessor +class AudioPluginAudioProcessor final : public juce::AudioProcessor { public: //============================================================================== diff --git a/examples/CMake/GuiApp/MainComponent.h b/examples/CMake/GuiApp/MainComponent.h index 042c8cb6ac..cfb5a52e5e 100644 --- a/examples/CMake/GuiApp/MainComponent.h +++ b/examples/CMake/GuiApp/MainComponent.h @@ -11,7 +11,7 @@ This component lives inside our window, and this is where you should put all your controls and content. */ -class MainComponent : public juce::Component +class MainComponent final : public juce::Component { public: //============================================================================== diff --git a/examples/DSP/ConvolutionDemo.h b/examples/DSP/ConvolutionDemo.h index dbcf63ea68..aad9ec8870 100644 --- a/examples/DSP/ConvolutionDemo.h +++ b/examples/DSP/ConvolutionDemo.h @@ -186,7 +186,7 @@ struct ConvolutionDemoDSP std::vector parameters { &cabinetParam }; }; -struct ConvolutionDemo : public Component +struct ConvolutionDemo final : public Component { ConvolutionDemo() { diff --git a/examples/DSP/FIRFilterDemo.h b/examples/DSP/FIRFilterDemo.h index ffbf386676..565e04748e 100644 --- a/examples/DSP/FIRFilterDemo.h +++ b/examples/DSP/FIRFilterDemo.h @@ -98,7 +98,7 @@ struct FIRFilterDemoDSP std::vector parameters { &cutoffParam, &typeParam }; }; -struct FIRFilterDemo : public Component +struct FIRFilterDemo final : public Component { FIRFilterDemo() { diff --git a/examples/DSP/GainDemo.h b/examples/DSP/GainDemo.h index 4c59c2403e..f85ec9560b 100644 --- a/examples/DSP/GainDemo.h +++ b/examples/DSP/GainDemo.h @@ -83,7 +83,7 @@ struct GainDemoDSP std::vector parameters { &gainParam }; }; -struct GainDemo : public Component +struct GainDemo final : public Component { GainDemo() { diff --git a/examples/DSP/IIRFilterDemo.h b/examples/DSP/IIRFilterDemo.h index 92c8e0730f..ebc3f63508 100644 --- a/examples/DSP/IIRFilterDemo.h +++ b/examples/DSP/IIRFilterDemo.h @@ -102,7 +102,7 @@ struct IIRFilterDemoDSP double sampleRate = 0.0; }; -struct IIRFilterDemo : public Component +struct IIRFilterDemo final : public Component { IIRFilterDemo() { diff --git a/examples/DSP/OscillatorDemo.h b/examples/DSP/OscillatorDemo.h index 131b6d24e4..6fe948268c 100644 --- a/examples/DSP/OscillatorDemo.h +++ b/examples/DSP/OscillatorDemo.h @@ -134,7 +134,7 @@ struct OscillatorDemoDSP std::vector parameters { &typeParam, &accuracy, &freqParam, &gainParam, &mixParam }; }; -struct OscillatorDemo : public Component +struct OscillatorDemo final : public Component { OscillatorDemo() { diff --git a/examples/DSP/OverdriveDemo.h b/examples/DSP/OverdriveDemo.h index 84f0242ecb..190229ebe4 100644 --- a/examples/DSP/OverdriveDemo.h +++ b/examples/DSP/OverdriveDemo.h @@ -113,7 +113,7 @@ struct OverdriveDemoDSP double sampleRate = 0.0; }; -struct OverdriveDemo : public Component +struct OverdriveDemo final : public Component { OverdriveDemo() { diff --git a/examples/DSP/SIMDRegisterDemo.h b/examples/DSP/SIMDRegisterDemo.h index a4ccd4cd78..7ad2f06410 100644 --- a/examples/DSP/SIMDRegisterDemo.h +++ b/examples/DSP/SIMDRegisterDemo.h @@ -156,7 +156,7 @@ struct SIMDRegisterDemoDSP double sampleRate = 0.0; }; -struct SIMDRegisterDemo : public Component +struct SIMDRegisterDemo final : public Component { SIMDRegisterDemo() { diff --git a/examples/DSP/StateVariableFilterDemo.h b/examples/DSP/StateVariableFilterDemo.h index d92479cdca..83c83935a6 100644 --- a/examples/DSP/StateVariableFilterDemo.h +++ b/examples/DSP/StateVariableFilterDemo.h @@ -100,7 +100,7 @@ struct StateVariableFilterDemoDSP double sampleRate = 0.0; }; -struct StateVariableFilterDemo : public Component +struct StateVariableFilterDemo final : public Component { StateVariableFilterDemo() { diff --git a/examples/DSP/WaveShaperTanhDemo.h b/examples/DSP/WaveShaperTanhDemo.h index 9f512e145c..24f134c6de 100644 --- a/examples/DSP/WaveShaperTanhDemo.h +++ b/examples/DSP/WaveShaperTanhDemo.h @@ -82,7 +82,7 @@ struct WaveShaperTanhDemoDSP std::vector parameters { &accuracy }; // no params for this demo }; -struct WaveShaperTanhDemo : public Component +struct WaveShaperTanhDemo final : public Component { WaveShaperTanhDemo() { diff --git a/examples/DemoRunner/Source/Main.cpp b/examples/DemoRunner/Source/Main.cpp index 69084f3e91..c476dc82c9 100644 --- a/examples/DemoRunner/Source/Main.cpp +++ b/examples/DemoRunner/Source/Main.cpp @@ -31,8 +31,8 @@ //============================================================================== #if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD // Just add a simple icon to the Window system tray area or Mac menu bar.. - struct DemoTaskbarComponent : public SystemTrayIconComponent, - private Timer + struct DemoTaskbarComponent final : public SystemTrayIconComponent, + private Timer { DemoTaskbarComponent() { @@ -76,7 +76,7 @@ std::unique_ptr sharedAudioDeviceManager; //============================================================================== -class DemoRunnerApplication : public JUCEApplication +class DemoRunnerApplication final : public JUCEApplication { public: //============================================================================== @@ -117,7 +117,7 @@ public: ApplicationCommandManager& getGlobalCommandManager() { return commandManager; } private: - class MainAppWindow : public DocumentWindow + class MainAppWindow final : public DocumentWindow { public: MainAppWindow (const String& name) diff --git a/examples/GUI/AccessibilityDemo.h b/examples/GUI/AccessibilityDemo.h index c3641a132c..9458966a48 100644 --- a/examples/GUI/AccessibilityDemo.h +++ b/examples/GUI/AccessibilityDemo.h @@ -57,7 +57,7 @@ This component sets its accessibility title and help text properties and also acts as a focus container for its children. */ -class ContentComponent : public Component +class ContentComponent final : public Component { public: ContentComponent (const String& title, const String& info, Component& contentToDisplay) @@ -96,8 +96,8 @@ public: private: //============================================================================== - struct InfoIcon : public Component, - public SettableTooltipClient + struct InfoIcon final : public Component, + public SettableTooltipClient { InfoIcon() { @@ -151,7 +151,7 @@ private: visible and controllable by accessibility clients. There are a few examples of some widgets in this demo such as Sliders, Buttons and a TreeView. */ -class JUCEWidgetsComponent : public Component +class JUCEWidgetsComponent final : public Component { public: JUCEWidgetsComponent() @@ -184,7 +184,7 @@ public: private: //============================================================================== - class ButtonsComponent : public Component + class ButtonsComponent final : public Component { public: ButtonsComponent() @@ -217,7 +217,7 @@ private: private: //============================================================================== - struct RadioButtonsGroupComponent : public Component + struct RadioButtonsGroupComponent final : public Component { RadioButtonsGroupComponent() { @@ -263,7 +263,7 @@ private: }; //============================================================================== - class SlidersComponent : public Component + class SlidersComponent final : public Component { public: SlidersComponent() @@ -317,7 +317,7 @@ private: }; //============================================================================== - class TreeViewComponent : public Component + class TreeViewComponent final : public Component { public: TreeViewComponent() @@ -335,7 +335,7 @@ private: private: //============================================================================== - struct RootItem : public TreeViewItem + struct RootItem final : public TreeViewItem { RootItem() { @@ -447,7 +447,7 @@ constexpr NameAndRole accessibilityRoles[] Component::createAccessibilityHandler() method to return a custom AccessibilityHandler. The properties of this handler are set by the various controls in the demo. */ -class CustomWidgetComponent : public Component +class CustomWidgetComponent final : public Component { public: CustomWidgetComponent() @@ -488,7 +488,7 @@ public: private: //============================================================================== - class AccessibleComponent : public Component + class AccessibleComponent final : public Component { public: explicit AccessibleComponent (CustomWidgetComponent& owner) @@ -543,7 +543,7 @@ private: }; //============================================================================== - class InfoComponent : public Component + class InfoComponent final : public Component { public: explicit InfoComponent (CustomWidgetComponent& owner) @@ -636,7 +636,7 @@ private: }; //============================================================================== - class ActionsComponent : public Component + class ActionsComponent final : public Component { public: explicit ActionsComponent (CustomWidgetComponent& owner) @@ -675,8 +675,8 @@ private: private: //============================================================================== - class AccessibilityActionComponent : public Component, - private Timer + class AccessibilityActionComponent final : public Component, + private Timer { public: AccessibilityActionComponent (CustomWidgetComponent& owner, @@ -769,7 +769,7 @@ private: }; //============================================================================== - class ValueInterfaceComponent : public Component + class ValueInterfaceComponent final : public Component { public: explicit ValueInterfaceComponent (CustomWidgetComponent& owner) @@ -883,7 +883,7 @@ private: private: //============================================================================== - struct RangedValueComponent : public Component + struct RangedValueComponent final : public Component { RangedValueComponent() { @@ -986,7 +986,7 @@ private: }; //============================================================================== - class StateComponent : public Component + class StateComponent final : public Component { public: StateComponent() @@ -1096,7 +1096,7 @@ private: /** The top-level component containing an example of custom child component navigation. */ -class CustomNavigationComponent : public Component +class CustomNavigationComponent final : public Component { public: CustomNavigationComponent() @@ -1126,7 +1126,7 @@ public: private: //============================================================================== - class NavigableComponentsHolder : public Component + class NavigableComponentsHolder final : public Component { public: NavigableComponentsHolder() @@ -1163,7 +1163,7 @@ private: std::unique_ptr createFocusTraverser() override { - struct CustomTraverser : public FocusTraverser + struct CustomTraverser final : public FocusTraverser { explicit CustomTraverser (NavigableComponentsHolder& owner) : navigableComponentsHolder (owner) {} @@ -1221,7 +1221,7 @@ private: } private: - struct NavigableComponent : public Component + struct NavigableComponent final : public Component { NavigableComponent (int index, int total, NavigableComponentsHolder& owner) { @@ -1360,7 +1360,7 @@ private: screen reader application to be read out along with a priority determining how it should be read out (whether it should interrupt other announcements, etc.). */ -class AnnouncementsComponent : public Component +class AnnouncementsComponent final : public Component { public: AnnouncementsComponent() @@ -1442,7 +1442,7 @@ private: This just contains a TabbedComponent with a tab for each of the top-level demos. */ -class AccessibilityDemo : public Component +class AccessibilityDemo final : public Component { public: AccessibilityDemo() diff --git a/examples/GUI/AnimationAppDemo.h b/examples/GUI/AnimationAppDemo.h index 8d92e06f10..6d4e768132 100644 --- a/examples/GUI/AnimationAppDemo.h +++ b/examples/GUI/AnimationAppDemo.h @@ -52,7 +52,7 @@ This component lives inside our window, and this is where you should put all your controls and content. */ -class AnimationAppDemo : public AnimatedAppComponent +class AnimationAppDemo final : public AnimatedAppComponent { public: //============================================================================== diff --git a/examples/GUI/AnimationDemo.h b/examples/GUI/AnimationDemo.h index 11e1bbe469..a8b73d5dff 100644 --- a/examples/GUI/AnimationDemo.h +++ b/examples/GUI/AnimationDemo.h @@ -50,7 +50,7 @@ //============================================================================== /** This will be the source of our balls and can be dragged around. */ -class BallGeneratorComponent : public Component +class BallGeneratorComponent final : public Component { public: BallGeneratorComponent() {} @@ -93,7 +93,7 @@ private: }; //============================================================================== -struct BallComponent : public Component +struct BallComponent final : public Component { BallComponent (Point pos) : position (pos), @@ -136,8 +136,8 @@ struct BallComponent : public Component }; //============================================================================== -class AnimationDemo : public Component, - private Timer +class AnimationDemo final : public Component, + private Timer { public: AnimationDemo() diff --git a/examples/GUI/BouncingBallWavetableDemo.h b/examples/GUI/BouncingBallWavetableDemo.h index 1c121a1b8f..d02c9588a0 100644 --- a/examples/GUI/BouncingBallWavetableDemo.h +++ b/examples/GUI/BouncingBallWavetableDemo.h @@ -50,8 +50,8 @@ //============================================================================== -class BouncingBallWavetableDemo : public AudioAppComponent, - private Timer +class BouncingBallWavetableDemo final : public AudioAppComponent, + private Timer { public: //============================================================================== diff --git a/examples/GUI/CameraDemo.h b/examples/GUI/CameraDemo.h index f49eed85a7..58d3e2e70f 100644 --- a/examples/GUI/CameraDemo.h +++ b/examples/GUI/CameraDemo.h @@ -50,7 +50,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class CameraDemo : public Component +class CameraDemo final : public Component { public: CameraDemo() diff --git a/examples/GUI/CodeEditorDemo.h b/examples/GUI/CodeEditorDemo.h index 11521fafa9..f823376a99 100644 --- a/examples/GUI/CodeEditorDemo.h +++ b/examples/GUI/CodeEditorDemo.h @@ -53,8 +53,8 @@ #endif //============================================================================== -class CodeEditorDemo : public Component, - private FilenameComponentListener +class CodeEditorDemo final : public Component, + private FilenameComponentListener { public: CodeEditorDemo() diff --git a/examples/GUI/ComponentDemo.h b/examples/GUI/ComponentDemo.h index 9202257f7a..1078e3002f 100644 --- a/examples/GUI/ComponentDemo.h +++ b/examples/GUI/ComponentDemo.h @@ -51,7 +51,7 @@ /** This class represents one of the individual lights in our grid. */ -class ToggleLightComponent : public Component +class ToggleLightComponent final : public Component { public: ToggleLightComponent() {} @@ -84,7 +84,7 @@ private: /** This is the parent class that holds multiple ToggleLightComponents in a grid. */ -class ToggleLightGridComponent : public Component +class ToggleLightGridComponent final : public Component { public: ToggleLightGridComponent() @@ -134,7 +134,7 @@ private: This component lives inside our window, and this is where you should put all your controls and content. */ -class ComponentDemo : public Component +class ComponentDemo final : public Component { public: //============================================================================== diff --git a/examples/GUI/ComponentTransformsDemo.h b/examples/GUI/ComponentTransformsDemo.h index 3cda30d045..0a26b131d8 100644 --- a/examples/GUI/ComponentTransformsDemo.h +++ b/examples/GUI/ComponentTransformsDemo.h @@ -50,7 +50,7 @@ #include "WidgetsDemo.h" //============================================================================== -class ComponentTransformsDemo : public Component +class ComponentTransformsDemo final : public Component { public: ComponentTransformsDemo() diff --git a/examples/GUI/DialogsDemo.h b/examples/GUI/DialogsDemo.h index 25770d36a4..08ebe4e458 100644 --- a/examples/GUI/DialogsDemo.h +++ b/examples/GUI/DialogsDemo.h @@ -55,7 +55,7 @@ struct MessageBoxOwnerComponent : public Component }; //============================================================================== -class DemoBackgroundThread : public ThreadWithProgressWindow +class DemoBackgroundThread final : public ThreadWithProgressWindow { public: explicit DemoBackgroundThread (MessageBoxOwnerComponent& comp) @@ -117,7 +117,7 @@ public: //============================================================================== -class DialogsDemo : public MessageBoxOwnerComponent +class DialogsDemo final : public MessageBoxOwnerComponent { public: enum DialogType diff --git a/examples/GUI/FlexBoxDemo.h b/examples/GUI/FlexBoxDemo.h index 2f9d0138f8..1daa078db7 100644 --- a/examples/GUI/FlexBoxDemo.h +++ b/examples/GUI/FlexBoxDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -struct DemoFlexPanel : public Component +struct DemoFlexPanel final : public Component { DemoFlexPanel (Colour col, FlexItem& item) : flexItem (item), colour (col) @@ -163,7 +163,7 @@ struct DemoFlexPanel : public Component }; //============================================================================== -struct FlexBoxDemo : public juce::Component +struct FlexBoxDemo final : public juce::Component { FlexBoxDemo() { diff --git a/examples/GUI/FontsDemo.h b/examples/GUI/FontsDemo.h index 6a08d6a28f..ba79d9ec21 100644 --- a/examples/GUI/FontsDemo.h +++ b/examples/GUI/FontsDemo.h @@ -49,9 +49,9 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class FontsDemo : public Component, - private ListBoxModel, - private Slider::Listener +class FontsDemo final : public Component, + private ListBoxModel, + private Slider::Listener { public: FontsDemo() diff --git a/examples/GUI/GraphicsDemo.h b/examples/GUI/GraphicsDemo.h index 8d005ba4cd..1634081a37 100644 --- a/examples/GUI/GraphicsDemo.h +++ b/examples/GUI/GraphicsDemo.h @@ -50,7 +50,7 @@ //============================================================================== /** Holds the various toggle buttons for the animation modes. */ -class ControllersComponent : public Component +class ControllersComponent final : public Component { public: ControllersComponent() @@ -113,7 +113,7 @@ public: }; //============================================================================== -class GraphicsDemoBase : public Component +class GraphicsDemoBase : public Component { public: GraphicsDemoBase (ControllersComponent& cc, const String& name) @@ -280,7 +280,7 @@ public: }; //============================================================================== -class RectangleFillTypesDemo : public GraphicsDemoBase +class RectangleFillTypesDemo final : public GraphicsDemoBase { public: RectangleFillTypesDemo (ControllersComponent& cc) @@ -316,7 +316,7 @@ public: }; //============================================================================== -class PathsDemo : public GraphicsDemoBase +class PathsDemo final : public GraphicsDemoBase { public: PathsDemo (ControllersComponent& cc, bool linear, bool radial) @@ -377,7 +377,7 @@ public: }; //============================================================================== -class StrokesDemo : public GraphicsDemoBase +class StrokesDemo final : public GraphicsDemoBase { public: StrokesDemo (ControllersComponent& cc) @@ -410,7 +410,7 @@ public: }; //============================================================================== -class ImagesRenderingDemo : public GraphicsDemoBase +class ImagesRenderingDemo final : public GraphicsDemoBase { public: ImagesRenderingDemo (ControllersComponent& cc, bool argb, bool tiled) @@ -448,7 +448,7 @@ public: }; //============================================================================== -class GlyphsDemo : public GraphicsDemoBase +class GlyphsDemo final : public GraphicsDemoBase { public: GlyphsDemo (ControllersComponent& cc) @@ -468,7 +468,7 @@ public: }; //============================================================================== -class SVGDemo : public GraphicsDemoBase +class SVGDemo final : public GraphicsDemoBase { public: SVGDemo (ControllersComponent& cc) @@ -513,7 +513,7 @@ public: }; //============================================================================== -class LinesDemo : public GraphicsDemoBase +class LinesDemo final : public GraphicsDemoBase { public: LinesDemo (ControllersComponent& cc) @@ -576,8 +576,8 @@ public: }; //============================================================================== -class DemoHolderComponent : public Component, - private Timer +class DemoHolderComponent final : public Component, + private Timer { public: DemoHolderComponent() @@ -623,8 +623,8 @@ private: }; //============================================================================== -class TestListComponent : public Component, - private ListBoxModel +class TestListComponent final : public Component, + private ListBoxModel { public: TestListComponent (DemoHolderComponent& holder, ControllersComponent& controls) @@ -695,7 +695,7 @@ private: }; //============================================================================== -class GraphicsDemo : public Component +class GraphicsDemo final : public Component { public: GraphicsDemo() diff --git a/examples/GUI/GridDemo.h b/examples/GUI/GridDemo.h index d159c52f07..30d082ac2a 100644 --- a/examples/GUI/GridDemo.h +++ b/examples/GUI/GridDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -struct GridDemo : public Component +struct GridDemo final : public Component { GridDemo() { diff --git a/examples/GUI/HelloWorldDemo.h b/examples/GUI/HelloWorldDemo.h index c5eb7d5486..84454d2691 100644 --- a/examples/GUI/HelloWorldDemo.h +++ b/examples/GUI/HelloWorldDemo.h @@ -48,7 +48,7 @@ //============================================================================== -class HelloWorldDemo : public Component +class HelloWorldDemo final : public Component { public: //============================================================================== diff --git a/examples/GUI/ImagesDemo.h b/examples/GUI/ImagesDemo.h index 6a112533ca..226a3e94c2 100644 --- a/examples/GUI/ImagesDemo.h +++ b/examples/GUI/ImagesDemo.h @@ -49,8 +49,8 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class ImagesDemo : public Component, - public FileBrowserListener +class ImagesDemo final : public Component, + public FileBrowserListener { public: ImagesDemo() diff --git a/examples/GUI/KeyMappingsDemo.h b/examples/GUI/KeyMappingsDemo.h index f4501855fe..c43a5db05b 100644 --- a/examples/GUI/KeyMappingsDemo.h +++ b/examples/GUI/KeyMappingsDemo.h @@ -66,8 +66,8 @@ enum KeyPressCommandIDs This is a simple target for the key-presses which will live inside the demo component and contains a button that can be moved around with the arrow keys. */ -class KeyPressTarget : public Component, - public ApplicationCommandTarget +class KeyPressTarget final : public Component, + public ApplicationCommandTarget { public: KeyPressTarget() @@ -213,7 +213,7 @@ private: }; //============================================================================== -class KeyMappingsDemo : public Component +class KeyMappingsDemo final : public Component { public: KeyMappingsDemo() diff --git a/examples/GUI/LookAndFeelDemo.h b/examples/GUI/LookAndFeelDemo.h index 374b9396a0..fc82d99fa7 100644 --- a/examples/GUI/LookAndFeelDemo.h +++ b/examples/GUI/LookAndFeelDemo.h @@ -55,7 +55,7 @@ It's a good idea not to hard code your colours, use the findColour method along with appropriate ColourIds so you can set these on a per-component basis. */ -struct CustomLookAndFeel : public LookAndFeel_V4 +struct CustomLookAndFeel : public LookAndFeel_V4 { void drawRoundThumb (Graphics& g, float x, float y, float diameter, Colour colour, float outlineThickness) { @@ -296,7 +296,7 @@ struct CustomLookAndFeel : public LookAndFeel_V4 This inherits from CustomLookAndFeel above for the linear bar and slider backgrounds. */ -struct SquareLookAndFeel : public CustomLookAndFeel +struct SquareLookAndFeel final : public CustomLookAndFeel { void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour, bool isMouseOverButton, bool isButtonDown) override @@ -434,7 +434,7 @@ struct SquareLookAndFeel : public CustomLookAndFeel }; //============================================================================== -struct LookAndFeelDemoComponent : public Component +struct LookAndFeelDemoComponent final : public Component { LookAndFeelDemoComponent() { @@ -521,7 +521,7 @@ struct LookAndFeelDemoComponent : public Component }; //============================================================================== -class LookAndFeelDemo : public Component +class LookAndFeelDemo final : public Component { public: LookAndFeelDemo() diff --git a/examples/GUI/MDIDemo.h b/examples/GUI/MDIDemo.h index 0c877583c0..0d05649234 100644 --- a/examples/GUI/MDIDemo.h +++ b/examples/GUI/MDIDemo.h @@ -53,8 +53,8 @@ also listen to changes in the text and mark the FileBasedDocument as 'dirty'. This 'dirty' flag is used to prompt the user to save the note when it is closed. */ -class Note : public Component, - public FileBasedDocument +class Note final : public Component, + public FileBasedDocument { public: Note (const String& name, const String& contents) @@ -133,7 +133,7 @@ private: //============================================================================== /** Simple MultiDocumentPanel that just tries to save our notes when they are closed. */ -class DemoMultiDocumentPanel : public MultiDocumentPanel +class DemoMultiDocumentPanel final : public MultiDocumentPanel { public: DemoMultiDocumentPanel() = default; @@ -165,8 +165,8 @@ private: /** Simple multi-document panel that manages a number of notes that you can store to files. By default this will look for notes saved to the desktop and load them up. */ -class MDIDemo : public Component, - public FileDragAndDropTarget +class MDIDemo final : public Component, + public FileDragAndDropTarget { public: MDIDemo() diff --git a/examples/GUI/MenusDemo.h b/examples/GUI/MenusDemo.h index 8f3abdc221..37b553e51d 100644 --- a/examples/GUI/MenusDemo.h +++ b/examples/GUI/MenusDemo.h @@ -54,7 +54,7 @@ is enabled. It contains an icon that can be used to show the side panel containing the menu. */ -struct BurgerMenuHeader : public Component +struct BurgerMenuHeader final : public Component { BurgerMenuHeader (SidePanel& sp) : sidePanel (sp) @@ -120,9 +120,9 @@ private: }; //============================================================================== -class MenusDemo : public Component, - public ApplicationCommandTarget, - public MenuBarModel +class MenusDemo final : public Component, + public ApplicationCommandTarget, + public MenuBarModel { public: //============================================================================== @@ -341,8 +341,8 @@ private: Command messages that aren't handled in the main component will be passed to this class to respond to. */ - class OuterCommandTarget : public Component, - public ApplicationCommandTarget + class OuterCommandTarget final : public Component, + public ApplicationCommandTarget { public: OuterCommandTarget (ApplicationCommandManager& m) @@ -430,8 +430,8 @@ private: Command messages that aren't handled in the OuterCommandTarget will be passed to this class to respond to. */ - struct InnerCommandTarget : public Component, - public ApplicationCommandTarget + struct InnerCommandTarget final : public Component, + public ApplicationCommandTarget { InnerCommandTarget (ApplicationCommandManager& m) : commandManager (m) diff --git a/examples/GUI/MultiTouchDemo.h b/examples/GUI/MultiTouchDemo.h index df7dabefc1..993f5048e2 100644 --- a/examples/GUI/MultiTouchDemo.h +++ b/examples/GUI/MultiTouchDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class MultiTouchDemo : public Component +class MultiTouchDemo final : public Component { public: MultiTouchDemo() diff --git a/examples/GUI/OpenGLAppDemo.h b/examples/GUI/OpenGLAppDemo.h index 2fbcc8b1fb..e36626fdbb 100644 --- a/examples/GUI/OpenGLAppDemo.h +++ b/examples/GUI/OpenGLAppDemo.h @@ -54,7 +54,7 @@ This component lives inside our window, and this is where you should put all your controls and content. */ -class OpenGLAppDemo : public OpenGLAppComponent +class OpenGLAppDemo final : public OpenGLAppComponent { public: //============================================================================== diff --git a/examples/GUI/OpenGLDemo.h b/examples/GUI/OpenGLDemo.h index 5f38288dfd..9bfe8bcacd 100644 --- a/examples/GUI/OpenGLDemo.h +++ b/examples/GUI/OpenGLDemo.h @@ -951,7 +951,7 @@ private: Graphics g (*glRenderer); g.addTransform (AffineTransform::scale (desktopScale)); - for (auto s : stars) + for (const auto& s : stars) { auto size = 0.25f; diff --git a/examples/GUI/OpenGLDemo2D.h b/examples/GUI/OpenGLDemo2D.h index a12657caa2..a8aee9a924 100644 --- a/examples/GUI/OpenGLDemo2D.h +++ b/examples/GUI/OpenGLDemo2D.h @@ -49,9 +49,9 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class OpenGLDemo2D : public Component, - private CodeDocument::Listener, - private Timer +class OpenGLDemo2D final : public Component, + private CodeDocument::Listener, + private Timer { public: OpenGLDemo2D() diff --git a/examples/GUI/PropertiesDemo.h b/examples/GUI/PropertiesDemo.h index 39b90167fe..d736875a9b 100644 --- a/examples/GUI/PropertiesDemo.h +++ b/examples/GUI/PropertiesDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class DemoButtonPropertyComponent : public ButtonPropertyComponent +class DemoButtonPropertyComponent final : public ButtonPropertyComponent { public: DemoButtonPropertyComponent (const String& propertyName) @@ -80,7 +80,7 @@ private: }; //============================================================================== -class DemoSliderPropertyComponent : public SliderPropertyComponent +class DemoSliderPropertyComponent final : public SliderPropertyComponent { public: DemoSliderPropertyComponent (const String& propertyName) @@ -162,8 +162,8 @@ static Array createChoices (int howMany) } //============================================================================== -class PropertiesDemo : public Component, - private Timer +class PropertiesDemo final : public Component, + private Timer { public: PropertiesDemo() diff --git a/examples/GUI/VideoDemo.h b/examples/GUI/VideoDemo.h index 569ea6f92c..23bcdedbac 100644 --- a/examples/GUI/VideoDemo.h +++ b/examples/GUI/VideoDemo.h @@ -51,9 +51,9 @@ #if JUCE_MAC || JUCE_WINDOWS //============================================================================== // so that we can easily have two video windows each with a file browser, wrap this up as a class.. -class MovieComponentWithFileBrowser : public Component, - public DragAndDropTarget, - private FilenameComponentListener +class MovieComponentWithFileBrowser final : public Component, + public DragAndDropTarget, + private FilenameComponentListener { public: MovieComponentWithFileBrowser() @@ -147,9 +147,9 @@ private: }; //============================================================================== -class VideoDemo : public Component, - public DragAndDropContainer, - private FileBrowserListener +class VideoDemo final : public Component, + public DragAndDropContainer, + private FileBrowserListener { public: VideoDemo() @@ -269,8 +269,8 @@ private: }; #elif JUCE_IOS || JUCE_ANDROID //============================================================================== -class VideoDemo : public Component, - private Timer +class VideoDemo final : public Component, + private Timer { public: VideoDemo() diff --git a/examples/GUI/WebBrowserDemo.h b/examples/GUI/WebBrowserDemo.h index 0148c95cf2..ffe25d746e 100644 --- a/examples/GUI/WebBrowserDemo.h +++ b/examples/GUI/WebBrowserDemo.h @@ -55,7 +55,7 @@ when the browser changes URL. You don't need to do this, you can just also just use the WebBrowserComponent class directly. */ -class DemoBrowserComponent : public WebBrowserComponent +class DemoBrowserComponent final : public WebBrowserComponent { public: //============================================================================== @@ -89,7 +89,7 @@ private: //============================================================================== -class WebBrowserDemo : public Component +class WebBrowserDemo final : public Component { public: WebBrowserDemo() diff --git a/examples/GUI/WidgetsDemo.h b/examples/GUI/WidgetsDemo.h index b1751a08b7..956d124e96 100644 --- a/examples/GUI/WidgetsDemo.h +++ b/examples/GUI/WidgetsDemo.h @@ -59,7 +59,7 @@ static void showBubbleMessage (Component& targetComponent, const String& textToS /** To demonstrate how sliders can have custom snapping applied to their values, this simple class snaps the value to 50 if it comes near. */ -struct SnappingSlider : public Slider +struct SnappingSlider final : public Slider { double snapValue (double attemptedValue, DragMode dragMode) override { @@ -74,8 +74,8 @@ struct SnappingSlider : public Slider }; /** A TextButton that pops up a colour chooser to change its colours. */ -class ColourChangeButton : public TextButton, - public ChangeListener +class ColourChangeButton final : public TextButton, + public ChangeListener { public: ColourChangeButton() @@ -112,7 +112,7 @@ public: }; //============================================================================== -struct SlidersPage : public Component +struct SlidersPage final : public Component { SlidersPage() { @@ -261,7 +261,7 @@ private: }; //============================================================================== -struct ButtonsPage : public Component +struct ButtonsPage final : public Component { ButtonsPage (bool isRunningComponentTransformDemo) { @@ -461,8 +461,8 @@ private: //============================================================================== -struct MiscPage : public Component, - private Timer +struct MiscPage final : public Component, + private Timer { MiscPage() { @@ -540,7 +540,7 @@ struct MiscPage : public Component, }; //============================================================================== -struct MenuPage : public Component +struct MenuPage final : public Component { MenuPage() { @@ -735,8 +735,8 @@ struct MenuPage : public Component }; //============================================================================== -class ToolbarDemoComp : public Component, - private Slider::Listener +class ToolbarDemoComp final : public Component, + private Slider::Listener { public: ToolbarDemoComp() @@ -802,7 +802,7 @@ private: customiseButton { "Customise..." }; //============================================================================== - class DemoToolbarItemFactory : public ToolbarItemFactory + class DemoToolbarItemFactory final : public ToolbarItemFactory { public: DemoToolbarItemFactory() {} @@ -977,8 +977,8 @@ private: /** This class shows how to implement a TableListBoxModel to show in a TableListBox. */ -class TableDemoComponent : public Component, - public TableListBoxModel +class TableDemoComponent final : public Component, + public TableListBoxModel { public: TableDemoComponent() @@ -1303,8 +1303,8 @@ private: }; //============================================================================== -class DragAndDropDemo : public Component, - public DragAndDropContainer +class DragAndDropDemo final : public Component, + public DragAndDropContainer { public: DragAndDropDemo() @@ -1509,7 +1509,7 @@ private: }; //============================================================================== -struct DemoTabbedComponent : public TabbedComponent +struct DemoTabbedComponent final : public TabbedComponent { DemoTabbedComponent (bool isRunningComponenTransformsDemo) : TabbedComponent (TabbedButtonBar::TabsAtTop) @@ -1567,7 +1567,7 @@ struct DemoTabbedComponent : public TabbedComponent }; //============================================================================== -struct WidgetsDemo : public Component +struct WidgetsDemo final : public Component { WidgetsDemo (bool isRunningComponenTransformsDemo = false) : tabs (isRunningComponenTransformsDemo) diff --git a/examples/GUI/WindowsDemo.h b/examples/GUI/WindowsDemo.h index 4aff0d49be..882ad9f5c7 100644 --- a/examples/GUI/WindowsDemo.h +++ b/examples/GUI/WindowsDemo.h @@ -50,7 +50,7 @@ //============================================================================== /** Just a simple window that deletes itself when closed. */ -class BasicWindow : public DocumentWindow +class BasicWindow final : public DocumentWindow { public: BasicWindow (const String& name, Colour backgroundColour, int buttonsNeeded) @@ -68,8 +68,8 @@ private: //============================================================================== /** This window contains a ColourSelector which can be used to change the window's colour. */ -class ColourSelectorWindow : public DocumentWindow, - private ChangeListener +class ColourSelectorWindow final : public DocumentWindow, + private ChangeListener { public: ColourSelectorWindow (const String& name, Colour backgroundColour, int buttonsNeeded) @@ -106,8 +106,8 @@ private: }; //============================================================================== -class BouncingBallComponent : public Component, - public Timer +class BouncingBallComponent final : public Component, + public Timer { public: BouncingBallComponent() @@ -159,7 +159,7 @@ private: }; //============================================================================== -class BouncingBallsContainer : public Component +class BouncingBallsContainer final : public Component { public: BouncingBallsContainer (int numBalls) @@ -207,7 +207,7 @@ private: }; //============================================================================== -class WindowsDemo : public Component +class WindowsDemo final : public Component { public: enum Windows diff --git a/examples/Plugins/ARAPluginDemo.h b/examples/Plugins/ARAPluginDemo.h index 7fc740899c..1e2c56b0d2 100644 --- a/examples/Plugins/ARAPluginDemo.h +++ b/examples/Plugins/ARAPluginDemo.h @@ -53,7 +53,7 @@ #include //============================================================================== -class ARADemoPluginAudioModification : public ARAAudioModification +class ARADemoPluginAudioModification final : public ARAAudioModification { public: ARADemoPluginAudioModification (ARAAudioSource* audioSource, @@ -79,7 +79,7 @@ struct PreviewState std::atomic previewedRegion { nullptr }; }; -class SharedTimeSliceThread : public TimeSliceThread +class SharedTimeSliceThread final : public TimeSliceThread { public: SharedTimeSliceThread() @@ -89,7 +89,7 @@ public: } }; -class AsyncConfigurationCallback : private AsyncUpdater +class AsyncConfigurationCallback final : private AsyncUpdater { public: explicit AsyncConfigurationCallback (std::function callbackIn) @@ -303,7 +303,7 @@ struct ProcessingLockInterface }; //============================================================================== -class PlaybackRenderer : public ARAPlaybackRenderer +class PlaybackRenderer final : public ARAPlaybackRenderer { public: PlaybackRenderer (ARA::PlugIn::DocumentController* dc, ProcessingLockInterface& lockInterfaceIn) @@ -480,8 +480,8 @@ private: std::unique_ptr> tempBuffer; }; -class EditorRenderer : public ARAEditorRenderer, - private ARARegionSequence::Listener +class EditorRenderer final : public ARAEditorRenderer, + private ARARegionSequence::Listener { public: EditorRenderer (ARA::PlugIn::DocumentController* documentController, @@ -699,8 +699,8 @@ private: }; //============================================================================== -class ARADemoPluginDocumentControllerSpecialisation : public ARADocumentControllerSpecialisation, - private ProcessingLockInterface +class ARADemoPluginDocumentControllerSpecialisation final : public ARADocumentControllerSpecialisation, + private ProcessingLockInterface { public: using ARADocumentControllerSpecialisation::ARADocumentControllerSpecialisation; @@ -853,8 +853,8 @@ struct PlayHeadState }; //============================================================================== -class ARADemoPluginAudioProcessorImpl : public AudioProcessor, - public AudioProcessorARAExtension +class ARADemoPluginAudioProcessorImpl : public AudioProcessor, + public AudioProcessorARAExtension { public: //============================================================================== @@ -985,14 +985,14 @@ private: ListenerList listeners; }; -class RulersView : public Component, - public SettableTooltipClient, - private Timer, - private TimeToViewScaling::Listener, - private ARAMusicalContext::Listener +class RulersView final : public Component, + public SettableTooltipClient, + private Timer, + private TimeToViewScaling::Listener, + private ARAMusicalContext::Listener { public: - class CycleMarkerComponent : public Component + class CycleMarkerComponent final : public Component { void paint (Graphics& g) override { @@ -1233,7 +1233,7 @@ private: bool isDraggingCycle = false; }; -class RulersHeader : public Component +class RulersHeader final : public Component { public: RulersHeader() @@ -1274,7 +1274,7 @@ private: }; //============================================================================== -struct WaveformCache : private ARAAudioSource::Listener +struct WaveformCache final : private ARAAudioSource::Listener { WaveformCache() : thumbnailCache (20) { @@ -1325,12 +1325,12 @@ private: std::map> thumbnails; }; -class PlaybackRegionView : public Component, - public ChangeListener, - public SettableTooltipClient, - private ARAAudioSource::Listener, - private ARAPlaybackRegion::Listener, - private ARAEditorView::Listener +class PlaybackRegionView final : public Component, + public ChangeListener, + public SettableTooltipClient, + private ARAAudioSource::Listener, + private ARAPlaybackRegion::Listener, + private ARAEditorView::Listener { public: PlaybackRegionView (ARAEditorView& editorView, ARAPlaybackRegion& region, WaveformCache& cache) @@ -1467,7 +1467,7 @@ public: } private: - class PreviewRegionOverlay : public Component + class PreviewRegionOverlay final : public Component { static constexpr auto previewLength = 0.5; @@ -1522,11 +1522,11 @@ private: bool isSelected = false; }; -class RegionSequenceView : public Component, - public ChangeBroadcaster, - private TimeToViewScaling::Listener, - private ARARegionSequence::Listener, - private ARAPlaybackRegion::Listener +class RegionSequenceView final : public Component, + public ChangeBroadcaster, + private TimeToViewScaling::Listener, + private ARARegionSequence::Listener, + private ARAPlaybackRegion::Listener { public: RegionSequenceView (ARAEditorView& editorView, TimeToViewScaling& scaling, ARARegionSequence& rs, WaveformCache& cache) @@ -1645,7 +1645,7 @@ private: double playbackDuration = 0.0; }; -class ZoomControls : public Component +class ZoomControls final : public Component { public: ZoomControls() @@ -1672,8 +1672,8 @@ private: TextButton zoomInButton { "+" }, zoomOutButton { "-" }; }; -class PlayheadPositionLabel : public Label, - private Timer +class PlayheadPositionLabel final : public Label, + private Timer { public: PlayheadPositionLabel (PlayHeadState& playHeadStateIn) @@ -1769,9 +1769,9 @@ private: ARAMusicalContext* selectedMusicalContext = nullptr; }; -class TrackHeader : public Component, - private ARARegionSequence::Listener, - private ARAEditorView::Listener +class TrackHeader final : public Component, + private ARARegionSequence::Listener, + private ARAEditorView::Listener { public: TrackHeader (ARAEditorView& editorView, ARARegionSequence& regionSequenceIn) @@ -1848,7 +1848,7 @@ private: constexpr auto trackHeight = 60; -class VerticalLayoutViewportContent : public Component +class VerticalLayoutViewportContent final : public Component { public: void resized() override @@ -1863,7 +1863,7 @@ public: } }; -class VerticalLayoutViewport : public Viewport +class VerticalLayoutViewport final : public Viewport { public: VerticalLayoutViewport() @@ -1887,12 +1887,12 @@ private: } }; -class OverlayComponent : public Component, - private Timer, - private TimeToViewScaling::Listener +class OverlayComponent final : public Component, + private Timer, + private TimeToViewScaling::Listener { public: - class PlayheadMarkerComponent : public Component + class PlayheadMarkerComponent final : public Component { void paint (Graphics& g) override { g.fillAll (Colours::yellow.darker (0.2f)); } }; @@ -1981,11 +1981,11 @@ private: PlayheadMarkerComponent playheadMarker; }; -class DocumentView : public Component, - public ChangeListener, - public ARAMusicalContext::Listener, - private ARADocument::Listener, - private ARAEditorView::Listener +class DocumentView final : public Component, + public ChangeListener, + public ARAMusicalContext::Listener, + private ARADocument::Listener, + private ARAEditorView::Listener { public: DocumentView (ARAEditorView& editorView, PlayHeadState& playHeadState) @@ -2287,8 +2287,8 @@ private: }; -class ARADemoPluginProcessorEditor : public AudioProcessorEditor, - public AudioProcessorEditorARAExtension +class ARADemoPluginProcessorEditor final : public AudioProcessorEditor, + public AudioProcessorEditorARAExtension { public: explicit ARADemoPluginProcessorEditor (ARADemoPluginAudioProcessorImpl& p) @@ -2334,7 +2334,7 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ARADemoPluginProcessorEditor) }; -class ARADemoPluginAudioProcessor : public ARADemoPluginAudioProcessorImpl +class ARADemoPluginAudioProcessor final : public ARADemoPluginAudioProcessorImpl { public: bool hasEditor() const override { return true; } diff --git a/examples/Plugins/AUv3SynthPluginDemo.h b/examples/Plugins/AUv3SynthPluginDemo.h index 06e60b8542..ccc162e7aa 100644 --- a/examples/Plugins/AUv3SynthPluginDemo.h +++ b/examples/Plugins/AUv3SynthPluginDemo.h @@ -54,7 +54,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class MaterialLookAndFeel : public LookAndFeel_V4 +class MaterialLookAndFeel final : public LookAndFeel_V4 { public: //============================================================================== @@ -178,8 +178,8 @@ public: }; //============================================================================== -class AUv3SynthEditor : public AudioProcessorEditor, - private Timer +class AUv3SynthEditor final : public AudioProcessorEditor, + private Timer { public: //============================================================================== @@ -309,7 +309,7 @@ private: }; //============================================================================== -class AUv3SynthProcessor : public AudioProcessor +class AUv3SynthProcessor final : public AudioProcessor { public: AUv3SynthProcessor () diff --git a/examples/Plugins/ArpeggiatorPluginDemo.h b/examples/Plugins/ArpeggiatorPluginDemo.h index b6489d7100..f715f4eea8 100644 --- a/examples/Plugins/ArpeggiatorPluginDemo.h +++ b/examples/Plugins/ArpeggiatorPluginDemo.h @@ -52,7 +52,7 @@ //============================================================================== -class Arpeggiator : public AudioProcessor +class Arpeggiator final : public AudioProcessor { public: diff --git a/examples/Plugins/AudioPluginDemo.h b/examples/Plugins/AudioPluginDemo.h index 189f090154..008ac34c89 100644 --- a/examples/Plugins/AudioPluginDemo.h +++ b/examples/Plugins/AudioPluginDemo.h @@ -55,7 +55,7 @@ //============================================================================== /** A demo synth sound that's just a basic sine wave.. */ -class SineWaveSound : public SynthesiserSound +class SineWaveSound final : public SynthesiserSound { public: SineWaveSound() {} @@ -66,7 +66,7 @@ public: //============================================================================== /** A simple demo synth voice that just plays a sine wave.. */ -class SineWaveVoice : public SynthesiserVoice +class SineWaveVoice final : public SynthesiserVoice { public: SineWaveVoice() {} @@ -175,7 +175,7 @@ private: //============================================================================== /** As the name suggest, this class does the actual audio processing. */ -class JuceDemoPluginAudioProcessor : public AudioProcessor +class JuceDemoPluginAudioProcessor final : public AudioProcessor { public: //============================================================================== @@ -362,9 +362,9 @@ public: private: //============================================================================== /** This is the editor component that our filter will display. */ - class JuceDemoPluginAudioProcessorEditor : public AudioProcessorEditor, - private Timer, - private Value::Listener + class JuceDemoPluginAudioProcessorEditor final : public AudioProcessorEditor, + private Timer, + private Value::Listener { public: JuceDemoPluginAudioProcessorEditor (JuceDemoPluginAudioProcessor& owner) diff --git a/examples/Plugins/DSPModulePluginDemo.h b/examples/Plugins/DSPModulePluginDemo.h index 004753132e..55b0cc1136 100644 --- a/examples/Plugins/DSPModulePluginDemo.h +++ b/examples/Plugins/DSPModulePluginDemo.h @@ -143,15 +143,15 @@ void resetAll (Processors&... processors) } //============================================================================== -class DspModulePluginDemo : public AudioProcessor, - private ValueTree::Listener +class DspModulePluginDemo : public AudioProcessor, + private ValueTree::Listener { public: DspModulePluginDemo() : DspModulePluginDemo (AudioProcessorValueTreeState::ParameterLayout{}) {} //============================================================================== - void prepareToPlay (double sampleRate, int samplesPerBlock) override + void prepareToPlay (double sampleRate, int samplesPerBlock) final { const auto channels = jmax (getTotalNumInputChannels(), getTotalNumOutputChannels()); @@ -163,15 +163,15 @@ public: reset(); } - void reset() override + void reset() final { chain.reset(); update(); } - void releaseResources() override {} + void releaseResources() final {} - void processBlock (AudioBuffer& buffer, MidiBuffer&) override + void processBlock (AudioBuffer& buffer, MidiBuffer&) final { if (jmax (getTotalNumInputChannels(), getTotalNumOutputChannels()) == 0) return; @@ -195,43 +195,43 @@ public: chain.process (dsp::ProcessContextReplacing (inoutBlock)); } - void processBlock (AudioBuffer&, MidiBuffer&) override {} + void processBlock (AudioBuffer&, MidiBuffer&) final {} //============================================================================== AudioProcessorEditor* createEditor() override { return nullptr; } bool hasEditor() const override { return false; } //============================================================================== - const String getName() const override { return "DSPModulePluginDemo"; } + const String getName() const final { return "DSPModulePluginDemo"; } - bool acceptsMidi() const override { return false; } - bool producesMidi() const override { return false; } - bool isMidiEffect() const override { return false; } + bool acceptsMidi() const final { return false; } + bool producesMidi() const final { return false; } + bool isMidiEffect() const final { return false; } - double getTailLengthSeconds() const override { return 0.0; } + double getTailLengthSeconds() const final { return 0.0; } //============================================================================== - int getNumPrograms() override { return 1; } - int getCurrentProgram() override { return 0; } - void setCurrentProgram (int) override {} - const String getProgramName (int) override { return "None"; } + int getNumPrograms() final { return 1; } + int getCurrentProgram() final { return 0; } + void setCurrentProgram (int) final {} + const String getProgramName (int) final { return "None"; } - void changeProgramName (int, const String&) override {} + void changeProgramName (int, const String&) final {} //============================================================================== - bool isBusesLayoutSupported (const BusesLayout& layout) const override + bool isBusesLayoutSupported (const BusesLayout& layout) const final { return layout == BusesLayout { { AudioChannelSet::stereo() }, { AudioChannelSet::stereo() } }; } //============================================================================== - void getStateInformation (MemoryBlock& destData) override + void getStateInformation (MemoryBlock& destData) final { copyXmlToBinary (*apvts.copyState().createXml(), destData); } - void setStateInformation (const void* data, int sizeInBytes) override + void setStateInformation (const void* data, int sizeInBytes) final { apvts.replaceState (ValueTree::fromXml (*getXmlFromBinary (data, sizeInBytes))); } @@ -811,7 +811,7 @@ private: } //============================================================================== - void valueTreePropertyChanged (ValueTree&, const Identifier&) override + void valueTreePropertyChanged (ValueTree&, const Identifier&) final { requiresUpdate.store (true); } @@ -1498,7 +1498,7 @@ private: }; //============================================================================== -class DspModulePluginDemoEditor : public AudioProcessorEditor +class DspModulePluginDemoEditor final : public AudioProcessorEditor { public: explicit DspModulePluginDemoEditor (DspModulePluginDemo& p) @@ -1637,7 +1637,7 @@ private: RangedAudioParameter& param; }; - class AttachedSlider : public ComponentWithParamMenu + class AttachedSlider final : public ComponentWithParamMenu { public: AttachedSlider (AudioProcessorEditor& editorIn, RangedAudioParameter& paramIn) @@ -1663,7 +1663,7 @@ private: SliderParameterAttachment attachment; }; - class AttachedToggle : public ComponentWithParamMenu + class AttachedToggle final : public ComponentWithParamMenu { public: AttachedToggle (AudioProcessorEditor& editorIn, RangedAudioParameter& paramIn) @@ -1682,7 +1682,7 @@ private: ButtonParameterAttachment attachment; }; - class AttachedCombo : public ComponentWithParamMenu + class AttachedCombo final : public ComponentWithParamMenu { public: AttachedCombo (AudioProcessorEditor& editorIn, RangedAudioParameter& paramIn) @@ -1795,7 +1795,7 @@ private: grid.performLayout (bounds); } - struct BasicControls : public Component + struct BasicControls final : public Component { explicit BasicControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::MainGroup& state) @@ -1814,7 +1814,7 @@ private: AttachedSlider pan, input, output; }; - struct DistortionControls : public Component + struct DistortionControls final : public Component { explicit DistortionControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::DistortionGroup& state) @@ -1840,7 +1840,7 @@ private: AttachedCombo type, oversampling; }; - struct ConvolutionControls : public Component + struct ConvolutionControls final : public Component { explicit ConvolutionControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::ConvolutionGroup& state) @@ -1860,7 +1860,7 @@ private: AttachedSlider mix; }; - struct MultiBandControls : public Component + struct MultiBandControls final : public Component { explicit MultiBandControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::MultiBandGroup& state) @@ -1881,7 +1881,7 @@ private: AttachedSlider low, high, lRFreq; }; - struct CompressorControls : public Component + struct CompressorControls final : public Component { explicit CompressorControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::CompressorGroup& state) @@ -1903,7 +1903,7 @@ private: AttachedSlider threshold, ratio, attack, release; }; - struct NoiseGateControls : public Component + struct NoiseGateControls final : public Component { explicit NoiseGateControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::NoiseGateGroup& state) @@ -1925,7 +1925,7 @@ private: AttachedSlider threshold, ratio, attack, release; }; - struct LimiterControls : public Component + struct LimiterControls final : public Component { explicit LimiterControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::LimiterGroup& state) @@ -1945,7 +1945,7 @@ private: AttachedSlider threshold, release; }; - struct DirectDelayControls : public Component + struct DirectDelayControls final : public Component { explicit DirectDelayControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::DirectDelayGroup& state) @@ -1968,7 +1968,7 @@ private: AttachedSlider delay, smooth, mix; }; - struct DelayEffectControls : public Component + struct DelayEffectControls final : public Component { explicit DelayEffectControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::DelayEffectGroup& state) @@ -1993,7 +1993,7 @@ private: AttachedSlider value, smooth, lowpass, feedback, mix; }; - struct PhaserControls : public Component + struct PhaserControls final : public Component { explicit PhaserControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::PhaserGroup& state) @@ -2016,7 +2016,7 @@ private: AttachedSlider rate, depth, centre, feedback, mix; }; - struct ChorusControls : public Component + struct ChorusControls final : public Component { explicit ChorusControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::ChorusGroup& state) @@ -2039,7 +2039,7 @@ private: AttachedSlider rate, depth, centre, feedback, mix; }; - struct LadderControls : public Component + struct LadderControls final : public Component { explicit LadderControls (AudioProcessorEditor& editor, const DspModulePluginDemo::ParameterReferences::LadderGroup& state) @@ -2088,7 +2088,7 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DspModulePluginDemoEditor) }; -struct DspModulePluginDemoAudioProcessor : public DspModulePluginDemo +struct DspModulePluginDemoAudioProcessor final : public DspModulePluginDemo { AudioProcessorEditor* createEditor() override { diff --git a/examples/Plugins/GainPluginDemo.h b/examples/Plugins/GainPluginDemo.h index 162ba0368c..7b97a27cbc 100644 --- a/examples/Plugins/GainPluginDemo.h +++ b/examples/Plugins/GainPluginDemo.h @@ -50,7 +50,7 @@ //============================================================================== -class GainProcessor : public AudioProcessor +class GainProcessor final : public AudioProcessor { public: diff --git a/examples/Plugins/HostPluginDemo.h b/examples/Plugins/HostPluginDemo.h index 3534e47227..e47db7dcbe 100644 --- a/examples/Plugins/HostPluginDemo.h +++ b/examples/Plugins/HostPluginDemo.h @@ -88,7 +88,7 @@ public: pluginList.addChangeListener (this); } - bool isBusesLayoutSupported (const BusesLayout& layouts) const override + bool isBusesLayoutSupported (const BusesLayout& layouts) const final { const auto& mainOutput = layouts.getMainOutputChannelSet(); const auto& mainInput = layouts.getMainInputChannelSet(); @@ -102,7 +102,7 @@ public: return true; } - void prepareToPlay (double sr, int bs) override + void prepareToPlay (double sr, int bs) final { const ScopedLock sl (innerMutex); @@ -115,7 +115,7 @@ public: } } - void releaseResources() override + void releaseResources() final { const ScopedLock sl (innerMutex); @@ -125,7 +125,7 @@ public: inner->releaseResources(); } - void reset() override + void reset() final { const ScopedLock sl (innerMutex); @@ -136,12 +136,12 @@ public: // In this example, we don't actually pass any audio through the inner processor. // In a 'real' plugin, we'd need to add some synchronisation to ensure that the inner // plugin instance was never modified (deleted, replaced etc.) during a call to processBlock. - void processBlock (AudioBuffer&, MidiBuffer&) override + void processBlock (AudioBuffer&, MidiBuffer&) final { jassert (! isUsingDoublePrecision()); } - void processBlock (AudioBuffer&, MidiBuffer&) override + void processBlock (AudioBuffer&, MidiBuffer&) final { jassert (isUsingDoublePrecision()); } @@ -149,18 +149,18 @@ public: bool hasEditor() const override { return false; } AudioProcessorEditor* createEditor() override { return nullptr; } - const String getName() const override { return "HostPluginDemo"; } - bool acceptsMidi() const override { return true; } - bool producesMidi() const override { return true; } - double getTailLengthSeconds() const override { return 0.0; } + const String getName() const final { return "HostPluginDemo"; } + bool acceptsMidi() const final { return true; } + bool producesMidi() const final { return true; } + double getTailLengthSeconds() const final { return 0.0; } - int getNumPrograms() override { return 0; } - int getCurrentProgram() override { return 0; } - void setCurrentProgram (int) override {} - const String getProgramName (int) override { return "None"; } - void changeProgramName (int, const String&) override {} + int getNumPrograms() final { return 0; } + int getCurrentProgram() final { return 0; } + void setCurrentProgram (int) final {} + const String getProgramName (int) final { return "None"; } + void changeProgramName (int, const String&) final {} - void getStateInformation (MemoryBlock& destData) override + void getStateInformation (MemoryBlock& destData) final { const ScopedLock sl (innerMutex); @@ -185,7 +185,7 @@ public: destData.replaceAll (text.toRawUTF8(), text.getNumBytesAsUTF8()); } - void setStateInformation (const void* data, int sizeInBytes) override + void setStateInformation (const void* data, int sizeInBytes) final { const ScopedLock sl (innerMutex); @@ -285,7 +285,7 @@ private: static constexpr const char* innerStateTag = "inner_state"; static constexpr const char* editorStyleTag = "editor_style"; - void changeListenerCallback (ChangeBroadcaster* source) override + void changeListenerCallback (ChangeBroadcaster* source) final { if (source != &pluginList) return; @@ -312,7 +312,7 @@ static void doLayout (Component* main, Component& bottom, int bottomHeight, Rect grid.performLayout (bounds); } -class PluginLoaderComponent : public Component +class PluginLoaderComponent final : public Component { public: template @@ -348,7 +348,7 @@ public: } private: - struct Buttons : public Component + struct Buttons final : public Component { Buttons() { @@ -390,7 +390,7 @@ private: }; //============================================================================== -class PluginEditorComponent : public Component +class PluginEditorComponent final : public Component { public: template @@ -435,7 +435,7 @@ private: }; //============================================================================== -class ScaledDocumentWindow : public DocumentWindow +class ScaledDocumentWindow final : public DocumentWindow { public: ScaledDocumentWindow (Colour bg, float scale) @@ -448,7 +448,7 @@ private: }; //============================================================================== -class HostAudioProcessorEditor : public AudioProcessorEditor +class HostAudioProcessorEditor final : public AudioProcessorEditor { public: explicit HostAudioProcessorEditor (HostAudioProcessorImpl& owner) @@ -576,7 +576,7 @@ private: }; //============================================================================== -class HostAudioProcessor : public HostAudioProcessorImpl +class HostAudioProcessor final : public HostAudioProcessorImpl { public: bool hasEditor() const override { return true; } diff --git a/examples/Plugins/MidiLoggerPluginDemo.h b/examples/Plugins/MidiLoggerPluginDemo.h index 104ef89f41..d45b500cda 100644 --- a/examples/Plugins/MidiLoggerPluginDemo.h +++ b/examples/Plugins/MidiLoggerPluginDemo.h @@ -113,8 +113,8 @@ private: }; //============================================================================== -class MidiTable : public Component, - private TableListBoxModel +class MidiTable final : public Component, + private TableListBoxModel { public: MidiTable (MidiListModel& m) @@ -220,8 +220,8 @@ private: }; //============================================================================== -class MidiLoggerPluginDemoProcessor : public AudioProcessor, - private Timer +class MidiLoggerPluginDemoProcessor final : public AudioProcessor, + private Timer { public: MidiLoggerPluginDemoProcessor() @@ -268,8 +268,8 @@ public: } private: - class Editor : public AudioProcessorEditor, - private Value::Listener + class Editor final : public AudioProcessorEditor, + private Value::Listener { public: explicit Editor (MidiLoggerPluginDemoProcessor& ownerIn) diff --git a/examples/Plugins/MultiOutSynthPluginDemo.h b/examples/Plugins/MultiOutSynthPluginDemo.h index a481b9e5b1..3d83c0cad0 100644 --- a/examples/Plugins/MultiOutSynthPluginDemo.h +++ b/examples/Plugins/MultiOutSynthPluginDemo.h @@ -53,7 +53,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class MultiOutSynth : public AudioProcessor +class MultiOutSynth final : public AudioProcessor { public: enum diff --git a/examples/Plugins/NoiseGatePluginDemo.h b/examples/Plugins/NoiseGatePluginDemo.h index 14a95145da..c3a824c4c0 100644 --- a/examples/Plugins/NoiseGatePluginDemo.h +++ b/examples/Plugins/NoiseGatePluginDemo.h @@ -50,7 +50,7 @@ //============================================================================== -class NoiseGate : public AudioProcessor +class NoiseGate final : public AudioProcessor { public: //============================================================================== diff --git a/examples/Plugins/ReaperEmbeddedViewPluginDemo.h b/examples/Plugins/ReaperEmbeddedViewPluginDemo.h index ae74adc9c9..3feb61c651 100644 --- a/examples/Plugins/ReaperEmbeddedViewPluginDemo.h +++ b/examples/Plugins/ReaperEmbeddedViewPluginDemo.h @@ -111,7 +111,7 @@ struct EmbeddedViewListener JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor") //============================================================================== -class EmbeddedUI : public reaper::IReaperUIEmbedInterface +class EmbeddedUI final : public reaper::IReaperUIEmbedInterface { public: explicit EmbeddedUI (EmbeddedViewListener& demo) : listener (demo) {} @@ -146,7 +146,7 @@ private: JUCE_END_IGNORE_WARNINGS_GCC_LIKE -class VST2Extensions : public VST2ClientExtensions +class VST2Extensions final : public VST2ClientExtensions { public: explicit VST2Extensions (EmbeddedViewListener& l) @@ -187,7 +187,7 @@ private: EmbeddedViewListener& listener; }; -class VST3Extensions : public VST3ClientExtensions +class VST3Extensions final : public VST3ClientExtensions { public: explicit VST3Extensions (EmbeddedViewListener& l) @@ -222,7 +222,7 @@ private: }; //============================================================================== -class Editor : public AudioProcessorEditor +class Editor final : public AudioProcessorEditor { public: explicit Editor (AudioProcessor& proc, @@ -258,9 +258,9 @@ private: }; //============================================================================== -class ReaperEmbeddedViewDemo : public AudioProcessor, - private EmbeddedViewListener, - private Timer +class ReaperEmbeddedViewDemo final : public AudioProcessor, + private EmbeddedViewListener, + private Timer { public: ReaperEmbeddedViewDemo() diff --git a/examples/Plugins/SamplerPluginDemo.h b/examples/Plugins/SamplerPluginDemo.h index 6e6d15c02d..674aa5e7dd 100644 --- a/examples/Plugins/SamplerPluginDemo.h +++ b/examples/Plugins/SamplerPluginDemo.h @@ -111,8 +111,8 @@ struct Command }; template -class TemplateCommand : public Command, - private Func +class TemplateCommand final : public Command, + private Func { public: template @@ -257,7 +257,7 @@ private: }; //============================================================================== -class MPESamplerVoice : public MPESynthesiserVoice +class MPESamplerVoice final : public MPESynthesiserVoice { public: explicit MPESamplerVoice (std::shared_ptr sound) @@ -501,7 +501,7 @@ private: }; template -class ReferenceCountingAdapter : public ReferenceCountedObject +class ReferenceCountingAdapter final : public ReferenceCountedObject { public: template @@ -564,7 +564,7 @@ public: }; //============================================================================== -class MemoryAudioFormatReaderFactory : public AudioFormatReaderFactory +class MemoryAudioFormatReaderFactory final : public AudioFormatReaderFactory { public: MemoryAudioFormatReaderFactory (const void* sampleDataIn, size_t dataSizeIn) @@ -588,7 +588,7 @@ private: }; //============================================================================== -class FileAudioFormatReaderFactory : public AudioFormatReaderFactory +class FileAudioFormatReaderFactory final : public AudioFormatReaderFactory { public: explicit FileAudioFormatReaderFactory (File fileIn) @@ -643,20 +643,20 @@ struct GenericVariantConverter }; template -struct VariantConverter> : GenericVariantConverter> {}; +struct VariantConverter> final : GenericVariantConverter> {}; template<> -struct VariantConverter : GenericVariantConverter {}; +struct VariantConverter final : GenericVariantConverter {}; template<> -struct VariantConverter> +struct VariantConverter> final : GenericVariantConverter> {}; } // namespace juce //============================================================================== -class VisibleRangeDataModel : private ValueTree::Listener +class VisibleRangeDataModel final : private ValueTree::Listener { public: class Listener @@ -757,7 +757,7 @@ private: }; //============================================================================== -class MPESettingsDataModel : private ValueTree::Listener +class MPESettingsDataModel final : private ValueTree::Listener { public: class Listener @@ -947,7 +947,7 @@ private: }; //============================================================================== -class DataModel : private ValueTree::Listener +class DataModel final : private ValueTree::Listener { public: class Listener @@ -1132,8 +1132,8 @@ constexpr int controlSeparation = 6; } // namespace //============================================================================== -class MPELegacySettingsComponent final : public Component, - private MPESettingsDataModel::Listener +class MPELegacySettingsComponent final : public Component, + private MPESettingsDataModel::Listener { public: explicit MPELegacySettingsComponent (const MPESettingsDataModel& model, @@ -1256,8 +1256,8 @@ private: }; //============================================================================== -class MPENewSettingsComponent final : public Component, - private MPESettingsDataModel::Listener +class MPENewSettingsComponent final : public Component, + private MPESettingsDataModel::Listener { public: MPENewSettingsComponent (const MPESettingsDataModel& model, @@ -1352,8 +1352,8 @@ private: }; //============================================================================== -class MPESettingsComponent final : public Component, - private MPESettingsDataModel::Listener +class MPESettingsComponent final : public Component, + private MPESettingsDataModel::Listener { public: MPESettingsComponent (const MPESettingsDataModel& model, @@ -1446,7 +1446,7 @@ private: }; //============================================================================== -class LoopPointMarker : public Component +class LoopPointMarker final : public Component { public: using MouseCallback = std::function; @@ -1523,8 +1523,8 @@ private: }; //============================================================================== -class Ruler : public Component, - private VisibleRangeDataModel::Listener +class Ruler final : public Component, + private VisibleRangeDataModel::Listener { public: explicit Ruler (const VisibleRangeDataModel& model) @@ -1614,9 +1614,9 @@ private: }; //============================================================================== -class LoopPointsOverlay : public Component, - private DataModel::Listener, - private VisibleRangeDataModel::Listener +class LoopPointsOverlay final : public Component, + private DataModel::Listener, + private VisibleRangeDataModel::Listener { public: LoopPointsOverlay (const DataModel& dModel, @@ -1715,9 +1715,9 @@ private: }; //============================================================================== -class PlaybackPositionOverlay : public Component, - private Timer, - private VisibleRangeDataModel::Listener +class PlaybackPositionOverlay final : public Component, + private Timer, + private VisibleRangeDataModel::Listener { public: using Provider = std::function()>; @@ -1762,10 +1762,10 @@ private: }; //============================================================================== -class WaveformView : public Component, - private ChangeListener, - private DataModel::Listener, - private VisibleRangeDataModel::Listener +class WaveformView final : public Component, + private ChangeListener, + private DataModel::Listener, + private VisibleRangeDataModel::Listener { public: WaveformView (const DataModel& model, @@ -1853,8 +1853,8 @@ private: }; //============================================================================== -class WaveformEditor : public Component, - private DataModel::Listener +class WaveformEditor final : public Component, + private DataModel::Listener { public: WaveformEditor (const DataModel& model, @@ -1909,9 +1909,9 @@ private: }; //============================================================================== -class MainSamplerView : public Component, - private DataModel::Listener, - private ChangeListener +class MainSamplerView final : public Component, + private DataModel::Listener, + private ChangeListener { public: MainSamplerView (const DataModel& model, @@ -2103,7 +2103,7 @@ struct ProcessorState }; //============================================================================== -class SamplerAudioProcessor : public AudioProcessor +class SamplerAudioProcessor final : public AudioProcessor { public: SamplerAudioProcessor() @@ -2366,10 +2366,10 @@ public: private: //============================================================================== - class SamplerAudioProcessorEditor : public AudioProcessorEditor, - public FileDragAndDropTarget, - private DataModel::Listener, - private MPESettingsDataModel::Listener + class SamplerAudioProcessorEditor final : public AudioProcessorEditor, + public FileDragAndDropTarget, + private DataModel::Listener, + private MPESettingsDataModel::Listener { public: SamplerAudioProcessorEditor (SamplerAudioProcessor& p, ProcessorState state) diff --git a/examples/Plugins/SurroundPluginDemo.h b/examples/Plugins/SurroundPluginDemo.h index 90e0867747..2c007b59de 100644 --- a/examples/Plugins/SurroundPluginDemo.h +++ b/examples/Plugins/SurroundPluginDemo.h @@ -105,7 +105,7 @@ public: samplesPlayed = samplesToPlay; } - bool applyBusLayouts (const BusesLayout& layouts) override + bool applyBusLayouts (const BusesLayout& layouts) final { // Some very badly-behaved hosts will call this during processing! const SpinLock::ScopedLockType lock (levelMutex); @@ -225,8 +225,8 @@ inline void configureLabel (Label& label, const AudioProcessor::Bus* layout) label.setColour (Label::textColourId, textColour); } -class InputBusViewer : public Component, - private Timer +class InputBusViewer final : public Component, + private Timer { public: InputBusViewer (ProcessorWithLevels& proc, int busNumber) @@ -306,7 +306,7 @@ private: }; //============================================================================== -class OutputBusViewer : public Component +class OutputBusViewer final : public Component { public: OutputBusViewer (ProcessorWithLevels& proc, int busNumber) @@ -332,7 +332,7 @@ public: channelButtons.emplace_back (channelName, channelName); auto& newButton = channelButtons.back(); - newButton.onClick = [&proc = processor, bus = bus, i] { proc.channelButtonClicked (bus, i); }; + newButton.onClick = [&p = processor, b = bus, i] { p.channelButtonClicked (b, i); }; addAndMakeVisible (newButton); } @@ -376,7 +376,7 @@ private: }; //============================================================================== -class SurroundEditor : public AudioProcessorEditor +class SurroundEditor final : public AudioProcessorEditor { public: explicit SurroundEditor (ProcessorWithLevels& parent) @@ -454,7 +454,7 @@ private: }; //============================================================================== -struct SurroundProcessor : public ProcessorWithLevels +struct SurroundProcessor final : public ProcessorWithLevels { AudioProcessorEditor* createEditor() override { return new SurroundEditor (*this); } bool hasEditor() const override { return true; } diff --git a/examples/Utilities/AnalyticsCollectionDemo.h b/examples/Utilities/AnalyticsCollectionDemo.h index 2dacda6df9..03ad3188f0 100644 --- a/examples/Utilities/AnalyticsCollectionDemo.h +++ b/examples/Utilities/AnalyticsCollectionDemo.h @@ -58,7 +58,7 @@ enum DemoAnalyticsEventTypes }; //============================================================================== -class GoogleAnalyticsDestination : public ThreadedAnalyticsDestination +class GoogleAnalyticsDestination final : public ThreadedAnalyticsDestination { public: GoogleAnalyticsDestination() @@ -298,7 +298,7 @@ private: }; //============================================================================== -class AnalyticsCollectionDemo : public Component +class AnalyticsCollectionDemo final : public Component { public: //============================================================================== diff --git a/examples/Utilities/Box2DDemo.h b/examples/Utilities/Box2DDemo.h index 837130e694..019a469a8e 100644 --- a/examples/Utilities/Box2DDemo.h +++ b/examples/Utilities/Box2DDemo.h @@ -101,8 +101,8 @@ JUCE_END_IGNORE_WARNINGS_GCC_LIKE /** This list box just displays a StringArray and broadcasts a change message when the selected row changes. */ -class Box2DTestList : public ListBoxModel, - public ChangeBroadcaster +class Box2DTestList final : public ListBoxModel, + public ChangeBroadcaster { public: Box2DTestList (const StringArray& testList) @@ -134,7 +134,7 @@ private: }; //============================================================================== -struct Box2DRenderComponent : public Component +struct Box2DRenderComponent final : public Component { Box2DRenderComponent() { @@ -159,9 +159,9 @@ struct Box2DRenderComponent : public Component }; //============================================================================== -class Box2DDemo : public Component, - private Timer, - private ChangeListener +class Box2DDemo final : public Component, + private Timer, + private ChangeListener { public: enum Demos diff --git a/examples/Utilities/ChildProcessDemo.h b/examples/Utilities/ChildProcessDemo.h index 3c9071949b..226f361adc 100644 --- a/examples/Utilities/ChildProcessDemo.h +++ b/examples/Utilities/ChildProcessDemo.h @@ -76,8 +76,8 @@ static String valueTreeToString (const ValueTree& v) } //============================================================================== -class ChildProcessDemo : public Component, - private MessageListener +class ChildProcessDemo final : public Component, + private MessageListener { public: ChildProcessDemo() @@ -174,9 +174,9 @@ public: //============================================================================== // This class is used by the main process, acting as the coordinator and receiving messages // from the worker process. - class DemoCoordinatorProcess : public ChildProcessCoordinator, - private DeletedAtShutdown, - private AsyncUpdater + class DemoCoordinatorProcess final : public ChildProcessCoordinator, + private DeletedAtShutdown, + private AsyncUpdater { public: DemoCoordinatorProcess (ChildProcessDemo& d) : demo (d) {} @@ -257,8 +257,8 @@ private: /* This class gets instantiated in the child process, and receives messages from the coordinator process. */ -class DemoWorkerProcess : public ChildProcessWorker, - private DeletedAtShutdown +class DemoWorkerProcess final : public ChildProcessWorker, + private DeletedAtShutdown { public: DemoWorkerProcess() = default; @@ -322,7 +322,7 @@ inline bool invokeChildProcessDemo (const String& commandLine) // based on the command line parameters, we can't just use the normal auto-generated Main.cpp. // Instead, we don't do anything in Main.cpp and create a JUCEApplication subclass here with // the necessary modifications. - class Application : public JUCEApplication + class Application final : public JUCEApplication { public: //============================================================================== diff --git a/examples/Utilities/CryptographyDemo.h b/examples/Utilities/CryptographyDemo.h index 1c1bf60361..403bf3222c 100644 --- a/examples/Utilities/CryptographyDemo.h +++ b/examples/Utilities/CryptographyDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class RSAComponent : public Component +class RSAComponent final : public Component { public: RSAComponent() @@ -141,7 +141,7 @@ private: }; //============================================================================== -class HashesComponent : public Component +class HashesComponent final : public Component { public: HashesComponent() @@ -238,7 +238,7 @@ private: }; //============================================================================== -class CryptographyDemo : public Component +class CryptographyDemo final : public Component { public: CryptographyDemo() diff --git a/examples/Utilities/InAppPurchasesDemo.h b/examples/Utilities/InAppPurchasesDemo.h index d0503f36e4..a2ff1b2ae6 100644 --- a/examples/Utilities/InAppPurchasesDemo.h +++ b/examples/Utilities/InAppPurchasesDemo.h @@ -67,7 +67,7 @@ */ //============================================================================== -class VoicePurchases : private InAppPurchases::Listener +class VoicePurchases final : private InAppPurchases::Listener { public: //============================================================================== @@ -278,7 +278,7 @@ private: }; //============================================================================== -class PhraseModel : public ListBoxModel +class PhraseModel final : public ListBoxModel { public: PhraseModel() {} @@ -308,12 +308,12 @@ private: }; //============================================================================== -class VoiceModel : public ListBoxModel +class VoiceModel final : public ListBoxModel { public: //============================================================================== - class VoiceRow : public Component, - private Timer + class VoiceRow final : public Component, + private Timer { public: VoiceRow (VoicePurchases& voicePurchases) : purchases (voicePurchases) @@ -491,8 +491,8 @@ private: }; //============================================================================== -class InAppPurchasesDemo : public Component, - private AsyncUpdater +class InAppPurchasesDemo final : public Component, + private AsyncUpdater { public: InAppPurchasesDemo() diff --git a/examples/Utilities/JavaScriptDemo.h b/examples/Utilities/JavaScriptDemo.h index 53e8e2572d..96528dcdf2 100644 --- a/examples/Utilities/JavaScriptDemo.h +++ b/examples/Utilities/JavaScriptDemo.h @@ -49,9 +49,9 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class JavaScriptDemo : public Component, - private CodeDocument::Listener, - private Timer +class JavaScriptDemo final : public Component, + private CodeDocument::Listener, + private Timer { public: JavaScriptDemo() @@ -125,7 +125,7 @@ public: //============================================================================== // This class is used by the script, and provides methods that the JS can call. - struct DemoClass : public DynamicObject + struct DemoClass final : public DynamicObject { DemoClass (JavaScriptDemo& demo) : owner (demo) { diff --git a/examples/Utilities/LiveConstantDemo.h b/examples/Utilities/LiveConstantDemo.h index 3ddcaf1193..caff9f1e7e 100644 --- a/examples/Utilities/LiveConstantDemo.h +++ b/examples/Utilities/LiveConstantDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -struct LiveConstantDemoComponent : public Component +struct LiveConstantDemoComponent final : public Component { LiveConstantDemoComponent() {} @@ -78,7 +78,7 @@ struct LiveConstantDemoComponent : public Component }; //============================================================================== -class LiveConstantDemo : public Component +class LiveConstantDemo final : public Component { public: LiveConstantDemo() diff --git a/examples/Utilities/MultithreadingDemo.h b/examples/Utilities/MultithreadingDemo.h index ce3ccee54e..62ab5c2685 100644 --- a/examples/Utilities/MultithreadingDemo.h +++ b/examples/Utilities/MultithreadingDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class BouncingBall : private ComponentListener +class BouncingBall : private ComponentListener { public: BouncingBall (Component& comp) @@ -145,8 +145,8 @@ private: }; //============================================================================== -class DemoThread : public BouncingBall, - public Thread +class DemoThread final : public BouncingBall, + public Thread { public: DemoThread (Component& containerComp) @@ -194,8 +194,8 @@ private: //============================================================================== -class DemoThreadPoolJob : public BouncingBall, - public ThreadPoolJob +class DemoThreadPoolJob final : public BouncingBall, + public ThreadPoolJob { public: DemoThreadPoolJob (Component& containerComp) @@ -232,8 +232,8 @@ private: }; //============================================================================== -class MultithreadingDemo : public Component, - private Timer +class MultithreadingDemo final : public Component, + private Timer { public: //============================================================================== diff --git a/examples/Utilities/NetworkingDemo.h b/examples/Utilities/NetworkingDemo.h index 43e74ee24a..6447d3d239 100644 --- a/examples/Utilities/NetworkingDemo.h +++ b/examples/Utilities/NetworkingDemo.h @@ -49,8 +49,8 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class NetworkingDemo : public Component, - private Thread +class NetworkingDemo final : public Component, + private Thread { public: NetworkingDemo() diff --git a/examples/Utilities/OSCDemo.h b/examples/Utilities/OSCDemo.h index 1ec2e05ac8..f97ad22451 100644 --- a/examples/Utilities/OSCDemo.h +++ b/examples/Utilities/OSCDemo.h @@ -48,9 +48,9 @@ //============================================================================== -class OSCLogListBox : public ListBox, - private ListBoxModel, - private AsyncUpdater +class OSCLogListBox final : public ListBox, + private ListBoxModel, + private AsyncUpdater { public: OSCLogListBox() @@ -189,7 +189,7 @@ private: }; //============================================================================== -class OSCSenderDemo : public Component +class OSCSenderDemo final : public Component { public: OSCSenderDemo() @@ -238,9 +238,9 @@ private: }; //============================================================================== -class OSCReceiverDemo : public Component, - private OSCReceiver, - private OSCReceiver::ListenerWithOSCAddress +class OSCReceiverDemo final : public Component, + private OSCReceiver, + private OSCReceiver::ListenerWithOSCAddress { public: //============================================================================== @@ -289,8 +289,8 @@ private: }; //============================================================================== -class OSCMonitorDemo : public Component, - private OSCReceiver::Listener +class OSCMonitorDemo final : public Component, + private OSCReceiver::Listener { public: //============================================================================== @@ -465,7 +465,7 @@ private: }; //============================================================================== -class OSCDemo : public Component +class OSCDemo final : public Component { public: OSCDemo() diff --git a/examples/Utilities/PushNotificationsDemo.h b/examples/Utilities/PushNotificationsDemo.h index 0637e705e3..e22190a29a 100644 --- a/examples/Utilities/PushNotificationsDemo.h +++ b/examples/Utilities/PushNotificationsDemo.h @@ -121,10 +121,10 @@ public class JuceActivity extends Activity */ //============================================================================== -class PushNotificationsDemo : public Component, - private ChangeListener, - private ComponentListener, - private PushNotifications::Listener +class PushNotificationsDemo final : public Component, + private ChangeListener, + private ComponentListener, + private PushNotifications::Listener { public: //============================================================================== @@ -781,7 +781,7 @@ private: } #endif - struct RowComponent : public Component + struct RowComponent final : public Component { RowComponent (Label& l, Component& c, int u = 1) : label (l), @@ -1123,7 +1123,7 @@ private: OwnedArray rowComponents; }; - struct AuxActionsView : public Component + struct AuxActionsView final : public Component { AuxActionsView() { @@ -1177,7 +1177,7 @@ private: TextButton removeAllPendingNotifsButton { "Remove All Pending Notifs" }; }; - struct RemoteView : public Component + struct RemoteView final : public Component { RemoteView() { @@ -1209,7 +1209,7 @@ private: TextButton unsubscribeFromSportsButton { "UnsubscribeFromSports" }; }; - struct DemoTabbedComponent : public TabbedComponent + struct DemoTabbedComponent final : public TabbedComponent { DemoTabbedComponent (PushNotificationsDemo& demoIn, TabbedButtonBar::Orientation orientation) : TabbedComponent (orientation), demo (demoIn) diff --git a/examples/Utilities/SystemInfoDemo.h b/examples/Utilities/SystemInfoDemo.h index ab70171656..591d242151 100644 --- a/examples/Utilities/SystemInfoDemo.h +++ b/examples/Utilities/SystemInfoDemo.h @@ -219,7 +219,7 @@ static String getAllSystemInfo() return systemInfo; } -class SystemInfoDemo : public Component +class SystemInfoDemo final : public Component { public: SystemInfoDemo() diff --git a/examples/Utilities/TimersAndEventsDemo.h b/examples/Utilities/TimersAndEventsDemo.h index df2d30cecf..da304a9dce 100644 --- a/examples/Utilities/TimersAndEventsDemo.h +++ b/examples/Utilities/TimersAndEventsDemo.h @@ -50,7 +50,7 @@ //============================================================================== /** Simple message that holds a Colour. */ -struct ColourMessage : public Message +struct ColourMessage final : public Message { ColourMessage (Colour col) : colour (col) {} @@ -73,10 +73,10 @@ struct ColourMessage : public Message The flash will then fade using a Timer to repaint itself and will send a change message once it is finished. */ -class FlashingComponent : public Component, - public MessageListener, - public ChangeBroadcaster, - private Timer +class FlashingComponent final : public Component, + public MessageListener, + public ChangeBroadcaster, + private Timer { public: FlashingComponent() {} @@ -144,8 +144,8 @@ private: }; //============================================================================== -class TimersAndEventsDemo : public Component, - private ChangeListener +class TimersAndEventsDemo final : public Component, + private ChangeListener { public: TimersAndEventsDemo() diff --git a/examples/Utilities/UnitTestsDemo.h b/examples/Utilities/UnitTestsDemo.h index ff6fcc94dc..d5e61e60db 100644 --- a/examples/Utilities/UnitTestsDemo.h +++ b/examples/Utilities/UnitTestsDemo.h @@ -53,7 +53,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class UnitTestsDemo : public Component +class UnitTestsDemo final : public Component { public: UnitTestsDemo() @@ -146,8 +146,8 @@ public: private: //============================================================================== - class TestRunnerThread : public Thread, - private Timer + class TestRunnerThread final : public Thread, + private Timer { public: TestRunnerThread (UnitTestsDemo& utd, const String& ctg) @@ -190,7 +190,7 @@ private: //============================================================================== // This subclass of UnitTestRunner is used to redirect the test output to our // TextBox, and to interrupt the running tests when our thread is asked to stop.. - class CustomTestRunner : public UnitTestRunner + class CustomTestRunner final : public UnitTestRunner { public: CustomTestRunner (TestRunnerThread& trt) : owner (trt) {} diff --git a/examples/Utilities/ValueTreesDemo.h b/examples/Utilities/ValueTreesDemo.h index 00a6a8c51f..b172700e08 100644 --- a/examples/Utilities/ValueTreesDemo.h +++ b/examples/Utilities/ValueTreesDemo.h @@ -49,8 +49,8 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class ValueTreeItem : public TreeViewItem, - private ValueTree::Listener +class ValueTreeItem final : public TreeViewItem, + private ValueTree::Listener { public: ValueTreeItem (const ValueTree& v, UndoManager& um) @@ -179,9 +179,9 @@ private: }; //============================================================================== -class ValueTreesDemo : public Component, - public DragAndDropContainer, - private Timer +class ValueTreesDemo final : public Component, + public DragAndDropContainer, + private Timer { public: ValueTreesDemo() diff --git a/examples/Utilities/XMLandJSONDemo.h b/examples/Utilities/XMLandJSONDemo.h index 1cf71f98f6..8362bccda3 100644 --- a/examples/Utilities/XMLandJSONDemo.h +++ b/examples/Utilities/XMLandJSONDemo.h @@ -49,7 +49,7 @@ #include "../Assets/DemoUtilities.h" //============================================================================== -class XmlTreeItem : public TreeViewItem +class XmlTreeItem final : public TreeViewItem { public: XmlTreeItem (XmlElement& x) : xml (x) {} @@ -115,7 +115,7 @@ private: }; //============================================================================== -class JsonTreeItem : public TreeViewItem +class JsonTreeItem final : public TreeViewItem { public: JsonTreeItem (Identifier i, var value) @@ -228,8 +228,8 @@ private: }; //============================================================================== -class XMLandJSONDemo : public Component, - private CodeDocument::Listener +class XMLandJSONDemo final : public Component, + private CodeDocument::Listener { public: /** The type of database to parse. */ diff --git a/extras/AudioPerformanceTest/Source/MainComponent.h b/extras/AudioPerformanceTest/Source/MainComponent.h index 28dbcdbf96..0b70d8406b 100644 --- a/extras/AudioPerformanceTest/Source/MainComponent.h +++ b/extras/AudioPerformanceTest/Source/MainComponent.h @@ -29,8 +29,8 @@ #include //============================================================================== -class MainContentComponent : public AudioAppComponent, - private Timer +class MainContentComponent final : public AudioAppComponent, + private Timer { public: //============================================================================== diff --git a/extras/AudioPluginHost/Source/HostStartup.cpp b/extras/AudioPluginHost/Source/HostStartup.cpp index 136630c82c..372c202e76 100644 --- a/extras/AudioPluginHost/Source/HostStartup.cpp +++ b/extras/AudioPluginHost/Source/HostStartup.cpp @@ -31,8 +31,8 @@ #error "If you're building the audio plugin host, you probably want to enable VST and/or AU support" #endif -class PluginScannerSubprocess : private ChildProcessWorker, - private AsyncUpdater +class PluginScannerSubprocess final : private ChildProcessWorker, + private AsyncUpdater { public: PluginScannerSubprocess() @@ -139,8 +139,8 @@ private: }; //============================================================================== -class PluginHostApp : public JUCEApplication, - private AsyncUpdater +class PluginHostApp final : public JUCEApplication, + private AsyncUpdater { public: PluginHostApp() = default; diff --git a/extras/AudioPluginHost/Source/Plugins/ARAPlugin.h b/extras/AudioPluginHost/Source/Plugins/ARAPlugin.h index 33cb6e76b9..ffae2a4f97 100644 --- a/extras/AudioPluginHost/Source/Plugins/ARAPlugin.h +++ b/extras/AudioPluginHost/Source/Plugins/ARAPlugin.h @@ -213,7 +213,7 @@ private: }; //============================================================================== -class AudioAccessController : public ARA::Host::AudioAccessControllerInterface +class AudioAccessController final : public ARA::Host::AudioAccessControllerInterface { public: ARA::ARAAudioReaderHostRef createAudioReaderForSource (ARA::ARAAudioSourceHostRef audioSourceHostRef, @@ -264,7 +264,7 @@ private: std::map> audioReaders; }; -class ArchivingController : public ARA::Host::ArchivingControllerInterface +class ArchivingController final : public ARA::Host::ArchivingControllerInterface { public: using ReaderConverter = ARAHostModel::ConversionFunctions; @@ -316,7 +316,7 @@ public: } }; -class ContentAccessController : public ARA::Host::ContentAccessControllerInterface +class ContentAccessController final : public ARA::Host::ContentAccessControllerInterface { public: using Converter = ARAHostModel::ConversionFunctions; @@ -433,7 +433,7 @@ public: ARA::ARAContentBarSignature barSignature; }; -class ModelUpdateController : public ARA::Host::ModelUpdateControllerInterface +class ModelUpdateController final : public ARA::Host::ModelUpdateControllerInterface { public: void notifyAudioSourceAnalysisProgress (ARA::ARAAudioSourceHostRef audioSourceHostRef, @@ -465,7 +465,7 @@ public: } }; -class PlaybackController : public ARA::Host::PlaybackControllerInterface +class PlaybackController final : public ARA::Host::PlaybackControllerInterface { public: void requestStartPlayback() noexcept override {} @@ -484,7 +484,7 @@ public: void requestEnableCycle (bool enable) noexcept override { ignoreUnused (enable); } }; -struct SimplePlayHead : public juce::AudioPlayHead +struct SimplePlayHead final : public juce::AudioPlayHead { Optional getPosition() const override { @@ -509,9 +509,9 @@ struct HostPlaybackController virtual void clearAudioSource() = 0; }; -class AudioSourceComponent : public Component, - public FileDragAndDropTarget, - public ChangeListener +class AudioSourceComponent final : public Component, + public FileDragAndDropTarget, + public ChangeListener { public: explicit AudioSourceComponent (HostPlaybackController& controller, juce::ChangeBroadcaster& bc) @@ -607,8 +607,8 @@ public: } private: - class WaveformComponent : public Component, - public ChangeListener + class WaveformComponent final : public Component, + public ChangeListener { public: WaveformComponent (AudioSourceComponent& p) @@ -701,14 +701,14 @@ private: TextButton playButton, goToStartButton; }; -class ARAPluginInstanceWrapper : public AudioPluginInstance +class ARAPluginInstanceWrapper final : public AudioPluginInstance { public: - class ARATestHost : public HostPlaybackController, - public juce::ChangeBroadcaster + class ARATestHost final : public HostPlaybackController, + public juce::ChangeBroadcaster { public: - class Editor : public AudioProcessorEditor + class Editor final : public AudioProcessorEditor { public: explicit Editor (ARATestHost& araTestHost) diff --git a/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.cpp b/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.cpp index e5b85fa57b..f02e4a18f2 100644 --- a/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.cpp +++ b/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.cpp @@ -31,7 +31,7 @@ //============================================================================== -struct NumberedBoxes : public TableListBox, +struct NumberedBoxes final : public TableListBox, private TableListBoxModel, private Button::Listener { @@ -170,9 +170,9 @@ private: }; //============================================================================== -class IOConfigurationWindow::InputOutputConfig : public Component, - private Button::Listener, - private NumberedBoxes::Listener +class IOConfigurationWindow::InputOutputConfig final : public Component, + private Button::Listener, + private NumberedBoxes::Listener { public: InputOutputConfig (IOConfigurationWindow& parent, bool direction) diff --git a/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.h b/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.h index eca7618ea1..228a26aecc 100644 --- a/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.h +++ b/extras/AudioPluginHost/Source/Plugins/IOConfigurationWindow.h @@ -30,7 +30,7 @@ class GraphDocumentComponent; //============================================================================== -class IOConfigurationWindow : public AudioProcessorEditor +class IOConfigurationWindow final : public AudioProcessorEditor { public: IOConfigurationWindow (AudioProcessor&); diff --git a/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp b/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp index 61f065f33c..6fb35a1a67 100644 --- a/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp +++ b/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp @@ -61,7 +61,7 @@ static std::unique_ptr createAssetInputStream (const char* resource #include "../../../../examples/Plugins/SurroundPluginDemo.h" //============================================================================== -class InternalPlugin : public AudioPluginInstance +class InternalPlugin final : public AudioPluginInstance { public: explicit InternalPlugin (std::unique_ptr innerIn) @@ -167,7 +167,7 @@ private: }; //============================================================================== -class SineWaveSynth : public AudioProcessor +class SineWaveSynth final : public AudioProcessor { public: SineWaveSynth() @@ -343,7 +343,7 @@ private: }; //============================================================================== -class ReverbPlugin : public AudioProcessor +class ReverbPlugin final : public AudioProcessor { public: ReverbPlugin() diff --git a/extras/AudioPluginHost/Source/Plugins/InternalPlugins.h b/extras/AudioPluginHost/Source/Plugins/InternalPlugins.h index 0325239f67..8f0f72099a 100644 --- a/extras/AudioPluginHost/Source/Plugins/InternalPlugins.h +++ b/extras/AudioPluginHost/Source/Plugins/InternalPlugins.h @@ -32,7 +32,7 @@ /** Manages the internal plugin types. */ -class InternalPluginFormat : public AudioPluginFormat +class InternalPluginFormat final : public AudioPluginFormat { public: //============================================================================== diff --git a/extras/AudioPluginHost/Source/Plugins/PluginGraph.h b/extras/AudioPluginHost/Source/Plugins/PluginGraph.h index 86ca82f5b1..c3007f6c2b 100644 --- a/extras/AudioPluginHost/Source/Plugins/PluginGraph.h +++ b/extras/AudioPluginHost/Source/Plugins/PluginGraph.h @@ -55,9 +55,9 @@ struct PluginDescriptionAndPreference /** A collection of plugins and some connections between them. */ -class PluginGraph : public FileBasedDocument, - public AudioProcessorListener, - private ChangeListener +class PluginGraph final : public FileBasedDocument, + public AudioProcessorListener, + private ChangeListener { public: //============================================================================== diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp index 483b4f5ddc..83fbdb8adf 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp @@ -92,8 +92,8 @@ #endif //============================================================================== -struct GraphEditorPanel::PinComponent : public Component, - public SettableTooltipClient +struct GraphEditorPanel::PinComponent final : public Component, + public SettableTooltipClient { PinComponent (GraphEditorPanel& p, AudioProcessorGraph::NodeAndChannel pinToUse, bool isIn) : panel (p), graph (p.graph), pin (pinToUse), isInput (isIn) @@ -170,10 +170,10 @@ struct GraphEditorPanel::PinComponent : public Component, }; //============================================================================== -struct GraphEditorPanel::PluginComponent : public Component, - public Timer, - private AudioProcessorParameter::Listener, - private AsyncUpdater +struct GraphEditorPanel::PluginComponent final : public Component, + public Timer, + private AudioProcessorParameter::Listener, + private AsyncUpdater { PluginComponent (GraphEditorPanel& p, AudioProcessorGraph::NodeID id) : panel (p), graph (p.graph), pluginID (id) { @@ -554,8 +554,8 @@ struct GraphEditorPanel::PluginComponent : public Component, //============================================================================== -struct GraphEditorPanel::ConnectorComponent : public Component, - public SettableTooltipClient +struct GraphEditorPanel::ConnectorComponent final : public Component, + public SettableTooltipClient { explicit ConnectorComponent (GraphEditorPanel& p) : panel (p), graph (p.graph) @@ -1001,8 +1001,8 @@ void GraphEditorPanel::timerCallback() } //============================================================================== -struct GraphDocumentComponent::TooltipBar : public Component, - private Timer +struct GraphDocumentComponent::TooltipBar final : public Component, + private Timer { TooltipBar() { @@ -1038,8 +1038,8 @@ struct GraphDocumentComponent::TooltipBar : public Component, }; //============================================================================== -class GraphDocumentComponent::TitleBarComponent : public Component, - private Button::Listener +class GraphDocumentComponent::TitleBarComponent final : public Component, + private Button::Listener { public: explicit TitleBarComponent (GraphDocumentComponent& graphDocumentComponent) @@ -1134,9 +1134,9 @@ private: }; //============================================================================== -struct GraphDocumentComponent::PluginListBoxModel : public ListBoxModel, - public ChangeListener, - public MouseListener +struct GraphDocumentComponent::PluginListBoxModel final : public ListBoxModel, + public ChangeListener, + public MouseListener { PluginListBoxModel (ListBox& lb, KnownPluginList& kpl) : owner (lb), diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h index 7223d0af80..48c86ffbd8 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h @@ -33,9 +33,9 @@ class MainHostWindow; /** A panel that displays and edits a PluginGraph. */ -class GraphEditorPanel : public Component, - public ChangeListener, - private Timer +class GraphEditorPanel final : public Component, + public ChangeListener, + private Timer { public: //============================================================================== @@ -98,10 +98,10 @@ private: It also manages the graph itself, and plays it. */ -class GraphDocumentComponent : public Component, - public DragAndDropTarget, - public DragAndDropContainer, - private ChangeListener +class GraphDocumentComponent final : public Component, + public DragAndDropTarget, + public DragAndDropContainer, + private ChangeListener { public: GraphDocumentComponent (AudioPluginFormatManager& formatManager, diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp index 7798cc240c..979c5ca69a 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp @@ -30,7 +30,7 @@ constexpr const char* scanModeKey = "pluginScanMode"; //============================================================================== -class Superprocess : private ChildProcessCoordinator +class Superprocess final : private ChildProcessCoordinator { public: Superprocess() @@ -94,8 +94,8 @@ private: }; //============================================================================== -class CustomPluginScanner : public KnownPluginList::CustomScanner, - private ChangeListener +class CustomPluginScanner final : public KnownPluginList::CustomScanner, + private ChangeListener { public: CustomPluginScanner() @@ -202,7 +202,7 @@ private: }; //============================================================================== -class CustomPluginListComponent : public PluginListComponent +class CustomPluginListComponent final : public PluginListComponent { public: CustomPluginListComponent (AudioPluginFormatManager& manager, @@ -256,7 +256,7 @@ private: }; //============================================================================== -class MainHostWindow::PluginListWindow : public DocumentWindow +class MainHostWindow::PluginListWindow final : public DocumentWindow { public: PluginListWindow (MainHostWindow& mw, AudioPluginFormatManager& pluginFormatManager) diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.h b/extras/AudioPluginHost/Source/UI/MainHostWindow.h index 0a73194084..ec0b2d592c 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.h +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.h @@ -74,11 +74,11 @@ void addPluginAutoScaleOptionsSubMenu (AudioPluginInstance*, PopupMenu&); constexpr const char* processUID = "juceaudiopluginhost"; //============================================================================== -class MainHostWindow : public DocumentWindow, - public MenuBarModel, - public ApplicationCommandTarget, - public ChangeListener, - public FileDragAndDropTarget +class MainHostWindow final : public DocumentWindow, + public MenuBarModel, + public ApplicationCommandTarget, + public ChangeListener, + public FileDragAndDropTarget { public: //============================================================================== diff --git a/extras/AudioPluginHost/Source/UI/PluginWindow.h b/extras/AudioPluginHost/Source/UI/PluginWindow.h index 212d28ba89..306b5dae29 100644 --- a/extras/AudioPluginHost/Source/UI/PluginWindow.h +++ b/extras/AudioPluginHost/Source/UI/PluginWindow.h @@ -46,10 +46,10 @@ class PluginGraph; /** A window that shows a log of parameter change messages sent by the plugin. */ -class PluginDebugWindow : public AudioProcessorEditor, - public AudioProcessorParameter::Listener, - public ListBoxModel, - public AsyncUpdater +class PluginDebugWindow final : public AudioProcessorEditor, + public AudioProcessorParameter::Listener, + public ListBoxModel, + public AsyncUpdater { public: PluginDebugWindow (AudioProcessor& proc) @@ -146,7 +146,7 @@ private: /** A desktop window containing a plugin's GUI. */ -class PluginWindow : public DocumentWindow +class PluginWindow final : public DocumentWindow { public: enum class Type @@ -235,7 +235,7 @@ public: } private: - class DecoratorConstrainer : public BorderedComponentBoundsConstrainer + class DecoratorConstrainer final : public BorderedComponentBoundsConstrainer { public: explicit DecoratorConstrainer (DocumentWindow& windowIn) @@ -327,7 +327,7 @@ private: } //============================================================================== - struct ProgramAudioProcessorEditor : public AudioProcessorEditor + struct ProgramAudioProcessorEditor final : public AudioProcessorEditor { explicit ProgramAudioProcessorEditor (AudioProcessor& p) : AudioProcessorEditor (p) diff --git a/extras/Build/juceaide/Main.cpp b/extras/Build/juceaide/Main.cpp index ebfe27a242..401a7cad8b 100644 --- a/extras/Build/juceaide/Main.cpp +++ b/extras/Build/juceaide/Main.cpp @@ -104,7 +104,7 @@ int writeBinaryData (juce::ArgumentList&& args) return 0; } -struct IconParseResults final +struct IconParseResults { juce::build_tools::Icons icons; juce::File output; @@ -191,7 +191,7 @@ bool getBoolValue (const std::unordered_map& dict, j || str.equalsIgnoreCase ("on"); } -struct UpdateField final +struct UpdateField { const std::unordered_map& dict; diff --git a/extras/NetworkGraphicsDemo/Source/ClientComponent.h b/extras/NetworkGraphicsDemo/Source/ClientComponent.h index b5ec5a393d..ff1b53dbfa 100644 --- a/extras/NetworkGraphicsDemo/Source/ClientComponent.h +++ b/extras/NetworkGraphicsDemo/Source/ClientComponent.h @@ -29,12 +29,12 @@ particular client covers, and updates itself when messages arrive from the master containing new canvas states. */ -class ClientCanvasComponent : public Component, - private OSCSender, - private OSCReceiver, - private OSCReceiver::Listener, - private AsyncUpdater, - private Timer +class ClientCanvasComponent final : public Component, + private OSCSender, + private OSCReceiver, + private OSCReceiver::Listener, + private AsyncUpdater, + private Timer { public: ClientCanvasComponent (PropertiesFile& p, int windowIndex) : properties (p) diff --git a/extras/NetworkGraphicsDemo/Source/Demos.h b/extras/NetworkGraphicsDemo/Source/Demos.h index 4a368ef6d5..aa31d2c360 100644 --- a/extras/NetworkGraphicsDemo/Source/Demos.h +++ b/extras/NetworkGraphicsDemo/Source/Demos.h @@ -24,7 +24,7 @@ */ -struct BlankCanvas : public AnimatedContent +struct BlankCanvas final : public AnimatedContent { String getName() const override { return "Blank Canvas"; } void reset() override {} @@ -33,7 +33,7 @@ struct BlankCanvas : public AnimatedContent }; //============================================================================== -struct GridLines : public AnimatedContent +struct GridLines final : public AnimatedContent { String getName() const override { return "Grid Lines"; } void reset() override {} @@ -64,7 +64,7 @@ struct GridLines : public AnimatedContent }; //============================================================================== -struct BackgroundLogo : public AnimatedContent +struct BackgroundLogo : public AnimatedContent { BackgroundLogo() { @@ -99,7 +99,7 @@ struct BackgroundLogo : public AnimatedContent }; //============================================================================== -struct FlockDemo : public BackgroundLogo +struct FlockDemo : public BackgroundLogo { String getName() const override { return "Flock"; } @@ -358,7 +358,7 @@ struct FlockDemo : public BackgroundLogo }; //============================================================================== -struct FlockWithText : public FlockDemo +struct FlockWithText final : public FlockDemo { FlockWithText() { @@ -445,7 +445,7 @@ struct FlockWithText : public FlockDemo }; //============================================================================== -struct SmallFlock : public FlockDemo +struct SmallFlock final : public FlockDemo { String getName() const override { return "Small Flock"; } @@ -456,7 +456,7 @@ struct SmallFlock : public FlockDemo }; //============================================================================== -struct BigFlock : public FlockDemo +struct BigFlock final : public FlockDemo { String getName() const override { return "Big Flock"; } @@ -468,7 +468,7 @@ struct BigFlock : public FlockDemo //============================================================================== template -struct MultiLogo : public BackgroundLogo +struct MultiLogo final : public BackgroundLogo { String getName() const override { return "Multi-Logo " + String ((int) numHorizontalLogos); } diff --git a/extras/NetworkGraphicsDemo/Source/Main.cpp b/extras/NetworkGraphicsDemo/Source/Main.cpp index 2ce75409bf..ce2f539249 100644 --- a/extras/NetworkGraphicsDemo/Source/Main.cpp +++ b/extras/NetworkGraphicsDemo/Source/Main.cpp @@ -47,7 +47,7 @@ namespace //============================================================================== -class NetworkGraphicsDemoApplication : public JUCEApplication +class NetworkGraphicsDemoApplication final : public JUCEApplication { public: NetworkGraphicsDemoApplication() : properties (getPropertyFileOptions()) @@ -89,7 +89,7 @@ public: } //============================================================================== - struct MainWindow : public DocumentWindow + struct MainWindow final : public DocumentWindow { explicit MainWindow (PropertiesFile& props) : DocumentWindow ("JUCE Networked Graphics Demo - Master", Colours::white, DocumentWindow::allButtons) diff --git a/extras/NetworkGraphicsDemo/Source/MasterComponent.h b/extras/NetworkGraphicsDemo/Source/MasterComponent.h index d7df6813e5..3e5c6656c6 100644 --- a/extras/NetworkGraphicsDemo/Source/MasterComponent.h +++ b/extras/NetworkGraphicsDemo/Source/MasterComponent.h @@ -28,11 +28,11 @@ Runs the master node, calls the demo to update the canvas, broadcasts those changes out to slaves, and shows a view of all the clients to allow them to be dragged around. */ -struct MasterContentComponent : public Component, - private Timer, - private OSCSender, - private OSCReceiver, - private OSCReceiver::Listener +struct MasterContentComponent final : public Component, + private Timer, + private OSCSender, + private OSCReceiver, + private OSCReceiver::Listener { MasterContentComponent (PropertiesFile& props) : properties (props) @@ -275,7 +275,7 @@ private: } //============================================================================== - struct DeviceComponent : public Component + struct DeviceComponent final : public Component { DeviceComponent (MasterContentComponent& e, String name) : Component (name), editor (e) diff --git a/extras/NetworkGraphicsDemo/Source/SharedCanvas.h b/extras/NetworkGraphicsDemo/Source/SharedCanvas.h index fe3d4b397f..0a5f564cf1 100644 --- a/extras/NetworkGraphicsDemo/Source/SharedCanvas.h +++ b/extras/NetworkGraphicsDemo/Source/SharedCanvas.h @@ -289,7 +289,7 @@ private: }; //============================================================================== -class CanvasGeneratingContext : public LowLevelGraphicsContext +class CanvasGeneratingContext final : public LowLevelGraphicsContext { public: CanvasGeneratingContext (SharedCanvasDescription& c) : canvas (c) @@ -405,7 +405,7 @@ public: private: //============================================================================== - struct SharedCanvasHolder : public ReferenceCountedObject + struct SharedCanvasHolder final : public ReferenceCountedObject { SharedCanvasDescription canvas; }; diff --git a/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h b/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h index 5c90b0567b..2fdaac5a2c 100644 --- a/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h +++ b/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h @@ -32,7 +32,7 @@ #include "jucer_NewProjectWizard.h" //============================================================================== -class ItemHeader : public Component +class ItemHeader final : public Component { public: ItemHeader (StringRef name, StringRef description, const char* iconSvgData) @@ -88,7 +88,7 @@ private: }; //============================================================================== -class TemplateComponent : public Component +class TemplateComponent final : public Component { public: TemplateComponent (const NewProjectTemplates::ProjectTemplate& temp, @@ -257,7 +257,7 @@ private: }; //============================================================================== -class ExampleComponent : public Component +class ExampleComponent final : public Component { public: ExampleComponent (const File& f, std::function selectedCallback) diff --git a/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.cpp b/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.cpp index d26b5299d8..18081fb684 100644 --- a/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.cpp +++ b/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.cpp @@ -32,7 +32,7 @@ #include "jucer_ContentComponents.h" //============================================================================== -struct ContentComponent : public Component +struct ContentComponent final : public Component { ContentComponent() { @@ -164,7 +164,7 @@ static std::unique_ptr createProjectTemplatesTab (ContentComponent& c } //============================================================================== -struct ProjectTemplatesAndExamples : public TabbedComponent +struct ProjectTemplatesAndExamples final : public TabbedComponent { ProjectTemplatesAndExamples (ContentComponent& c, std::function&&)>&& newProjectCb, @@ -203,8 +203,8 @@ struct ProjectTemplatesAndExamples : public TabbedComponent private: //============================================================================== - struct SetJUCEPathComponent : public Component, - private ChangeListener + struct SetJUCEPathComponent final : public Component, + private ChangeListener { explicit SetJUCEPathComponent (ProjectTemplatesAndExamples& o) : owner (o) diff --git a/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.h b/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.h index 2f99e9a053..370b578096 100644 --- a/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.h +++ b/extras/Projucer/Source/Application/StartPage/jucer_StartPageComponent.h @@ -29,7 +29,7 @@ struct ContentComponent; struct ProjectTemplatesAndExamples; //============================================================================== -class StartPageComponent : public Component +class StartPageComponent final : public Component { public: StartPageComponent (std::function&&)>&& newProjectCb, diff --git a/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h b/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h index bbbdf4f87b..47c7d1491b 100644 --- a/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h +++ b/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h @@ -26,7 +26,7 @@ #pragma once //============================================================================== -class StartPageTreeHolder : public Component +class StartPageTreeHolder final : public Component { public: enum class Open { no, yes }; @@ -82,7 +82,7 @@ public: private: //============================================================================== - class TreeSubItem : public TreeViewItem + class TreeSubItem final : public TreeViewItem { public: TreeSubItem (StartPageTreeHolder& o, const String& n, const StringArray& subItemsIn) @@ -153,7 +153,7 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeSubItem) }; - struct TreeRootItem : public TreeViewItem + struct TreeRootItem final : public TreeViewItem { explicit TreeRootItem (StartPageTreeHolder& o) : owner (o) diff --git a/extras/Projucer/Source/Application/UserAccount/jucer_LicenseController.h b/extras/Projucer/Source/Application/UserAccount/jucer_LicenseController.h index 93c2c52fa8..f55fcfafff 100644 --- a/extras/Projucer/Source/Application/UserAccount/jucer_LicenseController.h +++ b/extras/Projucer/Source/Application/UserAccount/jucer_LicenseController.h @@ -29,7 +29,7 @@ #include "jucer_LicenseQueryThread.h" //============================================================================== -class LicenseController : private Timer +class LicenseController final : private Timer { public: LicenseController() diff --git a/extras/Projucer/Source/Application/UserAccount/jucer_LicenseQueryThread.h b/extras/Projucer/Source/Application/UserAccount/jucer_LicenseQueryThread.h index 08b96574f4..3b5165e466 100644 --- a/extras/Projucer/Source/Application/UserAccount/jucer_LicenseQueryThread.h +++ b/extras/Projucer/Source/Application/UserAccount/jucer_LicenseQueryThread.h @@ -181,7 +181,7 @@ private: virtual bool parseServerResponse (const String&, LicenseState&) = 0; }; - struct UserLogin : public AccountEnquiryBase + struct UserLogin final : public AccountEnquiryBase { UserLogin (const String& e, const String& p) : userEmail (e), userPassword (p) @@ -230,7 +230,7 @@ private: String userEmail, userPassword; }; - struct UserLicenseQuery : public AccountEnquiryBase + struct UserLicenseQuery final : public AccountEnquiryBase { UserLicenseQuery (const String& authToken) : userAuthToken (authToken) diff --git a/extras/Projucer/Source/Application/UserAccount/jucer_LoginFormComponent.h b/extras/Projucer/Source/Application/UserAccount/jucer_LoginFormComponent.h index 6092c0b167..8d2855795e 100644 --- a/extras/Projucer/Source/Application/UserAccount/jucer_LoginFormComponent.h +++ b/extras/Projucer/Source/Application/UserAccount/jucer_LoginFormComponent.h @@ -29,7 +29,7 @@ #include "../../Project/UI/jucer_UserAvatarComponent.h" //============================================================================== -class LoginFormComponent : public Component +class LoginFormComponent final : public Component { public: LoginFormComponent (MainWindow& window) @@ -145,8 +145,8 @@ public: } private: - class ProgressButton : public TextButton, - private Timer + class ProgressButton final : public TextButton, + private Timer { public: ProgressButton (const String& buttonName) diff --git a/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h index 274cfa2874..1eb9fd26f1 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h @@ -27,7 +27,7 @@ //============================================================================== -class AboutWindowComponent : public Component +class AboutWindowComponent final : public Component { public: AboutWindowComponent() diff --git a/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h index 9482a3d3f4..c29073c5dd 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h @@ -28,7 +28,7 @@ #include "../../Utility/UI/PropertyComponents/jucer_ColourPropertyComponent.h" //============================================================================== -class EditorColourSchemeWindowComponent : public Component +class EditorColourSchemeWindowComponent final : public Component { public: EditorColourSchemeWindowComponent() @@ -62,8 +62,8 @@ private: //============================================================================== struct AppearanceEditor { - struct FontScanPanel : public Component, - private Timer + struct FontScanPanel final : public Component, + private Timer { FontScanPanel() { @@ -121,7 +121,7 @@ private: }; //============================================================================== - struct EditorPanel : public Component + struct EditorPanel final : public Component { EditorPanel() : loadButton ("Load Scheme..."), @@ -282,7 +282,7 @@ private: }; //============================================================================== - struct FontNameValueSource : public ValueSourceFilter + struct FontNameValueSource final : public ValueSourceFilter { FontNameValueSource (const Value& source) : ValueSourceFilter (source) {} @@ -321,7 +321,7 @@ private: }; //============================================================================== - struct FontSizeValueSource : public ValueSourceFilter + struct FontSizeValueSource final : public ValueSourceFilter { FontSizeValueSource (const Value& source) : ValueSourceFilter (source) {} diff --git a/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h b/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h index af2f2ff131..40d38df3a9 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h +++ b/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h @@ -27,7 +27,7 @@ //============================================================================== -struct FloatingToolWindow : public DialogWindow +struct FloatingToolWindow final : public DialogWindow { FloatingToolWindow (const String& title, const String& windowPosPropertyName, diff --git a/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h index 9552626e75..844f89898e 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h @@ -28,10 +28,10 @@ #include "../../Utility/UI/PropertyComponents/jucer_LabelPropertyComponent.h" //============================================================================== -class GlobalPathsWindowComponent : public Component, - private Timer, - private Value::Listener, - private ChangeListener +class GlobalPathsWindowComponent final : public Component, + private Timer, + private Value::Listener, + private ChangeListener { public: GlobalPathsWindowComponent() diff --git a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h index 85805cff58..6402609d90 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h @@ -57,8 +57,8 @@ static String getWidthLimitedStringFromVarArray (const var& varArray) noexcept } //============================================================================== -class PIPCreatorWindowComponent : public Component, - private ValueTree::Listener +class PIPCreatorWindowComponent final : public Component, + private ValueTree::Listener { public: PIPCreatorWindowComponent() @@ -109,7 +109,7 @@ public: private: //============================================================================== - struct PIPCreatorLookAndFeel : public ProjucerLookAndFeel + struct PIPCreatorLookAndFeel final : public ProjucerLookAndFeel { PIPCreatorLookAndFeel() {} diff --git a/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h index 1dff98857c..c4ca9c4eb1 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h @@ -27,8 +27,8 @@ //============================================================================== -class SVGPathDataComponent : public Component, - public FileDragAndDropTarget +class SVGPathDataComponent final : public Component, + public FileDragAndDropTarget { public: diff --git a/extras/Projucer/Source/Application/Windows/jucer_TranslationToolWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_TranslationToolWindowComponent.h index 55d29eb516..43aed72e33 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_TranslationToolWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_TranslationToolWindowComponent.h @@ -28,7 +28,7 @@ #include "../../Utility/Helpers/jucer_TranslationHelpers.h" //============================================================================== -class TranslationToolComponent : public Component +class TranslationToolComponent final : public Component { public: TranslationToolComponent() diff --git a/extras/Projucer/Source/Application/Windows/jucer_UTF8WindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_UTF8WindowComponent.h index b03a6abb4a..ec14767d54 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_UTF8WindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_UTF8WindowComponent.h @@ -27,7 +27,7 @@ //============================================================================== -class UTF8Component : public Component +class UTF8Component final : public Component { public: UTF8Component() diff --git a/extras/Projucer/Source/Application/jucer_Application.cpp b/extras/Projucer/Source/Application/jucer_Application.cpp index 319b391293..ccacd0c0b4 100644 --- a/extras/Projucer/Source/Application/jucer_Application.cpp +++ b/extras/Projucer/Source/Application/jucer_Application.cpp @@ -29,7 +29,7 @@ void registerGUIEditorCommands(); //============================================================================== -struct ProjucerApplication::MainMenuModel : public MenuBarModel +struct ProjucerApplication::MainMenuModel final : public MenuBarModel { MainMenuModel() { diff --git a/extras/Projucer/Source/Application/jucer_Application.h b/extras/Projucer/Source/Application/jucer_Application.h index 9e94627455..c317fedd07 100644 --- a/extras/Projucer/Source/Application/jucer_Application.h +++ b/extras/Projucer/Source/Application/jucer_Application.h @@ -33,8 +33,8 @@ #include "../Utility/UI/jucer_ProjucerLookAndFeel.h" //============================================================================== -class ProjucerApplication : public JUCEApplication, - private AsyncUpdater +class ProjucerApplication final : public JUCEApplication, + private AsyncUpdater { public: ProjucerApplication() = default; diff --git a/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp b/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp index b80984ae27..c1ccaba9aa 100644 --- a/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp +++ b/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp @@ -124,7 +124,7 @@ void LatestVersionCheckerAndUpdater::run() } //============================================================================== -class UpdateDialog : public Component +class UpdateDialog final : public Component { public: UpdateDialog (const String& newVersion, const String& releaseNotes) @@ -385,7 +385,7 @@ void LatestVersionCheckerAndUpdater::addNotificationToOpenProjects (const Versio } //============================================================================== -class DownloadAndInstallThread : private ThreadWithProgressWindow +class DownloadAndInstallThread final : private ThreadWithProgressWindow { public: DownloadAndInstallThread (const VersionInfo::Asset& a, const File& t, std::function&& cb) diff --git a/extras/Projucer/Source/Application/jucer_AutoUpdater.h b/extras/Projucer/Source/Application/jucer_AutoUpdater.h index cc4f705e9a..1f687e7219 100644 --- a/extras/Projucer/Source/Application/jucer_AutoUpdater.h +++ b/extras/Projucer/Source/Application/jucer_AutoUpdater.h @@ -29,8 +29,8 @@ class DownloadAndInstallThread; -class LatestVersionCheckerAndUpdater : public DeletedAtShutdown, - private Thread +class LatestVersionCheckerAndUpdater final : public DeletedAtShutdown, + private Thread { public: LatestVersionCheckerAndUpdater(); diff --git a/extras/Projucer/Source/Application/jucer_MainWindow.cpp b/extras/Projucer/Source/Application/jucer_MainWindow.cpp index 0ec51a8cb6..031cf9a792 100644 --- a/extras/Projucer/Source/Application/jucer_MainWindow.cpp +++ b/extras/Projucer/Source/Application/jucer_MainWindow.cpp @@ -33,9 +33,9 @@ #include "../Project/UI/jucer_ProjectContentComponent.h" //============================================================================== -class BlurOverlayWithComponent : public Component, - private ComponentMovementWatcher, - private AsyncUpdater +class BlurOverlayWithComponent final : public Component, + private ComponentMovementWatcher, + private AsyncUpdater { public: BlurOverlayWithComponent (MainWindow& window, std::unique_ptr comp) diff --git a/extras/Projucer/Source/Application/jucer_MainWindow.h b/extras/Projucer/Source/Application/jucer_MainWindow.h index b7bfad8f80..4880ac3f78 100644 --- a/extras/Projucer/Source/Application/jucer_MainWindow.h +++ b/extras/Projucer/Source/Application/jucer_MainWindow.h @@ -35,12 +35,12 @@ class ProjectContentComponent; /** The big top-level window where everything happens. */ -class MainWindow : public DocumentWindow, - public ApplicationCommandTarget, - public FileDragAndDropTarget, - public DragAndDropContainer, - private Value::Listener, - private ChangeListener +class MainWindow final : public DocumentWindow, + public ApplicationCommandTarget, + public FileDragAndDropTarget, + public DragAndDropContainer, + private Value::Listener, + private ChangeListener { public: //============================================================================== diff --git a/extras/Projucer/Source/CodeEditor/jucer_DocumentEditorComponent.h b/extras/Projucer/Source/CodeEditor/jucer_DocumentEditorComponent.h index c105730aed..fc47827ffe 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_DocumentEditorComponent.h +++ b/extras/Projucer/Source/CodeEditor/jucer_DocumentEditorComponent.h @@ -28,8 +28,8 @@ #include "jucer_OpenDocumentManager.h" //============================================================================== -class DocumentEditorComponent : public Component, - private OpenDocumentManager::DocumentCloseListener +class DocumentEditorComponent : public Component, + private OpenDocumentManager::DocumentCloseListener { public: //============================================================================== diff --git a/extras/Projucer/Source/CodeEditor/jucer_ItemPreviewComponent.h b/extras/Projucer/Source/CodeEditor/jucer_ItemPreviewComponent.h index a229c12986..ad3865c672 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_ItemPreviewComponent.h +++ b/extras/Projucer/Source/CodeEditor/jucer_ItemPreviewComponent.h @@ -27,7 +27,7 @@ //============================================================================== -class ItemPreviewComponent : public Component +class ItemPreviewComponent final : public Component { public: ItemPreviewComponent (const File& f) : file (f) diff --git a/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.cpp b/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.cpp index 0db552e7e1..c11066b25b 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.cpp +++ b/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.cpp @@ -30,7 +30,7 @@ //============================================================================== -class UnknownDocument : public OpenDocumentManager::Document +class UnknownDocument final : public OpenDocumentManager::Document { public: UnknownDocument (Project* p, const File& f) @@ -40,7 +40,7 @@ public: } //============================================================================== - struct Type : public OpenDocumentManager::DocumentType + struct Type final : public OpenDocumentManager::DocumentType { bool canOpenFile (const File&) override { return true; } Document* openFile (Project* p, const File& f) override { return new UnknownDocument (p, f); } diff --git a/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h b/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h index 161763e4d9..e7c3ba4b84 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h +++ b/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h @@ -134,7 +134,7 @@ private: }; //============================================================================== -class RecentDocumentList : private OpenDocumentManager::DocumentCloseListener +class RecentDocumentList final : private OpenDocumentManager::DocumentCloseListener { public: RecentDocumentList(); diff --git a/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.cpp b/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.cpp index b152892168..3e4bf7d50d 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.cpp +++ b/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.cpp @@ -375,7 +375,7 @@ void GenericCodeEditorComponent::removeListener (GenericCodeEditorComponent::Lis } //============================================================================== -class GenericCodeEditorComponent::FindPanel : public Component +class GenericCodeEditorComponent::FindPanel final : public Component { public: FindPanel() diff --git a/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.h b/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.h index d0454ac3a7..6cfc5bcd55 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.h +++ b/extras/Projucer/Source/CodeEditor/jucer_SourceCodeEditor.h @@ -28,7 +28,7 @@ #include "jucer_DocumentEditorComponent.h" //============================================================================== -class SourceCodeDocument : public OpenDocumentManager::Document +class SourceCodeDocument : public OpenDocumentManager::Document { public: SourceCodeDocument (Project*, const File&); @@ -93,7 +93,7 @@ public: CodeDocument& getCodeDocument(); //============================================================================== - struct Type : public OpenDocumentManager::DocumentType + struct Type final : public OpenDocumentManager::DocumentType { bool canOpenFile (const File& file) override { @@ -141,9 +141,9 @@ private: class GenericCodeEditorComponent; //============================================================================== -class SourceCodeEditor : public DocumentEditorComponent, - private ValueTree::Listener, - private CodeDocument::Listener +class SourceCodeEditor final : public DocumentEditorComponent, + private ValueTree::Listener, + private CodeDocument::Listener { public: SourceCodeEditor (OpenDocumentManager::Document*, CodeDocument&); @@ -178,7 +178,7 @@ private: //============================================================================== -class GenericCodeEditorComponent : public CodeEditorComponent +class GenericCodeEditorComponent : public CodeEditorComponent { public: GenericCodeEditorComponent (const File&, CodeDocument&, CodeTokeniser*); @@ -224,7 +224,7 @@ private: }; //============================================================================== -class CppCodeEditorComponent : public GenericCodeEditorComponent +class CppCodeEditorComponent final : public GenericCodeEditorComponent { public: CppCodeEditorComponent (const File&, CodeDocument&); diff --git a/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp b/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp index b8415bc2ba..fdeb27edc0 100644 --- a/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp +++ b/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp @@ -75,7 +75,7 @@ static LicenseState::Type getLicenseTypeFromValue (const String& d) } #if ! JUCER_ENABLE_GPL_MODE -struct LicenseController::ModalCompletionCallback : ModalComponentManager::Callback +struct LicenseController::ModalCompletionCallback final : ModalComponentManager::Callback { ModalCompletionCallback (LicenseController& controller) : owner (controller) {} void modalStateFinished (int returnValue) override { owner.modalStateFinished (returnValue); } diff --git a/extras/Projucer/Source/Project/Modules/jucer_AvailableModulesList.h b/extras/Projucer/Source/Project/Modules/jucer_AvailableModulesList.h index 186e0dd665..e174ee24ec 100644 --- a/extras/Projucer/Source/Project/Modules/jucer_AvailableModulesList.h +++ b/extras/Projucer/Source/Project/Modules/jucer_AvailableModulesList.h @@ -30,7 +30,7 @@ #include //============================================================================== -class AvailableModulesList : private AsyncUpdater +class AvailableModulesList final : private AsyncUpdater { public: using ModuleIDAndFolder = std::pair; diff --git a/extras/Projucer/Source/Project/UI/Sidebar/jucer_ExporterTreeItems.h b/extras/Projucer/Source/Project/UI/Sidebar/jucer_ExporterTreeItems.h index adec1a752e..23371d9c3b 100644 --- a/extras/Projucer/Source/Project/UI/Sidebar/jucer_ExporterTreeItems.h +++ b/extras/Projucer/Source/Project/UI/Sidebar/jucer_ExporterTreeItems.h @@ -27,8 +27,8 @@ //============================================================================== -class ExporterItem : public ProjectTreeItemBase, - private Value::Listener +class ExporterItem final : public ProjectTreeItemBase, + private Value::Listener { public: ExporterItem (Project& p, ProjectExporter* e, int index) @@ -184,7 +184,7 @@ private: } //============================================================================== - struct SettingsComp : public Component + struct SettingsComp final : public Component { SettingsComp (ProjectExporter& exp) : group (exp.getUniqueName(), @@ -213,7 +213,7 @@ private: //============================================================================== -class ConfigItem : public ProjectTreeItemBase +class ConfigItem final : public ProjectTreeItemBase { public: ConfigItem (const ProjectExporter::BuildConfiguration::Ptr& conf, ProjectExporter& e) @@ -290,7 +290,7 @@ private: ScopedMessageBox messageBox; //============================================================================== - class SettingsComp : public Component + class SettingsComp final : public Component { public: SettingsComp (ProjectExporter::BuildConfiguration& conf) @@ -319,7 +319,7 @@ private: }; //============================================================================== -class ExportersTreeRoot : public ProjectTreeItemBase +class ExportersTreeRoot final : public ProjectTreeItemBase { public: ExportersTreeRoot (Project& p) diff --git a/extras/Projucer/Source/Project/UI/Sidebar/jucer_FileTreeItems.h b/extras/Projucer/Source/Project/UI/Sidebar/jucer_FileTreeItems.h index d1e0b87ce8..1c8f7a1a4c 100644 --- a/extras/Projucer/Source/Project/UI/Sidebar/jucer_FileTreeItems.h +++ b/extras/Projucer/Source/Project/UI/Sidebar/jucer_FileTreeItems.h @@ -27,8 +27,8 @@ //============================================================================== -class FileTreeItemBase : public JucerTreeViewBase, - private ValueTree::Listener +class FileTreeItemBase : public JucerTreeViewBase, + private ValueTree::Listener { public: FileTreeItemBase (const Project::Item& projectItem) @@ -398,7 +398,7 @@ protected: void triggerAsyncRename (const Project::Item& itemToRename) { - struct RenameMessage : public CallbackMessage + struct RenameMessage final : public CallbackMessage { RenameMessage (TreeView* const t, const Project::Item& i) : tree (t), itemToRename (i) {} @@ -479,7 +479,7 @@ private: }; //============================================================================== -class SourceFileItem : public FileTreeItemBase +class SourceFileItem final : public FileTreeItemBase { public: SourceFileItem (const Project::Item& projectItem) @@ -651,7 +651,7 @@ public: }; //============================================================================== -class GroupItem : public FileTreeItemBase +class GroupItem final : public FileTreeItemBase { public: GroupItem (const Project::Item& projectItem, const String& filter = {}) diff --git a/extras/Projucer/Source/Project/UI/Sidebar/jucer_ModuleTreeItems.h b/extras/Projucer/Source/Project/UI/Sidebar/jucer_ModuleTreeItems.h index cbaae794d2..4f518e4ad5 100644 --- a/extras/Projucer/Source/Project/UI/Sidebar/jucer_ModuleTreeItems.h +++ b/extras/Projucer/Source/Project/UI/Sidebar/jucer_ModuleTreeItems.h @@ -27,7 +27,7 @@ //============================================================================== -class ModuleItem : public ProjectTreeItemBase +class ModuleItem final : public ProjectTreeItemBase { public: ModuleItem (Project& p, const String& modID) @@ -117,9 +117,9 @@ private: bool cppStandardHigherThanProject = false; //============================================================================== - class ModuleSettingsPanel : public Component, - private ValueTree::Listener, - private Value::Listener + class ModuleSettingsPanel final : public Component, + private ValueTree::Listener, + private Value::Listener { public: ModuleSettingsPanel (Project& p, const String& modID, TreeView* tree) @@ -275,8 +275,8 @@ private: String moduleID; //============================================================================== - class ModuleInfoComponent : public PropertyComponent, - private Value::Listener + class ModuleInfoComponent final : public PropertyComponent, + private Value::Listener { public: ModuleInfoComponent (Project& p, const String& modID) @@ -337,7 +337,7 @@ private: }; //============================================================================== - class MissingDependenciesComponent : public PropertyComponent + class MissingDependenciesComponent final : public PropertyComponent { public: MissingDependenciesComponent (Project& p, const String& modID) @@ -400,7 +400,7 @@ private: }; //============================================================================== - struct CppStandardWarningComponent : public PropertyComponent + struct CppStandardWarningComponent final : public PropertyComponent { CppStandardWarningComponent() : PropertyComponent ("CppStandard", 100) @@ -428,9 +428,9 @@ private: }; //============================================================================== -class EnabledModulesItem : public ProjectTreeItemBase, - private Value::Listener, - private AvailableModulesList::Listener +class EnabledModulesItem final : public ProjectTreeItemBase, + private Value::Listener, + private AvailableModulesList::Listener { public: EnabledModulesItem (Project& p) diff --git a/extras/Projucer/Source/Project/UI/Sidebar/jucer_ProjectTreeItemBase.h b/extras/Projucer/Source/Project/UI/Sidebar/jucer_ProjectTreeItemBase.h index f4b1a5d440..82fac7c357 100644 --- a/extras/Projucer/Source/Project/UI/Sidebar/jucer_ProjectTreeItemBase.h +++ b/extras/Projucer/Source/Project/UI/Sidebar/jucer_ProjectTreeItemBase.h @@ -27,8 +27,8 @@ //============================================================================== -struct ProjectTreeItemBase : public JucerTreeViewBase, - public ValueTree::Listener +struct ProjectTreeItemBase : public JucerTreeViewBase, + public ValueTree::Listener { ProjectTreeItemBase() {} diff --git a/extras/Projucer/Source/Project/UI/Sidebar/jucer_Sidebar.h b/extras/Projucer/Source/Project/UI/Sidebar/jucer_Sidebar.h index fa894d342c..9fd7eac48f 100644 --- a/extras/Projucer/Source/Project/UI/Sidebar/jucer_Sidebar.h +++ b/extras/Projucer/Source/Project/UI/Sidebar/jucer_Sidebar.h @@ -26,8 +26,8 @@ #pragma once //============================================================================== -class ConcertinaHeader : public Component, - public ChangeBroadcaster +class ConcertinaHeader final : public Component, + public ChangeBroadcaster { public: ConcertinaHeader (String n, Path p) @@ -98,9 +98,9 @@ private: }; //============================================================================== -class FindPanel : public Component, - private Timer, - private FocusChangeListener +class FindPanel final : public Component, + private Timer, + private FocusChangeListener { public: FindPanel (std::function cb) @@ -172,7 +172,7 @@ private: }; //============================================================================== -class ConcertinaTreeComponent : public Component +class ConcertinaTreeComponent final : public Component { public: class AdditionalComponents @@ -296,8 +296,8 @@ private: //============================================================================== -struct ProjectSettingsComponent : public Component, - private ChangeListener +struct ProjectSettingsComponent final : public Component, + private ChangeListener { ProjectSettingsComponent (Project& p) : project (p), @@ -359,7 +359,7 @@ struct ProjectSettingsComponent : public Component, }; //============================================================================== -struct FileTreePanel : public TreePanelBase +struct FileTreePanel final : public TreePanelBase { FileTreePanel (Project& p) : TreePanelBase (&p, "fileTreeState") @@ -376,7 +376,7 @@ struct FileTreePanel : public TreePanelBase } }; -struct ModuleTreePanel : public TreePanelBase +struct ModuleTreePanel final : public TreePanelBase { ModuleTreePanel (Project& p) : TreePanelBase (&p, "moduleTreeState") @@ -387,7 +387,7 @@ struct ModuleTreePanel : public TreePanelBase } }; -struct ExportersTreePanel : public TreePanelBase +struct ExportersTreePanel final : public TreePanelBase { ExportersTreePanel (Project& p) : TreePanelBase (&p, "exportersTreeState") @@ -399,8 +399,8 @@ struct ExportersTreePanel : public TreePanelBase }; //============================================================================== -class Sidebar : public Component, - private ChangeListener +class Sidebar final : public Component, + private ChangeListener { public: Sidebar (Project* p) diff --git a/extras/Projucer/Source/Project/UI/jucer_ContentViewComponent.h b/extras/Projucer/Source/Project/UI/jucer_ContentViewComponent.h index 7a703a084b..7bb1f8905a 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ContentViewComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_ContentViewComponent.h @@ -27,7 +27,7 @@ //============================================================================== -class ContentViewComponent : public Component +class ContentViewComponent final : public Component { public: ContentViewComponent() @@ -71,7 +71,7 @@ public: } private: - class LogoComponent : public Component + class LogoComponent final : public Component { public: void paint (Graphics& g) override diff --git a/extras/Projucer/Source/Project/UI/jucer_ContentViewComponents.h b/extras/Projucer/Source/Project/UI/jucer_ContentViewComponents.h index 79598849ca..4007f3f0d6 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ContentViewComponents.h +++ b/extras/Projucer/Source/Project/UI/jucer_ContentViewComponents.h @@ -28,7 +28,7 @@ #include "../../Utility/UI/PropertyComponents/jucer_LabelPropertyComponent.h" //============================================================================== -struct ContentViewHeader : public Component +struct ContentViewHeader final : public Component { ContentViewHeader (String headerName, Icon headerIcon) : name (headerName), icon (headerIcon) @@ -54,7 +54,7 @@ struct ContentViewHeader : public Component }; //============================================================================== -class ListBoxHeader : public Component +class ListBoxHeader final : public Component { public: ListBoxHeader (Array columnHeaders) @@ -154,7 +154,7 @@ private: }; //============================================================================== -class InfoButton : public Button +class InfoButton final : public Button { public: InfoButton (const String& infoToDisplay = {}) @@ -217,7 +217,7 @@ private: int numLines = 1; //============================================================================== - struct InfoWindow : public Component + struct InfoWindow final : public Component { InfoWindow (const String& s) : stringToDisplay (s) @@ -241,8 +241,8 @@ private: }; //============================================================================== -class PropertyGroupComponent : public Component, - private TextPropertyComponent::Listener +class PropertyGroupComponent final : public Component, + private TextPropertyComponent::Listener { public: PropertyGroupComponent (String name, Icon icon, String desc = {}) @@ -344,7 +344,7 @@ public: private: //============================================================================== - struct PropertyAndInfoWrapper : public Component + struct PropertyAndInfoWrapper final : public Component { PropertyAndInfoWrapper (PropertyComponent& c, InfoButton& i) : propertyComponent (c), diff --git a/extras/Projucer/Source/Project/UI/jucer_FileGroupInformationComponent.h b/extras/Projucer/Source/Project/UI/jucer_FileGroupInformationComponent.h index cd4c954c01..476f3c99cd 100644 --- a/extras/Projucer/Source/Project/UI/jucer_FileGroupInformationComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_FileGroupInformationComponent.h @@ -27,9 +27,9 @@ //============================================================================== -class FileGroupInformationComponent : public Component, - private ListBoxModel, - private ValueTree::Listener +class FileGroupInformationComponent final : public Component, + private ListBoxModel, + private ValueTree::Listener { public: FileGroupInformationComponent (const Project::Item& group) @@ -126,7 +126,7 @@ private: } //============================================================================== - class FileOptionComponent : public Component + class FileOptionComponent final : public Component { public: FileOptionComponent (const Project::Item& fileItem, ListBoxHeader* listBoxHeader) @@ -203,8 +203,8 @@ private: private: //============================================================================== - class CompilerFlagSchemeSelector : public Component, - private Value::Listener + class CompilerFlagSchemeSelector final : public Component, + private Value::Listener { public: CompilerFlagSchemeSelector (Project::Item& it) diff --git a/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.h b/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.h index 46e2b7cbeb..5ea4ed003b 100644 --- a/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.h @@ -34,11 +34,11 @@ class ProjectContentComponent; class ProjectExporter; //============================================================================== -class HeaderComponent : public Component, - private ValueTree::Listener, - private ChangeListener, - private Value::Listener, - private Timer +class HeaderComponent final : public Component, + private ValueTree::Listener, + private ChangeListener, + private Value::Listener, + private Timer { public: HeaderComponent (ProjectContentComponent* projectContentComponent); diff --git a/extras/Projucer/Source/Project/UI/jucer_ModulesInformationComponent.h b/extras/Projucer/Source/Project/UI/jucer_ModulesInformationComponent.h index 555ef8395b..c1372a46d6 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ModulesInformationComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_ModulesInformationComponent.h @@ -27,9 +27,9 @@ //============================================================================== -class ModulesInformationComponent : public Component, - private ListBoxModel, - private ValueTree::Listener +class ModulesInformationComponent final : public Component, + private ListBoxModel, + private ValueTree::Listener { public: ModulesInformationComponent (Project& p) diff --git a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp index 0ceae94e7a..c4d54dbe24 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp +++ b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp @@ -266,7 +266,7 @@ void ProjectContentComponent::setScrollableEditorComponent (std::unique_ptr content) @@ -601,7 +601,7 @@ void ProjectContentComponent::showTranslationTool() } //============================================================================== -struct AsyncCommandRetrier : public Timer +struct AsyncCommandRetrier final : public Timer { AsyncCommandRetrier (const ApplicationCommandTarget::InvocationInfo& i) : info (i) { diff --git a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.h b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.h index b5cbd23ca9..ef06dd6bcc 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.h @@ -34,10 +34,10 @@ class Sidebar; struct WizardHolder; //============================================================================== -class ProjectContentComponent : public Component, - public ApplicationCommandTarget, - private ChangeListener, - private OpenDocumentManager::DocumentCloseListener +class ProjectContentComponent final : public Component, + public ApplicationCommandTarget, + private ChangeListener, + private OpenDocumentManager::DocumentCloseListener { public: //============================================================================== diff --git a/extras/Projucer/Source/Project/UI/jucer_ProjectMessagesComponent.h b/extras/Projucer/Source/Project/UI/jucer_ProjectMessagesComponent.h index 14819f9008..f1b632ba6c 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ProjectMessagesComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_ProjectMessagesComponent.h @@ -29,8 +29,8 @@ #include "../../Application/jucer_Application.h" //============================================================================== -class MessagesPopupWindow : public Component, - private ComponentMovementWatcher +class MessagesPopupWindow final : public Component, + private ComponentMovementWatcher { public: MessagesPopupWindow (Component& target, Component& parent, Project& project) @@ -95,9 +95,9 @@ public: private: //============================================================================== - class MessagesListComponent : public Component, - private ValueTree::Listener, - private AsyncUpdater + class MessagesListComponent final : public Component, + private ValueTree::Listener, + private AsyncUpdater { public: MessagesListComponent (MessagesPopupWindow& o, Project& currentProject) @@ -151,7 +151,7 @@ private: static constexpr int messageSpacing = 2; //============================================================================== - struct MessageComponent : public Component + struct MessageComponent final : public Component { MessageComponent (MessagesListComponent& listComponent, const Identifier& messageToDisplay, @@ -379,7 +379,7 @@ private: }; //============================================================================== -class ProjectMessagesComponent : public Component +class ProjectMessagesComponent final : public Component { public: ProjectMessagesComponent() @@ -492,8 +492,8 @@ public: private: //============================================================================== - struct MessageCountComponent : public Component, - private ValueTree::Listener + struct MessageCountComponent final : public Component, + private ValueTree::Listener { MessageCountComponent (ProjectMessagesComponent& o, Path pathToUse) : owner (o), diff --git a/extras/Projucer/Source/Project/UI/jucer_UserAvatarComponent.h b/extras/Projucer/Source/Project/UI/jucer_UserAvatarComponent.h index 789f52e8ff..b430a502fa 100644 --- a/extras/Projucer/Source/Project/UI/jucer_UserAvatarComponent.h +++ b/extras/Projucer/Source/Project/UI/jucer_UserAvatarComponent.h @@ -28,10 +28,10 @@ #include "../../Application/jucer_Application.h" //============================================================================== -class UserAvatarComponent : public Component, - public SettableTooltipClient, - public ChangeBroadcaster, - private LicenseController::LicenseStateListener +class UserAvatarComponent final : public Component, + public SettableTooltipClient, + public ChangeBroadcaster, + private LicenseController::LicenseStateListener { public: UserAvatarComponent (bool isInteractive) diff --git a/extras/Projucer/Source/Project/jucer_Project.h b/extras/Projucer/Source/Project/jucer_Project.h index 9320aec6d9..c9d91a4fa3 100644 --- a/extras/Projucer/Source/Project/jucer_Project.h +++ b/extras/Projucer/Source/Project/jucer_Project.h @@ -120,11 +120,11 @@ namespace ProjectMessages enum class Async { no, yes }; //============================================================================== -class Project : public FileBasedDocument, - private ValueTree::Listener, - private LicenseController::LicenseStateListener, - private ChangeListener, - private AvailableModulesList::Listener +class Project final : public FileBasedDocument, + private ValueTree::Listener, + private LicenseController::LicenseStateListener, + private ChangeListener, + private AvailableModulesList::Listener { public: //============================================================================== @@ -562,7 +562,7 @@ private: static auto& getEnabledModulesImpl (This&); //============================================================================== - struct ProjectFileModificationPoller : private Timer + struct ProjectFileModificationPoller final : private Timer { ProjectFileModificationPoller (Project& p); bool isCheckPending() const noexcept { return pending; } diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h index 9df2ac6662..a89c0d6c6c 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h @@ -27,7 +27,7 @@ //============================================================================== -class AndroidProjectExporter : public ProjectExporter +class AndroidProjectExporter final : public ProjectExporter { public: //============================================================================== @@ -276,7 +276,7 @@ public: protected: //============================================================================== - class AndroidBuildConfiguration : public BuildConfiguration + class AndroidBuildConfiguration final : public BuildConfiguration { public: AndroidBuildConfiguration (Project& p, const ValueTree& settings, const ProjectExporter& e) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h index c0f5bdc13e..d259fbad06 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h @@ -28,7 +28,7 @@ #include "jucer_ProjectExport_MSVC.h" //============================================================================== -class CodeBlocksProjectExporter : public ProjectExporter +class CodeBlocksProjectExporter final : public ProjectExporter { public: enum CodeBlocksOS @@ -199,7 +199,7 @@ private: String getTargetPlatformString() const { return targetPlatformValue.get(); } //============================================================================== - class CodeBlocksBuildConfiguration : public BuildConfiguration + class CodeBlocksBuildConfiguration final : public BuildConfiguration { public: CodeBlocksBuildConfiguration (Project& p, const ValueTree& settings, const ProjectExporter& e) @@ -262,7 +262,7 @@ private: yes }; - class CodeBlocksTarget : public build_tools::ProjectType::Target + class CodeBlocksTarget final : public build_tools::ProjectType::Target { public: CodeBlocksTarget (const CodeBlocksProjectExporter& e, diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index bc07f916c7..54f91e3410 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -43,7 +43,7 @@ inline StringArray msBuildEscape (StringArray range) } //============================================================================== -class MSVCProjectExporterBase : public ProjectExporter +class MSVCProjectExporterBase : public ProjectExporter { public: MSVCProjectExporterBase (Project& p, const ValueTree& t, String folderName) @@ -154,8 +154,8 @@ public: } //============================================================================== - class MSVCBuildConfiguration : public BuildConfiguration, - private Value::Listener + class MSVCBuildConfiguration final : public BuildConfiguration, + private Value::Listener { public: MSVCBuildConfiguration (Project& p, const ValueTree& settings, const ProjectExporter& e) @@ -417,16 +417,16 @@ public: }; //============================================================================== - class MSVCTargetBase : public build_tools::ProjectType::Target + class MSVCTarget final : public build_tools::ProjectType::Target { public: - MSVCTargetBase (build_tools::ProjectType::Target::Type targetType, const MSVCProjectExporterBase& exporter) + MSVCTarget (build_tools::ProjectType::Target::Type targetType, const MSVCProjectExporterBase& exporter) : build_tools::ProjectType::Target (targetType), owner (exporter) { projectGuid = createGUID (owner.getProject().getProjectUIDString() + getName()); } - virtual ~MSVCTargetBase() {} + virtual ~MSVCTarget() {} String getProjectVersionString() const { return "10.00"; } String getProjectFileSuffix() const { return ".vcxproj"; } @@ -1302,7 +1302,7 @@ public: if (type == LV2PlugIn) { - const auto* writerTarget = [&]() -> MSVCTargetBase* + const auto* writerTarget = [&]() -> MSVCTarget* { for (auto* target : owner.targets) if (target->type == LV2Helper) @@ -1332,7 +1332,7 @@ public: const auto manifestScript = [&]() -> String { - const auto* writerTarget = [&]() -> MSVCTargetBase* + const auto* writerTarget = [&]() -> MSVCTarget* { for (auto* target : owner.targets) if (target->type == VST3Helper) @@ -1648,7 +1648,7 @@ public: callForAllSupportedTargets ([this] (build_tools::ProjectType::Target::Type targetType) { if (targetType != build_tools::ProjectType::Target::AggregateTarget) - targets.add (new MSVCTargetBase (targetType, *this)); + targets.add (new MSVCTarget (targetType, *this)); }); // If you hit this assert, you tried to generate a project for an exporter @@ -1656,7 +1656,7 @@ public: jassert (targets.size() > 0); } - const MSVCTargetBase* getSharedCodeTarget() const + const MSVCTarget* getSharedCodeTarget() const { for (auto target : targets) if (target->type == build_tools::ProjectType::Target::SharedCodeTarget) @@ -1700,7 +1700,7 @@ private: protected: //============================================================================== mutable File rcFile, iconFile, packagesConfigFile; - OwnedArray targets; + OwnedArray targets; ValueTreePropertyWithDefault IPPLibraryValue, IPP1ALibraryValue, @@ -1750,7 +1750,7 @@ protected: return getCleanedStringArray (searchPaths); } - String getTargetGuid (MSVCTargetBase::Type type) const + String getTargetGuid (MSVCTarget::Type type) const { for (auto* target : targets) if (target != nullptr && target->type == type) @@ -1762,9 +1762,9 @@ protected: //============================================================================== void writeProjectDependencies (OutputStream& out) const { - const auto sharedCodeGuid = getTargetGuid (MSVCTargetBase::SharedCodeTarget); - const auto lv2HelperGuid = getTargetGuid (MSVCTargetBase::LV2Helper); - const auto vst3HelperGuid = getTargetGuid (MSVCTargetBase::VST3Helper); + const auto sharedCodeGuid = getTargetGuid (MSVCTarget::SharedCodeTarget); + const auto lv2HelperGuid = getTargetGuid (MSVCTarget::LV2Helper); + const auto vst3HelperGuid = getTargetGuid (MSVCTarget::VST3Helper); for (int addingOtherTargets = 0; addingOtherTargets < (sharedCodeGuid.isNotEmpty() ? 2 : 1); ++addingOtherTargets) { @@ -1772,24 +1772,24 @@ protected: { if (auto* target = targets[i]) { - if (sharedCodeGuid.isEmpty() || (addingOtherTargets != 0) == (target->type != MSVCTargetBase::StandalonePlugIn)) + if (sharedCodeGuid.isEmpty() || (addingOtherTargets != 0) == (target->type != MSVCTarget::StandalonePlugIn)) { out << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" << projectName << " - " << target->getName() << "\", \"" << target->getVCProjFile().getFileName() << "\", \"" << target->getProjectGuid() << '"' << newLine; if (sharedCodeGuid.isNotEmpty() - && target->type != MSVCTargetBase::SharedCodeTarget - && target->type != MSVCTargetBase::LV2Helper - && target->type != MSVCTargetBase::VST3Helper) + && target->type != MSVCTarget::SharedCodeTarget + && target->type != MSVCTarget::LV2Helper + && target->type != MSVCTarget::VST3Helper) { out << "\tProjectSection(ProjectDependencies) = postProject" << newLine << "\t\t" << sharedCodeGuid << " = " << sharedCodeGuid << newLine; - if (target->type == MSVCTargetBase::LV2PlugIn && lv2HelperGuid.isNotEmpty()) + if (target->type == MSVCTarget::LV2PlugIn && lv2HelperGuid.isNotEmpty()) out << "\t\t" << lv2HelperGuid << " = " << lv2HelperGuid << newLine; - if (target->type == MSVCTargetBase::VST3PlugIn && vst3HelperGuid.isNotEmpty()) + if (target->type == MSVCTarget::VST3PlugIn && vst3HelperGuid.isNotEmpty()) out << "\t\t" << vst3HelperGuid << " = " << vst3HelperGuid << newLine; out << "\tEndProjectSection" << newLine; @@ -1925,7 +1925,7 @@ protected: }; //============================================================================== -class MSVCProjectExporterVC2017 : public MSVCProjectExporterBase +class MSVCProjectExporterVC2017 final : public MSVCProjectExporterBase { public: MSVCProjectExporterVC2017 (Project& p, const ValueTree& t) @@ -1970,7 +1970,7 @@ private: }; //============================================================================== -class MSVCProjectExporterVC2019 : public MSVCProjectExporterBase +class MSVCProjectExporterVC2019 final : public MSVCProjectExporterBase { public: MSVCProjectExporterVC2019 (Project& p, const ValueTree& t) @@ -2015,7 +2015,7 @@ private: }; //============================================================================== -class MSVCProjectExporterVC2022 : public MSVCProjectExporterBase +class MSVCProjectExporterVC2022 final : public MSVCProjectExporterBase { public: MSVCProjectExporterVC2022 (Project& p, const ValueTree& t) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h index c8834c71cf..215029bc2f 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h @@ -27,11 +27,11 @@ //============================================================================== -class MakefileProjectExporter : public ProjectExporter +class MakefileProjectExporter final : public ProjectExporter { protected: //============================================================================== - class MakeBuildConfiguration : public BuildConfiguration + class MakeBuildConfiguration final : public BuildConfiguration { public: MakeBuildConfiguration (Project& p, const ValueTree& settings, const ProjectExporter& e) @@ -125,7 +125,7 @@ protected: public: //============================================================================== - class MakefileTarget : public build_tools::ProjectType::Target + class MakefileTarget final : public build_tools::ProjectType::Target { public: MakefileTarget (build_tools::ProjectType::Target::Type targetType, const MakefileProjectExporter& exporter) @@ -299,10 +299,10 @@ public: for (auto& [path, flags] : filesToCompile) { - const auto additionalTargetDependencies = [&path = path, this] + const auto additionalTargetDependencies = [&p = path, this] { if ( owner.linuxSubprocessHelperProperties.shouldUseLinuxSubprocessHelper() - && path.getFileName().contains ("include_juce_gui_extra.cpp")) + && p.getFileName().contains ("include_juce_gui_extra.cpp")) { return owner.linuxSubprocessHelperProperties .getLinuxSubprocessHelperBinaryDataSource() diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index d5349cd80e..bd73fcc684 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -54,7 +54,7 @@ xcrun codesign --verify "$JUCE_FULL_PRODUCT_PATH" || xcrun codesign -f -s - "$JU )"; //============================================================================== -class XcodeProjectExporter : public ProjectExporter +class XcodeProjectExporter final : public ProjectExporter { public: //============================================================================== @@ -824,8 +824,8 @@ public: protected: //============================================================================== - class XcodeBuildConfiguration : public BuildConfiguration, - private ValueTree::Listener + class XcodeBuildConfiguration final : public BuildConfiguration, + private ValueTree::Listener { public: XcodeBuildConfiguration (Project& p, const ValueTree& t, const bool isIOS, const ProjectExporter& e) @@ -1070,7 +1070,7 @@ public: }; //============================================================================== - struct XcodeTarget : build_tools::ProjectType::Target + struct XcodeTarget final : build_tools::ProjectType::Target { //============================================================================== XcodeTarget (Type targetType, const XcodeProjectExporter& exporter) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h index c8d0deefd4..c216d4b240 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h @@ -64,7 +64,7 @@ private: }; //============================================================================== -class ProjectExporter : private Value::Listener +class ProjectExporter : private Value::Listener { public: ProjectExporter (Project&, const ValueTree& settings); @@ -264,7 +264,7 @@ public: const LinuxSubprocessHelperProperties linuxSubprocessHelperProperties { *this }; //============================================================================== - class BuildConfiguration : public ReferenceCountedObject + class BuildConfiguration : public ReferenceCountedObject { public: BuildConfiguration (Project& project, const ValueTree& configNode, const ProjectExporter&); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectSaver.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectSaver.h index 78bc3bc497..7d3088c8f5 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectSaver.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectSaver.h @@ -49,7 +49,7 @@ public: private: //============================================================================== - struct SaveThreadWithProgressWindow : public ThreadWithProgressWindow + struct SaveThreadWithProgressWindow final : public ThreadWithProgressWindow { public: SaveThreadWithProgressWindow (ProjectSaver& ps, diff --git a/extras/Projucer/Source/Settings/jucer_AppearanceSettings.h b/extras/Projucer/Source/Settings/jucer_AppearanceSettings.h index 0fc66b64dd..9f143642d5 100644 --- a/extras/Projucer/Source/Settings/jucer_AppearanceSettings.h +++ b/extras/Projucer/Source/Settings/jucer_AppearanceSettings.h @@ -27,7 +27,7 @@ //============================================================================== -class AppearanceSettings : private ValueTree::Listener +class AppearanceSettings final : private ValueTree::Listener { public: AppearanceSettings (bool updateAppWhenChanged); diff --git a/extras/Projucer/Source/Settings/jucer_StoredSettings.h b/extras/Projucer/Source/Settings/jucer_StoredSettings.h index 819670671b..298b9934c7 100644 --- a/extras/Projucer/Source/Settings/jucer_StoredSettings.h +++ b/extras/Projucer/Source/Settings/jucer_StoredSettings.h @@ -29,7 +29,7 @@ #include "jucer_AppearanceSettings.h" //============================================================================== -class StoredSettings : private ValueTree::Listener +class StoredSettings final : private ValueTree::Listener { public: StoredSettings(); @@ -50,7 +50,7 @@ public: //============================================================================== Array swatchColours; - struct ColourSelectorWithSwatches : public ColourSelector + struct ColourSelectorWithSwatches final : public ColourSelector { ColourSelectorWithSwatches(); ~ColourSelectorWithSwatches() override; diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.h b/extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.h index b57ce69a40..9399a59d73 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.h @@ -119,8 +119,8 @@ struct PropertyListBuilder //============================================================================== // A ValueSource which takes an input source, and forwards any changes in it. // This class is a handy way to create sources which re-map a value. -class ValueSourceFilter : public Value::ValueSource, - private Value::Listener +class ValueSourceFilter : public Value::ValueSource, + private Value::Listener { public: ValueSourceFilter (const Value& source) : sourceValue (source) diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_NewFileWizard.cpp b/extras/Projucer/Source/Utility/Helpers/jucer_NewFileWizard.cpp index 1f67c0fd93..f076083a3a 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_NewFileWizard.cpp +++ b/extras/Projucer/Source/Utility/Helpers/jucer_NewFileWizard.cpp @@ -57,7 +57,7 @@ namespace } //============================================================================== -class NewCppFileWizard : public NewFileWizard::Type +class NewCppFileWizard final : public NewFileWizard::Type { public: String getName() override { return "CPP File"; } @@ -85,7 +85,7 @@ public: }; //============================================================================== -class NewHeaderFileWizard : public NewFileWizard::Type +class NewHeaderFileWizard final : public NewFileWizard::Type { public: String getName() override { return "Header File"; } @@ -220,7 +220,7 @@ private: }; //============================================================================== -class NewSingleFileComponentFileWizard : public NewComponentFileWizard +class NewSingleFileComponentFileWizard final : public NewComponentFileWizard { public: String getName() override { return "Component class (in a single source file)"; } diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_ValueSourceHelpers.h b/extras/Projucer/Source/Utility/Helpers/jucer_ValueSourceHelpers.h index 09a8c09f3e..d5ca9309d4 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_ValueSourceHelpers.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_ValueSourceHelpers.h @@ -28,7 +28,7 @@ //============================================================================== template -class NumericValueSource : public ValueSourceFilter +class NumericValueSource final : public ValueSourceFilter { public: NumericValueSource (const Value& source) : ValueSourceFilter (source) {} diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_ValueTreePropertyWithDefaultWrapper.h b/extras/Projucer/Source/Utility/Helpers/jucer_ValueTreePropertyWithDefaultWrapper.h index 650d0e1e8b..14837ad5bc 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_ValueTreePropertyWithDefaultWrapper.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_ValueTreePropertyWithDefaultWrapper.h @@ -30,7 +30,7 @@ /** Wraps a ValueTreePropertyWithDefault object that has a default which depends on a global value. */ -class ValueTreePropertyWithDefaultWrapper : private Value::Listener +class ValueTreePropertyWithDefaultWrapper final : private Value::Listener { public: ValueTreePropertyWithDefaultWrapper() = default; diff --git a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_ColourPropertyComponent.h b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_ColourPropertyComponent.h index 31e5fe129d..dff52df4a6 100644 --- a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_ColourPropertyComponent.h +++ b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_ColourPropertyComponent.h @@ -27,7 +27,7 @@ //============================================================================== -struct ColourPropertyComponent : public PropertyComponent +struct ColourPropertyComponent final : public PropertyComponent { ColourPropertyComponent (UndoManager* undoManager, const String& name, const Value& colour, Colour defaultColour, bool canResetToDefault) @@ -49,8 +49,8 @@ private: A component that shows a colour swatch with hex ARGB value, and which pops up a colour selector when you click it. */ - struct ColourEditorComponent : public Component, - private Value::Listener + struct ColourEditorComponent final : public Component, + private Value::Listener { ColourEditorComponent (UndoManager* um, const Value& colour, Colour defaultCol, const bool canReset) @@ -139,9 +139,9 @@ private: }; //============================================================================== - struct PopupColourSelector : public Component, - private ChangeListener, - private Value::Listener + struct PopupColourSelector final : public Component, + private ChangeListener, + private Value::Listener { PopupColourSelector (const Value& colour, Colour defaultCol, diff --git a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_FilePathPropertyComponent.h b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_FilePathPropertyComponent.h index 55dc6fd4e0..08f94e77c4 100644 --- a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_FilePathPropertyComponent.h +++ b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_FilePathPropertyComponent.h @@ -32,9 +32,9 @@ The user may drag files over the property box, enter the path manually and/or click the '...' button to open a file selection dialog box. */ -class FilePathPropertyComponent : public PropertyComponent, - public FileDragAndDropTarget, - protected Value::Listener +class FilePathPropertyComponent : public PropertyComponent, + public FileDragAndDropTarget, + protected Value::Listener { public: FilePathPropertyComponent (Value valueToControl, const String& propertyName, bool isDir, bool thisOS = true, @@ -217,7 +217,7 @@ private: }; //============================================================================== -class FilePathPropertyComponentWithEnablement : public FilePathPropertyComponent +class FilePathPropertyComponentWithEnablement final : public FilePathPropertyComponent { public: FilePathPropertyComponentWithEnablement (const ValueTreePropertyWithDefault& valueToControl, diff --git a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_LabelPropertyComponent.h b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_LabelPropertyComponent.h index 0ec7f45865..95740b0275 100644 --- a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_LabelPropertyComponent.h +++ b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_LabelPropertyComponent.h @@ -27,7 +27,7 @@ //============================================================================== -class LabelPropertyComponent : public PropertyComponent +class LabelPropertyComponent final : public PropertyComponent { public: LabelPropertyComponent (const String& labelText, int propertyHeight = 25, @@ -57,7 +57,7 @@ public: private: //============================================================================== - struct LabelLookAndFeel : public ProjucerLookAndFeel + struct LabelLookAndFeel final : public ProjucerLookAndFeel { void drawPropertyComponentLabel (Graphics&, int, int, PropertyComponent&) {} }; diff --git a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h index c80b525cae..4f38e12f83 100644 --- a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h +++ b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h @@ -27,8 +27,8 @@ //============================================================================== -class TextPropertyComponentWithEnablement : public TextPropertyComponent, - private Value::Listener +class TextPropertyComponentWithEnablement final : public TextPropertyComponent, + private Value::Listener { public: TextPropertyComponentWithEnablement (const ValueTreePropertyWithDefault& valueToControl, @@ -54,8 +54,8 @@ private: }; //============================================================================== -class ChoicePropertyComponentWithEnablement : public ChoicePropertyComponent, - private Value::Listener +class ChoicePropertyComponentWithEnablement final : public ChoicePropertyComponent, + private Value::Listener { public: ChoicePropertyComponentWithEnablement (const ValueTreePropertyWithDefault& valueToControl, @@ -135,8 +135,8 @@ private: }; //============================================================================== -class MultiChoicePropertyComponentWithEnablement : public MultiChoicePropertyComponent, - private Value::Listener +class MultiChoicePropertyComponentWithEnablement final : public MultiChoicePropertyComponent, + private Value::Listener { public: MultiChoicePropertyComponentWithEnablement (const ValueTreePropertyWithDefault& valueToControl, diff --git a/extras/Projucer/Source/Utility/UI/jucer_IconButton.h b/extras/Projucer/Source/Utility/UI/jucer_IconButton.h index 60c6be4fb2..d3a02b9898 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_IconButton.h +++ b/extras/Projucer/Source/Utility/UI/jucer_IconButton.h @@ -27,7 +27,7 @@ //============================================================================== -class IconButton : public Button +class IconButton final : public Button { public: IconButton (String buttonName, Image imageToDisplay) diff --git a/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp b/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp index 9953a472c3..4da093d6f8 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp +++ b/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp @@ -125,7 +125,7 @@ std::unique_ptr JucerTreeViewBase::createItemComponent() } //============================================================================== -class RenameTreeItemCallback : public ModalComponentManager::Callback +class RenameTreeItemCallback final : public ModalComponentManager::Callback { public: RenameTreeItemCallback (JucerTreeViewBase& ti, Component& parent, const Rectangle& bounds) @@ -152,7 +152,7 @@ public: } private: - struct RenameEditor : public TextEditor + struct RenameEditor final : public TextEditor { void inputAttemptWhenModal() override { exitModalState (0); } }; @@ -209,7 +209,7 @@ ProjectContentComponent* JucerTreeViewBase::getProjectContentComponent() const } //============================================================================== -class JucerTreeViewBase::ItemSelectionTimer : public Timer +class JucerTreeViewBase::ItemSelectionTimer final : public Timer { public: explicit ItemSelectionTimer (JucerTreeViewBase& tvb) : owner (tvb) {} diff --git a/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h b/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h index 4a3e744fb2..eb707302e8 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h +++ b/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h @@ -29,8 +29,8 @@ class ProjectContentComponent; class Project; //============================================================================== -class JucerTreeViewBase : public TreeViewItem, - public TooltipClient +class JucerTreeViewBase : public TreeViewItem, + public TooltipClient { public: JucerTreeViewBase(); @@ -85,7 +85,7 @@ public: // To handle situations where an item gets deleted before openness is // restored for it, this OpennessRestorer keeps only a pointer to the // topmost tree item. - struct WholeTreeOpennessRestorer : public OpennessRestorer + struct WholeTreeOpennessRestorer final : public OpennessRestorer { WholeTreeOpennessRestorer (TreeViewItem& item) : OpennessRestorer (getTopLevelItem (item)) {} @@ -116,7 +116,7 @@ private: }; //============================================================================== -class TreePanelBase : public Component +class TreePanelBase : public Component { public: TreePanelBase (const Project* p, const String& treeviewID) @@ -201,7 +201,7 @@ private: }; //============================================================================== -class TreeItemComponent : public Component +class TreeItemComponent final : public Component { public: TreeItemComponent (JucerTreeViewBase& i) : item (&i) diff --git a/extras/Projucer/Source/Utility/UI/jucer_ProjucerLookAndFeel.h b/extras/Projucer/Source/Utility/UI/jucer_ProjucerLookAndFeel.h index 86abbd9ee0..656241f429 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_ProjucerLookAndFeel.h +++ b/extras/Projucer/Source/Utility/UI/jucer_ProjucerLookAndFeel.h @@ -27,7 +27,7 @@ //============================================================================== -class ProjucerLookAndFeel : public LookAndFeel_V4 +class ProjucerLookAndFeel : public LookAndFeel_V4 { public: ProjucerLookAndFeel(); diff --git a/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.cpp b/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.cpp index b6ac43dbbe..4edf63f585 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.cpp +++ b/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.cpp @@ -27,7 +27,7 @@ #include "jucer_SlidingPanelComponent.h" //============================================================================== -struct SlidingPanelComponent::DotButton : public Button +struct SlidingPanelComponent::DotButton final : public Button { DotButton (SlidingPanelComponent& sp, int pageIndex) : Button (String()), owner (sp), index (pageIndex) {} diff --git a/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h b/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h index f3f064e06a..e22f71de7a 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h +++ b/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h @@ -28,7 +28,7 @@ #include "../../Application/jucer_Application.h" //============================================================================== -class SlidingPanelComponent : public Component +class SlidingPanelComponent final : public Component { public: SlidingPanelComponent(); diff --git a/extras/UnitTestRunner/Source/Main.cpp b/extras/UnitTestRunner/Source/Main.cpp index 559a88ba44..933c2bff7f 100644 --- a/extras/UnitTestRunner/Source/Main.cpp +++ b/extras/UnitTestRunner/Source/Main.cpp @@ -26,7 +26,7 @@ #include //============================================================================== -class ConsoleLogger : public Logger +class ConsoleLogger final : public Logger { void logMessage (const String& message) override { @@ -39,7 +39,7 @@ class ConsoleLogger : public Logger }; //============================================================================== -class ConsoleUnitTestRunner : public UnitTestRunner +class ConsoleUnitTestRunner final : public UnitTestRunner { void logMessage (const String& message) override { diff --git a/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp b/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp index d5d9b44515..03e14ecb20 100644 --- a/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp +++ b/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp @@ -689,7 +689,7 @@ public: scopedProcID = [&self = *this, &lock = callbackLock, nextProcID = ScopedAudioDeviceIOProcID { *this, deviceID, audioIOProc }, - deviceID = deviceID]() mutable -> ScopedAudioDeviceIOProcID + dID = deviceID]() mutable -> ScopedAudioDeviceIOProcID { // It *looks* like AudioDeviceStart may start the audio callback running, and then // immediately lock an internal mutex. @@ -703,7 +703,7 @@ public: { const ScopedUnlock su (lock); - if (self.OK (AudioDeviceStart (deviceID, procID))) + if (self.OK (AudioDeviceStart (dID, procID))) return std::move (nextProcID); } diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h index 83d93962eb..7e728acaa3 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h @@ -514,7 +514,7 @@ public: if (func == nullptr) return nullptr; - return [func = std::move (func)] (float v, int) { return func (v); }; + return [f = std::move (func)] (float v, int) { return f (v); }; } void valueChanged (float) override; diff --git a/modules/juce_gui_basics/layout/juce_Grid.h b/modules/juce_gui_basics/layout/juce_Grid.h index 437f4657ff..50c6e144c0 100644 --- a/modules/juce_gui_basics/layout/juce_Grid.h +++ b/modules/juce_gui_basics/layout/juce_Grid.h @@ -216,8 +216,8 @@ private: struct Helpers; }; -constexpr Grid::Px operator"" _px (long double px) { return Grid::Px { px }; } -constexpr Grid::Px operator"" _px (unsigned long long px) { return Grid::Px { px }; } -constexpr Grid::Fr operator"" _fr (unsigned long long fr) { return Grid::Fr { fr }; } +constexpr Grid::Px operator""_px (long double px) { return Grid::Px { px }; } +constexpr Grid::Px operator""_px (unsigned long long px) { return Grid::Px { px }; } +constexpr Grid::Fr operator""_fr (unsigned long long fr) { return Grid::Fr { fr }; } } // namespace juce diff --git a/modules/juce_gui_basics/native/juce_MainMenu_mac.mm b/modules/juce_gui_basics/native/juce_MainMenu_mac.mm index dd0004328c..2215fba8b4 100644 --- a/modules/juce_gui_basics/native/juce_MainMenu_mac.mm +++ b/modules/juce_gui_basics/native/juce_MainMenu_mac.mm @@ -462,9 +462,9 @@ private: }; static ValidatorClass validatorClass; - static auto* instance = validatorClass.createInstance(); + static auto* vcInstance = validatorClass.createInstance(); - [item setTarget: instance]; + [item setTarget: vcInstance]; [menu insertItem: item atIndex: [menu numberOfItems]]; [item release]; diff --git a/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h b/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h index f31a27385b..4562abfb2a 100644 --- a/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h +++ b/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h @@ -274,9 +274,9 @@ private: // This is the callback that will actually fire in response to this screen's display // link callback. - result.emplace_back (screen, [callbacks = std::move (callbacks)] + result.emplace_back (screen, [cbs = std::move (callbacks)] { - for (const auto& callback : callbacks) + for (const auto& callback : cbs) callback(); }); } diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp index 44dfc6e1a5..ed42a39b91 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp @@ -145,23 +145,21 @@ public: fileWildcard); asyncFc->launchAsync (FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles, - [this, showMessageOnFailure, callback = std::move (callback)] (const FileChooser& fc) + [this, showMessageOnFailure, cb = std::move (callback)] (const FileChooser& fc) { auto chosenFile = fc.getResult(); if (chosenFile == File{}) { - if (callback != nullptr) - callback (Result::fail (TRANS ("User cancelled"))); - + NullCheckedInvocation::invoke (cb, Result::fail (TRANS ("User cancelled"))); return; } WeakReference parent { this }; - loadFromAsync (chosenFile, showMessageOnFailure, [parent, callback] (Result result) + loadFromAsync (chosenFile, showMessageOnFailure, [parent, cb] (Result result) { - if (parent != nullptr && callback != nullptr) - callback (result); + if (parent != nullptr) + NullCheckedInvocation::invoke (cb, result); }); asyncFc = nullptr; @@ -347,8 +345,7 @@ private: parent->messageBox = AlertWindow::showScopedAsync (options, nullptr); } - if (completed != nullptr) - completed (result); + NullCheckedInvocation::invoke (completed, result); }; if (newFile.existsAsFile()) @@ -356,7 +353,7 @@ private: auto afterLoading = [parent, showWaitCursor, newFile, - completed = std::move (completed), + cb = std::move (completed), tidyUp] (Result result) { if (result.wasOk()) @@ -367,10 +364,7 @@ private: MouseCursor::hideWaitCursor(); parent->document.setLastDocumentOpened (newFile); - - if (completed != nullptr) - completed (result); - + NullCheckedInvocation::invoke (cb, result); return; } @@ -397,15 +391,13 @@ private: if (! hasChangedSinceSaved()) { - if (completed != nullptr) - completed (savedOk); - + NullCheckedInvocation::invoke (completed, savedOk); return; } - auto afterAsking = [doSave = std::forward (doSave), - completed = std::move (completed)] (SafeParentPointer ptr, - int alertResult) + auto afterAsking = [save = std::forward (doSave), + cb = std::move (completed)] (SafeParentPointer ptr, + int alertResult) { if (ptr.shouldExitAsyncCallback()) return; @@ -413,25 +405,21 @@ private: switch (alertResult) { case 1: // save changes - doSave (true, true, [ptr, completed] (SaveResult result) + save (true, true, [ptr, cb] (SaveResult result) { if (ptr.shouldExitAsyncCallback()) return; - if (completed != nullptr) - completed (result); + NullCheckedInvocation::invoke (cb, result); }); return; case 2: // discard changes - if (completed != nullptr) - completed (savedOk); - + NullCheckedInvocation::invoke (cb, savedOk); return; } - if (completed != nullptr) - completed (userCancelledSave); + NullCheckedInvocation::invoke (cb, userCancelledSave); }; doAskToSaveChanges (parent, std::move (afterAsking)); @@ -453,10 +441,10 @@ private: std::function callback) { messageBox = AlertWindow::showScopedAsync (getAskToSaveChangesOptions(), - [parent, callback = std::move (callback)] (int alertResult) + [parent, cb = std::move (callback)] (int alertResult) { if (parent != nullptr) - callback (parent, alertResult); + cb (parent, alertResult); }); } @@ -487,7 +475,7 @@ private: showWaitCursor, oldFile, newFile, - afterSave = std::move (afterSave)] (Result result) + after = std::move (afterSave)] (Result result) { if (parent.shouldExitAsyncCallback()) { @@ -506,9 +494,7 @@ private: parent->document.sendChangeMessage(); // because the filename may have changed - if (afterSave != nullptr) - afterSave (savedOk); - + NullCheckedInvocation::invoke (after, savedOk); return; } @@ -530,9 +516,7 @@ private: } parent->document.sendChangeMessage(); // because the filename may have changed - - if (afterSave != nullptr) - afterSave (failedToWriteToFile); + NullCheckedInvocation::invoke (after, failedToWriteToFile); }); } @@ -562,9 +546,7 @@ private: // can't save to an unspecified file jassertfalse; - if (callback != nullptr) - callback (failedToWriteToFile); - + NullCheckedInvocation::invoke (callback, failedToWriteToFile); return; } @@ -573,7 +555,7 @@ private: newFile, showMessageOnFailure, showWaitCursor, - doSaveDocument = std::forward (doSaveDocument)] + saveDocument = std::forward (doSaveDocument)] { if (! parent.shouldExitAsyncCallback()) parent->saveInternal (parent, @@ -581,12 +563,12 @@ private: showMessageOnFailure, showWaitCursor, callback, - doSaveDocument); + saveDocument); }; if (warnAboutOverwritingExistingFiles && newFile.exists()) { - auto afterAsking = [callback = std::move (callback), + auto afterAsking = [cb = std::move (callback), saveInternalHelper] (SafeParentPointer ptr, bool shouldOverwrite) { @@ -595,8 +577,8 @@ private: if (shouldOverwrite) saveInternalHelper(); - else if (callback != nullptr) - callback (userCancelledSave); + else + NullCheckedInvocation::invoke (cb, userCancelledSave); }; doAskToOverwriteFile (parent, newFile, std::move (afterAsking)); return; @@ -698,10 +680,10 @@ private: return; messageBox = AlertWindow::showScopedAsync (getAskToOverwriteFileOptions (newFile), - [parent, callback = std::move (callback)] (int r) + [parent, cb = std::move (callback)] (int r) { if (parent != nullptr) - callback (parent, r != 1); + NullCheckedInvocation::invoke (cb, parent, r != 1); }); } @@ -724,9 +706,9 @@ private: if (warnAboutOverwritingExistingFiles) flags |= FileBrowserComponent::warnAboutOverwriting; - asyncFc->launchAsync (flags, [parent, callback = std::move (callback)] (const FileChooser& fc) + asyncFc->launchAsync (flags, [parent, cb = std::move (callback)] (const FileChooser& fc) { - callback (parent, fc.getResult()); + cb (parent, fc.getResult()); }); } @@ -741,28 +723,26 @@ private: { doSelectFilename (parent, warnAboutOverwritingExistingFiles, - [doSaveAs = std::forward (doSaveAs), - doAskToOverwriteFile = std::forward (doAskToOverwriteFile), - callback = std::move (callback)] (SafeParentPointer parentPtr, File chosen) + [saveAs = std::forward (doSaveAs), + askToOverwriteFile = std::forward (doAskToOverwriteFile), + cb = std::move (callback)] (SafeParentPointer parentPtr, File chosen) { if (parentPtr.shouldExitAsyncCallback()) return; if (chosen == File{}) { - if (callback != nullptr) - callback (userCancelledSave); - + NullCheckedInvocation::invoke (cb, userCancelledSave); return; } - auto updateAndSaveAs = [parentPtr, doSaveAs, callback] (const File& chosenFile) + auto updateAndSaveAs = [parentPtr, saveAs, cb] (const File& chosenFile) { if (parentPtr.shouldExitAsyncCallback()) return; parentPtr->document.setLastDocumentOpened (chosenFile); - doSaveAs (parentPtr, chosenFile, false, false, true, callback, false); + saveAs (parentPtr, chosenFile, false, false, true, cb, false); }; if (chosen.getFileExtension().isEmpty()) @@ -771,7 +751,7 @@ private: if (chosen.exists()) { - auto afterAsking = [chosen, updateAndSaveAs, callback] (SafeParentPointer overwritePtr, + auto afterAsking = [chosen, updateAndSaveAs, cb] (SafeParentPointer overwritePtr, bool overwrite) { if (overwritePtr.shouldExitAsyncCallback()) @@ -779,11 +759,11 @@ private: if (overwrite) updateAndSaveAs (chosen); - else if (callback != nullptr) - callback (userCancelledSave); + else + NullCheckedInvocation::invoke (cb, userCancelledSave); }; - doAskToOverwriteFile (parentPtr, chosen, std::move (afterAsking)); + askToOverwriteFile (parentPtr, chosen, std::move (afterAsking)); return; } } @@ -1118,17 +1098,13 @@ void FileBasedDocument::setFile (const File& newFile) void FileBasedDocument::loadDocumentAsync (const File& file, std::function callback) { const auto result = loadDocument (file); - - if (callback != nullptr) - callback (result); + NullCheckedInvocation::invoke (callback, result); } void FileBasedDocument::saveDocumentAsync (const File& file, std::function callback) { const auto result = saveDocument (file); - - if (callback != nullptr) - callback (result); + NullCheckedInvocation::invoke (callback, result); } File FileBasedDocument::getSuggestedSaveAsFile (const File& defaultFile)