diff --git a/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp b/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp index 1829c7c529..ba521e844b 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp +++ b/extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp @@ -227,7 +227,7 @@ private: //============================================================================== class MissingDependenciesComponent : public PropertyComponent, - public Button::Listener + public ButtonListener { public: MissingDependenciesComponent (Project& project_, ModuleList& moduleList_, const String& moduleID_) diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.cpp b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.cpp index a6a91f782e..7a9da83a58 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.cpp +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.cpp @@ -35,10 +35,12 @@ extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); //============================================================================== StandaloneFilterWindow::StandaloneFilterWindow (const String& title, - const Colour& backgroundColour) + const Colour& backgroundColour, + PropertySet* settingsToUse) : DocumentWindow (title, backgroundColour, DocumentWindow::minimiseButton | DocumentWindow::closeButton), + settings (settingsToUse), optionsButton ("options") { setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false); @@ -63,8 +65,6 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, JucePlugin_MaxNumOutputChannels, 44100, 512); - PropertySet* const globalSettings = getGlobalSettings(); - deviceManager = new AudioDeviceManager(); deviceManager->addAudioCallback (&player); deviceManager->addMidiInputCallback (String::empty, &player); @@ -73,19 +73,19 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, ScopedPointer savedState; - if (globalSettings != nullptr) - savedState = globalSettings->getXmlValue ("audioSetup"); + if (settings != nullptr) + savedState = settings->getXmlValue ("audioSetup"); deviceManager->initialise (filter->getNumInputChannels(), filter->getNumOutputChannels(), savedState, true); - if (globalSettings != nullptr) + if (settings != nullptr) { MemoryBlock data; - if (data.fromBase64Encoding (globalSettings->getValue ("filterState")) + if (data.fromBase64Encoding (settings->getValue ("filterState")) && data.getSize() > 0) { filter->setStateInformation (data.getData(), data.getSize()); @@ -94,28 +94,33 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, setContentOwned (filter->createEditorIfNeeded(), true); - const int x = globalSettings->getIntValue ("windowX", -100); - const int y = globalSettings->getIntValue ("windowY", -100); + if (settings != nullptr) + { + const int x = settings->getIntValue ("windowX", -100); + const int y = settings->getIntValue ("windowY", -100); - if (x != -100 && y != -100) - setBoundsConstrained (Rectangle (x, y, getWidth(), getHeight())); + if (x != -100 && y != -100) + setBoundsConstrained (Rectangle (x, y, getWidth(), getHeight())); + else + centreWithSize (getWidth(), getHeight()); + } else + { centreWithSize (getWidth(), getHeight()); + } } StandaloneFilterWindow::~StandaloneFilterWindow() { - PropertySet* const globalSettings = getGlobalSettings(); - - if (globalSettings != nullptr) + if (settings != nullptr) { - globalSettings->setValue ("windowX", getX()); - globalSettings->setValue ("windowY", getY()); + settings->setValue ("windowX", getX()); + settings->setValue ("windowY", getY()); if (deviceManager != nullptr) { ScopedPointer xml (deviceManager->createStateXml()); - globalSettings->setValue ("audioSetup", xml); + settings->setValue ("audioSetup", xml); } } @@ -123,12 +128,12 @@ StandaloneFilterWindow::~StandaloneFilterWindow() deviceManager->removeAudioCallback (&player); deviceManager = nullptr; - if (globalSettings != nullptr && filter != nullptr) + if (settings != nullptr && filter != nullptr) { MemoryBlock data; filter->getStateInformation (data); - globalSettings->setValue ("filterState", data.toBase64Encoding()); + settings->setValue ("filterState", data.toBase64Encoding()); } deleteFilter(); @@ -162,20 +167,16 @@ void StandaloneFilterWindow::resetFilter() setContentOwned (filter->createEditorIfNeeded(), true); } - PropertySet* const globalSettings = getGlobalSettings(); - - if (globalSettings != nullptr) - globalSettings->removeValue ("filterState"); + if (settings != nullptr) + settings->removeValue ("filterState"); } //============================================================================== void StandaloneFilterWindow::saveState() { - PropertySet* const globalSettings = getGlobalSettings(); - FileChooser fc (TRANS("Save current state"), - globalSettings != nullptr ? File (globalSettings->getValue ("lastStateFile")) - : File::nonexistent); + settings != nullptr ? File (settings->getValue ("lastStateFile")) + : File::nonexistent); if (fc.browseForFileToSave (true)) { @@ -193,11 +194,9 @@ void StandaloneFilterWindow::saveState() void StandaloneFilterWindow::loadState() { - PropertySet* const globalSettings = getGlobalSettings(); - FileChooser fc (TRANS("Load a saved state"), - globalSettings != nullptr ? File (globalSettings->getValue ("lastStateFile")) - : File::nonexistent); + settings != nullptr ? File (settings->getValue ("lastStateFile")) + : File::nonexistent); if (fc.browseForFileToOpen()) { @@ -228,7 +227,8 @@ void StandaloneFilterWindow::showAudioSettingsDialog() selectorComp.setSize (500, 450); - DialogWindow::showModalDialog (TRANS("Audio Settings"), &selectorComp, this, Colours::lightgrey, true, false, false); + DialogWindow::showModalDialog (TRANS("Audio Settings"), &selectorComp, this, + Colours::lightgrey, true, false, false); } //============================================================================== diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index b7aa00b1a6..55f43f4b7d 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -42,8 +42,14 @@ class StandaloneFilterWindow : public DocumentWindow, { public: //============================================================================== + /** Creates a window with a given title and colour. + The settings object can be a PropertySet that the class should use to + store its settings - the object that is passed-in will be owned by this + class and deleted automatically when no longer needed. (It can also be null) + */ StandaloneFilterWindow (const String& title, - const Colour& backgroundColour); + const Colour& backgroundColour, + PropertySet* settingsToUse); ~StandaloneFilterWindow(); @@ -60,14 +66,6 @@ public: /** Shows the audio properties dialog box modally. */ virtual void showAudioSettingsDialog(); - /** Implement this method to return the property set that should be used for storing - the plugin's state. - - This will be used to store the audio set-up and the filter's last state. You may want - to return an ApplicationProperties object. - */ - virtual PropertySet* getGlobalSettings() = 0; - //============================================================================== /** @internal */ void closeButtonPressed(); @@ -77,6 +75,7 @@ public: void resized(); private: + ScopedPointer settings; ScopedPointer filter; ScopedPointer deviceManager; AudioProcessorPlayer player; diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index b7706e136a..6208b161d4 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2147,7 +2147,7 @@ int VSTPluginInstance::dispatch (const int opcode, const int index, const int va //============================================================================== namespace { - static const int defaultVSTSampleRateValue = 16384; + static const int defaultVSTSampleRateValue = 44100; static const int defaultVSTBlockSizeValue = 512; // handles non plugin-specific callbacks.. @@ -2409,7 +2409,7 @@ const String VSTPluginInstance::getCategory() const { case kPlugCategEffect: result = "Effect"; break; case kPlugCategSynth: result = "Synth"; break; - case kPlugCategAnalysis: result = "Anaylsis"; break; + case kPlugCategAnalysis: result = "Analysis"; break; case kPlugCategMastering: result = "Mastering"; break; case kPlugCategSpacializer: result = "Spacial"; break; case kPlugCategRoomFx: result = "Reverb"; break; diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp index 7359df9319..e0e5678e22 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp @@ -229,7 +229,13 @@ void ResizableWindow::resized() } if (contentComponent != nullptr) + { + // The window expects to be able to be able to manage the size and position + // of its content component, so you can't arbitrarily add a transform to it! + jassert (! contentComponent->isTransformed()); + contentComponent->setBoundsInset (getContentComponentBorder()); + } updateLastPos();