From 12075b1a24c57c771ff23dce77cf98172a215ac7 Mon Sep 17 00:00:00 2001
From: Robbert van der Helm <mail@robbertvanderhelm.nl>
Date: Mon, 28 Feb 2022 20:25:49 +0100
Subject: [PATCH] Rename main CLAP plugin wrapper struct to Wrapper

---
 src/wrapper/clap/context.rs |  4 ++--
 src/wrapper/clap/factory.rs |  4 ++--
 src/wrapper/clap/plugin.rs  | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/wrapper/clap/context.rs b/src/wrapper/clap/context.rs
index f9f863d2..132d7c51 100644
--- a/src/wrapper/clap/context.rs
+++ b/src/wrapper/clap/context.rs
@@ -2,7 +2,7 @@ use parking_lot::RwLockWriteGuard;
 use std::collections::VecDeque;
 use std::sync::atomic::Ordering;
 
-use super::plugin::{Plugin, Task};
+use super::plugin::{Task, Wrapper};
 use crate::context::ProcessContext;
 use crate::event_loop::EventLoop;
 use crate::plugin::{ClapPlugin, NoteEvent};
@@ -11,7 +11,7 @@ use crate::plugin::{ClapPlugin, NoteEvent};
 /// to lock guards for event queues. Otherwise reading these events would require constant
 /// unnecessary atomic operations to lock the uncontested RwLocks.
 pub(crate) struct WrapperProcessContext<'a, P: ClapPlugin> {
-    pub(super) plugin: &'a Plugin<P>,
+    pub(super) plugin: &'a Wrapper<P>,
     pub(super) input_events_guard: RwLockWriteGuard<'a, VecDeque<NoteEvent>>,
 }
 
diff --git a/src/wrapper/clap/factory.rs b/src/wrapper/clap/factory.rs
index fc3e3656..e44f989a 100644
--- a/src/wrapper/clap/factory.rs
+++ b/src/wrapper/clap/factory.rs
@@ -6,7 +6,7 @@ use std::os::raw::c_char;
 use std::ptr;
 
 use super::descriptor::PluginDescriptor;
-use super::plugin::Plugin;
+use super::plugin::Wrapper;
 use crate::ClapPlugin;
 
 /// The plugin's factory. Initialized using a lazy_static from the entry poiunt's `get_factory()`
@@ -60,7 +60,7 @@ impl<P: ClapPlugin> Factory<P> {
 
         if !plugin_id.is_null() && CStr::from_ptr(plugin_id) == factory.plugin_descriptor.clap_id()
         {
-            &Box::leak(Box::new(Plugin::<P>::new(host))).clap_plugin
+            &Box::leak(Box::new(Wrapper::<P>::new(host))).clap_plugin
         } else {
             ptr::null()
         }
diff --git a/src/wrapper/clap/plugin.rs b/src/wrapper/clap/plugin.rs
index f0042e37..a6f63795 100644
--- a/src/wrapper/clap/plugin.rs
+++ b/src/wrapper/clap/plugin.rs
@@ -1,6 +1,6 @@
 use clap_sys::host::clap_host;
 use clap_sys::plugin::clap_plugin;
-use clap_sys::process::{clap_process, clap_process_status};
+use clap_sys::process::{clap_process, clap_process_status, CLAP_PROCESS_CONTINUE};
 use crossbeam::atomic::AtomicCell;
 use crossbeam::queue::ArrayQueue;
 use parking_lot::RwLock;
@@ -18,7 +18,7 @@ use crate::plugin::{BufferConfig, BusConfig, ClapPlugin};
 use crate::NoteEvent;
 
 #[repr(C)]
-pub struct Plugin<P: ClapPlugin> {
+pub struct Wrapper<P: ClapPlugin> {
     // Keep the vtable as the first field so we can do a simple pointer cast
     pub clap_plugin: clap_plugin,
 
@@ -75,7 +75,7 @@ pub enum Task {
 
 /// Because CLAP has this [clap_host::request_host_callback()] function, we don't need to use
 /// `OsEventLoop` and can instead just request a main thread callback directly.
-impl<P: ClapPlugin> EventLoop<Task, Plugin<P>> for Plugin<P> {
+impl<P: ClapPlugin> EventLoop<Task, Wrapper<P>> for Wrapper<P> {
     fn new_and_spawn(_executor: std::sync::Weak<Self>) -> Self {
         panic!("What are you doing");
     }
@@ -102,7 +102,7 @@ impl<P: ClapPlugin> EventLoop<Task, Plugin<P>> for Plugin<P> {
     }
 }
 
-impl<P: ClapPlugin> MainThreadExecutor<Task> for Plugin<P> {
+impl<P: ClapPlugin> MainThreadExecutor<Task> for Wrapper<P> {
     unsafe fn execute(&self, task: Task) {
         todo!("Implement latency changes for CLAP")
     }
@@ -111,7 +111,7 @@ impl<P: ClapPlugin> MainThreadExecutor<Task> for Plugin<P> {
 unsafe impl Send for HostCallback {}
 unsafe impl Sync for HostCallback {}
 
-impl<P: ClapPlugin> Plugin<P> {
+impl<P: ClapPlugin> Wrapper<P> {
     pub fn new(host_callback: *const clap_host) -> Self {
         let plugin_descriptor = Box::new(PluginDescriptor::default());