mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-26 02:14:22 +00:00
AudioPluginFormatManager is no longer a singleton. Singletons are bad: don't do it, kids.
This commit is contained in:
parent
9af7f2f480
commit
246cb94bb0
13 changed files with 43 additions and 45 deletions
|
|
@ -32,7 +32,7 @@
|
|||
class MainHostWindow::PluginListWindow : public DocumentWindow
|
||||
{
|
||||
public:
|
||||
PluginListWindow (MainHostWindow& owner_)
|
||||
PluginListWindow (MainHostWindow& owner_, AudioPluginFormatManager& formatManager)
|
||||
: DocumentWindow ("Available Plugins", Colours::white,
|
||||
DocumentWindow::minimiseButton | DocumentWindow::closeButton),
|
||||
owner (owner_)
|
||||
|
|
@ -40,7 +40,8 @@ public:
|
|||
const File deadMansPedalFile (appProperties->getUserSettings()
|
||||
->getFile().getSiblingFile ("RecentlyCrashedPluginsList"));
|
||||
|
||||
setContentOwned (new PluginListComponent (owner.knownPluginList,
|
||||
setContentOwned (new PluginListComponent (formatManager,
|
||||
owner.knownPluginList,
|
||||
deadMansPedalFile,
|
||||
appProperties->getUserSettings()), true);
|
||||
|
||||
|
|
@ -75,6 +76,9 @@ MainHostWindow::MainHostWindow()
|
|||
: DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), Colours::lightgrey,
|
||||
DocumentWindow::allButtons)
|
||||
{
|
||||
formatManager.addDefaultFormats();
|
||||
formatManager.addFormat (new InternalPluginFormat());
|
||||
|
||||
ScopedPointer<XmlElement> savedAudioState (appProperties->getUserSettings()
|
||||
->getXmlValue ("audioDeviceState"));
|
||||
|
||||
|
|
@ -84,7 +88,7 @@ MainHostWindow::MainHostWindow()
|
|||
setResizeLimits (500, 400, 10000, 10000);
|
||||
centreWithSize (800, 600);
|
||||
|
||||
setContentOwned (new GraphDocumentComponent (&deviceManager), false);
|
||||
setContentOwned (new GraphDocumentComponent (formatManager, &deviceManager), false);
|
||||
|
||||
restoreWindowStateFromString (appProperties->getUserSettings()->getValue ("mainWindowPos"));
|
||||
|
||||
|
|
@ -378,7 +382,7 @@ bool MainHostWindow::perform (const InvocationInfo& info)
|
|||
|
||||
case CommandIDs::showPluginListEditor:
|
||||
if (pluginListWindow == nullptr)
|
||||
pluginListWindow = new PluginListWindow (*this);
|
||||
pluginListWindow = new PluginListWindow (*this, formatManager);
|
||||
|
||||
pluginListWindow->toFront (true);
|
||||
break;
|
||||
|
|
@ -455,7 +459,7 @@ void MainHostWindow::filesDropped (const StringArray& files, int x, int y)
|
|||
else
|
||||
{
|
||||
OwnedArray <PluginDescription> typesFound;
|
||||
knownPluginList.scanAndAddDragAndDroppedFiles (files, typesFound);
|
||||
knownPluginList.scanAndAddDragAndDroppedFiles (formatManager, files, typesFound);
|
||||
|
||||
Point<int> pos (graphEditor->getLocalPoint (this, Point<int> (x, y)));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue