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

315 commits

Author SHA1 Message Date
reuk
13d27987f4
VST3 Client: Enforce that process and setActive are not called simultaneously in FL Studio
Opening some JUCE VST3s in FL Studio's patcher can cause crashes because
of data races on objects accessed from setActive() and process().

According to the VST3 specification, these functions should never be
called simultaneously, so I think this is a bug in FL Studio.
2023-02-02 15:06:06 +00:00
martin@ncore.li
f7a28a6d62
VST3: Fix bad value returned from setBusArrangements() (false == kResultTrue) when in/out bus counts are mismatching 2023-01-26 16:51:39 +00:00
reuk
4b222427f9
VST3: Avoid requesting channel layouts that cannot be represented as SpeakerArrangements 2023-01-25 17:07:23 +00:00
reuk
d6f30304f0
AudioProcessor: Return unique_ptr from createPluginFilterOfType 2022-12-14 11:12:33 +00:00
reuk
403ba3007f
PluginHostType: Automatically set jucePlugInClientCurrentWrapperType during createPluginFilterOfType 2022-12-14 11:12:33 +00:00
reuk
78a0fc6fa5
VST3 Client: Allow setBusArrangements to succeed if called during setActive 2022-12-14 11:12:30 +00:00
reuk
28f2157912
Convert ignoreUnused to [[maybe_unused]] 2022-12-01 11:41:50 +00:00
hogliux
1ae2a150d5 VST3 Client: Fix a compiler error in the VST3 wrapper when a plug-in uses the legacy PreferredChannelConfigurations option 2022-10-07 11:54:43 +02:00
reuk
ddfceb12b2
VST3 Client: Return correct programListId for root unit
This change fixes an issue where the program list was not populated in
Cubase 12.
2022-10-06 17:34:00 +01:00
reuk
69e0727ffd
VST3 Client: Attempt to preserve scale set by host 2022-10-06 17:33:59 +01:00
hogliux
f370edcb5d VST3: Fix an issue with sidechain configurations in Cubase 2022-10-05 08:41:56 +02:00
reuk
6c3b410e6f
VST3 Client: When emulating MIDI CCs with parameters, generate a MIDI event for each parameter event
Based on a similar patch in the Surge-XT fork of JUCE.

Co-authored-by: Paul Walker <paul@pwjw.com>
2022-09-01 15:44:26 +01:00
reuk
11b4672b55 VST3 Client: Fix occasional incorrect scaling in Ableton Live when rendering with OpenGL
This patch fixes an issue where closing and reopening a plugin editor in
Live could cause it to display at the wrong scale when using OpenGL.
2022-08-31 17:42:47 +01:00
attila
6c09aa69d9 VST3 Client: Fix setComponentState() threading on Linux
Before this commit it was possible for the plugin to transfer control
to its internal MessageThread and call
IComponentHandler::restartComponent() from it.
2022-07-14 19:18:27 +00:00
attila
6ea3788a3b VST3 Client: Fix warning when PreferredChannelConfigurations are set 2022-06-30 15:10:15 +00:00
reuk
f3ca634049
VST3 Client: Fix missing prototype warning 2022-06-27 14:38:26 +01:00
reuk
752c913cd2
AudioPlayHead: Move HostTimeNs out of AudioProcessor, to consolidate timing information 2022-06-16 16:19:09 +01:00
reuk
8fbd99c424
AudioPlayHead: Improve granularity of position info 2022-06-16 16:18:20 +01:00
reuk
964a1aa870
VST3 Client: Allow host to enable/disable buses at will
Previously, activateBus would fail if the new BusesLayout wasn't
supported, as reported by isBusesLayoutSupported. However, according to
the VST3 docs, a host is allowed to enable and disable buses in any
combination, and the plugin should be able to handle this gracefully.

The ability to enable/disable individual buses without failure is
particularly important because there's no VST3 API to set a complete bus
layout in one go. That is, the only way to set all buses active or all
buses inactive is to set the appropriate state on each bus individually,
which in turn means that at some point, some buses will be active and
some will be inactive. Disallowing such 'intermediate' states may
prevent the host from putting the plugin into other (valid) states.

To ensure that the VST3 wrapper always accepts activateBus calls, it now
keeps track of the activation state of each bus as requested by the
host. When the host tries to change the activation state, the wrapper
will try to set the host's "ideal" bus layout on the AudioProcessor. If
this fails, the AudioProcessor will retain its previous bus layout.

