tag:help.beatunes.com,2009-07-24:/discussions/plugin/1875-open-keybeaTunes: Discussion 2015-09-25T18:05:47Ztag:help.beatunes.com,2009-07-24:Comment/380223622015-09-25T06:11:08Z2015-09-25T06:11:08ZOpen Key<div><p>Hey John,</p>
<p>customizing key rendering is trivial using a <a href="https://www.beatunes.com/en/beatlet-keytextrenderer.html">KeyTextRenderer</a>.
The <code>Key</code> class is documented <a href="https://www.beatunes.com/apidocs/com/tagtraum/audiokern/key/Key.html">
here</a>. And the <a href="http://www.groovy-lang.org">Groovy</a>
code looks like this (also attached):</p>
<pre>
<code>import com.tagtraum.audiokern.key.Key
import com.tagtraum.beatunes.KeyTextRenderer
class BracedOpenKey implements KeyTextRenderer {
/**
* Create a textual representation for a Key object.
*
* @param key key
* @return textual representation
*/
def String toKeyString(Key key) {
String openKeyCode = key.getOpenKeyCode()
// create the final string
return "($openKeyCode)"
}
/**
* Create a tooltip representation for a key object.
* This may also include html-tags.
*
* @param key key
* @return tooltip representation
*/
def String toToolTip(Key key) {
toKeyString(key)
}
/**
* Short name of this renderer. To be used in the user interface.
*
* @return name
*/
def String getName() {
"Braced OpenKey"
}
}</code>
</pre>
<p>Just <a href="http://help.beatunes.com/kb/plugins/how-to-install-a-plugin">install
it as a plugin</a>.</p>
<p>Cheers,</p>
<p>-hendrik</p></div>hendriktag:help.beatunes.com,2009-07-24:Comment/380223622015-09-25T18:04:07Z2015-09-25T18:04:07ZOpen Key<div><p>Worked like a charm. Thanks</p></div>john.yulltag:help.beatunes.com,2009-07-24:Comment/380223622015-09-25T18:05:44Z2015-09-25T18:05:44ZOpen Key<div><p>Great! :-)</p></div>hendrik