mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Noexcept qualify the VST3 proxy implementations
For the same reasons mentioned in the last commit.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
#include "context-menu-target.h"
|
||||
|
||||
YaContextMenuTargetImpl::YaContextMenuTargetImpl(Vst3PluginBridge& bridge,
|
||||
const ConstructArgs&& args)
|
||||
const ConstructArgs&& args) noexcept
|
||||
: YaContextMenuTarget(std::move(args)), bridge(bridge) {}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
class YaContextMenuTargetImpl : public YaContextMenuTarget {
|
||||
public:
|
||||
YaContextMenuTargetImpl(Vst3PluginBridge& bridge,
|
||||
const ConstructArgs&& args);
|
||||
const ConstructArgs&& args) noexcept;
|
||||
|
||||
/**
|
||||
* We'll override the query interface to log queries for interfaces we do
|
||||
|
||||
@@ -86,16 +86,19 @@ RunLoopTasks::onFDIsSet(Steinberg::Linux::FileDescriptor /*fd*/) {
|
||||
Vst3PlugViewProxyImpl::Vst3PlugViewProxyImpl(
|
||||
Vst3PluginBridge& bridge,
|
||||
std::atomic_bool& is_active,
|
||||
Vst3PlugViewProxy::ConstructArgs&& args)
|
||||
Vst3PlugViewProxy::ConstructArgs&& args) noexcept
|
||||
: Vst3PlugViewProxy(std::move(args)), bridge(bridge), is_active(is_active) {
|
||||
is_active = true;
|
||||
}
|
||||
|
||||
Vst3PlugViewProxyImpl::~Vst3PlugViewProxyImpl() {
|
||||
Vst3PlugViewProxyImpl::~Vst3PlugViewProxyImpl() noexcept {
|
||||
is_active = false;
|
||||
|
||||
// Also drop the plug view smart pointer on the Wine side when this gets
|
||||
// dropped
|
||||
// NOTE: This can actually throw (e.g. out of memory or the socket got
|
||||
// closed). But if that were to happen, then we wouldn't be able to
|
||||
// recover from it anyways.
|
||||
send_mutually_recursive_message(
|
||||
Vst3PlugViewProxy::Destruct{.owner_instance_id = owner_instance_id()});
|
||||
}
|
||||
|
||||
@@ -107,14 +107,14 @@ class Vst3PlugViewProxyImpl : public Vst3PlugViewProxy {
|
||||
public:
|
||||
Vst3PlugViewProxyImpl(Vst3PluginBridge& bridge,
|
||||
std::atomic_bool& is_active,
|
||||
Vst3PlugViewProxy::ConstructArgs&& args);
|
||||
Vst3PlugViewProxy::ConstructArgs&& args) noexcept;
|
||||
|
||||
/**
|
||||
* When the reference count reaches zero and this destructor is called,
|
||||
* we'll send a request to the Wine plugin host to destroy the corresponding
|
||||
* object.
|
||||
*/
|
||||
~Vst3PlugViewProxyImpl();
|
||||
~Vst3PlugViewProxyImpl() noexcept override;
|
||||
|
||||
/**
|
||||
* We'll override the query interface to log queries for interfaces we do
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
Vst3PluginFactoryProxyImpl::Vst3PluginFactoryProxyImpl(
|
||||
Vst3PluginBridge& bridge,
|
||||
Vst3PluginFactoryProxy::ConstructArgs&& args)
|
||||
Vst3PluginFactoryProxy::ConstructArgs&& args) noexcept
|
||||
: Vst3PluginFactoryProxy(std::move(args)), bridge(bridge) {}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -25,7 +25,7 @@ class Vst3PluginBridge;
|
||||
class Vst3PluginFactoryProxyImpl : public Vst3PluginFactoryProxy {
|
||||
public:
|
||||
Vst3PluginFactoryProxyImpl(Vst3PluginBridge& bridge,
|
||||
Vst3PluginFactoryProxy::ConstructArgs&& args);
|
||||
Vst3PluginFactoryProxy::ConstructArgs&& args) noexcept;
|
||||
|
||||
/**
|
||||
* We'll override the query interface to log queries for interfaces we do
|
||||
|
||||
@@ -45,7 +45,10 @@ Vst3PluginProxyImpl::Vst3PluginProxyImpl(Vst3PluginBridge& bridge,
|
||||
bridge.register_plugin_proxy(*this);
|
||||
}
|
||||
|
||||
Vst3PluginProxyImpl::~Vst3PluginProxyImpl() {
|
||||
Vst3PluginProxyImpl::~Vst3PluginProxyImpl() noexcept {
|
||||
// NOTE: This can actually throw (e.g. out of memory or the socket got
|
||||
// closed). But if that were to happen, then we wouldn't be able to
|
||||
// recover from it anyways.
|
||||
bridge.send_message(
|
||||
Vst3PluginProxy::Destruct{.instance_id = instance_id()});
|
||||
bridge.unregister_plugin_proxy(*this);
|
||||
@@ -80,7 +83,7 @@ bool Vst3PluginProxyImpl::unregister_context_menu(size_t context_menu_id) {
|
||||
return context_menus.erase(context_menu_id);
|
||||
}
|
||||
|
||||
void Vst3PluginProxyImpl::clear_caches() {
|
||||
void Vst3PluginProxyImpl::clear_caches() noexcept {
|
||||
clear_bus_cache();
|
||||
|
||||
std::lock_guard lock(function_result_cache_mutex);
|
||||
@@ -1325,7 +1328,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getXmlRepresentationStream(
|
||||
}
|
||||
}
|
||||
|
||||
void Vst3PluginProxyImpl::clear_bus_cache() {
|
||||
void Vst3PluginProxyImpl::clear_bus_cache() noexcept {
|
||||
std::lock_guard lock(processing_bus_cache_mutex);
|
||||
if (processing_bus_cache) {
|
||||
processing_bus_cache.emplace();
|
||||
|
||||
@@ -36,7 +36,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
|
||||
* we'll send a request to the Wine plugin host to destroy the corresponding
|
||||
* object.
|
||||
*/
|
||||
~Vst3PluginProxyImpl();
|
||||
~Vst3PluginProxyImpl() noexcept override;
|
||||
|
||||
/**
|
||||
* We'll override the query interface to log queries for interfaces we do
|
||||
@@ -72,7 +72,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
|
||||
* @see clear_bus_cache
|
||||
* @see function_result_cache
|
||||
*/
|
||||
void clear_caches();
|
||||
void clear_caches() noexcept;
|
||||
|
||||
// From `IAudioPresentationLatency`
|
||||
tresult PLUGIN_API
|
||||
@@ -415,7 +415,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
|
||||
*
|
||||
* @see processing_bus_cache
|
||||
*/
|
||||
void clear_bus_cache();
|
||||
void clear_bus_cache() noexcept;
|
||||
|
||||
/**
|
||||
* If we have an active `IPlugView` instance, try to use the mutual
|
||||
|
||||
Reference in New Issue
Block a user