diff --git a/Modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/Modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index bbcd089..3c5b6b6 100644 --- a/Modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/Modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -2,15 +2,15 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2020 - Raw Material Software Limited + Copyright (c) 2022 - Raw Material Software Limited JUCE is an open source library subject to commercial or open-source licensing. - By using JUCE, you agree to the terms of both the JUCE 6 End-User License - Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). + By using JUCE, you agree to the terms of both the JUCE 7 End-User License + Agreement and JUCE Privacy Policy. - End User License Agreement: www.juce.com/juce-6-licence + End User License Agreement: www.juce.com/juce-7-licence Privacy Policy: www.juce.com/juce-privacy-policy Or: You may also use this code under the terms of the GPL v3 (see @@ -277,8 +277,8 @@ public: maxNumOutputs = jmax (0, (int) defaultConfig.numOuts); } - if (auto* bus = processor->getBus (true, 0)) - maxNumInputs = jmax (0, bus->getDefaultLayout().size()); +// if (auto* bus = processor->getBus (true, 0)) +// maxNumInputs = jmax (0, bus->getDefaultLayout().size()); if (auto* bus = processor->getBus (false, 0)) maxNumOutputs = jmax (0, bus->getDefaultLayout().size()); @@ -448,11 +448,12 @@ private: inner.audioDeviceAboutToStart (device); } - void audioDeviceIOCallback (const float** inputChannelData, - int numInputChannels, - float** outputChannelData, - int numOutputChannels, - int numSamples) override + void audioDeviceIOCallbackWithContext (const float** inputChannelData, + int numInputChannels, + float** outputChannelData, + int numOutputChannels, + int numSamples, + const AudioIODeviceCallbackContext& context) override { jassertquiet ((int) storedInputChannels.size() == numInputChannels); jassertquiet ((int) storedOutputChannels.size() == numOutputChannels); @@ -466,11 +467,12 @@ private: initChannelPointers (inputChannelData, storedInputChannels, position); initChannelPointers (outputChannelData, storedOutputChannels, position); - inner.audioDeviceIOCallback (storedInputChannels.data(), - (int) storedInputChannels.size(), - storedOutputChannels.data(), - (int) storedOutputChannels.size(), - blockLength); + inner.audioDeviceIOCallbackWithContext (storedInputChannels.data(), + (int) storedInputChannels.size(), + storedOutputChannels.data(), + (int) storedOutputChannels.size(), + blockLength, + context); position += blockLength; } @@ -598,11 +600,12 @@ private: }; //============================================================================== - void audioDeviceIOCallback (const float** inputChannelData, - int numInputChannels, - float** outputChannelData, - int numOutputChannels, - int numSamples) override + void audioDeviceIOCallbackWithContext (const float** inputChannelData, + int numInputChannels, + float** outputChannelData, + int numOutputChannels, + int numSamples, + const AudioIODeviceCallbackContext& context) override { if (muteInput) { @@ -610,8 +613,12 @@ private: inputChannelData = emptyBuffer.getArrayOfReadPointers(); } - player.audioDeviceIOCallback (inputChannelData, numInputChannels, - outputChannelData, numOutputChannels, numSamples); + player.audioDeviceIOCallbackWithContext (inputChannelData, + numInputChannels, + outputChannelData, + numOutputChannels, + numSamples, + context); } void audioDeviceAboutToStart (AudioIODevice* device) override @@ -683,7 +690,6 @@ private: class StandaloneFilterWindow : public DocumentWindow, private Button::Listener, public MenuBarModel - { public: //============================================================================== @@ -742,7 +748,6 @@ public: optionsButton.setTriggeredOnMouseDown(true); #endif #endif - pluginHolder.reset (new StandalonePluginHolder (settingsToUse, takeOwnershipOfSettings, preferredDefaultDeviceName, preferredSetupOptions, constrainToConfiguration, autoOpenMidiDevices)); @@ -795,9 +800,8 @@ public: ~StandaloneFilterWindow() override { #if JUCE_MAC - MenuBarModel::setMacMainMenu(nullptr); + MenuBarModel::setMacMainMenu(nullptr); #endif - #if (! JUCE_IOS) && (! JUCE_ANDROID) if (auto* props = pluginHolder->settings.get()) { @@ -837,35 +841,23 @@ public: JUCEApplicationBase::quit(); } - + StringArray getMenuBarNames() override { - // StringArray menuBarNames; - // menuBarNames.add("Options"); - // return menuBarNames; const char* menuNames[] = { 0 }; - return StringArray(menuNames); } - PopupMenu getMenuForIndex(int topLevelMenuIndex, const String& menuName) override { PopupMenu m; - // m.addItem (1, TRANS("Audio Settings...")); - // m.addSeparator(); - return m; } - void menuItemSelected(int menuItemID, int topLevelMenuIndex) override { handleMenuResult(menuItemID); } - void menuBarActivated(bool isActive) override {}; - - void handleMenuResult (int result) { switch (result) @@ -894,7 +886,7 @@ public: std::unique_ptr pluginHolder; MenuBarComponent menuBar; - PopupMenu menu; + PopupMenu menu; private: void updateContent() @@ -987,11 +979,17 @@ private: BorderSize computeBorder() const { - const auto outer = owner.getContentComponentBorder(); - return { outer.getTop() + (shouldShowNotification ? NotificationArea::height : 0), - outer.getLeft(), - outer.getBottom(), - outer.getRight() }; + const auto nativeFrame = [&]() -> BorderSize + { + if (auto* peer = owner.getPeer()) + if (const auto frameSize = peer->getFrameSizeIfPresent()) + return *frameSize; + + return {}; + }(); + + return nativeFrame.addedTo (owner.getContentComponentBorder()) + .addedTo (BorderSize { shouldShowNotification ? NotificationArea::height : 0, 0, 0, 0 }); } private: diff --git a/OB-Xd.jucer b/OB-Xd.jucer index 8c8e6d0..8792387 100644 --- a/OB-Xd.jucer +++ b/OB-Xd.jucer @@ -1,6 +1,6 @@ - + displaySplashScreen="0"> diff --git a/README.md b/README.md index e9e8732..92ea408 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ Latest binaries can be downloaded at https://www.discodsp.com/obxd/ # Building -Source code can be compiled with [JUCE 6.1.6](https://github.com/juce-framework/JUCE/releases/tag/6.1.6) and VST3 SDK. +Source code can be compiled with [JUCE 7.0.1](https://github.com/juce-framework/JUCE/releases/tag/7.0.1). diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 2ea0fc9..988e513 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -85,11 +85,7 @@ public: void buttonClicked (Button *) override; //bool keyPressed(const KeyPress & press) override; void timerCallback() override { -#if JUCE_WINDOWS || JUCE_LINUX - // No run timer to grab component on window -#else - this->grabKeyboardFocus(); -#endif + countTimer ++; if (countTimer == 4 && needNotifytoHost){ countTimer = 0; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 50115bf..39c1eef 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -40,7 +40,7 @@ AudioProcessorValueTreeState::ParameterLayout createParameterLayout() auto range = NormalisableRange {0.0f, 1.0f}; auto defaultValue = defaultParams.values[i]; auto parameter = std::make_unique ( - id, name, range, defaultValue, String{}, AudioProcessorParameter::genericParameter, + ParameterID{ id, 1 }, name, range, defaultValue, String{}, AudioProcessorParameter::genericParameter, [=](float value, int /*maxStringLength*/) { return ObxdAudioProcessor::getTrueParameterValueFromNormalizedRange(i, value);