The buffer remapping inside the process callback has been made more
robust, to handle cases where the host and the AudioProcessor disagree
about the activation state of each bus:

For input buses:
- If the host has activated the bus, but the AudioProcessor decided to
  keep the bus inactive, the host's input will be ignored.
- If the host deactivated the bus, but the AudioProcessor wanted to keep
  the bus active, the AudioProcessor will be provided with silence on
  that bus.

For output buses:
- If the host has activated the bus, but the AudioProcessor decided to
  keep the bus inactive, the wrapper will clear the host's output
  bus buffers.
- If the host deactivated the bus, but the AudioProcessor wanted to keep
  the bus active, the AudioProcessor's output on that bus will be
  ignored.

The AudioBuffer passed to the wrapped AudioProcessor will no longer
contain any pointers from the host's ProcessData. Instead, the host's
inputs will be copied (in JUCE channel order) to a temporary buffer,
and this temporary buffer will be passed to
AudioProcessor::processBlock. After processBlock, the buffer contents
will be copied to the host's output buffers.

This change is intended to avoid a potential issue when reordering
channels into JUCE order, which may necessitate copying a host input
channel to a different host output channel. In the case that the host is
using the same buffers for both inputs and outputs, copying an input to
an output channel may end up overwriting another input channel, breaking
the plugin's inputs.
2022-06-13 15:29:58 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
attila
5f4da905d7 ARA Client: Add ARA interface extensions to AU and VST3 wrappers 2022-05-12 12:31:30 +02:00
attila
3b5d7898ed VST3 Client: Only call prepareToPlay() from IComponent::setActive() 2022-05-11 16:06:18 +02:00
reuk
1182024fc4
LV2: Add initial hosting support 2022-04-22 14:18:51 +01:00
reuk
c91514f57f
VST3 Client: Properly notify host about added/removed event loop FDs 2022-04-22 14:18:49 +01:00
reuk
c30b3a1a31
Plugin Hosting: Take custom scaling into account when computing editor sizes 2022-04-22 14:18:49 +01:00
reuk
cfa289d943
AudioProcessor: Allow querying of the host timestamp in processBlock 2022-04-22 14:18:49 +01:00
reuk
19ddbe2368
Warnings: Fix missing-prototypes warnings 2022-04-22 14:18:48 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
f77b286b8c
VST3 Client: Work around broken editor resizing in Blue Cat's PatchWork 2022-04-01 16:41:48 +01:00
reuk
cad155bf1c
VST3 Client: Make window sizing slightly more robust in Live
The following was observed for a VST3 plugin hosted in Live 11.1 with
auto-scaling disabled:

- It never calls setContentScaleFactor on the plugin's UI, so the
  wrapper has to check the current display on a timer and update the
  current scale factor when necessary.

- It calls canResize on the plugin view after opening it, but doesn't
  seem to respect the result of this call. According to the VST3
  documentation, a host is supposed to only call checkSizeConstraint
  during a live resize operation (which should only happen if the plugin
  reports it can resize), but Live calls this function every time the
  user drags the editor. It also passes the result of this function to
  onSize, whether or not checkSizeConstraints reported success.

- When dragging an editor between displays, Live will continue to call
  checkSizeConstraint and onSize with the editor’s old size in physical
  pixels. In some cases, JUCE's "scale factor check" timer callback
  fires, resizes the view to the correct size, and then Live
  asynchronously calls onSize again with the editor's old size in
  physical pixels, resulting in the editor being set to the wrong
  logical size.

This patch ensures that checkSizeConstraint always returns the current
size of a nonResizable editor. This means that the logical size of the
editor should not change when the result of checkSizeContraint is used
to resize the window.
2022-04-01 16:41:48 +01:00
reuk
bb2b36a253
VST3 Client: Properly map between VST3 and JUCE layouts 2022-03-23 16:51:40 +00:00
reuk
18300abde9
VST3 Client: Add host API checks to setBusArrangements and activateBus 2022-03-23 16:51:39 +00:00
reuk
ebac835673
Fix some deprecation warnings 2022-03-22 17:27:54 +00:00
reuk
afe5199848
AudioProcessorParameter: Add new ParameterID and Attributes types 2022-03-03 13:47:05 +00:00
reuk
89a7d05180
VST3 Client: Avoid calling performEdit during setState
The host is guaranteed to re-scan all parameter values after setting a
new state on the plugin, so there's no need to notify the host about
parameter changes that happen during the setState call.

