| @@ -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> fileChooser; | |||
| std::unique_ptr<FileChooser> fileChooser; | |||
| }; | |||
| //============================================================================== | |||
| @@ -671,10 +671,10 @@ private: | |||
| uint32 currentBlockSize = 512; | |||
| uint32 currentNumChannels = 2; | |||
| ScopedPointer<AudioFormatReader> reader; | |||
| ScopedPointer<AudioFormatReaderSource> readerSource; | |||
| ScopedPointer<AudioTransportSource> transportSource; | |||
| ScopedPointer<DSPDemo<DemoType>> currentDemo; | |||
| std::unique_ptr<AudioFormatReader> reader; | |||
| std::unique_ptr<AudioFormatReaderSource> readerSource; | |||
| std::unique_ptr<AudioTransportSource> transportSource; | |||
| std::unique_ptr<DSPDemo<DemoType>> currentDemo; | |||
| AudioSourcePlayer audioSourcePlayer; | |||
| @@ -682,5 +682,5 @@ private: | |||
| AudioBuffer<float> fileReadBuffer; | |||
| ScopedPointer<DemoParametersComponent> parametersComponent; | |||
| std::unique_ptr<DemoParametersComponent> parametersComponent; | |||
| }; | |||
| @@ -100,7 +100,7 @@ inline Image getImageFromAssets (const char* assetName) | |||
| if (img.isNull()) | |||
| { | |||
| ScopedPointer<InputStream> juceIconStream (createAssetInputStream (assetName)); | |||
| std::unique_ptr<InputStream> juceIconStream (createAssetInputStream (assetName)); | |||
| if (juceIconStream == nullptr) | |||
| return {}; | |||
| @@ -115,7 +115,7 @@ inline Image getImageFromAssets (const char* assetName) | |||
| inline String loadEntireAssetIntoString (const char* assetName) | |||
| { | |||
| ScopedPointer<InputStream> input (createAssetInputStream (assetName)); | |||
| std::unique_ptr<InputStream> input (createAssetInputStream (assetName)); | |||
| if (input == nullptr) | |||
| return {}; | |||
| @@ -250,7 +250,7 @@ private: | |||
| if (faceGroup.size() == 0) | |||
| return nullptr; | |||
| ScopedPointer<Shape> shape (new Shape()); | |||
| std::unique_ptr<Shape> shape (new Shape()); | |||
| shape->name = name; | |||
| shape->material = material; | |||
| @@ -391,8 +391,8 @@ private: | |||
| AudioDeviceManager& audioDeviceManager { getSharedAudioDeviceManager (1, 2) }; | |||
| #endif | |||
| ScopedPointer<LatencyTester> latencyTester; | |||
| ScopedPointer<LiveScrollingAudioDisplay> liveAudioScroller; | |||
| std::unique_ptr<LatencyTester> latencyTester; | |||
| std::unique_ptr<LiveScrollingAudioDisplay> liveAudioScroller; | |||
| TextButton startTestButton { "Test Latency" }; | |||
| TextEditor resultsBox; | |||
| @@ -400,7 +400,7 @@ private: | |||
| TimeSliceThread thread { "audio file preview" }; | |||
| #if (JUCE_ANDROID || JUCE_IOS) | |||
| ScopedPointer<FileChooser> fileChooser; | |||
| std::unique_ptr<FileChooser> 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<AudioFormatReaderSource> currentAudioFileSource; | |||
| std::unique_ptr<AudioFormatReaderSource> currentAudioFileSource; | |||
| ScopedPointer<DemoThumbnailComp> thumbnail; | |||
| std::unique_ptr<DemoThumbnailComp> 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<AudioPlaybackDemo> 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 | |||
| @@ -76,7 +76,7 @@ public: | |||
| { | |||
| // Create an OutputStream to write to our destination file... | |||
| file.deleteFile(); | |||
| ScopedPointer<FileOutputStream> fileStream (file.createOutputStream()); | |||
| std::unique_ptr<FileOutputStream> 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<AudioFormatWriter::ThreadedWriter> threadedWriter; // the FIFO used to buffer the incoming data | |||
| std::unique_ptr<AudioFormatWriter::ThreadedWriter> threadedWriter; // the FIFO used to buffer the incoming data | |||
| double sampleRate = 0.0; | |||
| int64 nextSampleNum = 0; | |||
| @@ -143,7 +143,7 @@ private: | |||
| AudioDeviceManager& audioDeviceManager { getSharedAudioDeviceManager() }; | |||
| #endif | |||
| ScopedPointer<AudioDeviceSelectorComponent> audioSetupComp; | |||
| std::unique_ptr<AudioDeviceSelectorComponent> audioSetupComp; | |||
| TextEditor diagnosticsBox; | |||
| void changeListenerCallback (ChangeBroadcaster*) override | |||
| @@ -178,7 +178,7 @@ struct SynthAudioSource : public AudioSource | |||
| { | |||
| WavAudioFormat wavFormat; | |||
| ScopedPointer<AudioFormatReader> audioReader (wavFormat.createReaderFor (createAssetInputStream ("cello.wav"), true)); | |||
| std::unique_ptr<AudioFormatReader> audioReader (wavFormat.createReaderFor (createAssetInputStream ("cello.wav"), true)); | |||
| BigInteger allNotes; | |||
| allNotes.setRange (0, 128, true); | |||
| @@ -53,8 +53,8 @@ struct MidiDeviceListEntry : ReferenceCountedObject | |||
| MidiDeviceListEntry (const String& deviceName) : name (deviceName) {} | |||
| String name; | |||
| ScopedPointer<MidiInput> inDevice; | |||
| ScopedPointer<MidiOutput> outDevice; | |||
| std::unique_ptr<MidiInput> inDevice; | |||
| std::unique_ptr<MidiOutput> outDevice; | |||
| typedef ReferenceCountedObjectPtr<MidiDeviceListEntry> Ptr; | |||
| }; | |||
| @@ -476,8 +476,8 @@ private: | |||
| TextEditor midiMonitor { "MIDI Monitor" }; | |||
| TextButton pairButton { "MIDI Bluetooth devices..." }; | |||
| ScopedPointer<MidiDeviceListBox> midiInputSelector; | |||
| ScopedPointer<MidiDeviceListBox> midiOutputSelector; | |||
| std::unique_ptr<MidiDeviceListBox> midiInputSelector; | |||
| std::unique_ptr<MidiDeviceListBox> midiOutputSelector; | |||
| ReferenceCountedArray<MidiDeviceListEntry> midiInputs; | |||
| ReferenceCountedArray<MidiDeviceListEntry> midiOutputs; | |||
| @@ -88,7 +88,7 @@ struct ConvolutionDemoDSP | |||
| auto selectedType = cabinetTypeParameter->getCurrentSelectedID(); | |||
| auto assetName = (selectedType == 2 ? "guitar_amp.wav" : "cassette_recorder.wav"); | |||
| ScopedPointer<InputStream> assetInputStream (createAssetInputStream (assetName)); | |||
| std::unique_ptr<InputStream> assetInputStream (createAssetInputStream (assetName)); | |||
| if (assetInputStream != nullptr) | |||
| { | |||
| currentCabinetData.reset(); | |||
| @@ -124,7 +124,7 @@ struct SIMDRegisterDemoDSP | |||
| //============================================================================== | |||
| IIR::Coefficients<float>::Ptr iirCoefficients; | |||
| ScopedPointer<IIR::Filter<SIMDRegister<float>>> iir; | |||
| std::unique_ptr<IIR::Filter<SIMDRegister<float>>> iir; | |||
| AudioBlock<SIMDRegister<float>> interleaved; | |||
| AudioBlock<float> zero; | |||
| @@ -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> fileChooser; | |||
| std::unique_ptr<FileChooser> fileChooser; | |||
| }; | |||
| //============================================================================== | |||
| @@ -671,10 +671,10 @@ private: | |||
| uint32 currentBlockSize = 512; | |||
| uint32 currentNumChannels = 2; | |||
| ScopedPointer<AudioFormatReader> reader; | |||
| ScopedPointer<AudioFormatReaderSource> readerSource; | |||
| ScopedPointer<AudioTransportSource> transportSource; | |||
| ScopedPointer<DSPDemo<DemoType>> currentDemo; | |||
| std::unique_ptr<AudioFormatReader> reader; | |||
| std::unique_ptr<AudioFormatReaderSource> readerSource; | |||
| std::unique_ptr<AudioTransportSource> transportSource; | |||
| std::unique_ptr<DSPDemo<DemoType>> currentDemo; | |||
| AudioSourcePlayer audioSourcePlayer; | |||
| @@ -682,5 +682,5 @@ private: | |||
| AudioBuffer<float> fileReadBuffer; | |||
| ScopedPointer<DemoParametersComponent> parametersComponent; | |||
| std::unique_ptr<DemoParametersComponent> parametersComponent; | |||
| }; | |||
| @@ -100,7 +100,7 @@ inline Image getImageFromAssets (const char* assetName) | |||
| if (img.isNull()) | |||
| { | |||
| ScopedPointer<InputStream> juceIconStream (createAssetInputStream (assetName)); | |||
| std::unique_ptr<InputStream> juceIconStream (createAssetInputStream (assetName)); | |||
| if (juceIconStream == nullptr) | |||
| return {}; | |||
| @@ -115,7 +115,7 @@ inline Image getImageFromAssets (const char* assetName) | |||
| inline String loadEntireAssetIntoString (const char* assetName) | |||
| { | |||
| ScopedPointer<InputStream> input (createAssetInputStream (assetName)); | |||
| std::unique_ptr<InputStream> input (createAssetInputStream (assetName)); | |||
| if (input == nullptr) | |||
| return {}; | |||
| @@ -250,7 +250,7 @@ private: | |||
| if (faceGroup.size() == 0) | |||
| return nullptr; | |||
| ScopedPointer<Shape> shape (new Shape()); | |||
| std::unique_ptr<Shape> shape (new Shape()); | |||
| shape->name = name; | |||
| shape->material = material; | |||
| @@ -80,7 +80,7 @@ File JUCEDemos::findExamplesDirectoryFromExecutable (File exec) | |||
| } | |||
| //============================================================================== | |||
| ScopedPointer<AudioDeviceManager> sharedAudioDeviceManager; | |||
| std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager; | |||
| static String getCurrentDefaultAudioDeviceName (AudioDeviceManager& deviceManager, bool isInput) | |||
| { | |||
| @@ -72,6 +72,6 @@ CodeEditorComponent::ColourScheme getDarkColourScheme(); | |||
| CodeEditorComponent::ColourScheme getLightColourScheme(); | |||
| //============================================================================== | |||
| extern ScopedPointer<AudioDeviceManager> sharedAudioDeviceManager; | |||
| extern std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager; | |||
| AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels = -1, int numOutputChannels = -1); | |||
| @@ -141,12 +141,12 @@ private: | |||
| MainComponent& getMainComponent() { return *dynamic_cast<MainComponent*> (getContentComponent()); } | |||
| private: | |||
| ScopedPointer<Component> taskbarIcon; | |||
| std::unique_ptr<Component> taskbarIcon; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainAppWindow) | |||
| }; | |||
| ScopedPointer<MainAppWindow> mainWindow; | |||
| std::unique_ptr<MainAppWindow> mainWindow; | |||
| }; | |||
| //============================================================================== | |||
| @@ -54,7 +54,7 @@ struct DemoContent : public Component | |||
| void showHomeScreen() { setComponent (createIntroDemo()); } | |||
| private: | |||
| ScopedPointer<Component> comp; | |||
| std::unique_ptr<Component> comp; | |||
| }; | |||
| //============================================================================== | |||
| @@ -53,10 +53,10 @@ public: | |||
| private: | |||
| std::function<void(bool)> demoChangedCallback; | |||
| ScopedPointer<DemoContent> demoContent; | |||
| std::unique_ptr<DemoContent> demoContent; | |||
| #if ! (JUCE_ANDROID || JUCE_IOS) | |||
| ScopedPointer<CodeContent> codeContent; | |||
| std::unique_ptr<CodeContent> codeContent; | |||
| #endif | |||
| String currentDemoCategory; | |||
| @@ -58,7 +58,7 @@ private: | |||
| void updateRenderingEngine (int index); | |||
| //============================================================================== | |||
| ScopedPointer<DemoContentComponent> contentComponent; | |||
| std::unique_ptr<DemoContentComponent> contentComponent; | |||
| SidePanel demosPanel { "Demos", 250, true }; | |||
| OpenGLContext openGLContext; | |||
| @@ -156,7 +156,7 @@ private: | |||
| StringArray lookAndFeelNames; | |||
| OwnedArray<LookAndFeel> lookAndFeels; | |||
| ScopedPointer<AudioDeviceSelectorComponent> audioSettings; | |||
| std::unique_ptr<AudioDeviceSelectorComponent> audioSettings; | |||
| //============================================================================== | |||
| void refreshRenderingEngineSelector() | |||
| @@ -113,8 +113,8 @@ public: | |||
| private: | |||
| //============================================================================== | |||
| ScopedPointer<CameraDevice> cameraDevice; | |||
| ScopedPointer<Component> cameraPreviewComp; | |||
| std::unique_ptr<CameraDevice> cameraDevice; | |||
| std::unique_ptr<Component> cameraPreviewComp; | |||
| ImageComponent lastSnapshot; | |||
| ComboBox cameraSelectorComboBox { "Camera" }; | |||
| @@ -104,7 +104,7 @@ private: | |||
| CPlusPlusCodeTokeniser cppTokeniser; | |||
| // the editor component | |||
| ScopedPointer<CodeEditorComponent> editor; | |||
| std::unique_ptr<CodeEditorComponent> editor; | |||
| FilenameComponent fileChooser { "File", {}, true, false, false, "*.cpp;*.h;*.hpp;*.c;*.mm;*.m", {}, | |||
| "Choose a C++ file to open it in the editor" }; | |||
| @@ -94,7 +94,7 @@ public: | |||
| } | |||
| private: | |||
| ScopedPointer<Component> content; | |||
| std::unique_ptr<Component> content; | |||
| struct CornerDragger : public Component | |||
| { | |||
| @@ -321,8 +321,8 @@ private: | |||
| fileToSave = fileToSave.getChildFile ("JUCE.png"); | |||
| fileToSave.deleteFile(); | |||
| ScopedPointer<OutputStream> outStream (fileToSave.createOutputStream()); | |||
| ScopedPointer<InputStream> inStream (createAssetInputStream ("juce_icon.png")); | |||
| std::unique_ptr<OutputStream> outStream (fileToSave.createOutputStream()); | |||
| std::unique_ptr<InputStream> inStream (createAssetInputStream ("juce_icon.png")); | |||
| outStream->writeFromInputStream (*inStream, -1); | |||
| } | |||
| @@ -343,8 +343,8 @@ private: | |||
| #if JUCE_ANDROID || JUCE_IOS | |||
| if (! result.isEmpty()) | |||
| { | |||
| ScopedPointer<InputStream> wi (fileToSave.createInputStream()); | |||
| ScopedPointer<OutputStream> wo (result.createOutputStream()); | |||
| std::unique_ptr<InputStream> wi (fileToSave.createInputStream()); | |||
| std::unique_ptr<OutputStream> wo (result.createOutputStream()); | |||
| if (wi.get() != nullptr && wo.get() != nullptr) | |||
| { | |||
| @@ -442,7 +442,7 @@ private: | |||
| } | |||
| ImagePreviewComponent imagePreview; | |||
| ScopedPointer<FileChooser> fc; | |||
| std::unique_ptr<FileChooser> fc; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DialogsDemo) | |||
| }; | |||
| @@ -223,7 +223,7 @@ private: | |||
| ComboBox styleBox; | |||
| StretchableLayoutManager verticalLayout; | |||
| ScopedPointer<StretchableLayoutResizerBar> verticalDividerBar; | |||
| std::unique_ptr<StretchableLayoutResizerBar> verticalDividerBar; | |||
| //============================================================================== | |||
| void refreshPreviewBoxFont() | |||
| @@ -490,7 +490,7 @@ public: | |||
| ZipFile icons (createAssetInputStream ("icons.zip"), true); | |||
| // Load a random SVG file from our embedded icons.zip file. | |||
| const ScopedPointer<InputStream> svgFileStream (icons.createStreamForEntry (Random::getSystemRandom().nextInt (icons.getNumEntries()))); | |||
| const std::unique_ptr<InputStream> svgFileStream (icons.createStreamForEntry (Random::getSystemRandom().nextInt (icons.getNumEntries()))); | |||
| if (svgFileStream.get() != nullptr) | |||
| { | |||
| @@ -505,7 +505,7 @@ public: | |||
| } | |||
| Time lastSVGLoadTime; | |||
| ScopedPointer<DrawableComposite> svgDrawable; | |||
| std::unique_ptr<DrawableComposite> svgDrawable; | |||
| }; | |||
| //============================================================================== | |||
| @@ -314,7 +314,7 @@ public: | |||
| private: | |||
| ApplicationCommandManager commandManager; | |||
| ScopedPointer<MenuBarComponent> menuBar; | |||
| std::unique_ptr<MenuBarComponent> menuBar; | |||
| MenuBarPosition menuBarPosition = MenuBarPosition::window; | |||
| SidePanel sidePanel { "Menu", 300, false }; | |||
| @@ -181,7 +181,7 @@ public: | |||
| " gl_FragColor = colour;\n" | |||
| "}\n"; | |||
| ScopedPointer<OpenGLShaderProgram> newShader (new OpenGLShaderProgram (openGLContext)); | |||
| std::unique_ptr<OpenGLShaderProgram> 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<OpenGLShaderProgram::Attribute> position, normal, sourceColour, textureCoordIn; | |||
| std::unique_ptr<OpenGLShaderProgram::Attribute> position, normal, sourceColour, textureCoordIn; | |||
| private: | |||
| static OpenGLShaderProgram::Attribute* createAttribute (OpenGLContext& openGLContext, | |||
| @@ -289,7 +289,7 @@ private: | |||
| viewMatrix .reset (createUniform (openGLContext, shaderProgram, "viewMatrix")); | |||
| } | |||
| ScopedPointer<OpenGLShaderProgram::Uniform> projectionMatrix, viewMatrix; | |||
| std::unique_ptr<OpenGLShaderProgram::Uniform> projectionMatrix, viewMatrix; | |||
| private: | |||
| static OpenGLShaderProgram::Uniform* createUniform (OpenGLContext& openGLContext, | |||
| @@ -397,10 +397,10 @@ private: | |||
| const char* vertexShader; | |||
| const char* fragmentShader; | |||
| ScopedPointer<OpenGLShaderProgram> shader; | |||
| ScopedPointer<Shape> shape; | |||
| ScopedPointer<Attributes> attributes; | |||
| ScopedPointer<Uniforms> uniforms; | |||
| std::unique_ptr<OpenGLShaderProgram> shader; | |||
| std::unique_ptr<Shape> shape; | |||
| std::unique_ptr<Attributes> attributes; | |||
| std::unique_ptr<Uniforms> uniforms; | |||
| String newVertexShader, newFragmentShader; | |||
| @@ -110,7 +110,7 @@ struct OpenGLDemoClasses | |||
| if (textureCoordIn.get() != nullptr) openGLContext.extensions.glDisableVertexAttribArray (textureCoordIn->attributeID); | |||
| } | |||
| ScopedPointer<OpenGLShaderProgram::Attribute> position, normal, sourceColour, textureCoordIn; | |||
| std::unique_ptr<OpenGLShaderProgram::Attribute> position, normal, sourceColour, textureCoordIn; | |||
| private: | |||
| static OpenGLShaderProgram::Attribute* createAttribute (OpenGLContext& openGLContext, | |||
| @@ -137,7 +137,7 @@ struct OpenGLDemoClasses | |||
| bouncingNumber .reset (createUniform (openGLContext, shader, "bouncingNumber")); | |||
| } | |||
| ScopedPointer<OpenGLShaderProgram::Uniform> projectionMatrix, viewMatrix, texture, lightPosition, bouncingNumber; | |||
| std::unique_ptr<OpenGLShaderProgram::Uniform> 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<LowLevelGraphicsContext> glRenderer (createOpenGLGraphicsContext (openGLContext, | |||
| std::unique_ptr<LowLevelGraphicsContext> glRenderer (createOpenGLGraphicsContext (openGLContext, | |||
| roundToInt (desktopScale * getWidth()), | |||
| roundToInt (desktopScale * getHeight()))); | |||
| @@ -810,14 +810,14 @@ struct OpenGLDemoClasses | |||
| OpenGLContext openGLContext; | |||
| ScopedPointer<DemoControlsOverlay> controlsOverlay; | |||
| std::unique_ptr<DemoControlsOverlay> controlsOverlay; | |||
| float rotation = 0.0f; | |||
| ScopedPointer<OpenGLShaderProgram> shader; | |||
| ScopedPointer<Shape> shape; | |||
| ScopedPointer<Attributes> attributes; | |||
| ScopedPointer<Uniforms> uniforms; | |||
| std::unique_ptr<OpenGLShaderProgram> shader; | |||
| std::unique_ptr<Shape> shape; | |||
| std::unique_ptr<Attributes> attributes; | |||
| std::unique_ptr<Uniforms> uniforms; | |||
| OpenGLTexture texture; | |||
| DemoTexture* textureToUse = nullptr; | |||
| @@ -837,7 +837,7 @@ struct OpenGLDemoClasses | |||
| { | |||
| if (newVertexShader.isNotEmpty() || newFragmentShader.isNotEmpty()) | |||
| { | |||
| ScopedPointer<OpenGLShaderProgram> newShader (new OpenGLShaderProgram (openGLContext)); | |||
| std::unique_ptr<OpenGLShaderProgram> newShader (new OpenGLShaderProgram (openGLContext)); | |||
| if (newShader->addVertexShader (OpenGLHelpers::translateVertexShaderToV3 (newVertexShader)) | |||
| && newShader->addFragmentShader (OpenGLHelpers::translateFragmentShaderToV3 (newFragmentShader)) | |||
| @@ -143,7 +143,7 @@ public: | |||
| startTimer (1); | |||
| } | |||
| ScopedPointer<OpenGLGraphicsContextCustomShader> shader; | |||
| std::unique_ptr<OpenGLGraphicsContextCustomShader> shader; | |||
| Label statusLabel, presetLabel { {}, "Shader Preset:" }; | |||
| ComboBox presetBox; | |||
| @@ -131,7 +131,7 @@ public: | |||
| } | |||
| private: | |||
| ScopedPointer<DemoBrowserComponent> webView; | |||
| std::unique_ptr<DemoBrowserComponent> webView; | |||
| TextEditor addressTextBox; | |||
| @@ -50,7 +50,7 @@ | |||
| //============================================================================== | |||
| static void showBubbleMessage (Component& targetComponent, const String& textToShow, | |||
| ScopedPointer<BubbleMessageComponent>& bmc) | |||
| std::unique_ptr<BubbleMessageComponent>& bmc) | |||
| { | |||
| bmc.reset (new BubbleMessageComponent()); | |||
| @@ -450,7 +450,7 @@ struct ButtonsPage : public Component | |||
| private: | |||
| OwnedArray<Component> components; | |||
| ScopedPointer<BubbleMessageComponent> bubbleMessage; | |||
| std::unique_ptr<BubbleMessageComponent> 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<InputStream> svgFileStream (icons.createStreamForEntry (i)); | |||
| std::unique_ptr<InputStream> svgFileStream (icons.createStreamForEntry (i)); | |||
| if (svgFileStream.get() != nullptr) | |||
| { | |||
| @@ -920,7 +920,7 @@ private: | |||
| TableListBox table; // the table component itself | |||
| Font font { 14.0f }; | |||
| ScopedPointer<XmlElement> demoData; // This is the XML document loaded from the embedded file "demo table data.xml" | |||
| std::unique_ptr<XmlElement> 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<BubbleMessageComponent> bubbleMessage; | |||
| std::unique_ptr<BubbleMessageComponent> bubbleMessage; | |||
| }; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DemoTabbedComponent) | |||
| @@ -195,7 +195,7 @@ public: | |||
| if (auto* assetStream = createAssetInputStream ("proaudio.path")) | |||
| { | |||
| ScopedPointer<InputStream> fileStream (assetStream); | |||
| std::unique_ptr<InputStream> fileStream (assetStream); | |||
| Path proAudioPath; | |||
| proAudioPath.loadPathFromStream (*fileStream); | |||
| @@ -415,7 +415,7 @@ private: | |||
| void loadNewSample (InputStream* soundBuffer, const char* format) | |||
| { | |||
| ScopedPointer<AudioFormatReader> formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); | |||
| std::unique_ptr<AudioFormatReader> 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<AudioFormatWriter> writer (formatManager.findFormatForFileExtension ("wav")->createWriterFor (stream, lastSampleRate, 1, 16, | |||
| std::unique_ptr<AudioFormatWriter> writer (formatManager.findFormatForFileExtension ("wav")->createWriterFor (stream, lastSampleRate, 1, 16, | |||
| StringPairArray(), 0)); | |||
| writer->writeFromAudioSampleBuffer (currentRecording, 0, currentRecording.getNumSamples()); | |||
| writer->flush(); | |||
| @@ -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<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes)); | |||
| std::unique_ptr<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes)); | |||
| if (xmlState.get() != nullptr) | |||
| { | |||
| @@ -499,7 +499,7 @@ private: | |||
| gainLabel { {}, "Throughput level:" }, | |||
| delayLabel { {}, "Delay:" }; | |||
| ScopedPointer<ParameterSlider> gainSlider, delaySlider; | |||
| std::unique_ptr<ParameterSlider> gainSlider, delaySlider; | |||
| Colour backgroundColour; | |||
| //============================================================================== | |||
| @@ -272,7 +272,8 @@ public: | |||
| auto maxSize = static_cast<size_t> (roundToInt (getSampleRate() * (8192.0 / 44100.0))); | |||
| auto assetName = (type == 0 ? "Impulse1.wav" : "Impulse2.wav"); | |||
| ScopedPointer<InputStream> assetInputStream (createAssetInputStream (assetName)); | |||
| std::unique_ptr<InputStream> assetInputStream (createAssetInputStream (assetName)); | |||
| if (assetInputStream != nullptr) | |||
| { | |||
| currentCabinetData.reset(); | |||
| @@ -478,7 +479,7 @@ private: | |||
| //============================================================================== | |||
| DspModulePluginDemoAudioProcessor& processor; | |||
| ScopedPointer<ParameterSlider> inputVolumeSlider, outputVolumeSlider, | |||
| std::unique_ptr<ParameterSlider> inputVolumeSlider, outputVolumeSlider, | |||
| lowPassFilterFreqSlider, highPassFilterFreqSlider; | |||
| ComboBox stereoBox, slopeBox, waveshaperBox, cabinetTypeBox; | |||
| ToggleButton cabinetSimButton, oversamplingButton; | |||
| @@ -555,7 +556,7 @@ private: | |||
| dsp::Gain<float> inputVolume, outputVolume; | |||
| ScopedPointer<dsp::Oversampling<float>> oversampling; | |||
| std::unique_ptr<dsp::Oversampling<float>> oversampling; | |||
| bool audioCurrentlyOversampled = false; | |||
| Atomic<int> cabinetType; | |||
| @@ -236,13 +236,13 @@ public: | |||
| //============================================================================== | |||
| void getStateInformation (MemoryBlock& destData) override | |||
| { | |||
| auto xml = ScopedPointer<XmlElement> (parameters.state.createXml()); | |||
| auto xml = std::unique_ptr<XmlElement> (parameters.state.createXml()); | |||
| copyXmlToBinary (*xml, destData); | |||
| } | |||
| void setStateInformation (const void* data, int sizeInBytes) override | |||
| { | |||
| auto xmlState = ScopedPointer<XmlElement> (getXmlFromBinary (data, sizeInBytes)); | |||
| auto xmlState = std::unique_ptr<XmlElement> (getXmlFromBinary (data, sizeInBytes)); | |||
| if (xmlState.get() != nullptr) | |||
| if (xmlState->hasTagName (parameters.state.getType())) | |||
| @@ -157,7 +157,7 @@ private: | |||
| void loadNewSample (InputStream* soundBuffer, const char* format) | |||
| { | |||
| ScopedPointer<AudioFormatReader> formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); | |||
| std::unique_ptr<AudioFormatReader> formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true)); | |||
| BigInteger midiNotes; | |||
| midiNotes.setRange (0, 126, true); | |||
| @@ -2065,7 +2065,7 @@ public: | |||
| { | |||
| if (auto* asset = createAssetInputStream ("cello.wav")) | |||
| { | |||
| ScopedPointer<InputStream> inputStream (asset); | |||
| std::unique_ptr<InputStream> inputStream (asset); | |||
| inputStream->readIntoMemoryBlock (mb); | |||
| readerFactory.reset (new MemoryAudioFormatReaderFactory (mb.getData(), mb.getSize())); | |||
| @@ -211,7 +211,7 @@ private: | |||
| // method is called on app shutdown so it needs to complete quickly! | |||
| XmlDocument previouslySavedEvents (savedEventsFile); | |||
| ScopedPointer<XmlElement> xml (previouslySavedEvents.getDocumentElement()); | |||
| std::unique_ptr<XmlElement> xml (previouslySavedEvents.getDocumentElement()); | |||
| if (xml.get() == nullptr || xml->getTagName() != "events") | |||
| xml.reset (new XmlElement ("events")); | |||
| @@ -247,7 +247,7 @@ private: | |||
| void restoreUnloggedEvents (std::deque<AnalyticsEvent>& restoredEventQueue) override | |||
| { | |||
| XmlDocument savedEvents (savedEventsFile); | |||
| ScopedPointer<XmlElement> xml (savedEvents.getDocumentElement()); | |||
| std::unique_ptr<XmlElement> xml (savedEvents.getDocumentElement()); | |||
| if (xml.get() == nullptr || xml->getTagName() != "events") | |||
| return; | |||
| @@ -292,7 +292,7 @@ private: | |||
| CriticalSection webStreamCreation; | |||
| bool shouldExit = false; | |||
| ScopedPointer<WebInputStream> webStream; | |||
| std::unique_ptr<WebInputStream> webStream; | |||
| String apiKey; | |||
| @@ -365,7 +365,7 @@ private: | |||
| } | |||
| TextButton eventButton { "Press me!" }, crashButton { "Simulate crash!" }; | |||
| ScopedPointer<ButtonTracker> logEventButtonPress; | |||
| std::unique_ptr<ButtonTracker> logEventButtonPress; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AnalyticsCollectionDemo) | |||
| }; | |||
| @@ -83,7 +83,7 @@ struct Test | |||
| virtual void Keyboard (unsigned char /*key*/) {} | |||
| virtual void KeyboardUp (unsigned char /*key*/) {} | |||
| ScopedPointer<b2World> m_world { new b2World (b2Vec2 (0.0f, -10.0f)) }; | |||
| std::unique_ptr<b2World> m_world { new b2World (b2Vec2 (0.0f, -10.0f)) }; | |||
| }; | |||
| #include "../Assets/Box2DTests/AddPair.h" | |||
| @@ -149,7 +149,7 @@ struct Box2DRenderComponent : public Component | |||
| } | |||
| } | |||
| ScopedPointer<Test> currentTest; | |||
| std::unique_ptr<Test> currentTest; | |||
| }; | |||
| //============================================================================== | |||
| @@ -67,7 +67,7 @@ static MemoryBlock valueTreeToMemoryBlock (const ValueTree& v) | |||
| static String valueTreeToString (const ValueTree& v) | |||
| { | |||
| ScopedPointer<XmlElement> xml (v.createXml()); | |||
| std::unique_ptr<XmlElement> xml (v.createXml()); | |||
| if (xml.get() != nullptr) | |||
| return xml->createDocument ({}, true, false); | |||
| @@ -201,7 +201,7 @@ public: | |||
| }; | |||
| //============================================================================== | |||
| ScopedPointer<DemoMasterProcess> masterProcess; | |||
| std::unique_ptr<DemoMasterProcess> masterProcess; | |||
| private: | |||
| TextButton launchButton { "Launch Child Process" }; | |||
| @@ -284,7 +284,7 @@ public: | |||
| */ | |||
| bool invokeChildProcessDemo (const String& commandLine) | |||
| { | |||
| ScopedPointer<DemoSlaveProcess> slave (new DemoSlaveProcess()); | |||
| std::unique_ptr<DemoSlaveProcess> 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> mainWindow; | |||
| std::unique_ptr<MainWindow> mainWindow; | |||
| }; | |||
| //============================================================================== | |||
| @@ -382,8 +382,7 @@ public: | |||
| if (auto* assetStream = createAssetInputStream (String ("Purchases/" + String (imageResourceName)).toRawUTF8())) | |||
| { | |||
| ScopedPointer<InputStream> fileStream (assetStream); | |||
| std::unique_ptr<InputStream> fileStream (assetStream); | |||
| avatar = PNGImageFormat().decodeImage (*fileStream); | |||
| } | |||
| } | |||
| @@ -557,7 +556,7 @@ private: | |||
| if (auto* assetStream = createAssetInputStream (assetName.toRawUTF8())) | |||
| { | |||
| ScopedPointer<InputStream> fileStream (assetStream); | |||
| std::unique_ptr<InputStream> fileStream (assetStream); | |||
| currentPhraseData.reset(); | |||
| fileStream->readIntoMemoryBlock (currentPhraseData); | |||
| @@ -572,7 +571,7 @@ private: | |||
| Label phraseLabel { "phraseLabel", NEEDS_TRANS ("Phrases:") }; | |||
| ListBox phraseListBox { "phraseListBox" }; | |||
| ScopedPointer<ListBoxModel> phraseModel { new PhraseModel() }; | |||
| std::unique_ptr<ListBoxModel> phraseModel { new PhraseModel() }; | |||
| TextButton playStopButton { "Play" }; | |||
| SoundPlayer player; | |||
| @@ -581,7 +580,7 @@ private: | |||
| Label voiceLabel { "voiceLabel", NEEDS_TRANS ("Voices:") }; | |||
| ListBox voiceListBox { "voiceListBox" }; | |||
| ScopedPointer<VoiceModel> voiceModel { new VoiceModel (purchases) }; | |||
| std::unique_ptr<VoiceModel> voiceModel { new VoiceModel (purchases) }; | |||
| MemoryBlock currentPhraseData; | |||
| @@ -154,7 +154,7 @@ public: | |||
| private: | |||
| CodeDocument codeDocument; | |||
| ScopedPointer<CodeEditorComponent> editor; | |||
| std::unique_ptr<CodeEditorComponent> editor; | |||
| TextEditor outputDisplay; | |||
| void codeDocumentTextInserted (const String&, int) override { startTimer (300); } | |||
| @@ -101,7 +101,7 @@ public: | |||
| StringPairArray responseHeaders; | |||
| int statusCode = 0; | |||
| ScopedPointer<InputStream> stream (url.createInputStream (false, nullptr, nullptr, {}, | |||
| std::unique_ptr<InputStream> stream (url.createInputStream (false, nullptr, nullptr, {}, | |||
| 10000, // timeout in millisecs | |||
| &responseHeaders, &statusCode)); | |||
| if (stream.get() != nullptr) | |||
| @@ -220,7 +220,7 @@ struct UnitTestClasses | |||
| } | |||
| private: | |||
| ScopedPointer<TestRunnerThread> currentTestThread; | |||
| std::unique_ptr<TestRunnerThread> currentTestThread; | |||
| TextButton startTestButton { "Run Unit Tests..." }; | |||
| ComboBox categoriesBox; | |||
| @@ -109,7 +109,7 @@ public: | |||
| { | |||
| if (items.size() > 0) | |||
| { | |||
| ScopedPointer<XmlElement> oldOpenness (treeView.getOpennessState (false)); | |||
| std::unique_ptr<XmlElement> oldOpenness (treeView.getOpennessState (false)); | |||
| for (auto* v : items) | |||
| { | |||
| @@ -291,7 +291,7 @@ private: | |||
| TextButton undoButton { "Undo" }, | |||
| redoButton { "Redo" }; | |||
| ScopedPointer<ValueTreeItem> rootItem; | |||
| std::unique_ptr<ValueTreeItem> rootItem; | |||
| UndoManager undoManager; | |||
| void timerCallback() override | |||
| @@ -303,13 +303,13 @@ private: | |||
| CodeEditorComponent codeDocumentComponent { codeDocument, nullptr }; | |||
| TreeView resultsTree; | |||
| ScopedPointer<TreeViewItem> rootItem; | |||
| ScopedPointer<XmlElement> parsedXml; | |||
| std::unique_ptr<TreeViewItem> rootItem; | |||
| std::unique_ptr<XmlElement> parsedXml; | |||
| TextEditor errorMessage; | |||
| void rebuildTree() | |||
| { | |||
| ScopedPointer<XmlElement> openness; | |||
| std::unique_ptr<XmlElement> openness; | |||
| if (rootItem.get() != nullptr) | |||
| openness.reset (rootItem->getOpennessState()); | |||
| @@ -88,7 +88,7 @@ public: | |||
| }; | |||
| private: | |||
| ScopedPointer<MainWindow> mainWindow; | |||
| std::unique_ptr<MainWindow> mainWindow; | |||
| }; | |||
| //============================================================================== | |||
| @@ -212,7 +212,7 @@ void FilterGraph::newDocument() | |||
| Result FilterGraph::loadDocument (const File& file) | |||
| { | |||
| XmlDocument doc (file); | |||
| ScopedPointer<XmlElement> xml (doc.getDocumentElement()); | |||
| std::unique_ptr<XmlElement> 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<XmlElement> xml (createXml()); | |||
| std::unique_ptr<XmlElement> xml (createXml()); | |||
| if (! xml->writeToFile (file, {})) | |||
| return Result::fail ("Couldn't write to the file"); | |||
| @@ -46,7 +46,7 @@ private: | |||
| AudioProcessor::BusesLayout currentLayout; | |||
| Label title; | |||
| ScopedPointer<InputOutputConfig> inConfig, outConfig; | |||
| std::unique_ptr<InputOutputConfig> inConfig, outConfig; | |||
| InputOutputConfig* getConfig (bool isInput) noexcept { return isInput ? inConfig.get() : outConfig.get(); } | |||
| void update(); | |||
| @@ -137,10 +137,10 @@ public: | |||
| bool moreThanOneInstanceAllowed() override { return true; } | |||
| ApplicationCommandManager commandManager; | |||
| ScopedPointer<ApplicationProperties> appProperties; | |||
| std::unique_ptr<ApplicationProperties> appProperties; | |||
| private: | |||
| ScopedPointer<MainHostWindow> mainWindow; | |||
| std::unique_ptr<MainHostWindow> mainWindow; | |||
| }; | |||
| static PluginHostApp& getApp() { return *dynamic_cast<PluginHostApp*>(JUCEApplication::getInstance()); } | |||
| @@ -47,7 +47,7 @@ | |||
| KnownPluginList& knownPluginList; | |||
| AudioUnitPluginFormat formatToScan; | |||
| ScopedPointer<PluginDirectoryScanner> scanner; | |||
| std::unique_ptr<PluginDirectoryScanner> 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<PopupMenu> menu; | |||
| std::unique_ptr<PopupMenu> 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<AUScanner> scanner; | |||
| std::unique_ptr<AUScanner> scanner; | |||
| #endif | |||
| }; | |||
| @@ -76,8 +76,8 @@ private: | |||
| OwnedArray<FilterComponent> nodes; | |||
| OwnedArray<ConnectorComponent> connectors; | |||
| ScopedPointer<ConnectorComponent> draggingConnector; | |||
| ScopedPointer<PopupMenu> menu; | |||
| std::unique_ptr<ConnectorComponent> draggingConnector; | |||
| std::unique_ptr<PopupMenu> menu; | |||
| FilterComponent* getComponentForFilter (AudioProcessorGraph::NodeID) const; | |||
| ConnectorComponent* getComponentForConnection (const AudioProcessorGraph::Connection&) const; | |||
| @@ -115,7 +115,7 @@ public: | |||
| bool closeAnyOpenPluginWindows(); | |||
| //============================================================================== | |||
| ScopedPointer<FilterGraph> graph; | |||
| std::unique_ptr<FilterGraph> graph; | |||
| void resized() override; | |||
| void unfocusKeyboardComponent(); | |||
| @@ -126,8 +126,8 @@ public: | |||
| void itemDropped (const SourceDetails&) override; | |||
| //============================================================================== | |||
| ScopedPointer<GraphEditorPanel> graphPanel; | |||
| ScopedPointer<MidiKeyboardComponent> keyboardComp; | |||
| std::unique_ptr<GraphEditorPanel> graphPanel; | |||
| std::unique_ptr<MidiKeyboardComponent> keyboardComp; | |||
| //============================================================================== | |||
| void showSidePanel (bool isSettingsPanel); | |||
| @@ -144,14 +144,14 @@ private: | |||
| MidiKeyboardState keyState; | |||
| struct TooltipBar; | |||
| ScopedPointer<TooltipBar> statusBar; | |||
| std::unique_ptr<TooltipBar> statusBar; | |||
| class TitleBarComponent; | |||
| ScopedPointer<TitleBarComponent> titleBarComponent; | |||
| std::unique_ptr<TitleBarComponent> titleBarComponent; | |||
| //============================================================================== | |||
| struct PluginListBoxModel; | |||
| ScopedPointer<PluginListBoxModel> pluginListBoxModel; | |||
| std::unique_ptr<PluginListBoxModel> pluginListBoxModel; | |||
| ListBox pluginListBox; | |||
| @@ -84,8 +84,8 @@ MainHostWindow::MainHostWindow() | |||
| RuntimePermissions::request (RuntimePermissions::recordAudio, | |||
| [safeThis = SafePointer<MainHostWindow> (this)] (bool granted) mutable | |||
| { | |||
| ScopedPointer<XmlElement> savedAudioState (getAppProperties().getUserSettings() | |||
| ->getXmlValue ("audioDeviceState")); | |||
| std::unique_ptr<XmlElement> 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<XmlElement> savedPluginList (getAppProperties().getUserSettings()->getXmlValue ("pluginList")); | |||
| std::unique_ptr<XmlElement> 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<XmlElement> savedPluginList (knownPluginList.createXml()); | |||
| std::unique_ptr<XmlElement> savedPluginList (knownPluginList.createXml()); | |||
| if (savedPluginList != nullptr) | |||
| { | |||
| @@ -577,7 +577,7 @@ void MainHostWindow::showAudioSettings() | |||
| ModalCallbackFunction::create | |||
| ([safeThis = SafePointer<MainHostWindow> (this)] (int) | |||
| { | |||
| ScopedPointer<XmlElement> audioState (safeThis->deviceManager.createStateXml()); | |||
| std::unique_ptr<XmlElement> audioState (safeThis->deviceManager.createStateXml()); | |||
| getAppProperties().getUserSettings()->setValue ("audioDeviceState", audioState.get()); | |||
| getAppProperties().getUserSettings()->saveIfNeeded(); | |||
| @@ -92,7 +92,7 @@ public: | |||
| bool isDoublePrecisionProcessing(); | |||
| void updatePrecisionMenuItem (ApplicationCommandInfo& info); | |||
| ScopedPointer<GraphDocumentComponent> graphHolder; | |||
| std::unique_ptr<GraphDocumentComponent> graphHolder; | |||
| private: | |||
| //============================================================================== | |||
| @@ -104,7 +104,7 @@ private: | |||
| KnownPluginList::SortMethod pluginSortMethod; | |||
| class PluginListWindow; | |||
| ScopedPointer<PluginListWindow> pluginListWindow; | |||
| std::unique_ptr<PluginListWindow> pluginListWindow; | |||
| void showAudioSettings(); | |||
| @@ -159,7 +159,7 @@ int main (int argc, char* argv[]) | |||
| headerFile.deleteFile(); | |||
| cppFile.deleteFile(); | |||
| ScopedPointer<OutputStream> header (headerFile.createOutputStream()); | |||
| std::unique_ptr<OutputStream> header (headerFile.createOutputStream()); | |||
| if (header == nullptr) | |||
| { | |||
| @@ -168,7 +168,7 @@ int main (int argc, char* argv[]) | |||
| return 0; | |||
| } | |||
| ScopedPointer<OutputStream> cpp (cppFile.createOutputStream()); | |||
| std::unique_ptr<OutputStream> cpp (cppFile.createOutputStream()); | |||
| if (cpp == nullptr) | |||
| { | |||
| @@ -84,7 +84,7 @@ struct BackgroundLogo : public AnimatedContent | |||
| </svg> | |||
| )blahblah"; | |||
| ScopedPointer<XmlElement> svg (XmlDocument::parse (logoData)); | |||
| std::unique_ptr<XmlElement> 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<Drawable> logo; | |||
| std::unique_ptr<Drawable> logo; | |||
| }; | |||
| //============================================================================== | |||
| @@ -348,7 +348,7 @@ private: | |||
| updateCanvasInfo (currentCanvas); | |||
| { | |||
| ScopedPointer<CanvasGeneratingContext> context (new CanvasGeneratingContext (currentCanvas)); | |||
| std::unique_ptr<CanvasGeneratingContext> context (new CanvasGeneratingContext (currentCanvas)); | |||
| Graphics g (*context); | |||
| if (content != nullptr) | |||
| @@ -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> mainWindow;\r\n" | |||
| " std::unique_ptr<MainWindow> 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> mainWindow;\r\n" | |||
| " std::unique_ptr<MainWindow> 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> mainWindow;\r\n" | |||
| "\r\n" | |||
| " std::unique_ptr<MainWindow> 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; | |||
| @@ -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; | |||
| @@ -132,11 +132,11 @@ private: | |||
| Rectangle<float> huckleberryLogoBounds, juceLogoBounds; | |||
| ScopedPointer<Drawable> juceLogo { Drawable::createFromImageData (BinaryData::juce_icon_png, | |||
| BinaryData::juce_icon_pngSize) }; | |||
| std::unique_ptr<Drawable> juceLogo { Drawable::createFromImageData (BinaryData::juce_icon_png, | |||
| BinaryData::juce_icon_pngSize) }; | |||
| ScopedPointer<Drawable> huckleberryLogo { Drawable::createFromImageData (BinaryData::huckleberry_icon_svg, | |||
| BinaryData::huckleberry_icon_svgSize) }; | |||
| std::unique_ptr<Drawable> huckleberryLogo { Drawable::createFromImageData (BinaryData::huckleberry_icon_svg, | |||
| BinaryData::huckleberry_icon_svgSize) }; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AboutWindowComponent) | |||
| }; | |||
| @@ -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<ToggleButton> shareApplicationUsageDataToggle; | |||
| std::unique_ptr<ToggleButton> shareApplicationUsageDataToggle; | |||
| TextButton okButton { "OK" }, upgradeLicenseButton { "Upgrade License" }; | |||
| void lookAndFeelChanged() override | |||
| @@ -60,7 +60,7 @@ public: | |||
| } | |||
| private: | |||
| ScopedPointer<Component> content; | |||
| std::unique_ptr<Component> content; | |||
| //============================================================================== | |||
| struct AppearanceEditor | |||
| @@ -33,7 +33,7 @@ struct FloatingToolWindow : public DialogWindow | |||
| FloatingToolWindow (const String& title, | |||
| const String& windowPosPropertyName, | |||
| Component* content, | |||
| ScopedPointer<Component>& ownerPointer, | |||
| std::unique_ptr<Component>& ownerPointer, | |||
| bool shouldBeResizable, | |||
| int defaultW, int defaultH, | |||
| int minW, int minH, | |||
| @@ -84,7 +84,7 @@ struct FloatingToolWindow : public DialogWindow | |||
| private: | |||
| String windowPosProperty; | |||
| ScopedPointer<Component>& owner; | |||
| std::unique_ptr<Component>& owner; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FloatingToolWindow) | |||
| }; | |||
| @@ -307,7 +307,7 @@ private: | |||
| } | |||
| //============================================================================== | |||
| ScopedPointer<LookAndFeel> lf; | |||
| std::unique_ptr<LookAndFeel> lf; | |||
| Viewport propertyViewport; | |||
| PropertyGroupComponent propertyGroup { "PIP Creator", { getIcons().juceLogo, Colours::transparentBlack } }; | |||
| @@ -163,7 +163,7 @@ public: | |||
| dragOver = false; | |||
| repaint(); | |||
| ScopedPointer<XmlElement> element (XmlDocument::parse (File (files[0]))); | |||
| std::unique_ptr<XmlElement> element (XmlDocument::parse (File (files[0]))); | |||
| if (element != nullptr) | |||
| { | |||
| @@ -141,29 +141,29 @@ public: | |||
| //============================================================================== | |||
| ProjucerLookAndFeel lookAndFeel; | |||
| ScopedPointer<StoredSettings> settings; | |||
| ScopedPointer<Icons> icons; | |||
| std::unique_ptr<StoredSettings> settings; | |||
| std::unique_ptr<Icons> icons; | |||
| struct MainMenuModel; | |||
| ScopedPointer<MainMenuModel> menuModel; | |||
| std::unique_ptr<MainMenuModel> menuModel; | |||
| MainWindowList mainWindowList; | |||
| OpenDocumentManager openDocumentManager; | |||
| ScopedPointer<ApplicationCommandManager> commandManager; | |||
| std::unique_ptr<ApplicationCommandManager> commandManager; | |||
| ScopedPointer<Component> utf8Window, svgPathWindow, aboutWindow, applicationUsageDataWindow, | |||
| std::unique_ptr<Component> utf8Window, svgPathWindow, aboutWindow, applicationUsageDataWindow, | |||
| pathsWindow, editorColourSchemeWindow, pipCreatorWindow; | |||
| ScopedPointer<FileLogger> logger; | |||
| std::unique_ptr<FileLogger> logger; | |||
| bool isRunningCommandLine; | |||
| ScopedPointer<ChildProcessCache> childProcessCache; | |||
| ScopedPointer<LicenseController> licenseController; | |||
| std::unique_ptr<ChildProcessCache> childProcessCache; | |||
| std::unique_ptr<LicenseController> licenseController; | |||
| private: | |||
| void* server = nullptr; | |||
| ScopedPointer<LatestVersionChecker> versionChecker; | |||
| std::unique_ptr<LatestVersionChecker> versionChecker; | |||
| TooltipWindow tooltipWindow; | |||
| void loginOrLogout(); | |||
| @@ -191,7 +191,7 @@ private: | |||
| void launchDemoRunner(); | |||
| int numExamples = 0; | |||
| ScopedPointer<AlertWindow> demoRunnerAlert; | |||
| std::unique_ptr<AlertWindow> demoRunnerAlert; | |||
| #if JUCE_LINUX | |||
| ChildProcess makeProcess; | |||
| @@ -201,7 +201,7 @@ private: | |||
| void setupAnalytics(); | |||
| void showSetJUCEPathAlert(); | |||
| ScopedPointer<AlertWindow> pathAlert; | |||
| std::unique_ptr<AlertWindow> pathAlert; | |||
| //============================================================================== | |||
| void setColourScheme (int index, bool saveSetting); | |||
| @@ -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<InputStream> in; | |||
| std::unique_ptr<InputStream> in; | |||
| for (int redirect = 0; redirect < maxRedirects; ++redirect) | |||
| { | |||
| @@ -395,11 +395,11 @@ public: | |||
| private: | |||
| bool hasOverwriteButton; | |||
| ScopedPointer<Label> titleLabel, contentLabel, changeLogLabel, overwriteLabel, overwritePath; | |||
| ScopedPointer<TextButton> okButton, cancelButton; | |||
| ScopedPointer<TextEditor> changeLog; | |||
| ScopedPointer<TextButton> overwriteButton; | |||
| ScopedPointer<Drawable> juceIcon; | |||
| std::unique_ptr<Label> titleLabel, contentLabel, changeLogLabel, overwriteLabel, overwritePath; | |||
| std::unique_ptr<TextButton> okButton, cancelButton; | |||
| std::unique_ptr<TextEditor> changeLog; | |||
| std::unique_ptr<TextButton> overwriteButton; | |||
| std::unique_ptr<Drawable> juceIcon; | |||
| void lookAndFeelChanged() override | |||
| { | |||
| @@ -626,9 +626,9 @@ void LatestVersionChecker::checkForNewVersion() | |||
| const int numRedirects = 0; | |||
| const ScopedPointer<InputStream> in (updateURL.createInputStream (false, nullptr, nullptr, | |||
| extraHeaders, 0, &responseHeaders, | |||
| &statusCode, numRedirects)); | |||
| const std::unique_ptr<InputStream> in (updateURL.createInputStream (false, nullptr, nullptr, | |||
| extraHeaders, 0, &responseHeaders, | |||
| &statusCode, numRedirects)); | |||
| if (threadShouldExit()) | |||
| return; // can't connect: fail silently. | |||
| @@ -163,7 +163,7 @@ namespace | |||
| } | |||
| } | |||
| ScopedPointer<Project> project; | |||
| std::unique_ptr<Project> project; | |||
| }; | |||
| //============================================================================== | |||
| @@ -307,7 +307,7 @@ namespace | |||
| std::cout << "Writing: " << targetFile.getFullPathName() << std::endl; | |||
| TemporaryFile temp (targetFile); | |||
| ScopedPointer<FileOutputStream> out (temp.getFile().createOutputStream()); | |||
| std::unique_ptr<FileOutputStream> out (temp.getFile().createOutputStream()); | |||
| bool ok = out != nullptr && zip.writeToStream (*out, nullptr); | |||
| out.reset(); | |||
| @@ -732,7 +732,7 @@ namespace | |||
| #endif | |||
| auto settingsFile = userAppData.getChildFile ("Projucer").getChildFile ("Projucer.settings"); | |||
| ScopedPointer<XmlElement> xml (XmlDocument::parse (settingsFile)); | |||
| std::unique_ptr<XmlElement> xml (XmlDocument::parse (settingsFile)); | |||
| auto settingsTree = ValueTree::fromXml (*xml); | |||
| if (! settingsTree.isValid()) | |||
| @@ -60,7 +60,7 @@ MainWindow::MainWindow() | |||
| { | |||
| commandManager.getKeyMappings()->resetToDefaultMappings(); | |||
| ScopedPointer<XmlElement> keys (getGlobalProperties().getXmlValue ("keyMappings")); | |||
| std::unique_ptr<XmlElement> keys (getGlobalProperties().getXmlValue ("keyMappings")); | |||
| if (keys != nullptr) | |||
| commandManager.getKeyMappings()->restoreFromXml (*keys); | |||
| @@ -234,7 +234,7 @@ bool MainWindow::openFile (const File& file) | |||
| if (file.hasFileExtension (Project::projectFileExtension)) | |||
| { | |||
| ScopedPointer<Project> newDoc (new Project (file)); | |||
| std::unique_ptr<Project> newDoc (new Project (file)); | |||
| auto result = newDoc->loadFrom (file, true); | |||
| @@ -78,7 +78,7 @@ public: | |||
| bool shouldDropFilesWhenDraggedExternally (const DragAndDropTarget::SourceDetails& sourceDetails, | |||
| StringArray& files, bool& canMoveFiles) override; | |||
| private: | |||
| ScopedPointer<Project> currentProject; | |||
| std::unique_ptr<Project> currentProject; | |||
| Value projectNameValue; | |||
| static const char* getProjectWindowPosName() { return "projectWindowPos"; } | |||
| @@ -26,7 +26,7 @@ public: | |||
| { | |||
| // This method is where you should put your application's initialisation code.. | |||
| mainWindow = new MainWindow (getApplicationName()); | |||
| mainWindow.reset (new MainWindow (getApplicationName())); | |||
| } | |||
| void shutdown() override | |||
| @@ -92,7 +92,7 @@ public: | |||
| }; | |||
| private: | |||
| ScopedPointer<MainWindow> mainWindow; | |||
| std::unique_ptr<MainWindow> mainWindow; | |||
| }; | |||
| //============================================================================== | |||
| @@ -26,7 +26,7 @@ public: | |||
| { | |||
| // This method is where you should put your application's initialisation code.. | |||
| mainWindow = new MainWindow (getApplicationName()); | |||
| mainWindow.reset (new MainWindow (getApplicationName())); | |||
| } | |||
| void shutdown() override | |||
| @@ -91,7 +91,7 @@ public: | |||
| }; | |||
| private: | |||
| ScopedPointer<MainWindow> mainWindow; | |||
| std::unique_ptr<MainWindow> mainWindow; | |||
| }; | |||
| //============================================================================== | |||
| @@ -57,7 +57,8 @@ private: | |||
| //============================================================================== | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow) | |||
| }; | |||
| ScopedPointer<MainWindow> mainWindow; | |||
| std::unique_ptr<MainWindow> mainWindow; | |||
| }; | |||
| //============================================================================== | |||
| @@ -74,7 +74,7 @@ public: | |||
| private: | |||
| StringArray facts; | |||
| File file; | |||
| ScopedPointer<Drawable> drawable; | |||
| std::unique_ptr<Drawable> drawable; | |||
| void tryToLoadImage() | |||
| { | |||
| @@ -83,7 +83,7 @@ private: | |||
| drawable.reset(); | |||
| { | |||
| ScopedPointer<InputStream> input (file.createInputStream()); | |||
| std::unique_ptr<InputStream> input (file.createInputStream()); | |||
| if (input != nullptr) | |||
| { | |||
| @@ -113,7 +113,7 @@ private: | |||
| if (drawable == nullptr) | |||
| { | |||
| ScopedPointer<XmlElement> svg (XmlDocument::parse (file)); | |||
| std::unique_ptr<XmlElement> svg (XmlDocument::parse (file)); | |||
| if (svg != nullptr) | |||
| drawable.reset (Drawable::createFromSVG (*svg)); | |||
| @@ -677,7 +677,7 @@ private: | |||
| static Colour getBackgroundColour() { return Colour (0xcb5c7879); } | |||
| }; | |||
| ScopedPointer<LiteralHighlightOverlay> overlay; | |||
| std::unique_ptr<LiteralHighlightOverlay> overlay; | |||
| }; | |||
| //============================================================================== | |||
| @@ -127,10 +127,10 @@ public: | |||
| protected: | |||
| FileModificationDetector modDetector; | |||
| ScopedPointer<CodeDocument> codeDoc; | |||
| std::unique_ptr<CodeDocument> codeDoc; | |||
| Project* project; | |||
| ScopedPointer<CodeEditorComponent::State> lastState; | |||
| std::unique_ptr<CodeEditorComponent::State> lastState; | |||
| void reloadInternal(); | |||
| }; | |||
| @@ -150,7 +150,7 @@ public: | |||
| void scrollToKeepRangeOnScreen (Range<int> range); | |||
| void highlight (Range<int> range, bool cursorAtStart); | |||
| ScopedPointer<GenericCodeEditorComponent> editor; | |||
| std::unique_ptr<GenericCodeEditorComponent> editor; | |||
| private: | |||
| void resized() override; | |||
| @@ -214,7 +214,7 @@ public: | |||
| private: | |||
| File file; | |||
| class FindPanel; | |||
| ScopedPointer<FindPanel> findPanel; | |||
| std::unique_ptr<FindPanel> findPanel; | |||
| ListenerList<Listener> listeners; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GenericCodeEditorComponent) | |||
| @@ -158,8 +158,8 @@ public: | |||
| const String userCodeComment ("UserButtonCode_" + memberVariableName); | |||
| callback | |||
| << "if (buttonThatWasClicked == " << memberVariableName | |||
| << ")\n{\n //[" << userCodeComment << "] -- add your button handler code here..\n //[/" << userCodeComment << "]\n}\n"; | |||
| << "if (buttonThatWasClicked == " << memberVariableName << ".get())\n" | |||
| << "{\n //[" << userCodeComment << "] -- add your button handler code here..\n //[/" << userCodeComment << "]\n}\n"; | |||
| } | |||
| } | |||
| @@ -152,8 +152,8 @@ public: | |||
| const String userCodeComment ("UserComboBoxCode_" + memberVariableName); | |||
| callback | |||
| << "if (comboBoxThatHasChanged == " << memberVariableName | |||
| << ")\n{\n //[" << userCodeComment << "] -- add your combo box handling code here..\n //[/" << userCodeComment << "]\n}\n"; | |||
| << "if (comboBoxThatHasChanged == " << memberVariableName << ".get())\n" | |||
| << "{\n //[" << userCodeComment << "] -- add your combo box handling code here..\n //[/" << userCodeComment << "]\n}\n"; | |||
| } | |||
| } | |||
| @@ -63,7 +63,7 @@ Component* ComponentTypeHandler::createCopyOf (JucerDocument* document, Componen | |||
| jassert (getHandlerFor (existing) == this); | |||
| Component* const newOne = createNewComponent (document); | |||
| ScopedPointer<XmlElement> xml (createXmlFor (&existing, document->getComponentLayout())); | |||
| std::unique_ptr<XmlElement> xml (createXmlFor (&existing, document->getComponentLayout())); | |||
| if (xml != nullptr) | |||
| restoreFromXml (*xml, newOne, document->getComponentLayout()); | |||
| @@ -559,7 +559,7 @@ void ComponentTypeHandler::fillInMemberVariableDeclarations (GeneratedCode& code | |||
| clsName = getClassName (component); | |||
| code.privateMemberDeclarations | |||
| << "ScopedPointer<" << clsName << "> " << memberVariableName << ";\n"; | |||
| << "std::unique_ptr<" << clsName << "> " << memberVariableName << ";\n"; | |||
| } | |||
| void ComponentTypeHandler::fillInResizeCode (GeneratedCode& code, Component* component, const String& memberVariableName) | |||
| @@ -589,7 +589,7 @@ void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* c | |||
| const String virtualName (component->getProperties() ["virtualName"].toString()); | |||
| String s; | |||
| s << "addAndMakeVisible (" << memberVariableName << " = new "; | |||
| s << memberVariableName << ".reset (new "; | |||
| if (virtualName.isNotEmpty()) | |||
| s << CodeHelpers::makeValidIdentifier (virtualName, false, false, true); | |||
| @@ -597,7 +597,9 @@ void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* c | |||
| s << getClassName (component); | |||
| if (params.isEmpty()) | |||
| { | |||
| s << "());\n"; | |||
| } | |||
| else | |||
| { | |||
| StringArray lines; | |||
| @@ -608,6 +610,9 @@ void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* c | |||
| s << " (" << params << "));\n"; | |||
| } | |||
| s << "addAndMakeVisible (" << memberVariableName << ".get());\n"; | |||
| if (SettableTooltipClient* ttc = dynamic_cast<SettableTooltipClient*> (component)) | |||
| { | |||
| if (ttc->getTooltip().isNotEmpty()) | |||
| @@ -171,8 +171,8 @@ struct SliderHandler : public ComponentTypeHandler | |||
| const String userCodeComment ("UserSliderCode_" + memberVariableName); | |||
| callback | |||
| << "if (sliderThatWasMoved == " << memberVariableName | |||
| << ")\n{\n //[" << userCodeComment << "] -- add your slider handling code here..\n //[/" << userCodeComment << "]\n}\n"; | |||
| << "if (sliderThatWasMoved == " << memberVariableName << ".get())\n" | |||
| << "{\n //[" << userCodeComment << "] -- add your slider handling code here..\n //[/" << userCodeComment << "]\n}\n"; | |||
| } | |||
| } | |||
| @@ -179,7 +179,7 @@ public: | |||
| { | |||
| File jucerCpp = code.document->getCppFile().getSiblingFile (getTabJucerFile (t, i)); | |||
| ScopedPointer<JucerDocument> doc (JucerDocument::createForCppFile (nullptr, jucerCpp)); | |||
| std::unique_ptr<JucerDocument> doc (JucerDocument::createForCppFile (nullptr, jucerCpp)); | |||
| if (doc != nullptr) | |||
| { | |||
| @@ -403,7 +403,7 @@ private: | |||
| bool isUsingJucerComp; | |||
| String contentClassName, constructorParams; | |||
| String jucerComponentFile; | |||
| ScopedPointer<TestComponent> jucerComp; | |||
| std::unique_ptr<TestComponent> jucerComp; | |||
| }; | |||
| //============================================================================== | |||
| @@ -723,7 +723,7 @@ private: | |||
| private: | |||
| int indexToRemove; | |||
| ScopedPointer<XmlElement> previousState; | |||
| std::unique_ptr<XmlElement> previousState; | |||
| }; | |||
| }; | |||
| @@ -1164,7 +1164,7 @@ private: | |||
| { | |||
| showCorrectTab(); | |||
| ScopedPointer<XmlElement> state (getTabState (getComponent(), from)); | |||
| std::unique_ptr<XmlElement> state (getTabState (getComponent(), from)); | |||
| getComponent()->removeTab (from); | |||
| addNewTab (getComponent(), to); | |||
| @@ -148,7 +148,7 @@ public: | |||
| if (filename.isNotEmpty()) | |||
| file = code.document->getCppFile().getSiblingFile (filename); | |||
| ScopedPointer<JucerDocument> doc (JucerDocument::createForCppFile (nullptr, file)); | |||
| std::unique_ptr<JucerDocument> doc (JucerDocument::createForCppFile (nullptr, file)); | |||
| if (doc != nullptr) | |||
| { | |||
| @@ -168,7 +168,7 @@ JucerDocument* ButtonDocument::createCopy() | |||
| ButtonDocument* newOne = new ButtonDocument (cpp); | |||
| newOne->resources = resources; | |||
| ScopedPointer<XmlElement> xml (createXml()); | |||
| std::unique_ptr<XmlElement> xml (createXml()); | |||
| newOne->loadFromXml (*xml); | |||
| return newOne; | |||
| @@ -67,6 +67,6 @@ public: | |||
| StringArray& initialContents) const; | |||
| //============================================================================== | |||
| ScopedPointer<PaintRoutine> paintRoutines[7]; | |||
| std::unique_ptr<PaintRoutine> paintRoutines[7]; | |||
| bool paintStatesEnabled [7]; | |||
| }; | |||
| @@ -55,7 +55,7 @@ JucerDocument* ComponentDocument::createCopy() | |||
| newOne->resources = resources; | |||
| ScopedPointer<XmlElement> xml (createXml()); | |||
| std::unique_ptr<XmlElement> xml (createXml()); | |||
| newOne->loadFromXml (*xml); | |||
| return newOne; | |||
| @@ -55,6 +55,6 @@ public: | |||
| void applyCustomPaintSnippets (StringArray&); | |||
| private: | |||
| ScopedPointer<ComponentLayout> components; | |||
| ScopedPointer<PaintRoutine> backgroundGraphics; | |||
| std::unique_ptr<ComponentLayout> components; | |||
| std::unique_ptr<PaintRoutine> backgroundGraphics; | |||
| }; | |||
| @@ -919,7 +919,7 @@ void ColouredElement::convertToNewPathElement (const Path& path) | |||
| newElement.setStrokeType (getStrokeType().stroke, false); | |||
| newElement.setStrokeFill (getStrokeType().fill, false); | |||
| ScopedPointer<XmlElement> xml (newElement.createXml()); | |||
| std::unique_ptr<XmlElement> xml (newElement.createXml()); | |||
| PaintElement* e = getOwner()->addElementFromXml (*xml, getOwner()->indexOfElement (this), true); | |||
| @@ -130,7 +130,7 @@ protected: | |||
| void updateSiblingComps(); | |||
| private: | |||
| ScopedPointer<ResizableBorderComponent> border; | |||
| std::unique_ptr<ResizableBorderComponent> border; | |||
| String typeName; | |||
| bool selected, dragging, mouseDownSelectStatus; | |||
| double originalAspectRatio; | |||
| @@ -43,7 +43,7 @@ void PaintElementGroup::ungroup (const bool undoable) | |||
| for (int i = 0; i < subElements.size(); ++i) | |||
| { | |||
| ScopedPointer<XmlElement> xml (subElements.getUnchecked(i)->createXml()); | |||
| std::unique_ptr<XmlElement> xml (subElements.getUnchecked(i)->createXml()); | |||
| PaintElement* newOne = getOwner()->addElementFromXml (*xml, index, undoable); | |||
| getOwner()->getSelectedElements().addToSelection (newOne); | |||
| @@ -63,7 +63,7 @@ void PaintElementGroup::groupSelected (PaintRoutine* routine) | |||
| { | |||
| if (routine->getSelectedElements().isSelected (routine->getElement (i))) | |||
| { | |||
| ScopedPointer<XmlElement> xml (routine->getElement(i)->createXml()); | |||
| std::unique_ptr<XmlElement> xml (routine->getElement(i)->createXml()); | |||
| if (auto* newOne = ObjectTypes::createElementForXml (xml.get(), routine)) | |||
| newGroup->subElements.add (newOne); | |||
| @@ -91,7 +91,7 @@ void PaintElementImage::fillInGeneratedCode (GeneratedCode& code, String& paintM | |||
| << customPaintCode | |||
| << " //[/UserPaintCustomArguments]\n"; | |||
| if (dynamic_cast<const DrawableImage*> (getDrawable()) != 0) | |||
| if (dynamic_cast<const DrawableImage*> (getDrawable())) | |||
| { | |||
| const String imageVariable ("cachedImage_" + resourceName.replace ("::", "_") + "_" + String (code.getUniqueSuffix())); | |||
| @@ -102,7 +102,6 @@ void PaintElementImage::fillInGeneratedCode (GeneratedCode& code, String& paintM | |||
| else | |||
| r << " g.setColour (Colours::black.withAlpha (" << CodeHelpers::floatLiteral (opacity, 3) << "));\n"; | |||
| if (mode == stretched) | |||
| { | |||
| r << " g.drawImage (" << imageVariable << ",\n" | |||
| @@ -132,11 +131,11 @@ void PaintElementImage::fillInGeneratedCode (GeneratedCode& code, String& paintM | |||
| const String imageVariable ("drawable" + String (code.getUniqueSuffix())); | |||
| code.privateMemberDeclarations | |||
| << "ScopedPointer<Drawable> " << imageVariable << ";\n"; | |||
| << "std::unique_ptr<Drawable> " << imageVariable << ";\n"; | |||
| code.constructorCode | |||
| << imageVariable << " = Drawable::createFromImageData (" | |||
| << resourceName << ", " << resourceName << "Size);\n"; | |||
| << imageVariable << ".reset (Drawable::createFromImageData (" | |||
| << resourceName << ", " << resourceName << "Size));\n"; | |||
| code.destructorCode | |||
| << imageVariable << " = nullptr;\n"; | |||
| @@ -598,7 +598,7 @@ void PaintElementPath::restorePathFromString (const String& s) | |||
| for (int i = 0; i < tokens.size(); ++i) | |||
| { | |||
| ScopedPointer<PathPoint> p (new PathPoint (this)); | |||
| std::unique_ptr<PathPoint> p (new PathPoint (this)); | |||
| if (tokens[i] == "s") | |||
| { | |||
| @@ -653,7 +653,7 @@ void PaintElementPath::setToPath (const Path& newPath) | |||
| while (i.next()) | |||
| { | |||
| ScopedPointer<PathPoint> p (new PathPoint (this)); | |||
| std::unique_ptr<PathPoint> p (new PathPoint (this)); | |||
| p->type = i.elementType; | |||
| if (i.elementType == Path::Iterator::startNewSubPath) | |||
| @@ -205,5 +205,5 @@ public: | |||
| } | |||
| }; | |||
| ScopedPointer<ColourPropEditorComponent> colourPropEditor; | |||
| std::unique_ptr<ColourPropEditorComponent> colourPropEditor; | |||
| }; | |||
| @@ -441,7 +441,7 @@ protected: | |||
| }; | |||
| ComponentLayout* layout; | |||
| ScopedPointer<PositionPropLabel> textEditor; | |||
| std::unique_ptr<PositionPropLabel> textEditor; | |||
| TextButton button; | |||
| Component* component; | |||
| @@ -201,7 +201,7 @@ void ComponentLayoutEditor::refreshAllComponents() | |||
| { | |||
| for (int i = getNumChildComponents(); --i >= 0;) | |||
| { | |||
| ScopedPointer<ComponentOverlayComponent> overlay (dynamic_cast<ComponentOverlayComponent*> (getChildComponent (i))); | |||
| std::unique_ptr<ComponentOverlayComponent> overlay (dynamic_cast<ComponentOverlayComponent*> (getChildComponent (i))); | |||
| if (overlay != nullptr && layout.containsComponent (overlay->target)) | |||
| overlay.release(); | |||
| @@ -76,7 +76,7 @@ public: | |||
| const int borderThickness; | |||
| private: | |||
| ScopedPointer<ResizableBorderComponent> border; | |||
| std::unique_ptr<ResizableBorderComponent> border; | |||
| ComponentLayout& layout; | |||
| @@ -54,7 +54,7 @@ public: | |||
| private: | |||
| double scaleFactor = 1.0; | |||
| ScopedPointer<Component> content; | |||
| std::unique_ptr<Component> content; | |||
| }; | |||
| //============================================================================== | |||
| @@ -93,7 +93,7 @@ public: | |||
| else | |||
| { | |||
| for (int i = getNumChildComponents(); --i >= 0;) | |||
| ScopedPointer<DraggerOverlayComp> deleter (dynamic_cast<DraggerOverlayComp*> (getChildComponent (i))); | |||
| std::unique_ptr<DraggerOverlayComp> deleter (dynamic_cast<DraggerOverlayComp*> (getChildComponent (i))); | |||
| } | |||
| } | |||
| } | |||
| @@ -127,7 +127,7 @@ public: | |||
| private: | |||
| JucerDocument& document; | |||
| ScopedPointer<ListBox> listBox; | |||
| std::unique_ptr<ListBox> listBox; | |||
| StringArray baseClasses, returnValues, methods, initialContents; | |||
| }; | |||
| @@ -609,7 +609,7 @@ void JucerDocumentEditor::saveLastSelectedTab() const | |||
| { | |||
| auto& projectProps = project->getStoredProperties(); | |||
| ScopedPointer<XmlElement> root (projectProps.getXmlValue ("GUIComponentsLastTab")); | |||
| std::unique_ptr<XmlElement> root (projectProps.getXmlValue ("GUIComponentsLastTab")); | |||
| if (root == nullptr) | |||
| root.reset (new XmlElement ("FILES")); | |||
| @@ -634,7 +634,7 @@ void JucerDocumentEditor::restoreLastSelectedTab() | |||
| { | |||
| if (auto* project = document->getCppDocument().getProject()) | |||
| { | |||
| ScopedPointer<XmlElement> root (project->getStoredProperties().getXmlValue ("GUIComponentsLastTab")); | |||
| std::unique_ptr<XmlElement> root (project->getStoredProperties().getXmlValue ("GUIComponentsLastTab")); | |||
| if (root != nullptr) | |||
| { | |||
| @@ -938,7 +938,7 @@ void JucerDocumentEditor::getCommandInfo (const CommandID commandID, Application | |||
| bool canPaste = false; | |||
| ScopedPointer<XmlElement> doc (XmlDocument::parse (SystemClipboard::getTextFromClipboard())); | |||
| std::unique_ptr<XmlElement> doc (XmlDocument::parse (SystemClipboard::getTextFromClipboard())); | |||
| if (doc != nullptr) | |||
| { | |||
| @@ -1156,7 +1156,7 @@ bool JucerDocumentEditor::perform (const InvocationInfo& info) | |||
| case StandardApplicationCommandIDs::paste: | |||
| { | |||
| ScopedPointer<XmlElement> doc (XmlDocument::parse (SystemClipboard::getTextFromClipboard())); | |||
| std::unique_ptr<XmlElement> doc (XmlDocument::parse (SystemClipboard::getTextFromClipboard())); | |||
| if (doc != nullptr) | |||
| { | |||
| @@ -69,7 +69,7 @@ public: | |||
| static JucerDocumentEditor* getActiveDocumentHolder(); | |||
| private: | |||
| ScopedPointer<JucerDocument> document; | |||
| std::unique_ptr<JucerDocument> document; | |||
| ComponentLayoutPanel* compLayoutPanel = nullptr; | |||
| struct JucerDocumentTabs : public TabbedComponent | |||