mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Replaced all usage of ScopedPointer with std::unique_ptr
This commit is contained in:
parent
e6104e3fed
commit
ab863a6dc2
401 changed files with 1091 additions and 1113 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue