Also add noexcept qualifications on the Wine side

See the last few commits.
This commit is contained in:
Robbert van der Helm
2021-05-14 18:27:19 +02:00
parent 37257298a1
commit a9643577fd
12 changed files with 118 additions and 100 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ HostBridge::HostBridge(MainContext& main_context,
parent_pid(parent_pid),
watchdog_guard(main_context.register_watchdog(*this)) {}
void HostBridge::handle_win32_events() {
HostBridge::~HostBridge() noexcept {}
void HostBridge::handle_win32_events() noexcept {
MSG msg;
for (int i = 0;
+3 -3
View File
@@ -37,7 +37,7 @@ class HostBridge {
pid_t parent_pid);
public:
virtual ~HostBridge(){};
virtual ~HostBridge() noexcept;
/**
* If a plugin instance returns `true` here, then the event loop should not
@@ -51,7 +51,7 @@ class HostBridge {
*
* @relates MainContext::async_handle_events
*/
virtual bool inhibits_event_loop() = 0;
virtual bool inhibits_event_loop() noexcept = 0;
/**
* Handle events until the plugin exits. The actual events are posted to
@@ -88,7 +88,7 @@ class HostBridge {
* because of incorrect assumptions made by the plugin. See the dostring for
* `Vst2Bridge::editor` for more information.
*/
void handle_win32_events();
void handle_win32_events() noexcept;
/**
* Used as part of the watchdog. This will check whether the remote host
+3 -3
View File
@@ -78,7 +78,7 @@ StdIoCapture::StdIoCapture(boost::asio::io_context& io_context,
pipe.assign(pipe_fd[0]);
}
StdIoCapture::~StdIoCapture() {
StdIoCapture::~StdIoCapture() noexcept {
// Restore the original file descriptor and close the pipe. The other wend
// was already closed in the constructor.
dup2(original_fd_copy, target_fd);
@@ -112,11 +112,11 @@ GroupBridge::GroupBridge(boost::filesystem::path group_socket_path)
});
}
GroupBridge::~GroupBridge() {
GroupBridge::~GroupBridge() noexcept {
stdio_context.stop();
}
bool GroupBridge::is_event_loop_inhibited() {
bool GroupBridge::is_event_loop_inhibited() noexcept {
std::lock_guard lock(active_plugins_mutex);
for (auto& [parameters, value] : active_plugins) {
+12 -6
View File
@@ -51,14 +51,17 @@ class StdIoCapture {
*/
StdIoCapture(boost::asio::io_context& io_context, int file_descriptor);
StdIoCapture(const StdIoCapture&) = delete;
StdIoCapture& operator=(const StdIoCapture&) = delete;
/**
* On cleanup, close the outgoing file descriptor from the pipe and restore
* the original file descriptor for the captured stream.
*/
~StdIoCapture();
~StdIoCapture() noexcept;
StdIoCapture(const StdIoCapture&) = delete;
StdIoCapture& operator=(const StdIoCapture&) = delete;
StdIoCapture(StdIoCapture&&) = delete;
StdIoCapture& operator=(StdIoCapture&&) = delete;
/**
* The pipe endpoint where all output from the original file descriptor gets
@@ -122,18 +125,21 @@ class GroupBridge {
*/
explicit GroupBridge(boost::filesystem::path group_socket_path);
~GroupBridge();
~GroupBridge() noexcept;
GroupBridge(const GroupBridge&) = delete;
GroupBridge& operator=(const GroupBridge&) = delete;
GroupBridge(const GroupBridge&&) = delete;
GroupBridge& operator=(GroupBridge&&) = delete;
/**
* If this returns `true`, then the group host's event loop should
* temporarily be disabled. This simply calls
* `HostBridge::inhibits_event_loop()` for all plugins hosted in this group
* process.
*/
bool is_event_loop_inhibited();
bool is_event_loop_inhibited() noexcept;
/**
* Run a plugin's dispatcher and message loop, processing all events on the
+4 -3
View File
@@ -316,7 +316,7 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
});
}
bool Vst2Bridge::inhibits_event_loop() {
bool Vst2Bridge::inhibits_event_loop() noexcept {
return !is_initialized;
}
@@ -420,7 +420,7 @@ void Vst2Bridge::run() {
});
}
void Vst2Bridge::handle_x11_events() {
void Vst2Bridge::handle_x11_events() noexcept {
if (editor) {
editor->handle_x11_events();
}
@@ -488,7 +488,8 @@ intptr_t Vst2Bridge::dispatch_wrapper(AEffect* plugin,
class HostCallbackDataConverter : DefaultDataConverter {
public:
HostCallbackDataConverter(AEffect* plugin, VstTimeInfo& last_time_info)
HostCallbackDataConverter(AEffect* plugin,
VstTimeInfo& last_time_info) noexcept
: plugin(plugin), last_time_info(last_time_info) {}
EventPayload read(const int opcode,
+2 -2
View File
@@ -58,7 +58,7 @@ class Vst2Bridge : public HostBridge {
std::string endpoint_base_dir,
pid_t parent_pid);
bool inhibits_event_loop() override;
bool inhibits_event_loop() noexcept override;
/**
* Here we'll handle incoming `dispatch()` messages until the sockets get
@@ -66,7 +66,7 @@ class Vst2Bridge : public HostBridge {
*/
void run() override;
void handle_x11_events() override;
void handle_x11_events() noexcept override;
protected:
void close_sockets() override;
+7 -7
View File
@@ -38,18 +38,18 @@ Steinberg::FUnknownPtr<Steinberg::IPluginBase> hack_init_plugin_base(
Steinberg::IPtr<Steinberg::FUnknown> object,
Steinberg::IPtr<Steinberg::Vst::IComponent> component);
InstancePlugView::InstancePlugView() {}
InstancePlugView::InstancePlugView() noexcept {}
InstancePlugView::InstancePlugView(
Steinberg::IPtr<Steinberg::IPlugView> plug_view)
Steinberg::IPtr<Steinberg::IPlugView> plug_view) noexcept
: plug_view(plug_view),
parameter_finder(plug_view),
plug_view_content_scale_support(plug_view) {}
InstanceInterfaces::InstanceInterfaces() {}
InstanceInterfaces::InstanceInterfaces() noexcept {}
InstanceInterfaces::InstanceInterfaces(
Steinberg::IPtr<Steinberg::FUnknown> object)
Steinberg::IPtr<Steinberg::FUnknown> object) noexcept
: object(object),
audio_presentation_latency(object),
audio_processor(object),
@@ -119,7 +119,7 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context,
main_context.update_timer_interval(config.event_loop_interval());
}
bool Vst3Bridge::inhibits_event_loop() {
bool Vst3Bridge::inhibits_event_loop() noexcept {
std::lock_guard lock(object_instances_mutex);
for (const auto& [instance_id, object] : object_instances) {
@@ -1121,7 +1121,7 @@ void Vst3Bridge::run() {
});
}
void Vst3Bridge::handle_x11_events() {
void Vst3Bridge::handle_x11_events() noexcept {
std::lock_guard lock(object_instances_mutex);
for (const auto& [instance_id, object] : object_instances) {
@@ -1154,7 +1154,7 @@ void Vst3Bridge::unregister_context_menu(size_t object_instance_id,
context_menu_id);
}
size_t Vst3Bridge::generate_instance_id() {
size_t Vst3Bridge::generate_instance_id() noexcept {
return current_instance_id.fetch_add(1);
}
+7 -7
View File
@@ -36,9 +36,9 @@ class Vst3ContextMenuProxyImpl;
* @relates InstanceInterfaces
*/
struct InstancePlugView {
InstancePlugView();
InstancePlugView() noexcept;
InstancePlugView(Steinberg::IPtr<Steinberg::IPlugView> plug_View);
InstancePlugView(Steinberg::IPtr<Steinberg::IPlugView> plug_View) noexcept;
Steinberg::IPtr<Steinberg::IPlugView> plug_view;
@@ -59,9 +59,9 @@ struct InstancePlugView {
* `IPluginBase::initialize()`.
*/
struct InstanceInterfaces {
InstanceInterfaces();
InstanceInterfaces() noexcept;
InstanceInterfaces(Steinberg::IPtr<Steinberg::FUnknown> object);
InstanceInterfaces(Steinberg::IPtr<Steinberg::FUnknown> object) noexcept;
/**
* A dedicated thread for handling incoming `IAudioProcessor` and
@@ -227,7 +227,7 @@ class Vst3Bridge : public HostBridge {
* `object_instances` that supports `IPluginBase` whether
* `IPluginBase::iniitalize()` has been called.
*/
bool inhibits_event_loop() override;
bool inhibits_event_loop() noexcept override;
/**
* Here we'll listen for and handle incoming control messages until the
@@ -235,7 +235,7 @@ class Vst3Bridge : public HostBridge {
*/
void run() override;
void handle_x11_events() override;
void handle_x11_events() noexcept override;
protected:
void close_sockets() override;
@@ -416,7 +416,7 @@ class Vst3Bridge : public HostBridge {
* is used to be able to refer to specific instances created for
* `IPluginFactory::createInstance()`.
*/
size_t generate_instance_id();
size_t generate_instance_id() noexcept;
/**
* Assign a unique identifier to an object and add it to `object_instances`.