Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > ede7a87b37818518798575974c5532a5 > files > 46

lv2-c++-tools-devel-1.0.3-5.fc15.i686.rpm

<!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&#160;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 &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1NoUserResize.html">LV2::NoUserResize&lt; Required &gt;</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1FixedSize.html">LV2::FixedSize&lt; Required &gt;</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1Presets.html">LV2::Presets&lt; Required &gt;</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1WriteMIDI.html">LV2::WriteMIDI&lt; Required &gt;</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLV2_1_1URIMap.html">LV2::URIMap&lt; Required &gt;</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 &lt;lv2gui.hpp&gt;</span>
<span class="preprocessor">#include &lt;gtkmm.h&gt;</span>

<span class="keyword">class </span>MyGUI : <span class="keyword">public</span> LV2::GUI&lt;MyGUI, LV2::URIMap&lt;true&gt;, LV2::WriteMIDI&lt;true&gt; &gt; {
<span class="keyword">public</span>:
  MyGUI(<span class="keyword">const</span> <span class="keywordtype">char</span>* plugin_uri)
    : m_button(<span class="stringliteral">&quot;Click me!&quot;</span>) {
    pack_start(m_button);
    m_button.signal_clicked().connect(sigc::mem_fun(*<span class="keyword">this</span>, &amp;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&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>