diff --git a/examples/Assets/DSPDemos_Common.h b/examples/Assets/DSPDemos_Common.h index 3ec6f72a8a..dc9dfcb59e 100644 --- a/examples/Assets/DSPDemos_Common.h +++ b/examples/Assets/DSPDemos_Common.h @@ -602,7 +602,7 @@ private: return; } - fileChooser = new FileChooser ("Select an audio file...", File(), "*.wav;*.mp3;*.aif"); + fileChooser.reset (new FileChooser ("Select an audio file...", File(), "*.wav;*.mp3;*.aif")); fileChooser->launchAsync (FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles, [safeThis] (const FileChooser& fc) mutable @@ -639,7 +639,7 @@ private: ToggleButton loopButton { "Loop File" }; AudioFileReaderComponent& audioFileReader; - ScopedPointer fileChooser; + std::unique_ptr fileChooser; }; //============================================================================== @@ -671,10 +671,10 @@ private: uint32 currentBlockSize = 512; uint32 currentNumChannels = 2; - ScopedPointer reader; - ScopedPointer readerSource; - ScopedPointer transportSource; - ScopedPointer> currentDemo; + std::unique_ptr reader; + std::unique_ptr readerSource; + std::unique_ptr transportSource; + std::unique_ptr> currentDemo; AudioSourcePlayer audioSourcePlayer; @@ -682,5 +682,5 @@ private: AudioBuffer fileReadBuffer; - ScopedPointer parametersComponent; + std::unique_ptr parametersComponent; }; diff --git a/examples/Assets/DemoUtilities.h b/examples/Assets/DemoUtilities.h index 92108d8490..8d641574af 100644 --- a/examples/Assets/DemoUtilities.h +++ b/examples/Assets/DemoUtilities.h @@ -100,7 +100,7 @@ inline Image getImageFromAssets (const char* assetName) if (img.isNull()) { - ScopedPointer juceIconStream (createAssetInputStream (assetName)); + std::unique_ptr juceIconStream (createAssetInputStream (assetName)); if (juceIconStream == nullptr) return {}; @@ -115,7 +115,7 @@ inline Image getImageFromAssets (const char* assetName) inline String loadEntireAssetIntoString (const char* assetName) { - ScopedPointer input (createAssetInputStream (assetName)); + std::unique_ptr input (createAssetInputStream (assetName)); if (input == nullptr) return {}; diff --git a/examples/Assets/WavefrontObjParser.h b/examples/Assets/WavefrontObjParser.h index f2a0526515..696214ce57 100644 --- a/examples/Assets/WavefrontObjParser.h +++ b/examples/Assets/WavefrontObjParser.h @@ -250,7 +250,7 @@ private: if (faceGroup.size() == 0) return nullptr; - ScopedPointer shape (new Shape()); + std::unique_ptr shape (new Shape()); shape->name = name; shape->material = material; diff --git a/examples/Audio/AudioLatencyDemo.h b/examples/Audio/AudioLatencyDemo.h index 7920d453de..45733d37d4 100644 --- a/examples/Audio/AudioLatencyDemo.h +++ b/examples/Audio/AudioLatencyDemo.h @@ -391,8 +391,8 @@ private: AudioDeviceManager& audioDeviceManager { getSharedAudioDeviceManager (1, 2) }; #endif - ScopedPointer latencyTester; - ScopedPointer liveAudioScroller; + std::unique_ptr latencyTester; + std::unique_ptr liveAudioScroller; TextButton startTestButton { "Test Latency" }; TextEditor resultsBox; diff --git a/examples/Audio/AudioPlaybackDemo.h b/examples/Audio/AudioPlaybackDemo.h index b0f942f9c7..e4da079e72 100644 --- a/examples/Audio/AudioPlaybackDemo.h +++ b/examples/Audio/AudioPlaybackDemo.h @@ -400,7 +400,7 @@ private: TimeSliceThread thread { "audio file preview" }; #if (JUCE_ANDROID || JUCE_IOS) - ScopedPointer fileChooser; + std::unique_ptr fileChooser; TextButton chooseFileButton {"Choose Audio File...", "Choose an audio file for playback"}; #else DirectoryContentsList directoryList {nullptr, thread}; @@ -410,9 +410,9 @@ private: URL currentAudioFile; AudioSourcePlayer audioSourcePlayer; AudioTransportSource transportSource; - ScopedPointer currentAudioFileSource; + std::unique_ptr currentAudioFileSource; - ScopedPointer thumbnail; + std::unique_ptr thumbnail; Label zoomLabel { {}, "zoom:" }, explanation { {}, "Select an audio file in the treeview above, and this page will display its waveform, and let you play it.." }; Slider zoomSlider { Slider::LinearHorizontal, Slider::NoTextBox }; @@ -487,7 +487,7 @@ private: #if (JUCE_ANDROID || JUCE_IOS) void buttonClicked (Button* btn) override { - if (btn == &chooseFileButton && fileChooser == nullptr) + if (btn == &chooseFileButton && fileChooser.get() == nullptr) { SafePointer safeThis (this); @@ -504,7 +504,7 @@ private: if (FileChooser::isPlatformDialogAvailable()) { - fileChooser = new FileChooser ("Select an audio file...", File(), "*.wav;*.mp3;*.aif"); + fileChooser.reset (new FileChooser ("Select an audio file...", File(), "*.wav;*.mp3;*.aif")); fileChooser->launchAsync (FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles, [safeThis] (const FileChooser& fc) mutable diff --git a/examples/Audio/AudioRecordingDemo.h b/examples/Audio/AudioRecordingDemo.h index 932832569d..bf89b270df 100644 --- a/examples/Audio/AudioRecordingDemo.h +++ b/examples/Audio/AudioRecordingDemo.h @@ -76,7 +76,7 @@ public: { // Create an OutputStream to write to our destination file... file.deleteFile(); - ScopedPointer fileStream (file.createOutputStream()); + std::unique_ptr fileStream (file.createOutputStream()); if (fileStream.get() != nullptr) { @@ -159,7 +159,7 @@ public: private: AudioThumbnail& thumbnail; TimeSliceThread backgroundThread { "Audio Recorder Thread" }; // the thread that will write our audio data to disk - ScopedPointer threadedWriter; // the FIFO used to buffer the incoming data + std::unique_ptr threadedWriter; // the FIFO used to buffer the incoming data double sampleRate = 0.0; int64 nextSampleNum = 0; diff --git a/examples/Audio/AudioSettingsDemo.h b/examples/Audio/AudioSettingsDemo.h index 08ff2b9df3..d93377bc0f 100644 --- a/examples/Audio/AudioSettingsDemo.h +++ b/examples/Audio/AudioSettingsDemo.h @@ -143,7 +143,7 @@ private: AudioDeviceManager& audioDeviceManager { getSharedAudioDeviceManager() }; #endif - ScopedPointer audioSetupComp; + std::unique_ptr audioSetupComp; TextEditor diagnosticsBox; void changeListenerCallback (ChangeBroadcaster*) override diff --git a/examples/Audio/AudioSynthesiserDemo.h b/examples/Audio/AudioSynthesiserDemo.h index cfed6dfe5a..5e1e7cad52 100644 --- a/examples/Audio/AudioSynthesiserDemo.h +++ b/examples/Audio/AudioSynthesiserDemo.h @@ -178,7 +178,7 @@ struct SynthAudioSource : public AudioSource { WavAudioFormat wavFormat; - ScopedPointer audioReader (wavFormat.createReaderFor (createAssetInputStream ("cello.wav"), true)); + std::unique_ptr audioReader (wavFormat.createReaderFor (createAssetInputStream ("cello.wav"), true)); BigInteger allNotes; allNotes.setRange (0, 128, true); diff --git a/examples/Audio/MidiDemo.h b/examples/Audio/MidiDemo.h index 6b6e33f2c4..0f0fef92df 100644 --- a/examples/Audio/MidiDemo.h +++ b/examples/Audio/MidiDemo.h @@ -53,8 +53,8 @@ struct MidiDeviceListEntry : ReferenceCountedObject MidiDeviceListEntry (const String& deviceName) : name (deviceName) {} String name; - ScopedPointer inDevice; - ScopedPointer outDevice; + std::unique_ptr inDevice; + std::unique_ptr outDevice; typedef ReferenceCountedObjectPtr Ptr; }; @@ -476,8 +476,8 @@ private: TextEditor midiMonitor { "MIDI Monitor" }; TextButton pairButton { "MIDI Bluetooth devices..." }; - ScopedPointer midiInputSelector; - ScopedPointer midiOutputSelector; + std::unique_ptr midiInputSelector; + std::unique_ptr midiOutputSelector; ReferenceCountedArray midiInputs; ReferenceCountedArray midiOutputs; diff --git a/examples/DSP/ConvolutionDemo.h b/examples/DSP/ConvolutionDemo.h index 1391f45231..d9db0aef0b 100644 --- a/examples/DSP/ConvolutionDemo.h +++ b/examples/DSP/ConvolutionDemo.h @@ -88,7 +88,7 @@ struct ConvolutionDemoDSP auto selectedType = cabinetTypeParameter->getCurrentSelectedID(); auto assetName = (selectedType == 2 ? "guitar_amp.wav" : "cassette_recorder.wav"); - ScopedPointer assetInputStream (createAssetInputStream (assetName)); + std::unique_ptr assetInputStream (createAssetInputStream (assetName)); if (assetInputStream != nullptr) { currentCabinetData.reset(); diff --git a/examples/DSP/SIMDRegisterDemo.h b/examples/DSP/SIMDRegisterDemo.h index d17ba27edf..da338865fe 100644 --- a/examples/DSP/SIMDRegisterDemo.h +++ b/examples/DSP/SIMDRegisterDemo.h @@ -124,7 +124,7 @@ struct SIMDRegisterDemoDSP //============================================================================== IIR::Coefficients::Ptr iirCoefficients; - ScopedPointer>> iir; + std::unique_ptr>> iir; AudioBlock> interleaved; AudioBlock zero; diff --git a/examples/DemoRunner/Builds/Android/app/src/main/assets/DSPDemos_Common.h b/examples/DemoRunner/Builds/Android/app/src/main/assets/DSPDemos_Common.h index 3ec6f72a8a..dc9dfcb59e 100644 --- a/examples/DemoRunner/Builds/Android/app/src/main/assets/DSPDemos_Common.h +++ b/examples/DemoRunner/Builds/Android/app/src/main/assets/DSPDemos_Common.h @@ -602,7 +602,7 @@ private: return; } - fileChooser = new FileChooser ("Select an audio file...", File(), "*.wav;*.mp3;*.aif"); + fileChooser.reset (new FileChooser ("Select an audio file...", File(), "*.wav;*.mp3;*.aif")); fileChooser->launchAsync (FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles, [safeThis] (const FileChooser& fc) mutable @@ -639,7 +639,7 @@ private: ToggleButton loopButton { "Loop File" }; AudioFileReaderComponent& audioFileReader; - ScopedPointer fileChooser; + std::unique_ptr fileChooser; }; //============================================================================== @@ -671,10 +671,10 @@ private: uint32 currentBlockSize = 512; uint32 currentNumChannels = 2; - ScopedPointer reader; - ScopedPointer readerSource; - ScopedPointer transportSource; - ScopedPointer> currentDemo; + std::unique_ptr reader; + std::unique_ptr readerSource; + std::unique_ptr transportSource; + std::unique_ptr> currentDemo; AudioSourcePlayer audioSourcePlayer; @@ -682,5 +682,5 @@ private: AudioBuffer fileReadBuffer; - ScopedPointer parametersComponent; + std::unique_ptr parametersComponent; }; diff --git a/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h b/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h index 92108d8490..8d641574af 100644 --- a/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h +++ b/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h @@ -100,7 +100,7 @@ inline Image getImageFromAssets (const char* assetName) if (img.isNull()) { - ScopedPointer juceIconStream (createAssetInputStream (assetName)); + std::unique_ptr juceIconStream (createAssetInputStream (assetName)); if (juceIconStream == nullptr) return {}; @@ -115,7 +115,7 @@ inline Image getImageFromAssets (const char* assetName) inline String loadEntireAssetIntoString (const char* assetName) { - ScopedPointer input (createAssetInputStream (assetName)); + std::unique_ptr input (createAssetInputStream (assetName)); if (input == nullptr) return {}; diff --git a/examples/DemoRunner/Builds/Android/app/src/main/assets/WavefrontObjParser.h b/examples/DemoRunner/Builds/Android/app/src/main/assets/WavefrontObjParser.h index f2a0526515..696214ce57 100644 --- a/examples/DemoRunner/Builds/Android/app/src/main/assets/WavefrontObjParser.h +++ b/examples/DemoRunner/Builds/Android/app/src/main/assets/WavefrontObjParser.h @@ -250,7 +250,7 @@ private: if (faceGroup.size() == 0) return nullptr; - ScopedPointer shape (new Shape()); + std::unique_ptr shape (new Shape()); shape->name = name; shape->material = material; diff --git a/examples/DemoRunner/Source/Demos/JUCEDemos.cpp b/examples/DemoRunner/Source/Demos/JUCEDemos.cpp index 2e7c9de1f6..19eb3e948d 100644 --- a/examples/DemoRunner/Source/Demos/JUCEDemos.cpp +++ b/examples/DemoRunner/Source/Demos/JUCEDemos.cpp @@ -80,7 +80,7 @@ File JUCEDemos::findExamplesDirectoryFromExecutable (File exec) } //============================================================================== -ScopedPointer sharedAudioDeviceManager; +std::unique_ptr sharedAudioDeviceManager; static String getCurrentDefaultAudioDeviceName (AudioDeviceManager& deviceManager, bool isInput) { diff --git a/examples/DemoRunner/Source/Demos/JUCEDemos.h b/examples/DemoRunner/Source/Demos/JUCEDemos.h index 2edae97580..f158d208f1 100644 --- a/examples/DemoRunner/Source/Demos/JUCEDemos.h +++ b/examples/DemoRunner/Source/Demos/JUCEDemos.h @@ -72,6 +72,6 @@ CodeEditorComponent::ColourScheme getDarkColourScheme(); CodeEditorComponent::ColourScheme getLightColourScheme(); //============================================================================== -extern ScopedPointer sharedAudioDeviceManager; +extern std::unique_ptr sharedAudioDeviceManager; AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels = -1, int numOutputChannels = -1); diff --git a/examples/DemoRunner/Source/Main.cpp b/examples/DemoRunner/Source/Main.cpp index 4cc2b4f7d3..34bf46f92a 100644 --- a/examples/DemoRunner/Source/Main.cpp +++ b/examples/DemoRunner/Source/Main.cpp @@ -141,12 +141,12 @@ private: MainComponent& getMainComponent() { return *dynamic_cast (getContentComponent()); } private: - ScopedPointer taskbarIcon; + std::unique_ptr taskbarIcon; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainAppWindow) }; - ScopedPointer mainWindow; + std::unique_ptr mainWindow; }; //============================================================================== diff --git a/examples/DemoRunner/Source/UI/DemoContentComponent.cpp b/examples/DemoRunner/Source/UI/DemoContentComponent.cpp index 0cbd997847..19e61be797 100644 --- a/examples/DemoRunner/Source/UI/DemoContentComponent.cpp +++ b/examples/DemoRunner/Source/UI/DemoContentComponent.cpp @@ -54,7 +54,7 @@ struct DemoContent : public Component void showHomeScreen() { setComponent (createIntroDemo()); } private: - ScopedPointer comp; + std::unique_ptr comp; }; //============================================================================== diff --git a/examples/DemoRunner/Source/UI/DemoContentComponent.h b/examples/DemoRunner/Source/UI/DemoContentComponent.h index 9a2f8d22d3..680996c1d8 100644 --- a/examples/DemoRunner/Source/UI/DemoContentComponent.h +++ b/examples/DemoRunner/Source/UI/DemoContentComponent.h @@ -53,10 +53,10 @@ public: private: std::function demoChangedCallback; - ScopedPointer demoContent; + std::unique_ptr demoContent; #if ! (JUCE_ANDROID || JUCE_IOS) - ScopedPointer codeContent; + std::unique_ptr codeContent; #endif String currentDemoCategory; diff --git a/examples/DemoRunner/Source/UI/MainComponent.h b/examples/DemoRunner/Source/UI/MainComponent.h index 6a9d1576ab..30a8980521 100644 --- a/examples/DemoRunner/Source/UI/MainComponent.h +++ b/examples/DemoRunner/Source/UI/MainComponent.h @@ -58,7 +58,7 @@ private: void updateRenderingEngine (int index); //============================================================================== - ScopedPointer contentComponent; + std::unique_ptr contentComponent; SidePanel demosPanel { "Demos", 250, true }; OpenGLContext openGLContext; diff --git a/examples/DemoRunner/Source/UI/SettingsContent.h b/examples/DemoRunner/Source/UI/SettingsContent.h index 51c9ee0355..fb9c18fb13 100644 --- a/examples/DemoRunner/Source/UI/SettingsContent.h +++ b/examples/DemoRunner/Source/UI/SettingsContent.h @@ -156,7 +156,7 @@ private: StringArray lookAndFeelNames; OwnedArray lookAndFeels; - ScopedPointer audioSettings; + std::unique_ptr audioSettings; //============================================================================== void refreshRenderingEngineSelector() diff --git a/examples/GUI/CameraDemo.h b/examples/GUI/CameraDemo.h index 301a619e11..300c64cc2e 100644 --- a/examples/GUI/CameraDemo.h +++ b/examples/GUI/CameraDemo.h @@ -113,8 +113,8 @@ public: private: //============================================================================== - ScopedPointer cameraDevice; - ScopedPointer cameraPreviewComp; + std::unique_ptr cameraDevice; + std::unique_ptr cameraPreviewComp; ImageComponent lastSnapshot; ComboBox cameraSelectorComboBox { "Camera" }; diff --git a/examples/GUI/CodeEditorDemo.h b/examples/GUI/CodeEditorDemo.h index 2ff9cf3483..239938606c 100644 --- a/examples/GUI/CodeEditorDemo.h +++ b/examples/GUI/CodeEditorDemo.h @@ -104,7 +104,7 @@ private: CPlusPlusCodeTokeniser cppTokeniser; // the editor component - ScopedPointer editor; + std::unique_ptr editor; FilenameComponent fileChooser { "File", {}, true, false, false, "*.cpp;*.h;*.hpp;*.c;*.mm;*.m", {}, "Choose a C++ file to open it in the editor" }; diff --git a/examples/GUI/ComponentTransformsDemo.h b/examples/GUI/ComponentTransformsDemo.h index c3a5e51ece..5b7d5b6979 100644 --- a/examples/GUI/ComponentTransformsDemo.h +++ b/examples/GUI/ComponentTransformsDemo.h @@ -94,7 +94,7 @@ public: } private: - ScopedPointer content; + std::unique_ptr content; struct CornerDragger : public Component { diff --git a/examples/GUI/DialogsDemo.h b/examples/GUI/DialogsDemo.h index 4c56ccdf5b..1c27591f27 100644 --- a/examples/GUI/DialogsDemo.h +++ b/examples/GUI/DialogsDemo.h @@ -321,8 +321,8 @@ private: fileToSave = fileToSave.getChildFile ("JUCE.png"); fileToSave.deleteFile(); - ScopedPointer outStream (fileToSave.createOutputStream()); - ScopedPointer inStream (createAssetInputStream ("juce_icon.png")); + std::unique_ptr outStream (fileToSave.createOutputStream()); + std::unique_ptr inStream (createAssetInputStream ("juce_icon.png")); outStream->writeFromInputStream (*inStream, -1); } @@ -343,8 +343,8 @@ private: #if JUCE_ANDROID || JUCE_IOS if (! result.isEmpty()) { - ScopedPointer wi (fileToSave.createInputStream()); - ScopedPointer wo (result.createOutputStream()); + std::unique_ptr wi (fileToSave.createInputStream()); + std::unique_ptr wo (result.createOutputStream()); if (wi.get() != nullptr && wo.get() != nullptr) { @@ -442,7 +442,7 @@ private: } ImagePreviewComponent imagePreview; - ScopedPointer fc; + std::unique_ptr fc; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DialogsDemo) }; diff --git a/examples/GUI/FontsDemo.h b/examples/GUI/FontsDemo.h index 647df1dda0..ab90926716 100644 --- a/examples/GUI/FontsDemo.h +++ b/examples/GUI/FontsDemo.h @@ -223,7 +223,7 @@ private: ComboBox styleBox; StretchableLayoutManager verticalLayout; - ScopedPointer verticalDividerBar; + std::unique_ptr verticalDividerBar; //============================================================================== void refreshPreviewBoxFont() diff --git a/examples/GUI/GraphicsDemo.h b/examples/GUI/GraphicsDemo.h index b47247676a..a5403242a6 100644 --- a/examples/GUI/GraphicsDemo.h +++ b/examples/GUI/GraphicsDemo.h @@ -490,7 +490,7 @@ public: ZipFile icons (createAssetInputStream ("icons.zip"), true); // Load a random SVG file from our embedded icons.zip file. - const ScopedPointer svgFileStream (icons.createStreamForEntry (Random::getSystemRandom().nextInt (icons.getNumEntries()))); + const std::unique_ptr svgFileStream (icons.createStreamForEntry (Random::getSystemRandom().nextInt (icons.getNumEntries()))); if (svgFileStream.get() != nullptr) { @@ -505,7 +505,7 @@ public: } Time lastSVGLoadTime; - ScopedPointer svgDrawable; + std::unique_ptr svgDrawable; }; //============================================================================== diff --git a/examples/GUI/MenusDemo.h b/examples/GUI/MenusDemo.h index 279e97f23e..35bc07429d 100644 --- a/examples/GUI/MenusDemo.h +++ b/examples/GUI/MenusDemo.h @@ -314,7 +314,7 @@ public: private: ApplicationCommandManager commandManager; - ScopedPointer menuBar; + std::unique_ptr menuBar; MenuBarPosition menuBarPosition = MenuBarPosition::window; SidePanel sidePanel { "Menu", 300, false }; diff --git a/examples/GUI/OpenGLAppDemo.h b/examples/GUI/OpenGLAppDemo.h index d2b458a46d..10cc2a8998 100644 --- a/examples/GUI/OpenGLAppDemo.h +++ b/examples/GUI/OpenGLAppDemo.h @@ -181,7 +181,7 @@ public: " gl_FragColor = colour;\n" "}\n"; - ScopedPointer newShader (new OpenGLShaderProgram (openGLContext)); + std::unique_ptr newShader (new OpenGLShaderProgram (openGLContext)); String statusText; if (newShader->addVertexShader (OpenGLHelpers::translateVertexShaderToV3 (vertexShader)) @@ -265,7 +265,7 @@ private: if (textureCoordIn.get() != nullptr) glContext.extensions.glDisableVertexAttribArray (textureCoordIn->attributeID); } - ScopedPointer position, normal, sourceColour, textureCoordIn; + std::unique_ptr position, normal, sourceColour, textureCoordIn; private: static OpenGLShaderProgram::Attribute* createAttribute (OpenGLContext& openGLContext, @@ -289,7 +289,7 @@ private: viewMatrix .reset (createUniform (openGLContext, shaderProgram, "viewMatrix")); } - ScopedPointer projectionMatrix, viewMatrix; + std::unique_ptr projectionMatrix, viewMatrix; private: static OpenGLShaderProgram::Uniform* createUniform (OpenGLContext& openGLContext, @@ -397,10 +397,10 @@ private: const char* vertexShader; const char* fragmentShader; - ScopedPointer shader; - ScopedPointer shape; - ScopedPointer attributes; - ScopedPointer uniforms; + std::unique_ptr shader; + std::unique_ptr shape; + std::unique_ptr attributes; + std::unique_ptr uniforms; String newVertexShader, newFragmentShader; diff --git a/examples/GUI/OpenGLDemo.h b/examples/GUI/OpenGLDemo.h index 64c2449318..9c6a87dac5 100644 --- a/examples/GUI/OpenGLDemo.h +++ b/examples/GUI/OpenGLDemo.h @@ -110,7 +110,7 @@ struct OpenGLDemoClasses if (textureCoordIn.get() != nullptr) openGLContext.extensions.glDisableVertexAttribArray (textureCoordIn->attributeID); } - ScopedPointer position, normal, sourceColour, textureCoordIn; + std::unique_ptr position, normal, sourceColour, textureCoordIn; private: static OpenGLShaderProgram::Attribute* createAttribute (OpenGLContext& openGLContext, @@ -137,7 +137,7 @@ struct OpenGLDemoClasses bouncingNumber .reset (createUniform (openGLContext, shader, "bouncingNumber")); } - ScopedPointer projectionMatrix, viewMatrix, texture, lightPosition, bouncingNumber; + std::unique_ptr projectionMatrix, viewMatrix, texture, lightPosition, bouncingNumber; private: static OpenGLShaderProgram::Uniform* createUniform (OpenGLContext& openGLContext, @@ -775,7 +775,7 @@ struct OpenGLDemoClasses void drawBackground2DStuff (float desktopScale) { // Create an OpenGLGraphicsContext that will draw into this GL window.. - ScopedPointer glRenderer (createOpenGLGraphicsContext (openGLContext, + std::unique_ptr glRenderer (createOpenGLGraphicsContext (openGLContext, roundToInt (desktopScale * getWidth()), roundToInt (desktopScale * getHeight()))); @@ -810,14 +810,14 @@ struct OpenGLDemoClasses OpenGLContext openGLContext; - ScopedPointer controlsOverlay; + std::unique_ptr controlsOverlay; float rotation = 0.0f; - ScopedPointer shader; - ScopedPointer shape; - ScopedPointer attributes; - ScopedPointer uniforms; + std::unique_ptr shader; + std::unique_ptr shape; + std::unique_ptr attributes; + std::unique_ptr uniforms; OpenGLTexture texture; DemoTexture* textureToUse = nullptr; @@ -837,7 +837,7 @@ struct OpenGLDemoClasses { if (newVertexShader.isNotEmpty() || newFragmentShader.isNotEmpty()) { - ScopedPointer newShader (new OpenGLShaderProgram (openGLContext)); + std::unique_ptr newShader (new OpenGLShaderProgram (openGLContext)); if (newShader->addVertexShader (OpenGLHelpers::translateVertexShaderToV3 (newVertexShader)) && newShader->addFragmentShader (OpenGLHelpers::translateFragmentShaderToV3 (newFragmentShader)) diff --git a/examples/GUI/OpenGLDemo2D.h b/examples/GUI/OpenGLDemo2D.h index e9d4ad573a..6452ecb650 100644 --- a/examples/GUI/OpenGLDemo2D.h +++ b/examples/GUI/OpenGLDemo2D.h @@ -143,7 +143,7 @@ public: startTimer (1); } - ScopedPointer shader; + std::unique_ptr shader; Label statusLabel, presetLabel { {}, "Shader Preset:" }; ComboBox presetBox; diff --git a/examples/GUI/WebBrowserDemo.h b/examples/GUI/WebBrowserDemo.h index f0ab4fe09e..41a1ca1eb0 100644 --- a/examples/GUI/WebBrowserDemo.h +++ b/examples/GUI/WebBrowserDemo.h @@ -131,7 +131,7 @@ public: } private: - ScopedPointer webView; + std::unique_ptr webView; TextEditor addressTextBox; diff --git a/examples/GUI/WidgetsDemo.h b/examples/GUI/WidgetsDemo.h index bc978b3bff..29a10be0a3 100644 --- a/examples/GUI/WidgetsDemo.h +++ b/examples/GUI/WidgetsDemo.h @@ -50,7 +50,7 @@ //============================================================================== static void showBubbleMessage (Component& targetComponent, const String& textToShow, - ScopedPointer& bmc) + std::unique_ptr& bmc) { bmc.reset (new BubbleMessageComponent()); @@ -450,7 +450,7 @@ struct ButtonsPage : public Component private: OwnedArray components; - ScopedPointer bubbleMessage; + std::unique_ptr bubbleMessage; // This little function avoids a bit of code-duplication by adding a component to // our list as well as calling addAndMakeVisible on it.. @@ -675,7 +675,7 @@ private: for (int i = 0; i < icons.getNumEntries(); ++i) { - ScopedPointer svgFileStream (icons.createStreamForEntry (i)); + std::unique_ptr svgFileStream (icons.createStreamForEntry (i)); if (svgFileStream.get() != nullptr) { @@ -920,7 +920,7 @@ private: TableListBox table; // the table component itself Font font { 14.0f }; - ScopedPointer demoData; // This is the XML document loaded from the embedded file "demo table data.xml" + std::unique_ptr demoData; // This is the XML document loaded from the embedded file "demo table data.xml" XmlElement* columnList = nullptr; // A pointer to the sub-node of demoData that contains the list of columns XmlElement* dataList = nullptr; // A pointer to the sub-node of demoData that contains the list of data rows int numRows; // The number of rows of data we've got @@ -1321,7 +1321,7 @@ struct DemoTabbedComponent : public TabbedComponent bubbleMessage); } private: - ScopedPointer bubbleMessage; + std::unique_ptr bubbleMessage; }; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DemoTabbedComponent) diff --git a/examples/Plugins/AUv3SynthPluginDemo.h b/examples/Plugins/AUv3SynthPluginDemo.h index 7a41bfcb5a..822c2d4795 100644 --- a/examples/Plugins/AUv3SynthPluginDemo.h +++ b/examples/Plugins/AUv3SynthPluginDemo.h @@ -195,7 +195,7 @@ public: if (auto* assetStream = createAssetInputStream ("proaudio.path")) { - ScopedPointer fileStream (assetStream); + std::unique_ptr fileStream (assetStream); Path proAudioPath; proAudioPath.loadPathFromStream (*fileStream); @@ -415,7 +415,7 @@ private: void loadNewSample (InputStream* soundBuffer, const char* format) { - ScopedPointer formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); + std::unique_ptr formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); BigInteger midiNotes; midiNotes.setRange (0, 126, true); @@ -431,7 +431,7 @@ private: auto* stream = new MemoryOutputStream (mb, true); { - ScopedPointer writer (formatManager.findFormatForFileExtension ("wav")->createWriterFor (stream, lastSampleRate, 1, 16, + std::unique_ptr writer (formatManager.findFormatForFileExtension ("wav")->createWriterFor (stream, lastSampleRate, 1, 16, StringPairArray(), 0)); writer->writeFromAudioSampleBuffer (currentRecording, 0, currentRecording.getNumSamples()); writer->flush(); diff --git a/examples/Plugins/AudioPluginDemo.h b/examples/Plugins/AudioPluginDemo.h index 861d3f75fc..6d01d6ba4e 100644 --- a/examples/Plugins/AudioPluginDemo.h +++ b/examples/Plugins/AudioPluginDemo.h @@ -307,7 +307,7 @@ public: // whose contents will have been created by the getStateInformation() call. // This getXmlFromBinary() helper function retrieves our XML from the binary blob.. - ScopedPointer xmlState (getXmlFromBinary (data, sizeInBytes)); + std::unique_ptr xmlState (getXmlFromBinary (data, sizeInBytes)); if (xmlState.get() != nullptr) { @@ -499,7 +499,7 @@ private: gainLabel { {}, "Throughput level:" }, delayLabel { {}, "Delay:" }; - ScopedPointer gainSlider, delaySlider; + std::unique_ptr gainSlider, delaySlider; Colour backgroundColour; //============================================================================== diff --git a/examples/Plugins/DSPModulePluginDemo.h b/examples/Plugins/DSPModulePluginDemo.h index af8c215a6a..ff2cd7ce91 100644 --- a/examples/Plugins/DSPModulePluginDemo.h +++ b/examples/Plugins/DSPModulePluginDemo.h @@ -272,7 +272,8 @@ public: auto maxSize = static_cast (roundToInt (getSampleRate() * (8192.0 / 44100.0))); auto assetName = (type == 0 ? "Impulse1.wav" : "Impulse2.wav"); - ScopedPointer assetInputStream (createAssetInputStream (assetName)); + std::unique_ptr assetInputStream (createAssetInputStream (assetName)); + if (assetInputStream != nullptr) { currentCabinetData.reset(); @@ -478,7 +479,7 @@ private: //============================================================================== DspModulePluginDemoAudioProcessor& processor; - ScopedPointer inputVolumeSlider, outputVolumeSlider, + std::unique_ptr inputVolumeSlider, outputVolumeSlider, lowPassFilterFreqSlider, highPassFilterFreqSlider; ComboBox stereoBox, slopeBox, waveshaperBox, cabinetTypeBox; ToggleButton cabinetSimButton, oversamplingButton; @@ -555,7 +556,7 @@ private: dsp::Gain inputVolume, outputVolume; - ScopedPointer> oversampling; + std::unique_ptr> oversampling; bool audioCurrentlyOversampled = false; Atomic cabinetType; diff --git a/examples/Plugins/InterAppAudioEffectPluginDemo.h b/examples/Plugins/InterAppAudioEffectPluginDemo.h index 30588d4cc0..429bff107c 100644 --- a/examples/Plugins/InterAppAudioEffectPluginDemo.h +++ b/examples/Plugins/InterAppAudioEffectPluginDemo.h @@ -236,13 +236,13 @@ public: //============================================================================== void getStateInformation (MemoryBlock& destData) override { - auto xml = ScopedPointer (parameters.state.createXml()); + auto xml = std::unique_ptr (parameters.state.createXml()); copyXmlToBinary (*xml, destData); } void setStateInformation (const void* data, int sizeInBytes) override { - auto xmlState = ScopedPointer (getXmlFromBinary (data, sizeInBytes)); + auto xmlState = std::unique_ptr (getXmlFromBinary (data, sizeInBytes)); if (xmlState.get() != nullptr) if (xmlState->hasTagName (parameters.state.getType())) diff --git a/examples/Plugins/MultiOutSynthPluginDemo.h b/examples/Plugins/MultiOutSynthPluginDemo.h index 5db3df5695..db8a8a39af 100644 --- a/examples/Plugins/MultiOutSynthPluginDemo.h +++ b/examples/Plugins/MultiOutSynthPluginDemo.h @@ -157,7 +157,7 @@ private: void loadNewSample (InputStream* soundBuffer, const char* format) { - ScopedPointer formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); + std::unique_ptr formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); BigInteger midiNotes; midiNotes.setRange (0, 126, true); diff --git a/examples/Plugins/SamplerPluginDemo.h b/examples/Plugins/SamplerPluginDemo.h index 06c37973b3..38e1f47a1f 100644 --- a/examples/Plugins/SamplerPluginDemo.h +++ b/examples/Plugins/SamplerPluginDemo.h @@ -2065,7 +2065,7 @@ public: { if (auto* asset = createAssetInputStream ("cello.wav")) { - ScopedPointer inputStream (asset); + std::unique_ptr inputStream (asset); inputStream->readIntoMemoryBlock (mb); readerFactory.reset (new MemoryAudioFormatReaderFactory (mb.getData(), mb.getSize())); diff --git a/examples/Utilities/AnalyticsCollectionDemo.h b/examples/Utilities/AnalyticsCollectionDemo.h index 349977df41..8883781080 100644 --- a/examples/Utilities/AnalyticsCollectionDemo.h +++ b/examples/Utilities/AnalyticsCollectionDemo.h @@ -211,7 +211,7 @@ private: // method is called on app shutdown so it needs to complete quickly! XmlDocument previouslySavedEvents (savedEventsFile); - ScopedPointer xml (previouslySavedEvents.getDocumentElement()); + std::unique_ptr xml (previouslySavedEvents.getDocumentElement()); if (xml.get() == nullptr || xml->getTagName() != "events") xml.reset (new XmlElement ("events")); @@ -247,7 +247,7 @@ private: void restoreUnloggedEvents (std::deque& restoredEventQueue) override { XmlDocument savedEvents (savedEventsFile); - ScopedPointer xml (savedEvents.getDocumentElement()); + std::unique_ptr xml (savedEvents.getDocumentElement()); if (xml.get() == nullptr || xml->getTagName() != "events") return; @@ -292,7 +292,7 @@ private: CriticalSection webStreamCreation; bool shouldExit = false; - ScopedPointer webStream; + std::unique_ptr webStream; String apiKey; @@ -365,7 +365,7 @@ private: } TextButton eventButton { "Press me!" }, crashButton { "Simulate crash!" }; - ScopedPointer logEventButtonPress; + std::unique_ptr logEventButtonPress; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AnalyticsCollectionDemo) }; diff --git a/examples/Utilities/Box2DDemo.h b/examples/Utilities/Box2DDemo.h index 362f98c89a..362543d232 100644 --- a/examples/Utilities/Box2DDemo.h +++ b/examples/Utilities/Box2DDemo.h @@ -83,7 +83,7 @@ struct Test virtual void Keyboard (unsigned char /*key*/) {} virtual void KeyboardUp (unsigned char /*key*/) {} - ScopedPointer m_world { new b2World (b2Vec2 (0.0f, -10.0f)) }; + std::unique_ptr m_world { new b2World (b2Vec2 (0.0f, -10.0f)) }; }; #include "../Assets/Box2DTests/AddPair.h" @@ -149,7 +149,7 @@ struct Box2DRenderComponent : public Component } } - ScopedPointer currentTest; + std::unique_ptr currentTest; }; //============================================================================== diff --git a/examples/Utilities/ChildProcessDemo.h b/examples/Utilities/ChildProcessDemo.h index 704abaf493..50cc37966b 100644 --- a/examples/Utilities/ChildProcessDemo.h +++ b/examples/Utilities/ChildProcessDemo.h @@ -67,7 +67,7 @@ static MemoryBlock valueTreeToMemoryBlock (const ValueTree& v) static String valueTreeToString (const ValueTree& v) { - ScopedPointer xml (v.createXml()); + std::unique_ptr xml (v.createXml()); if (xml.get() != nullptr) return xml->createDocument ({}, true, false); @@ -201,7 +201,7 @@ public: }; //============================================================================== - ScopedPointer masterProcess; + std::unique_ptr masterProcess; private: TextButton launchButton { "Launch Child Process" }; @@ -284,7 +284,7 @@ public: */ bool invokeChildProcessDemo (const String& commandLine) { - ScopedPointer slave (new DemoSlaveProcess()); + std::unique_ptr slave (new DemoSlaveProcess()); if (slave->initialiseFromCommandLine (commandLine, demoCommandLineUID)) { @@ -316,7 +316,7 @@ bool invokeChildProcessDemo (const String& commandLine) if (invokeChildProcessDemo (commandLine)) return; - mainWindow = new MainWindow ("ChildProcessDemo", new ChildProcessDemo()); + mainWindow.reset (new MainWindow ("ChildProcessDemo", new ChildProcessDemo())); } void shutdown() override { mainWindow = nullptr; } @@ -346,7 +346,8 @@ bool invokeChildProcessDemo (const String& commandLine) private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow) }; - ScopedPointer mainWindow; + + std::unique_ptr mainWindow; }; //============================================================================== diff --git a/examples/Utilities/InAppPurchasesDemo.h b/examples/Utilities/InAppPurchasesDemo.h index d70c78afe3..68f2783c12 100644 --- a/examples/Utilities/InAppPurchasesDemo.h +++ b/examples/Utilities/InAppPurchasesDemo.h @@ -382,8 +382,7 @@ public: if (auto* assetStream = createAssetInputStream (String ("Purchases/" + String (imageResourceName)).toRawUTF8())) { - ScopedPointer fileStream (assetStream); - + std::unique_ptr fileStream (assetStream); avatar = PNGImageFormat().decodeImage (*fileStream); } } @@ -557,7 +556,7 @@ private: if (auto* assetStream = createAssetInputStream (assetName.toRawUTF8())) { - ScopedPointer fileStream (assetStream); + std::unique_ptr fileStream (assetStream); currentPhraseData.reset(); fileStream->readIntoMemoryBlock (currentPhraseData); @@ -572,7 +571,7 @@ private: Label phraseLabel { "phraseLabel", NEEDS_TRANS ("Phrases:") }; ListBox phraseListBox { "phraseListBox" }; - ScopedPointer phraseModel { new PhraseModel() }; + std::unique_ptr phraseModel { new PhraseModel() }; TextButton playStopButton { "Play" }; SoundPlayer player; @@ -581,7 +580,7 @@ private: Label voiceLabel { "voiceLabel", NEEDS_TRANS ("Voices:") }; ListBox voiceListBox { "voiceListBox" }; - ScopedPointer voiceModel { new VoiceModel (purchases) }; + std::unique_ptr voiceModel { new VoiceModel (purchases) }; MemoryBlock currentPhraseData; diff --git a/examples/Utilities/JavaScriptDemo.h b/examples/Utilities/JavaScriptDemo.h index 6a5749a558..47a1f6f1f9 100644 --- a/examples/Utilities/JavaScriptDemo.h +++ b/examples/Utilities/JavaScriptDemo.h @@ -154,7 +154,7 @@ public: private: CodeDocument codeDocument; - ScopedPointer editor; + std::unique_ptr editor; TextEditor outputDisplay; void codeDocumentTextInserted (const String&, int) override { startTimer (300); } diff --git a/examples/Utilities/NetworkingDemo.h b/examples/Utilities/NetworkingDemo.h index bbfb348ca5..8cd1fca1fd 100644 --- a/examples/Utilities/NetworkingDemo.h +++ b/examples/Utilities/NetworkingDemo.h @@ -101,7 +101,7 @@ public: StringPairArray responseHeaders; int statusCode = 0; - ScopedPointer stream (url.createInputStream (false, nullptr, nullptr, {}, + std::unique_ptr stream (url.createInputStream (false, nullptr, nullptr, {}, 10000, // timeout in millisecs &responseHeaders, &statusCode)); if (stream.get() != nullptr) diff --git a/examples/Utilities/UnitTestsDemo.h b/examples/Utilities/UnitTestsDemo.h index e8e22601c6..066d0c40c9 100644 --- a/examples/Utilities/UnitTestsDemo.h +++ b/examples/Utilities/UnitTestsDemo.h @@ -220,7 +220,7 @@ struct UnitTestClasses } private: - ScopedPointer currentTestThread; + std::unique_ptr currentTestThread; TextButton startTestButton { "Run Unit Tests..." }; ComboBox categoriesBox; diff --git a/examples/Utilities/ValueTreesDemo.h b/examples/Utilities/ValueTreesDemo.h index 4bef4120c9..7143bbaa3c 100644 --- a/examples/Utilities/ValueTreesDemo.h +++ b/examples/Utilities/ValueTreesDemo.h @@ -109,7 +109,7 @@ public: { if (items.size() > 0) { - ScopedPointer oldOpenness (treeView.getOpennessState (false)); + std::unique_ptr oldOpenness (treeView.getOpennessState (false)); for (auto* v : items) { @@ -291,7 +291,7 @@ private: TextButton undoButton { "Undo" }, redoButton { "Redo" }; - ScopedPointer rootItem; + std::unique_ptr rootItem; UndoManager undoManager; void timerCallback() override diff --git a/examples/Utilities/XMLandJSONDemo.h b/examples/Utilities/XMLandJSONDemo.h index 0fc695f0b4..f22235f976 100644 --- a/examples/Utilities/XMLandJSONDemo.h +++ b/examples/Utilities/XMLandJSONDemo.h @@ -303,13 +303,13 @@ private: CodeEditorComponent codeDocumentComponent { codeDocument, nullptr }; TreeView resultsTree; - ScopedPointer rootItem; - ScopedPointer parsedXml; + std::unique_ptr rootItem; + std::unique_ptr parsedXml; TextEditor errorMessage; void rebuildTree() { - ScopedPointer openness; + std::unique_ptr openness; if (rootItem.get() != nullptr) openness.reset (rootItem->getOpennessState()); diff --git a/extras/AudioPerformanceTest/Source/Main.cpp b/extras/AudioPerformanceTest/Source/Main.cpp index c221c7e87d..bfce625b56 100644 --- a/extras/AudioPerformanceTest/Source/Main.cpp +++ b/extras/AudioPerformanceTest/Source/Main.cpp @@ -88,7 +88,7 @@ public: }; private: - ScopedPointer mainWindow; + std::unique_ptr mainWindow; }; //============================================================================== diff --git a/extras/AudioPluginHost/Source/Filters/FilterGraph.cpp b/extras/AudioPluginHost/Source/Filters/FilterGraph.cpp index c894505d22..47a3223712 100644 --- a/extras/AudioPluginHost/Source/Filters/FilterGraph.cpp +++ b/extras/AudioPluginHost/Source/Filters/FilterGraph.cpp @@ -212,7 +212,7 @@ void FilterGraph::newDocument() Result FilterGraph::loadDocument (const File& file) { XmlDocument doc (file); - ScopedPointer xml (doc.getDocumentElement()); + std::unique_ptr xml (doc.getDocumentElement()); if (xml == nullptr || ! xml->hasTagName ("FILTERGRAPH")) return Result::fail ("Not a valid filter graph file"); @@ -223,7 +223,7 @@ Result FilterGraph::loadDocument (const File& file) Result FilterGraph::saveDocument (const File& file) { - ScopedPointer xml (createXml()); + std::unique_ptr xml (createXml()); if (! xml->writeToFile (file, {})) return Result::fail ("Couldn't write to the file"); diff --git a/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h b/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h index 1531874543..4fcf3ba6bc 100644 --- a/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h +++ b/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h @@ -46,7 +46,7 @@ private: AudioProcessor::BusesLayout currentLayout; Label title; - ScopedPointer inConfig, outConfig; + std::unique_ptr inConfig, outConfig; InputOutputConfig* getConfig (bool isInput) noexcept { return isInput ? inConfig.get() : outConfig.get(); } void update(); diff --git a/extras/AudioPluginHost/Source/HostStartup.cpp b/extras/AudioPluginHost/Source/HostStartup.cpp index ac827684ba..63e8713b37 100644 --- a/extras/AudioPluginHost/Source/HostStartup.cpp +++ b/extras/AudioPluginHost/Source/HostStartup.cpp @@ -137,10 +137,10 @@ public: bool moreThanOneInstanceAllowed() override { return true; } ApplicationCommandManager commandManager; - ScopedPointer appProperties; + std::unique_ptr appProperties; private: - ScopedPointer mainWindow; + std::unique_ptr mainWindow; }; static PluginHostApp& getApp() { return *dynamic_cast(JUCEApplication::getInstance()); } diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp index 61fc57c91d..cd51a8bbde 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp @@ -47,7 +47,7 @@ KnownPluginList& knownPluginList; AudioUnitPluginFormat formatToScan; - ScopedPointer scanner; + std::unique_ptr scanner; FileSearchPath paths; ThreadPool pool; @@ -485,7 +485,7 @@ struct GraphEditorPanel::FilterComponent : public Component, Font font { 13.0f, Font::bold }; int numIns = 0, numOuts = 0; DropShadowEffect shadow; - ScopedPointer menu; + std::unique_ptr menu; }; @@ -1081,7 +1081,7 @@ struct GraphDocumentComponent::PluginListBoxModel : public ListBoxModel, owner.addMouseListener (this, true); #if JUCE_IOS - scanner = new AUScanner (knownPlugins); + scanner.reset (new AUScanner (knownPlugins)); #endif } @@ -1133,7 +1133,7 @@ struct GraphDocumentComponent::PluginListBoxModel : public ListBoxModel, bool isOverSelectedRow = false; #if JUCE_IOS - ScopedPointer scanner; + std::unique_ptr scanner; #endif }; diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h index cf24387f23..7112e05a37 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h @@ -76,8 +76,8 @@ private: OwnedArray nodes; OwnedArray connectors; - ScopedPointer draggingConnector; - ScopedPointer menu; + std::unique_ptr draggingConnector; + std::unique_ptr menu; FilterComponent* getComponentForFilter (AudioProcessorGraph::NodeID) const; ConnectorComponent* getComponentForConnection (const AudioProcessorGraph::Connection&) const; @@ -115,7 +115,7 @@ public: bool closeAnyOpenPluginWindows(); //============================================================================== - ScopedPointer graph; + std::unique_ptr graph; void resized() override; void unfocusKeyboardComponent(); @@ -126,8 +126,8 @@ public: void itemDropped (const SourceDetails&) override; //============================================================================== - ScopedPointer graphPanel; - ScopedPointer keyboardComp; + std::unique_ptr graphPanel; + std::unique_ptr keyboardComp; //============================================================================== void showSidePanel (bool isSettingsPanel); @@ -144,14 +144,14 @@ private: MidiKeyboardState keyState; struct TooltipBar; - ScopedPointer statusBar; + std::unique_ptr statusBar; class TitleBarComponent; - ScopedPointer titleBarComponent; + std::unique_ptr titleBarComponent; //============================================================================== struct PluginListBoxModel; - ScopedPointer pluginListBoxModel; + std::unique_ptr pluginListBoxModel; ListBox pluginListBox; diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp index feace10313..9abd73a38c 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp @@ -84,8 +84,8 @@ MainHostWindow::MainHostWindow() RuntimePermissions::request (RuntimePermissions::recordAudio, [safeThis = SafePointer (this)] (bool granted) mutable { - ScopedPointer savedAudioState (getAppProperties().getUserSettings() - ->getXmlValue ("audioDeviceState")); + std::unique_ptr savedAudioState (getAppProperties().getUserSettings() + ->getXmlValue ("audioDeviceState")); safeThis->deviceManager.initialise (granted ? 256 : 0, 256, savedAudioState.get(), true); }); @@ -109,7 +109,7 @@ MainHostWindow::MainHostWindow() InternalPluginFormat internalFormat; internalFormat.getAllTypes (internalTypes); - ScopedPointer savedPluginList (getAppProperties().getUserSettings()->getXmlValue ("pluginList")); + std::unique_ptr savedPluginList (getAppProperties().getUserSettings()->getXmlValue ("pluginList")); if (savedPluginList != nullptr) knownPluginList.recreateFromXml (*savedPluginList); @@ -220,7 +220,7 @@ void MainHostWindow::changeListenerCallback (ChangeBroadcaster* changed) // save the plugin list every time it gets changed, so that if we're scanning // and it crashes, we've still saved the previous ones - ScopedPointer savedPluginList (knownPluginList.createXml()); + std::unique_ptr savedPluginList (knownPluginList.createXml()); if (savedPluginList != nullptr) { @@ -577,7 +577,7 @@ void MainHostWindow::showAudioSettings() ModalCallbackFunction::create ([safeThis = SafePointer (this)] (int) { - ScopedPointer audioState (safeThis->deviceManager.createStateXml()); + std::unique_ptr audioState (safeThis->deviceManager.createStateXml()); getAppProperties().getUserSettings()->setValue ("audioDeviceState", audioState.get()); getAppProperties().getUserSettings()->saveIfNeeded(); diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.h b/extras/AudioPluginHost/Source/UI/MainHostWindow.h index 7b64ff327e..78e87e8992 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.h +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.h @@ -92,7 +92,7 @@ public: bool isDoublePrecisionProcessing(); void updatePrecisionMenuItem (ApplicationCommandInfo& info); - ScopedPointer graphHolder; + std::unique_ptr graphHolder; private: //============================================================================== @@ -104,7 +104,7 @@ private: KnownPluginList::SortMethod pluginSortMethod; class PluginListWindow; - ScopedPointer pluginListWindow; + std::unique_ptr pluginListWindow; void showAudioSettings(); diff --git a/extras/BinaryBuilder/Source/Main.cpp b/extras/BinaryBuilder/Source/Main.cpp index 5310e885d0..e6c4aeaac5 100644 --- a/extras/BinaryBuilder/Source/Main.cpp +++ b/extras/BinaryBuilder/Source/Main.cpp @@ -159,7 +159,7 @@ int main (int argc, char* argv[]) headerFile.deleteFile(); cppFile.deleteFile(); - ScopedPointer header (headerFile.createOutputStream()); + std::unique_ptr header (headerFile.createOutputStream()); if (header == nullptr) { @@ -168,7 +168,7 @@ int main (int argc, char* argv[]) return 0; } - ScopedPointer cpp (cppFile.createOutputStream()); + std::unique_ptr cpp (cppFile.createOutputStream()); if (cpp == nullptr) { diff --git a/extras/NetworkGraphicsDemo/Source/Demos.h b/extras/NetworkGraphicsDemo/Source/Demos.h index 0ae21e8b42..24517755e7 100644 --- a/extras/NetworkGraphicsDemo/Source/Demos.h +++ b/extras/NetworkGraphicsDemo/Source/Demos.h @@ -84,7 +84,7 @@ struct BackgroundLogo : public AnimatedContent )blahblah"; - ScopedPointer svg (XmlDocument::parse (logoData)); + std::unique_ptr svg (XmlDocument::parse (logoData)); logo.reset (Drawable::createFromSVG (*svg)); } @@ -97,7 +97,7 @@ struct BackgroundLogo : public AnimatedContent logo->drawWithin (g, canvas.getLimits().reduced (3.0f), RectanglePlacement (RectanglePlacement::centred), 0.6f); } - ScopedPointer logo; + std::unique_ptr logo; }; //============================================================================== diff --git a/extras/NetworkGraphicsDemo/Source/MasterComponent.h b/extras/NetworkGraphicsDemo/Source/MasterComponent.h index 481fcec2b2..8464f66999 100644 --- a/extras/NetworkGraphicsDemo/Source/MasterComponent.h +++ b/extras/NetworkGraphicsDemo/Source/MasterComponent.h @@ -348,7 +348,7 @@ private: updateCanvasInfo (currentCanvas); { - ScopedPointer context (new CanvasGeneratingContext (currentCanvas)); + std::unique_ptr context (new CanvasGeneratingContext (currentCanvas)); Graphics g (*context); if (content != nullptr) diff --git a/extras/Projucer/JuceLibraryCode/BinaryData.cpp b/extras/Projucer/JuceLibraryCode/BinaryData.cpp index 504d2cddd1..ff35bfd947 100644 --- a/extras/Projucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Projucer/JuceLibraryCode/BinaryData.cpp @@ -6498,7 +6498,7 @@ static const unsigned char temp_binary_data_42[] = " {\r\n" " // This method is where you should put your application's initialisation code..\r\n" "\r\n" -" mainWindow = new MainWindow (getApplicationName());\r\n" +" mainWindow.reset (new MainWindow (getApplicationName()));\r\n" " }\r\n" "\r\n" " void shutdown() override\r\n" @@ -6564,7 +6564,7 @@ static const unsigned char temp_binary_data_42[] = " };\r\n" "\r\n" "private:\r\n" -" ScopedPointer mainWindow;\r\n" +" std::unique_ptr mainWindow;\r\n" "};\r\n" "\r\n" "//==============================================================================\r\n" @@ -6603,7 +6603,7 @@ static const unsigned char temp_binary_data_43[] = " {\r\n" " // This method is where you should put your application's initialisation code..\r\n" "\r\n" -" mainWindow = new MainWindow (getApplicationName());\r\n" +" mainWindow.reset (new MainWindow (getApplicationName()));\r\n" " }\r\n" "\r\n" " void shutdown() override\r\n" @@ -6668,7 +6668,7 @@ static const unsigned char temp_binary_data_43[] = " };\r\n" "\r\n" "private:\r\n" -" ScopedPointer mainWindow;\r\n" +" std::unique_ptr mainWindow;\r\n" "};\r\n" "\r\n" "//==============================================================================\r\n" @@ -7224,7 +7224,8 @@ static const unsigned char temp_binary_data_53[] = " //==============================================================================\r\n" " JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)\r\n" " };\r\n" -" ScopedPointer mainWindow;\r\n" +"\r\n" +" std::unique_ptr mainWindow;\r\n" "};\r\n" "\r\n" "//==============================================================================\r\n" @@ -7634,8 +7635,8 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) case 0x28d496ad: numBytes = 1233; return jucer_InlineComponentTemplate_h; case 0x8905395b: numBytes = 473; return jucer_MainConsoleAppTemplate_cpp; case 0x5e5ea047: numBytes = 2021; return jucer_MainTemplate_NoWindow_cpp; - case 0xda2391f8: numBytes = 4004; return jucer_MainTemplate_SimpleWindow_cpp; - case 0x400bc026: numBytes = 3964; return jucer_MainTemplate_Window_cpp; + case 0xda2391f8: numBytes = 4012; return jucer_MainTemplate_SimpleWindow_cpp; + case 0x400bc026: numBytes = 3972; return jucer_MainTemplate_Window_cpp; case 0xf4842835: numBytes = 1491; return jucer_NewComponentTemplate_cpp; case 0xe7bf237a: numBytes = 646; return jucer_NewComponentTemplate_h; case 0x02a2a077: numBytes = 278; return jucer_NewCppFileTemplate_cpp; @@ -7645,7 +7646,7 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) case 0x7fbac252: numBytes = 1665; return jucer_OpenGLComponentTemplate_cpp; case 0x491fa0d7: numBytes = 1263; return jucer_OpenGLComponentTemplate_h; case 0xbc050edc: numBytes = 4926; return jucer_PIPAudioProcessorTemplate_h; - case 0xf4ca9e9a: numBytes = 2443; return jucer_PIPMain_cpp; + case 0xf4ca9e9a: numBytes = 2447; return jucer_PIPMain_cpp; case 0x0b16e320: numBytes = 517; return jucer_PIPTemplate_h; case 0x763d39dc: numBytes = 1050; return colourscheme_dark_xml; case 0xe8b08520: numBytes = 1050; return colourscheme_light_xml; diff --git a/extras/Projucer/JuceLibraryCode/BinaryData.h b/extras/Projucer/JuceLibraryCode/BinaryData.h index 70e9d16916..79fa6ece5e 100644 --- a/extras/Projucer/JuceLibraryCode/BinaryData.h +++ b/extras/Projucer/JuceLibraryCode/BinaryData.h @@ -135,10 +135,10 @@ namespace BinaryData const int jucer_MainTemplate_NoWindow_cppSize = 2021; extern const char* jucer_MainTemplate_SimpleWindow_cpp; - const int jucer_MainTemplate_SimpleWindow_cppSize = 4004; + const int jucer_MainTemplate_SimpleWindow_cppSize = 4012; extern const char* jucer_MainTemplate_Window_cpp; - const int jucer_MainTemplate_Window_cppSize = 3964; + const int jucer_MainTemplate_Window_cppSize = 3972; extern const char* jucer_NewComponentTemplate_cpp; const int jucer_NewComponentTemplate_cppSize = 1491; @@ -168,7 +168,7 @@ namespace BinaryData const int jucer_PIPAudioProcessorTemplate_hSize = 4926; extern const char* jucer_PIPMain_cpp; - const int jucer_PIPMain_cppSize = 2443; + const int jucer_PIPMain_cppSize = 2447; extern const char* jucer_PIPTemplate_h; const int jucer_PIPTemplate_hSize = 517; diff --git a/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h index df2db4a5dd..aa33c486c8 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_AboutWindowComponent.h @@ -132,11 +132,11 @@ private: Rectangle huckleberryLogoBounds, juceLogoBounds; - ScopedPointer juceLogo { Drawable::createFromImageData (BinaryData::juce_icon_png, - BinaryData::juce_icon_pngSize) }; + std::unique_ptr juceLogo { Drawable::createFromImageData (BinaryData::juce_icon_png, + BinaryData::juce_icon_pngSize) }; - ScopedPointer huckleberryLogo { Drawable::createFromImageData (BinaryData::huckleberry_icon_svg, - BinaryData::huckleberry_icon_svgSize) }; + std::unique_ptr huckleberryLogo { Drawable::createFromImageData (BinaryData::huckleberry_icon_svg, + BinaryData::huckleberry_icon_svgSize) }; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AboutWindowComponent) }; diff --git a/extras/Projucer/Source/Application/Windows/jucer_ApplicationUsageDataWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_ApplicationUsageDataWindowComponent.h index ce8164c37a..15ccb5b1fb 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_ApplicationUsageDataWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_ApplicationUsageDataWindowComponent.h @@ -152,7 +152,7 @@ private: Label headerLabel, bodyLabel; HyperlinkButton juceEULALink, privacyPolicyLink; Label shareApplicationUsageDataLabel { {}, "Help JUCE to improve its software and services by sharing my application usage data" }; - ScopedPointer shareApplicationUsageDataToggle; + std::unique_ptr shareApplicationUsageDataToggle; TextButton okButton { "OK" }, upgradeLicenseButton { "Upgrade License" }; void lookAndFeelChanged() override diff --git a/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h index beca635c5a..9783247458 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_EditorColourSchemeWindowComponent.h @@ -60,7 +60,7 @@ public: } private: - ScopedPointer content; + std::unique_ptr content; //============================================================================== struct AppearanceEditor diff --git a/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h b/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h index 99208f302b..ff2fdb3ab9 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h +++ b/extras/Projucer/Source/Application/Windows/jucer_FloatingToolWindow.h @@ -33,7 +33,7 @@ struct FloatingToolWindow : public DialogWindow FloatingToolWindow (const String& title, const String& windowPosPropertyName, Component* content, - ScopedPointer& ownerPointer, + std::unique_ptr& ownerPointer, bool shouldBeResizable, int defaultW, int defaultH, int minW, int minH, @@ -84,7 +84,7 @@ struct FloatingToolWindow : public DialogWindow private: String windowPosProperty; - ScopedPointer& owner; + std::unique_ptr& owner; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FloatingToolWindow) }; diff --git a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h index 4a609531e5..b439d75ca9 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h @@ -307,7 +307,7 @@ private: } //============================================================================== - ScopedPointer lf; + std::unique_ptr lf; Viewport propertyViewport; PropertyGroupComponent propertyGroup { "PIP Creator", { getIcons().juceLogo, Colours::transparentBlack } }; diff --git a/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h index cafc1663bc..fed80a62aa 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_SVGPathDataWindowComponent.h @@ -163,7 +163,7 @@ public: dragOver = false; repaint(); - ScopedPointer element (XmlDocument::parse (File (files[0]))); + std::unique_ptr element (XmlDocument::parse (File (files[0]))); if (element != nullptr) { diff --git a/extras/Projucer/Source/Application/jucer_Application.h b/extras/Projucer/Source/Application/jucer_Application.h index 97b1871c4a..6689d45fa6 100644 --- a/extras/Projucer/Source/Application/jucer_Application.h +++ b/extras/Projucer/Source/Application/jucer_Application.h @@ -141,29 +141,29 @@ public: //============================================================================== ProjucerLookAndFeel lookAndFeel; - ScopedPointer settings; - ScopedPointer icons; + std::unique_ptr settings; + std::unique_ptr icons; struct MainMenuModel; - ScopedPointer menuModel; + std::unique_ptr menuModel; MainWindowList mainWindowList; OpenDocumentManager openDocumentManager; - ScopedPointer commandManager; + std::unique_ptr commandManager; - ScopedPointer utf8Window, svgPathWindow, aboutWindow, applicationUsageDataWindow, + std::unique_ptr utf8Window, svgPathWindow, aboutWindow, applicationUsageDataWindow, pathsWindow, editorColourSchemeWindow, pipCreatorWindow; - ScopedPointer logger; + std::unique_ptr logger; bool isRunningCommandLine; - ScopedPointer childProcessCache; - ScopedPointer licenseController; + std::unique_ptr childProcessCache; + std::unique_ptr licenseController; private: void* server = nullptr; - ScopedPointer versionChecker; + std::unique_ptr versionChecker; TooltipWindow tooltipWindow; void loginOrLogout(); @@ -191,7 +191,7 @@ private: void launchDemoRunner(); int numExamples = 0; - ScopedPointer demoRunnerAlert; + std::unique_ptr demoRunnerAlert; #if JUCE_LINUX ChildProcess makeProcess; @@ -201,7 +201,7 @@ private: void setupAnalytics(); void showSetJUCEPathAlert(); - ScopedPointer pathAlert; + std::unique_ptr pathAlert; //============================================================================== void setColourScheme (int index, bool saveSetting); diff --git a/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp b/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp index 6ac28bebd0..1d4060448a 100644 --- a/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp +++ b/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp @@ -178,7 +178,7 @@ public: const int maxRedirects = 5; // we need to do the redirecting manually due to inconsistencies on the way headers are handled on redirects - ScopedPointer in; + std::unique_ptr in; for (int redirect = 0; redirect < maxRedirects; ++redirect) { @@ -395,11 +395,11 @@ public: private: bool hasOverwriteButton; - ScopedPointer