Commit Graph

80 Commits

Author SHA1 Message Date
Robin Gareus
cb0b152b35 VST3: Fix MSVC related crashes
Do not simply allocate std::vector<> space but also initialize
elements. The data is later accessed as C-pointer array: &var[0].
With most compilers simply reserving space in the vector is
sufficient in order to later access the elements directly.
However actually placing objects in the vector before referencing
them is more correct.
2021-03-02 19:05:58 +01:00
Robin Gareus
3722b8a94f VST3: work around plugins with missing controller state
If a plugin implements Vst::IComponent::set_state() but
does not implement Vst::IEditController::setComponentState()
nor dedicated get/setState interface for the IEditController,
querying the parameters using Vst::IEditController::getParamNormalized()
returns values that do reflect the restored state.

In this case the host needs to save/restore all control-parameters,
and ignore values reported by ::getParamNormalized().

This fixes a state save/restore issue with softube.vst3, however
vstpresets are still broken: the GUI (IComponent) is updated,
however the controller isn't.
2021-03-02 03:22:25 +01:00
Robin Gareus
4a9a4bf3de VST3: pre-allocate AudioBusBuffers
This also reverts 768d8362cd since it causes crashes
with various plugins (eg. surge.vst3).

Ardour now provides AudioBusBuffers for all audio I/O busses,
regardless of Ardour using those busses.

This fixes crashes of plugins that ignore ProcessData::numInputs
or ProcessData::numOutputs. Those plugins are expected to check
numChannels and channelBuffers for those excess channels, which are
0, NULL for unused busses.

ProcessData numInputs, numOutputs does correctly reflect actual
busses that are in-use (at most one main and one aux for each direction).
2020-12-30 21:25:03 +01:00
Robin Gareus
768d8362cd VST3: Amend 15864be609 set numI/O correctly 2020-12-30 18:52:16 +01:00
Robin Gareus
15864be609 VST3: always pass buffers for all audio busses
This should fix an issue with yabridge and MCompressor.
The plugin has two kMain inputs and expects ProcessData:inputs
to always have two entries, even if the second bus is explicitly
disabled.

see https://hastebin.com/ekewojiqep.txt
```
IComponent::activateBus(type = 0, dir = 0, index = 1, state = false)
data.numInputs = 1;
```

TODO: optimize (pre-allocate) if it works as expected
2020-12-30 18:10:17 +01:00
Robin Gareus
62ac7c6a80 VST3: Announce IPlugFrame interface support 2020-12-30 14:36:26 +01:00
Robin Gareus
34769a9062 NO-OP: whitespace 2020-12-03 22:10:26 +01:00
Robin Gareus
b79520d316 VST3: Use a proxy for connecting and passing messages #8481
This separates channels in each direction component <> controller,
preventing recursions.
2020-12-03 02:48:20 +01:00
Robin Gareus
3a74c5e602 VST3: add more debug messages 2020-11-25 02:20:37 +01:00
Robin Gareus
5e853d0977 VST3: fix plugin bus configuration
This fixes crashes when configuring some plugins that have more
input busses than output busses. e.g. TDR Nova.
2020-11-25 02:18:22 +01:00
Robin Gareus
a1f40979bd VST3: fix failed c'tor case
~VST3PI() may call terminate() w/o a VST3 component.
2020-11-20 19:48:39 +01:00
Robin Gareus
7558c1316e VST3: inform plugins about last bar 2020-11-20 02:07:49 +01:00
luna
8f00826803 Make sure VST3 projectTimeMusic is updated 2020-11-20 01:43:21 +01:00
Robin Gareus
ff51e315e3 VST3: fix kMaxSendLevel, on Mixbus 15dB gain can be added 2020-11-17 14:54:31 +01:00
Robin Gareus
5fd2d6cc81 VST3: add debug message for preset/state restore 2020-11-17 02:44:11 +01:00
Robin Gareus
4a8e9f28f3 VST3: unconditionally set controller's component state
This synchronizes component and controller when loading presets
like the VST3 SDK does.
2020-11-17 00:56:54 +01:00
Robin Gareus
b8b232cfab VST3: query latency when plugin is activated regardless of Vst::kLatencyChanged 2020-11-02 01:58:05 +01:00
Robin Gareus
35414fcef0 VST3: yet another attempt at state-retore #8460 2020-11-02 01:46:08 +01:00
Robin Gareus
66c19647df NO-OP: fix typos 2020-11-01 12:25:22 +01:00
Robin Gareus
b119758161 fix debug messages in prev commit 2020-10-25 20:31:50 +01:00
Robin Gareus
da1782d56e VST3: Keep preset in sync with plugin GUI
When a user loads a preset using the plugin's own GUI, update
Ardour's preset dropdown.
2020-10-25 19:50:22 +01:00
Robin Gareus
f3fbb96d6a Fix VST3 PSL channel-index order
While Ardour uses separate indices when naming tracks and busses
("track 1", "track 2", "bus 1", "bus 2"), the indices are contiguous
(0: "track 1", 1: "track 2", 2: "bus 1", 3: "bus 2").
2020-10-22 01:37:40 +02:00
Robin Gareus
a266a2d5b9 Use session API to set solo
This is required so that ::update_route_solo_state() is called
to propagate solo/mute state
2020-10-18 15:28:10 +02:00
Robin Gareus
9b382fe1c5 VST3: use CoreSelection API
This implements bc78629788 properly, without relying
on libardour_cp static methods.
2020-10-18 14:36:09 +02:00
Robin Gareus
e6fe0e8cca Prepare for static CP API removal 2/2
This partially reverts bc78629788
2020-10-18 14:28:45 +02:00
Robin Gareus
bc78629788 VST3: add support to focus/select tracks 2020-10-16 17:17:00 +02:00
Robin Gareus
3b7b6a720d VST3: remove redundant query interface 2020-10-15 21:46:45 +02:00
Robin Gareus
09a4dcee68 VST3: fix controller state restore
This partially reverts 9e7cfdd880, VST3 host-checker
uses complete state for the controller.
2020-10-15 20:45:26 +02:00
Robin Gareus
3271a96100 VST3: allow to debug TUID support 2020-10-15 20:40:35 +02:00
Robin Gareus
9ddd83d829 VST3: cont't work on PSL extensions
* fix notification strings
* optional mute/solo controls (master bus)
2020-10-13 20:20:23 +02:00
Robin Gareus
6baecca57b VST3: debug PSL callbacks 2020-10-13 15:56:32 +02:00
Robin Gareus
c5618f01d6 VST3: only expose Mixbus sends via PSL extensions 2020-10-13 03:49:19 +02:00
Robin Gareus
4b3b13457e Fix typo in previous commit 2020-10-13 01:37:37 +02:00
Robin Gareus
0fac4843db VST3: tweak PSL extensions 2020-10-13 01:30:48 +02:00
Robin Gareus
48e4855304 VST3: do not show bypass control inline 2020-10-13 01:25:58 +02:00
Robin Gareus
63ad43dbd9 VST3: update callback debug messages 2020-10-13 01:25:43 +02:00
Robin Gareus
3caf0ac5da VST3: use either info-handler or info-listener, not both 2020-10-13 01:24:05 +02:00
Robin Gareus
0400ae2047 Fix VST3 debug message
get_info() is not yet available during Plugin::init().
set_info() is only called after from VST3PluginInfo::load() after
the plugin was instantiated.
2020-10-12 19:06:30 +02:00
Robin Gareus
c2125eedc6 VST3: add debug messages 2020-10-09 22:18:05 +02:00
Robin Gareus
b8157580c6 VST3: fix PSL callback subscription 2020-10-09 21:48:52 +02:00
Robin Gareus
9e7cfdd880 VST3: use read-only substream to restore state 2020-10-09 20:58:43 +02:00
Robin Gareus
0edd0c2abc Do not bind pure virtual functions, use indirection
This fixes Windows/MSVC builds, where linking fails due
to binding a pure virtual function.
2020-10-09 18:23:53 +02:00
Robin Gareus
734a31accf VST3: announce support for implemeted features 2020-10-09 17:45:15 +02:00
Robin Gareus
e8c6d20b18 Factor out namespace 2020-10-09 14:13:07 +02:00
Robin Gareus
85acfb0842 Use explicit cast to bool 2020-10-09 14:12:58 +02:00
Robin Gareus
37475308ee VST3: store all input controls (not only automatable ones) 2020-10-09 14:12:52 +02:00
Robin Gareus
64391334a4 NO-OP: Remove unused API implementation 2020-10-09 02:06:50 +02:00
Robin Gareus
e4bbb1bc81 VST3: Implement ContextInfo (console) extension 2020-10-08 15:36:36 +02:00
Robin Gareus
65c433dce2 VST3: Implement PSI extensions
* Register classes
* Implement automation-state notification
* Implenent parameter slave
2020-10-08 15:36:35 +02:00
Robin Gareus
9746a63625 VST3: implement ChannelContext::IInfoListener 2020-10-08 15:36:35 +02:00