<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GUI mixins</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> </div> <div class="headertitle"> <h1>GUI mixins</h1> </div> </div> <div class="contents"> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="nested-classes"></a> Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1NoUserResize.html">LV2::NoUserResize< Required ></a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1FixedSize.html">LV2::FixedSize< Required ></a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1Presets.html">LV2::Presets< Required ></a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1WriteMIDI.html">LV2::WriteMIDI< Required ></a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1URIMap.html">LV2::URIMap< Required ></a></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>These classes implement extra functionality that you may want to have in your <a class="el" href="classLV2_1_1GUI.html">GUI</a> class, just like the <a class="el" href="group__pluginmixins.html">plugin mixins</a> do for plugin classes. Some of them are template classes with a boolean <code>Required</code> parameter - if this is true the <a class="el" href="classLV2_1_1GUI.html">GUI</a> will fail to instantiate unless the host supports the extension implemented by that mixin. For example, if you wanted a <a class="el" href="classLV2_1_1GUI.html">GUI</a> 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:</p> <div class="fragment"><pre class="fragment"><span class="preprocessor">#include <lv2gui.hpp></span> <span class="preprocessor">#include <gtkmm.h></span> <span class="keyword">class </span>MyGUI : <span class="keyword">public</span> LV2::GUI<MyGUI, LV2::URIMap<true>, LV2::WriteMIDI<true> > { <span class="keyword">public</span>: MyGUI(<span class="keyword">const</span> <span class="keywordtype">char</span>* plugin_uri) : m_button(<span class="stringliteral">"Click me!"</span>) { pack_start(m_button); m_button.signal_clicked().connect(sigc::mem_fun(*<span class="keyword">this</span>, &MyGUI::send_event)); } <span class="keyword">protected</span>: <span class="keywordtype">void</span> send_event() { uint8_t noteon[] = { 0x90, 0x50, 0x40 }; write_midi(3, 3, noteon); } Gtk::Button m_button; }; </pre></div><p>The function <code>write_midi()</code> is implemented in <a class="el" href="structLV2_1_1WriteMIDI.html">LV2::WriteMIDI</a> and thus available in <code>MyGUI</code>. <a class="el" href="structLV2_1_1WriteMIDI.html">LV2::WriteMIDI</a> requires that <a class="el" href="structLV2_1_1URIMap.html">LV2::URIMap</a> is also used (because of the way event types work in LV2) - if you don't add <a class="el" href="structLV2_1_1URIMap.html">LV2::URIMap</a> as well you will get a compilation error. </p> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Feb 8 2011 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>