MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::core::IEditor Struct Referenceabstract

Interface for the plugin's gui functionality. More...

#include <mostlyharmless_IEditor.h>

Inheritance diagram for mostly_harmless::core::IEditor:
mostly_harmless::gui::WebviewBase mostly_harmless::gui::WebviewEditor

Public Member Functions

virtual ~IEditor () noexcept=default
 
virtual void initialise ()=0
 
virtual void destroy ()=0
 
virtual bool allowResize () const noexcept=0
 
virtual void setSize (std::uint32_t width, std::uint32_t height)=0
 
virtual void onResizeRequested (std::uint32_t *newWidth, std::uint32_t *newHeight)=0
 
virtual void getSize (std::uint32_t *width, std::uint32_t *height)=0
 
virtual void setParent (void *parentHandle)=0
 
virtual void show ()=0
 
virtual void hide ()=0
 
virtual void onParamEvent (events::ProcToGuiParamEvent event)=0
 

Detailed Description

Interface for the plugin's gui functionality.

As detailed in the FX Plugin tutorial, users can optionally implement this (or descendents), and must implement ISharedState, IEngine and IPluginEntry, and register their subclasses with the framework to create an audio plugin. These will also be created if using the provided create.py script.

This interface serves as the the barebones gui hooks for implementing a framework of your choosing with the framework, and doesn't provide any functionality out of the box. If you'd like to use a webview gui, take a look at WebviewEditor or WebviewBase instead.

Constructor & Destructor Documentation

◆ ~IEditor()

virtual mostly_harmless::core::IEditor::~IEditor ( )
virtualdefaultnoexcept

Virtual destructor.

Member Function Documentation

◆ allowResize()

virtual bool mostly_harmless::core::IEditor::allowResize ( ) const
nodiscardpure virtualnoexcept

Return true here if you want your gui to be resizable, otherwise return false.

Returns
Whether or not the gui is allowed to be resized.

Implemented in mostly_harmless::gui::WebviewBase, and mostly_harmless::gui::WebviewEditor.

◆ destroy()

virtual void mostly_harmless::core::IEditor::destroy ( )
pure virtual

Called when the editor is closed.

Implemented in mostly_harmless::gui::WebviewBase.

◆ getSize()

virtual void mostly_harmless::core::IEditor::getSize ( std::uint32_t * width,
std::uint32_t * height )
pure virtual

Queries the editor about the size of its window. Initially, the parent window's size depends entirely on this call.

Parameters
widthA pointer to the width, to set.
heightA pointer to the height, to set.

Implemented in mostly_harmless::gui::WebviewBase.

◆ hide()

virtual void mostly_harmless::core::IEditor::hide ( )
pure virtual

Called when the editor should hide.

Implemented in mostly_harmless::gui::WebviewBase.

◆ initialise()

virtual void mostly_harmless::core::IEditor::initialise ( )
pure virtual

Called immediately after the gui has been created - use this to perform any post-creation initialisation.

Implemented in mostly_harmless::gui::WebviewBase, and mostly_harmless::gui::WebviewEditor.

◆ onParamEvent()

virtual void mostly_harmless::core::IEditor::onParamEvent ( events::ProcToGuiParamEvent event)
pure virtual

Called via the internal gui dispatch thread when a new parameter event is sent by the host - use this hook to sync the changes with the gui!

Implemented in mostly_harmless::gui::WebviewBase, and mostly_harmless::gui::WebviewEditor.

◆ onResizeRequested()

virtual void mostly_harmless::core::IEditor::onResizeRequested ( std::uint32_t * newWidth,
std::uint32_t * newHeight )
pure virtual

Called when the host tries to adjust the editor's size, and allows the user to add extra constraints to the requested bounds. Calls to this will be followed by a subsequent call to setSize, using the values stored in the newWidth and newHeight parameters.

Parameters
newWidthA pointer containing the new requested width. Can be mutated by your implementation, to clamp the size to a certain max or aspect ratio, for example.
newHeightA pointer containing the new requested height. Can be mutated by your implementation, to clamp the size to a certain max or aspect ratio, for example.

Implemented in mostly_harmless::gui::WebviewBase, and mostly_harmless::gui::WebviewEditor.

◆ setParent()

virtual void mostly_harmless::core::IEditor::setParent ( void * parentHandle)
pure virtual

Use this function to add your custom window to the parent view.

Parameters
parentHandleA void* to the parent window's handle - the actual type is platform specific (HWND on Windows, NSView on macOS).

Implemented in mostly_harmless::gui::WebviewBase.

◆ setSize()

virtual void mostly_harmless::core::IEditor::setSize ( std::uint32_t width,
std::uint32_t height )
pure virtual

Called when the size of the parent window has been changed.

Parameters
widthThe new parent width.
heightThe new parent height.

Implemented in mostly_harmless::gui::WebviewBase.

◆ show()

virtual void mostly_harmless::core::IEditor::show ( )
pure virtual

Called when the editor should show.

Implemented in mostly_harmless::gui::WebviewBase.


The documentation for this struct was generated from the following file: