Noexcept qualify the VST3 proxy implementations

For the same reasons mentioned in the last commit.
This commit is contained in:
Robbert van der Helm
2021-05-14 17:30:05 +02:00
parent 59ba2aeb5f
commit 8ba6e4a937
18 changed files with 37 additions and 27 deletions
@@ -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();
+3 -3
View File
@@ -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
@@ -22,7 +22,7 @@
Vst3ComponentHandlerProxyImpl::Vst3ComponentHandlerProxyImpl(
Vst3Bridge& bridge,
Vst3ComponentHandlerProxy::ConstructArgs&& args)
Vst3ComponentHandlerProxy::ConstructArgs&& args) noexcept
: Vst3ComponentHandlerProxy(std::move(args)), bridge(bridge) {
// The lifecycle of this object is managed together with that of the plugin
// object instance this host context got passed to
@@ -22,7 +22,7 @@ class Vst3ComponentHandlerProxyImpl : public Vst3ComponentHandlerProxy {
public:
Vst3ComponentHandlerProxyImpl(
Vst3Bridge& bridge,
Vst3ComponentHandlerProxy::ConstructArgs&& args);
Vst3ComponentHandlerProxy::ConstructArgs&& args) noexcept;
/**
* We'll override the query interface to log queries for interfaces we do
@@ -20,7 +20,7 @@
Vst3ConnectionPointProxyImpl::Vst3ConnectionPointProxyImpl(
Vst3Bridge& bridge,
Vst3ConnectionPointProxy::ConstructArgs&& args)
Vst3ConnectionPointProxy::ConstructArgs&& args) noexcept
: Vst3ConnectionPointProxy(std::move(args)), bridge(bridge) {}
tresult PLUGIN_API
@@ -22,7 +22,7 @@ class Vst3ConnectionPointProxyImpl : public Vst3ConnectionPointProxy {
public:
Vst3ConnectionPointProxyImpl(
Vst3Bridge& bridge,
Vst3ConnectionPointProxy::ConstructArgs&& args);
Vst3ConnectionPointProxy::ConstructArgs&& args) noexcept;
/**
* We'll override the query interface to log queries for interfaces we do
@@ -20,14 +20,17 @@
Vst3ContextMenuProxyImpl::Vst3ContextMenuProxyImpl(
Vst3Bridge& bridge,
Vst3ContextMenuProxy::ConstructArgs&& args)
Vst3ContextMenuProxy::ConstructArgs&& args) noexcept
: Vst3ContextMenuProxy(std::move(args)), bridge(bridge) {
bridge.register_context_menu(*this);
}
Vst3ContextMenuProxyImpl::~Vst3ContextMenuProxyImpl() {
Vst3ContextMenuProxyImpl::~Vst3ContextMenuProxyImpl() noexcept {
// Also drop the context menu smart pointer on plugin 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.
bridge.send_message(
Vst3ContextMenuProxy::Destruct{.owner_instance_id = owner_instance_id(),
.context_menu_id = context_menu_id()});
@@ -20,14 +20,15 @@
class Vst3ContextMenuProxyImpl : public Vst3ContextMenuProxy {
public:
Vst3ContextMenuProxyImpl(Vst3Bridge& bridge,
Vst3ContextMenuProxy::ConstructArgs&& args);
Vst3ContextMenuProxyImpl(
Vst3Bridge& bridge,
Vst3ContextMenuProxy::ConstructArgs&& args) noexcept;
/**
* When the reference count reaches zero and this destructor is called,
* we'll send a request to plugin to destroy the corresponding object.
*/
~Vst3ContextMenuProxyImpl();
~Vst3ContextMenuProxyImpl() noexcept override;
/**
* We'll override the query interface to log queries for interfaces we do
@@ -23,7 +23,7 @@
Vst3HostContextProxyImpl::Vst3HostContextProxyImpl(
Vst3Bridge& bridge,
Vst3HostContextProxy::ConstructArgs&& args)
Vst3HostContextProxy::ConstructArgs&& args) noexcept
: Vst3HostContextProxy(std::move(args)), bridge(bridge) {
// The lifecycle of this object is managed together with that of the plugin
// object instance this host context got passed to
@@ -21,7 +21,7 @@
class Vst3HostContextProxyImpl : public Vst3HostContextProxy {
public:
Vst3HostContextProxyImpl(Vst3Bridge& bridge,
Vst3HostContextProxy::ConstructArgs&& args);
Vst3HostContextProxy::ConstructArgs&& args) noexcept;
/**
* We'll override the query interface to log queries for interfaces we do
@@ -20,7 +20,7 @@
Vst3PlugFrameProxyImpl::Vst3PlugFrameProxyImpl(
Vst3Bridge& bridge,
Vst3PlugFrameProxy::ConstructArgs&& args)
Vst3PlugFrameProxy::ConstructArgs&& args) noexcept
: Vst3PlugFrameProxy(std::move(args)), bridge(bridge) {
// The lifecycle of this object is managed together with that of the plugin
// object instance this host context got passed to
@@ -21,7 +21,7 @@
class Vst3PlugFrameProxyImpl : public Vst3PlugFrameProxy {
public:
Vst3PlugFrameProxyImpl(Vst3Bridge& bridge,
Vst3PlugFrameProxy::ConstructArgs&& args);
Vst3PlugFrameProxy::ConstructArgs&& args) noexcept;
/**
* We'll override the query interface to log queries for interfaces we do