1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Made a lot of ScopedPointer usage conform to the std::unique_ptr interface

This commit is contained in:
Tom Poole 2018-04-10 14:50:25 +01:00
parent 2d9fc46b4e
commit 4229dc0a4f
99 changed files with 6809 additions and 498 deletions

View file

@ -57,8 +57,8 @@
auto deadMansPedalFile = getAppProperties().getUserSettings()
->getFile().getSiblingFile ("RecentlyCrashedPluginsList");
scanner = new PluginDirectoryScanner (knownPluginList, formatToScan, paths,
true, deadMansPedalFile, true);
scanner.reset (new PluginDirectoryScanner (knownPluginList, formatToScan, paths,
true, deadMansPedalFile, true));
for (int i = 5; --i >= 0;)
pool.addJob (new ScanJob (*this), true);
@ -399,7 +399,7 @@ struct GraphEditorPanel::FilterComponent : public Component,
void showPopupMenu()
{
menu = new PopupMenu;
menu.reset (new PopupMenu);
menu->addItem (1, "Delete this filter");
menu->addItem (2, "Disconnect all pins");
menu->addItem (3, "Toggle Bypass");
@ -820,7 +820,7 @@ void GraphEditorPanel::updateComponents()
void GraphEditorPanel::showPopupMenu (Point<int> mousePos)
{
menu = new PopupMenu;
menu.reset (new PopupMenu);
if (auto* mainWindow = findParentComponentOfClass<MainHostWindow>())
{
@ -842,15 +842,15 @@ void GraphEditorPanel::beginConnectorDrag (AudioProcessorGraph::NodeAndChannel s
{
auto* c = dynamic_cast<ConnectorComponent*> (e.originalComponent);
connectors.removeObject (c, false);
draggingConnector = c;
draggingConnector.reset (c);
if (draggingConnector == nullptr)
draggingConnector = new ConnectorComponent (*this);
draggingConnector.reset (new ConnectorComponent (*this));
draggingConnector->setInput (source);
draggingConnector->setOutput (dest);
addAndMakeVisible (draggingConnector);
addAndMakeVisible (draggingConnector.get());
draggingConnector->toFront (false);
dragConnector (e);
@ -1148,31 +1148,37 @@ GraphDocumentComponent::GraphDocumentComponent (AudioPluginFormatManager& fm,
{
init();
deviceManager.addChangeListener (graphPanel);
deviceManager.addChangeListener (graphPanel.get());
deviceManager.addAudioCallback (&graphPlayer);
deviceManager.addMidiInputCallback (String(), &graphPlayer.getMidiMessageCollector());
}
void GraphDocumentComponent::init()
{
addAndMakeVisible (graphPanel = new GraphEditorPanel (*graph));
graphPanel.reset (new GraphEditorPanel (*graph));
addAndMakeVisible (graphPanel.get());
graphPlayer.setProcessor (&graph->graph);
keyState.addListener (&graphPlayer.getMidiMessageCollector());
addAndMakeVisible (keyboardComp = new MidiKeyboardComponent (keyState, MidiKeyboardComponent::horizontalKeyboard));
addAndMakeVisible (statusBar = new TooltipBar());
keyboardComp.reset (new MidiKeyboardComponent (keyState, MidiKeyboardComponent::horizontalKeyboard));
addAndMakeVisible (keyboardComp.get());
statusBar.reset (new TooltipBar());
addAndMakeVisible (statusBar.get());
graphPanel->updateComponents();
if (isOnTouchDevice())
{
if (isOnTouchDevice())
addAndMakeVisible (titleBarComponent = new TitleBarComponent (*this));
{
titleBarComponent.reset (new TitleBarComponent (*this));
addAndMakeVisible (titleBarComponent.get());
}
pluginListBoxModel = new PluginListBoxModel (pluginListBox, pluginList);
pluginListBoxModel.reset (new PluginListBoxModel (pluginListBox, pluginList));
pluginListBox.setModel (pluginListBoxModel);
pluginListBox.setModel (pluginListBoxModel.get());
pluginListBox.setRowHeight (40);
pluginListSidePanel.setContent (&pluginListBox, false);
@ -1230,7 +1236,7 @@ void GraphDocumentComponent::releaseGraph()
if (graphPanel != nullptr)
{
deviceManager.removeChangeListener (graphPanel);
deviceManager.removeChangeListener (graphPanel.get());
graphPanel = nullptr;
}