Classes | |
struct | LV2::NoUserResize< Required > |
struct | LV2::FixedSize< Required > |
struct | LV2::Presets< Required > |
struct | LV2::WriteMIDI< Required > |
struct | LV2::URIMap< Required > |
Required
parameter - if this is true the GUI will fail to instantiate unless the host supports the extension implemented by that mixin. For example, if you wanted a GUI that wrote a MIDI Note On event to port 3 in the plugin whenever the user clicked a button, you could do it like this:
#include <lv2gui.hpp> #include <gtkmm.h> class MyGUI : public LV2::GUI<MyGUI, LV2::URIMap<true>, LV2::WriteMIDI<true> > { public: MyGUI(const char* plugin_uri) : m_button("Click me!") { pack_start(m_button); m_button.signal_clicked().connect(sigc::mem_fun(*this, &MyGUI::send_event)); } protected: void send_event() { uint8_t noteon[] = { 0x90, 0x50, 0x40 }; write_midi(3, 3, noteon); } Gtk::Button m_button; };
The function write_midi()
is implemented in LV2::WriteMIDI and thus available in MyGUI
. LV2::WriteMIDI requires that LV2::URIMap is also used (because of the way event types work in LV2) - if you don't add LV2::URIMap as well you will get a compilation error.