LV2 Toolkit  1.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
UI< Derived, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7, Ext8, Ext9 > Class Template Reference

#include <lvtk/ui.hpp>

Collaboration diagram for UI< Derived, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7, Ext8, Ext9 >:
Collaboration graph
[legend]

Public Member Functions

void port_event (uint32_t port, uint32_t buffer_size, uint32_t format, void const *buffer)
 
void * controller ()
 

Static Public Member Functions

static int register_class (char const *uri)
 

Protected Member Functions

void write (uint32_t port, uint32_t buffer_size, uint32_t format, void const *buffer)
 
void write_control (uint32_t port, float value)
 
Feature const *const * features ()
 
char const * bundle_path () const
 

Detailed Description

template<class Derived, class Ext1 = end, class Ext2 = end, class Ext3 = end, class Ext4 = end, class Ext5 = end, class Ext6 = end, class Ext7 = end, class Ext8 = end, class Ext9 = end>
class lvtk::UI< Derived, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7, Ext8, Ext9 >

This is the base class for a plugin UI. You should inherit it and override any public member functions you want to provide implementations for. All subclasses must have a constructor with the signature

where plugin_uri is the URI of the plugin that this UI will control (not the URI for the UI itself).

You can extend your UI classes, for example adding support for UI extensions, by passing UI mixin classes as template parameters to UI (second template parameter and onwards).

Examples:
beep_ui.cpp, silence_ui.cpp, and workhorse_ui.cpp.

Member Function Documentation

char const* bundle_path ( ) const
inlineprotected

Get the filesystem path to the bundle that contains this UI.

void* controller ( )
inline

Get the controller

Returns
Instance this UI is controlling
Remarks
You only need it if you want to handle extensions yourself.
Feature const* const* features ( )
inlineprotected

Get the feature array

Returns
The host-passed Feature array
Remarks
This may only be valid while the constructor is running.
void port_event ( uint32_t  port,
uint32_t  buffer_size,
uint32_t  format,
void const *  buffer 
)
inline

Override this if you want your UI to do something when a control port value changes in the plugin instance.

static int register_class ( char const *  uri)
inlinestatic

Use this template function to register a class as a LV2 UI.

Parameters
uriThe UIs URI
Returns
Descriptor index
void write ( uint32_t  port,
uint32_t  buffer_size,
uint32_t  format,
void const *  buffer 
)
inlineprotected

Send a chunk of data to a plugin port. The format of the chunk is determined by the port type and the transfer mechanisms used, you should probably use a wrapper function instead such as write_control().

void write_control ( uint32_t  port,
float  value 
)
inlineprotected

Set the value of a control input port in the plugin instance.


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