From 16c76215c5c614db9750163e1213bcd1eb3e93e7 Mon Sep 17 00:00:00 2001 From: glowcoil Date: Mon, 29 Apr 2024 12:05:24 -0500 Subject: [PATCH] remove Gesture API Expose begin/end_gesture and set_param directly via the Host struct. An RAII Gesture API can be built on top of it in the future. --- src/host.rs | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/host.rs b/src/host.rs index 8ee5278..7f3b5c0 100644 --- a/src/host.rs +++ b/src/host.rs @@ -18,29 +18,15 @@ impl Host { Host { inner } } - pub fn edit_param(&self, id: ParamId) -> Gesture { + pub fn begin_gesture(&self, id: ParamId) { self.inner.begin_gesture(id); - - Gesture { - inner: Arc::clone(&self.inner), - id, - } } -} - -pub struct Gesture { - inner: Arc, - id: ParamId, -} -impl Gesture { - pub fn set_value(&self, value: ParamValue) { - self.inner.set_param(self.id, value); + pub fn end_gesture(&self, id: ParamId) { + self.inner.end_gesture(id); } -} -impl Drop for Gesture { - fn drop(&mut self) { - self.inner.end_gesture(self.id); + pub fn set_param(&self, id: ParamId, value: ParamValue) { + self.inner.set_param(id, value); } }