Signed-off-by: falkTX <falktx@falktx.com>v7.0.12-distrho
| @@ -34,6 +34,7 @@ struct PluginUtilities | |||
| { | |||
| PluginUtilities() = delete; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| static int getDesktopFlags (const AudioProcessorEditor& editor) | |||
| { | |||
| return editor.wantsLayerBackedView() | |||
| @@ -50,6 +51,7 @@ struct PluginUtilities | |||
| { | |||
| editor.addToDesktop (getDesktopFlags (editor), parent); | |||
| } | |||
| #endif | |||
| static const PluginHostType& getHostType() | |||
| { | |||
| @@ -35,12 +35,16 @@ | |||
| #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1 | |||
| #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1 | |||
| #endif | |||
| #include <juce_audio_plugin_client/juce_audio_plugin_client.h> | |||
| #include <juce_audio_plugin_client/detail/juce_CheckSettingMacros.h> | |||
| #include <juce_audio_plugin_client/detail/juce_PluginUtilities.h> | |||
| #include <juce_audio_plugin_client/detail/juce_LinuxMessageThread.h> | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include <juce_audio_plugin_client/detail/juce_LinuxMessageThread.h> | |||
| #endif | |||
| #include <juce_audio_processors/utilities/juce_FlagCache.h> | |||
| #include <juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp> | |||
| @@ -725,6 +729,7 @@ public: | |||
| return LV2_STATE_SUCCESS; | |||
| } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| std::unique_ptr<AudioProcessorEditor> createEditor() | |||
| { | |||
| return std::unique_ptr<AudioProcessorEditor> (processor->createEditorIfNeeded()); | |||
| @@ -734,6 +739,7 @@ public: | |||
| { | |||
| processor->editorBeingDeleted (editor); | |||
| } | |||
| #endif | |||
| static std::unique_ptr<AudioProcessor> createProcessorInstance() | |||
| { | |||
| @@ -791,7 +797,7 @@ private: | |||
| ScopedJuceInitialiser_GUI scopedJuceInitialiser; | |||
| #if JUCE_LINUX || JUCE_BSD | |||
| #if (JUCE_LINUX || JUCE_BSD) && ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| SharedResourcePointer<detail::MessageThread> messageThread; | |||
| #endif | |||
| @@ -890,6 +896,7 @@ private: | |||
| "\tlv2:binary <" << URL::addEscapeChars (libraryPath.getFileName(), false) << "> ;\n" | |||
| "\trdfs:seeAlso <dsp.ttl> .\n"; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| if (proc.hasEditor()) | |||
| { | |||
| #if JUCE_MAC | |||
| @@ -909,6 +916,7 @@ private: | |||
| "\trdfs:seeAlso <ui.ttl> .\n" | |||
| "\n"; | |||
| } | |||
| #endif | |||
| for (auto i = 0, end = proc.getNumPrograms(); i < end; ++i) | |||
| { | |||
| @@ -1141,8 +1149,10 @@ private: | |||
| os << "<" JucePlugin_LV2URI ">\n"; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| if (proc.hasEditor()) | |||
| os << "\tui:ui <" << JucePluginLV2UriUi << "> ;\n"; | |||
| #endif | |||
| const auto versionParts = StringArray::fromTokens (JucePlugin_VersionString, ".", ""); | |||
| @@ -1346,6 +1356,7 @@ private: | |||
| static Result writeUiTtl (AudioProcessor& proc, const File& libraryPath) | |||
| { | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| if (! proc.hasEditor()) | |||
| return Result::ok(); | |||
| @@ -1387,6 +1398,7 @@ private: | |||
| "\topts:supportedOption\n" | |||
| "\t\tui:scaleFactor ,\n" | |||
| "\t\tparam:sampleRate .\n"; | |||
| #endif | |||
| return Result::ok(); | |||
| } | |||
| @@ -1513,6 +1525,7 @@ static Optional<float> findScaleFactor (const LV2_URID_Map* symap, const LV2_Opt | |||
| return parser.parseNumericOption<float> (scaleFactorOption); | |||
| } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| class LV2UIInstance final : private Component, | |||
| private ComponentListener | |||
| { | |||
| @@ -1825,6 +1838,7 @@ LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor (uint32_t index) | |||
| return &descriptor; | |||
| } | |||
| #endif | |||
| } // namespace juce::lv2_client | |||
| @@ -34,7 +34,9 @@ | |||
| #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1 | |||
| #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 | |||
| #define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1 | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1 | |||
| #endif | |||
| #define JUCE_GUI_BASICS_INCLUDE_SCOPED_THREAD_DPI_AWARENESS_SETTER 1 | |||
| #define JUCE_GRAPHICS_INCLUDE_COREGRAPHICS_HELPERS 1 | |||
| @@ -42,7 +44,7 @@ | |||
| #include <juce_gui_extra/juce_gui_extra.h> | |||
| //============================================================================== | |||
| #if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && (JUCE_LINUX || JUCE_BSD) | |||
| #if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && (JUCE_LINUX || JUCE_BSD) && ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wvariadic-macros") | |||
| #include <X11/Xlib.h> | |||
| JUCE_END_IGNORE_WARNINGS_GCC_LIKE | |||
| @@ -197,9 +199,11 @@ private: | |||
| #include "format_types/juce_LegacyAudioParameter.cpp" | |||
| #include "processors/juce_AudioProcessor.cpp" | |||
| #include "processors/juce_AudioPluginInstance.cpp" | |||
| #include "processors/juce_AudioProcessorEditor.cpp" | |||
| #include "processors/juce_AudioProcessorGraph.cpp" | |||
| #include "processors/juce_GenericAudioProcessorEditor.cpp" | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include "processors/juce_AudioProcessorEditor.cpp" | |||
| #include "processors/juce_GenericAudioProcessorEditor.cpp" | |||
| #endif | |||
| #include "processors/juce_PluginDescription.cpp" | |||
| #include "format_types/juce_ARACommon.cpp" | |||
| #include "format_types/juce_LADSPAPluginFormat.cpp" | |||
| @@ -207,9 +211,11 @@ private: | |||
| #include "format_types/juce_VST3PluginFormat.cpp" | |||
| #include "format_types/juce_AudioUnitPluginFormat.mm" | |||
| #include "format_types/juce_ARAHosting.cpp" | |||
| #include "scanning/juce_KnownPluginList.cpp" | |||
| #include "scanning/juce_PluginDirectoryScanner.cpp" | |||
| #include "scanning/juce_PluginListComponent.cpp" | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include "scanning/juce_KnownPluginList.cpp" | |||
| #include "scanning/juce_PluginDirectoryScanner.cpp" | |||
| #include "scanning/juce_PluginListComponent.cpp" | |||
| #endif | |||
| #include "processors/juce_AudioProcessorParameterGroup.cpp" | |||
| #include "utilities/juce_AudioProcessorParameterWithID.cpp" | |||
| #include "utilities/juce_RangedAudioParameter.cpp" | |||
| @@ -217,7 +223,9 @@ private: | |||
| #include "utilities/juce_AudioParameterInt.cpp" | |||
| #include "utilities/juce_AudioParameterBool.cpp" | |||
| #include "utilities/juce_AudioParameterChoice.cpp" | |||
| #include "utilities/juce_ParameterAttachments.cpp" | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include "utilities/juce_ParameterAttachments.cpp" | |||
| #endif | |||
| #include "utilities/juce_AudioProcessorValueTreeState.cpp" | |||
| #include "utilities/juce_PluginHostType.cpp" | |||
| #include "utilities/juce_AAXClientExtensions.cpp" | |||
| @@ -235,3 +243,8 @@ private: | |||
| #include "format_types/juce_LV2PluginFormat_test.cpp" | |||
| #endif | |||
| #endif | |||
| #if JUCE_AUDIOPROCESSOR_NO_GUI | |||
| // commonly used classes in DSP code | |||
| namespace juce { Colour::Colour(juce::uint32) noexcept {} } | |||
| #endif | |||
| @@ -138,14 +138,18 @@ | |||
| #include "processors/juce_AudioProcessorParameter.h" | |||
| #include "processors/juce_HostedAudioProcessorParameter.h" | |||
| #include "processors/juce_AudioProcessorEditorHostContext.h" | |||
| #include "processors/juce_AudioProcessorEditor.h" | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include "processors/juce_AudioProcessorEditor.h" | |||
| #endif | |||
| #include "processors/juce_AudioProcessorListener.h" | |||
| #include "processors/juce_AudioProcessorParameterGroup.h" | |||
| #include "processors/juce_AudioProcessor.h" | |||
| #include "processors/juce_PluginDescription.h" | |||
| #include "processors/juce_AudioPluginInstance.h" | |||
| #include "processors/juce_AudioProcessorGraph.h" | |||
| #include "processors/juce_GenericAudioProcessorEditor.h" | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include "processors/juce_GenericAudioProcessorEditor.h" | |||
| #endif | |||
| #include "format/juce_AudioPluginFormat.h" | |||
| #include "format/juce_AudioPluginFormatManager.h" | |||
| #include "scanning/juce_KnownPluginList.h" | |||
| @@ -164,7 +168,9 @@ | |||
| #include "utilities/juce_AudioParameterInt.h" | |||
| #include "utilities/juce_AudioParameterBool.h" | |||
| #include "utilities/juce_AudioParameterChoice.h" | |||
| #include "utilities/juce_ParameterAttachments.h" | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| #include "utilities/juce_ParameterAttachments.h" | |||
| #endif | |||
| #include "utilities/juce_AudioProcessorValueTreeState.h" | |||
| #include "utilities/juce_PluginHostType.h" | |||
| #include "utilities/ARA/juce_ARADebug.h" | |||
| @@ -50,12 +50,14 @@ AudioProcessor::AudioProcessor (const BusesProperties& ioConfig) | |||
| AudioProcessor::~AudioProcessor() | |||
| { | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| { | |||
| const ScopedLock sl (activeEditorLock); | |||
| // ooh, nasty - the editor should have been deleted before its AudioProcessor. | |||
| jassert (activeEditor == nullptr); | |||
| } | |||
| #endif | |||
| #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING | |||
| // This will fail if you've called beginParameterChangeGesture() for one | |||
| @@ -871,6 +873,7 @@ void AudioProcessor::audioIOChanged (bool busNumberChanged, bool channelNumChang | |||
| processorLayoutsChanged(); | |||
| } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| //============================================================================== | |||
| void AudioProcessor::editorBeingDeleted (AudioProcessorEditor* const editor) noexcept | |||
| { | |||
| @@ -907,6 +910,7 @@ AudioProcessorEditor* AudioProcessor::createEditorIfNeeded() | |||
| return ed; | |||
| } | |||
| #endif | |||
| //============================================================================== | |||
| void AudioProcessor::getCurrentProgramStateInformation (juce::MemoryBlock& destData) | |||
| @@ -959,6 +959,7 @@ public: | |||
| */ | |||
| virtual void setNonRealtime (bool isNonRealtime) noexcept; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| //============================================================================== | |||
| /** Creates the processor's GUI. | |||
| @@ -1008,6 +1009,7 @@ public: | |||
| This may call createEditor() internally to create the component. | |||
| */ | |||
| AudioProcessorEditor* createEditorIfNeeded(); | |||
| #endif | |||
| //============================================================================== | |||
| /** Returns the default number of steps for a parameter. | |||
| @@ -1241,9 +1243,11 @@ public: | |||
| virtual CurveData getResponseCurve (CurveData::Type /*curveType*/) const { return {}; } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| //============================================================================== | |||
| /** Not for public use - this is called before deleting an editor component. */ | |||
| void editorBeingDeleted (AudioProcessorEditor*) noexcept; | |||
| #endif | |||
| /** Flags to indicate the type of plugin context in which a processor is being used. */ | |||
| enum WrapperType | |||
| @@ -1273,7 +1277,9 @@ public: | |||
| struct TrackProperties | |||
| { | |||
| String name; // The name of the track - this will be empty if the track name is not known | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| Colour colour; // The colour of the track - this will be transparentBlack if the colour is not known | |||
| #endif | |||
| // other properties may be added in the future | |||
| }; | |||
| @@ -1522,7 +1528,9 @@ private: | |||
| //============================================================================== | |||
| Array<AudioProcessorListener*> listeners; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| Component::SafePointer<AudioProcessorEditor> activeEditor; | |||
| #endif | |||
| double currentSampleRate = 0; | |||
| int blockSize = 0, latencySamples = 0; | |||
| bool suspended = false; | |||
| @@ -2096,8 +2096,10 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::producesMidi() const | |||
| bool AudioProcessorGraph::AudioGraphIOProcessor::isInput() const noexcept { return type == audioInputNode || type == midiInputNode; } | |||
| bool AudioProcessorGraph::AudioGraphIOProcessor::isOutput() const noexcept { return type == audioOutputNode || type == midiOutputNode; } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| bool AudioProcessorGraph::AudioGraphIOProcessor::hasEditor() const { return false; } | |||
| AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; } | |||
| #endif | |||
| int AudioProcessorGraph::AudioGraphIOProcessor::getNumPrograms() { return 0; } | |||
| int AudioProcessorGraph::AudioGraphIOProcessor::getCurrentProgram() { return 0; } | |||
| @@ -2310,8 +2312,10 @@ private: | |||
| double getTailLengthSeconds() const override { return {}; } | |||
| bool acceptsMidi() const override { return midiIn == MidiIn ::yes; } | |||
| bool producesMidi() const override { return midiOut == MidiOut::yes; } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| AudioProcessorEditor* createEditor() override { return {}; } | |||
| bool hasEditor() const override { return {}; } | |||
| #endif | |||
| int getNumPrograms() override { return 1; } | |||
| int getCurrentProgram() override { return {}; } | |||
| void setCurrentProgram (int) override {} | |||
| @@ -387,8 +387,10 @@ public: | |||
| bool acceptsMidi() const override; | |||
| bool producesMidi() const override; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| bool hasEditor() const override; | |||
| AudioProcessorEditor* createEditor() override; | |||
| #endif | |||
| int getNumPrograms() override; | |||
| int getCurrentProgram() override; | |||
| @@ -424,8 +426,10 @@ public: | |||
| bool acceptsMidi() const override; | |||
| bool producesMidi() const override; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| bool hasEditor() const override { return false; } | |||
| AudioProcessorEditor* createEditor() override { return nullptr; } | |||
| #endif | |||
| int getNumPrograms() override { return 0; } | |||
| int getCurrentProgram() override { return 0; } | |||
| void setCurrentProgram (int) override { } | |||
| @@ -468,6 +468,7 @@ void AudioProcessorValueTreeState::timerCallback() | |||
| : jlimit (50, 500, getTimerInterval() + 20)); | |||
| } | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| //============================================================================== | |||
| template <typename Attachment, typename Control> | |||
| std::unique_ptr<Attachment> makeAttachment (const AudioProcessorValueTreeState& stateToUse, | |||
| @@ -501,6 +502,7 @@ AudioProcessorValueTreeState::ButtonAttachment::ButtonAttachment (AudioProcessor | |||
| : attachment (makeAttachment<ButtonParameterAttachment> (stateToUse, parameterID, button)) | |||
| { | |||
| } | |||
| #endif | |||
| //============================================================================== | |||
| //============================================================================== | |||
| @@ -528,6 +528,7 @@ public: | |||
| friend class AudioProcessorValueTreeState::ParameterAdapter; | |||
| }; | |||
| #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||
| //============================================================================== | |||
| /** An object of this class maintains a connection between a Slider and a parameter | |||
| in an AudioProcessorValueTreeState. | |||
| @@ -595,6 +596,7 @@ public: | |||
| std::unique_ptr<ButtonParameterAttachment> attachment; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ButtonAttachment) | |||
| }; | |||
| #endif | |||
| private: | |||
| //============================================================================== | |||