This also avoids a problem where Bitwig would complain about invalid
parameter IDs in 'engine.log' when loading projects containing JUCE
VST3s. These log messages were produced because a call to setState was
made before Bitwig registered the plugin's parameters, and the setState
call in turn called performEdit with parameter IDs that were yet to be
registered.
2022-02-23 10:56:11 +00:00
reuk
068dffdb8c
AudioProcessorEditorHostContext: Fix naming of getContextMenuForParameter 2022-02-18 16:43:25 +00:00
reuk
3f315ddd00 Plugin clients: Fix bypass behaviours to match getBypassParameter() documentation 2022-02-07 14:24:11 +00:00
reuk
bd52350c00
VST3 Wrapper: Avoid calling processBlock when there is no audio input/output 2022-01-17 10:58:18 +00:00
reuk
640194c878
MinGW: Improve compatibility
With this patch applied, the DemoRunner should build under MinGW, and be
(nearly) feature-complete compared to the MSVC build.

Specifically, when building with MinGW:
- Adds support for accessibility
- Fixes build issues in the juce_video module
- Fixes a link issue in the VST3 wrapper when VST3_CAN_REPLACE_VST2 is
  defined
- Adds support for the new-style native FileChooser
- Tidies up some other low-severity warnings

Known issues:
- Direct2D rendering is still not supported when building with MinGW due
  to ABI compatibilities.
2022-01-17 10:58:18 +00:00
reuk
6f80be1edb
VST3 Client: Ensure editor scale is correct immediately after creation
This fixes a bug where selecting "Always on top" in the plugin editor
window in Cubase 11 on Windows 11 on a display with > 100% scale would
cause the editor to display with the wrong scale factor.

It seems that Cubase calls removed() then attached() on the plugin view,
destroying and recreating the editor wrapper component. The editor
opened with 100% scale, but requests from the host to set the "real"
scale factor were ignored because the JUCE wrapper thought that the
requested scale had already been applied.

Applying the cached scale factor directly after constructing the editor
keeps everything in a consistent state, and seems to resolve the issue.
2021-11-24 16:20:36 +00:00
reuk
3850a2bb20
AudioPlayHead: Update wrappers to use new FrameRate type 2021-11-19 16:35:22 +00:00
reuk
4ca923a34b
NSViewComponentPeer: Allow mouse events to reach unfocused windows
This change allows mouse events (including enter and exit events) to
reach unfocused views on macOS. This matches the behaviour of unfocused
windows on Linux and Windows, where components paint in their "hovered"
states even when the application window is in the background.

As a byproduct of using tracking areas on macOS, we can remove the fake
mouse move generator.
2021-10-27 16:33:37 +01:00
reuk
4c2dba0822
VST3 Client: Ensure that all programs can be selected via parameter in hosts
Hosts such as REAPER normalise the program parameter value by dividing
the program value by the step count, rather than going via the
parameter's toNormalized function. To be compatible, we should use the
same scaling technique. At time of writing, the coversion process is
detailed under the heading "Conversion of normalized values" on this
page:

https://developer.steinberg.help/display/VST/Parameters+and+Automation
2021-10-26 16:52:15 +01:00
attila
63ac579c1b VST3 Client: Fix build when JUCE_VST3_CAN_REPLACE_VST2 is enabled 2021-10-14 18:56:18 +02:00
reuk
47dcc31e77
VST3 Client: Allow setting latency from inside prepareToPlay 2021-10-07 14:31:26 +01:00
reuk
294caba2b5
VST3: Add dirty-state set/get
Adds a mechanism to notify the host that the plugin state needs saving,
using updateHostDisplay.

Also allows JUCE hosts to detect when a plugin needs its state saving
via the AudioProcessorListener.
2021-10-06 16:59:07 +01:00
reuk
afa6465098
UB Sanitizer: Avoid warnings in third party code, with clang 2021-09-28 11:31:50 +01:00
reuk
d0615041f0
Plugin clients: Avoid notifying listeners when parameters have not changed 2021-09-28 11:31:49 +01:00
reuk
ea250b3655
VST3 Client: Change VST3 native menu so that its position is specified in logical pixels 2021-09-28 11:31:48 +01:00
reuk
cfec0b5356
GenericAudioProcessorEditor: Add support for grouped parameters 2021-09-27 15:44:48 +01:00