Skip to main content

IcedEditor

Struct IcedEditor 

Source
pub struct IcedEditor<P, M>
where P: Params + 'static, M: IcedPlugin<P>,
{ /* private fields */ }
Expand description

Iced-based plugin editor.

Type parameters:

  • P - the plugin’s Params type
  • M - the plugin’s IcedPlugin implementation

Implementations§

Source§

impl<P: Params + 'static> IcedEditor<P, AutoPlugin>

Source

pub fn from_layout(params: Arc<P>, layout: GridLayout) -> Self

Create an editor that auto-generates the UI from a GridLayout.

Source§

impl<P: Params + 'static, M: IcedPlugin<P> + 'static> IcedEditor<P, M>

Source

pub fn new(params: Arc<P>, size: (u32, u32)) -> Self

Create an editor with a custom IcedPlugin implementation.

Source

pub fn with_font(self, family: &'static str, data: &'static [u8]) -> Self

Set a custom default font (family name + TrueType data).

IcedEditor::new(params, (250, 330))
    .with_font("JetBrains Mono", truce_gui::font::JETBRAINS_MONO)
Source

pub fn with_meter_ids(self, ids: Vec<impl Into<u32>>) -> Self

Set meter IDs to poll each tick.

Trait Implementations§

Source§

impl<P: Params + 'static, M: IcedPlugin<P> + 'static> Drop for IcedEditor<P, M>

Source§

fn drop(&mut self)

Defensive cleanup for hosts that drop the editor without first calling Editor::close. Pro Tools AAX has been seen to do this on plugin removal under certain conditions; live-coding hosts and unit tests can also short-circuit the lifecycle. On Linux baseview::WindowHandle has no Drop, so without an explicit close the render thread would keep running against a freed *mut IcedEditor and later panic inside wgpu as surfaces tear down. close() is idempotent - baseview_window.take() no-ops on the second call - so calling it here on top of a well-behaved host’s earlier close() is safe.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<P: Params + 'static, M: IcedPlugin<P>> Editor for IcedEditor<P, M>

Source§

fn size(&self) -> (u32, u32)

Initial window size in logical points. Read more
Source§

fn open(&mut self, parent: RawWindowHandle, context: PluginContext)

Create the GUI as a child of the host-provided parent window.
Source§

fn close(&mut self)

Destroy the GUI.
Source§

fn idle(&mut self)

Called ~60fps on the host’s UI thread for repaint/animation.
Source§

fn can_resize(&self) -> bool

Whether the plugin supports resizing.
Source§

fn screenshot( &mut self, _params: Arc<dyn Params>, ) -> Option<(Vec<u8>, u32, u32)>

Render a headless screenshot of the editor at its natural size. Read more
Source§

fn set_size(&mut self, width: u32, height: u32) -> bool

Host requests a resize. Return true to accept.
Source§

fn set_scale_factor(&mut self, factor: f64)

Host notifies the editor of a new content scale factor. Read more
Source§

fn state_changed(&mut self)

Plugin state was restored (preset recall, undo, session load). Read more
Source§

impl<P: Params, M: IcedPlugin<P>> Send for IcedEditor<P, M>

Auto Trait Implementations§

§

impl<P, M> !Freeze for IcedEditor<P, M>

§

impl<P, M> !RefUnwindSafe for IcedEditor<P, M>

§

impl<P, M> !Sync for IcedEditor<P, M>

§

impl<P, M> Unpin for IcedEditor<P, M>
where M: Unpin,

§

impl<P, M> UnsafeUnpin for IcedEditor<P, M>
where M: UnsafeUnpin,

§

impl<P, M> !UnwindSafe for IcedEditor<P, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<State, Message> IntoBoot<State, Message> for State

Source§

fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some Application.
Source§

impl<E> IntoEditor for E
where E: Editor + 'static,

Source§

fn into_editor(self) -> Box<dyn Editor>

Box this editor into a Box<dyn Editor>.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> MaybeClone for T

Source§

impl<T> MaybeDebug for T

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSend for T
where T: Send,