pub struct EditorContext {
pub begin_edit: Arc<dyn Fn(u32) + Send + Sync>,
pub set_param: Arc<dyn Fn(u32, f64) + Send + Sync>,
pub end_edit: Arc<dyn Fn(u32) + Send + Sync>,
pub request_resize: Arc<dyn Fn(u32, u32) -> bool + Send + Sync>,
pub get_param: Arc<dyn Fn(u32) -> f64 + Send + Sync>,
pub get_param_plain: Arc<dyn Fn(u32) -> f64 + Send + Sync>,
pub format_param: Arc<dyn Fn(u32) -> String + Send + Sync>,
pub get_meter: Arc<dyn Fn(u32) -> f32 + Send + Sync>,
}Expand description
Context passed to Editor::open(). Provides communication with the host and parameter store.
All fields are Arc-wrapped, so cloning is cheap (reference count bump).
Fields§
§begin_edit: Arc<dyn Fn(u32) + Send + Sync>§set_param: Arc<dyn Fn(u32, f64) + Send + Sync>§end_edit: Arc<dyn Fn(u32) + Send + Sync>§request_resize: Arc<dyn Fn(u32, u32) -> bool + Send + Sync>§get_param: Arc<dyn Fn(u32) -> f64 + Send + Sync>Read a parameter’s normalized value from the plugin (for host→GUI sync).
get_param_plain: Arc<dyn Fn(u32) -> f64 + Send + Sync>Read a parameter’s plain value from the plugin.
format_param: Arc<dyn Fn(u32) -> String + Send + Sync>Format a parameter’s current value as a display string.
get_meter: Arc<dyn Fn(u32) -> f32 + Send + Sync>Read a meter value (0.0–1.0) by meter ID. Used for level meters. Returns 0.0 if the meter ID doesn’t exist.
Trait Implementations§
Source§impl Clone for EditorContext
impl Clone for EditorContext
Source§fn clone(&self) -> EditorContext
fn clone(&self) -> EditorContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EditorContext
impl !RefUnwindSafe for EditorContext
impl Send for EditorContext
impl Sync for EditorContext
impl Unpin for EditorContext
impl UnsafeUnpin for EditorContext
impl !UnwindSafe for EditorContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more