<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Inchoate Thoughts &#187; Jacob</title>
	<atom:link href="http://inchoatethoughts.com/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://inchoatethoughts.com</link>
	<description>Drums, Computers, and Disjointed Ramblings</description>
	<lastBuildDate>Fri, 04 Jun 2010 06:08:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Launching Boxee with a Windows Media Center Remote</title>
		<link>http://inchoatethoughts.com/launching-boxee-with-a-windows-media-center-remote</link>
		<comments>http://inchoatethoughts.com/launching-boxee-with-a-windows-media-center-remote#comments</comments>
		<pubDate>Fri, 04 Jun 2010 04:28:49 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Boxee]]></category>
		<category><![CDATA[Green Button]]></category>
		<category><![CDATA[Media Center]]></category>
		<category><![CDATA[Remote]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=322</guid>
		<description><![CDATA[I was recently notified that Boxee might benefit from the same hack I used to get XBMC working with my Windows Media Center remote (see the post before this one). The problem was the same. While you can use a Windows Media Center remote and IR receiver (or a universal remote emulating one) to control [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_324" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2010/06/Boxee.png"><img class="size-medium wp-image-324" title="Boxee" src="http://inchoatethoughts.com/wp-content/uploads/2010/06/Boxee-300x187.png" alt="Boxee" width="300" height="187" /></a><p class="wp-caption-text">Boxee</p></div>
<p>I was recently notified that Boxee might benefit from the same hack I used to get XBMC working with my Windows Media Center remote (see the <a href="http://inchoatethoughts.com/launching-xbmc-with-a-windows-media-center-remote">post</a> before this one). The problem was the same. While you can use a Windows Media Center remote and IR receiver (or a universal remote emulating one) to control Boxee, the green button will continue to launch Windows Media Center. I was asked to modify the little launcher I had written for launching XBMC to launch Boxee instead. About 10 seconds of coding (and another 5 minutes of testing) later, I had what appears to be a working solution.</p>
<p><a title="Download BoxeeLauncher" href="http://inchoatethoughts.com/files/BoxeeLauncher.zip" target="_blank">Download BoxeeLauncher</a> (source code and Visual Studio project are included)</p>
<p style="text-align: left;">Install instructions are the same:</p>
<p style="text-align: left; padding-left: 30px;">We need to change permissions on the default launcher so we can copy over it:<br />
1. Go to &#8220;C:\Windows\ehome&#8221;<br />
2. In the &#8220;ehome&#8221; directory, right click &#8220;ehshell.exe&#8221; and choose &#8220;Properties&#8221;<br />
3. Click on the &#8220;Security&#8221; tab and click on the &#8220;Advanced&#8221; button at the bottom.<br />
4. Click on the &#8220;Owner&#8221; tab and click the &#8220;Edit&#8221; button.<br />
5. Select &#8220;Administrators&#8221; and hit &#8220;OK.&#8221;<br />
6. Click &#8220;OK&#8221; in the &#8220;Advanced Security Settings for ehshell.exe&#8221; dialog.<br />
7. In the &#8220;ehshell.exe Properties&#8221; dialog, click on &#8220;Administrators&#8221; under &#8220;Group or user names&#8221; and click the &#8220;Edit&#8221; button.<br />
8. Select &#8220;Administrators&#8221; (or add that group if it isn&#8217;t already there) and check the &#8220;Full Control&#8221; box in the Allow column.<br />
9. &#8220;OK&#8221; out of all the properties and permissions dialogs.<br />
10. While in &#8220;C:\Windows\ehome&#8221;, copy ehshell.exe and paste it somewhere safe as a backup, in case you ever need to restore.</p>
<p style="padding-left: 30px;">Now, we can copy the new launcher.<br />
11. From this folder (the one this readme file is in), copy ehshell.exe<br />
12. Paste the modified &#8220;ehshell.exe&#8221; in the &#8220;C:\Windows\ehome&#8221; directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/launching-boxee-with-a-windows-media-center-remote/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Launching XBMC with a Windows Media Center Remote</title>
		<link>http://inchoatethoughts.com/launching-xbmc-with-a-windows-media-center-remote</link>
		<comments>http://inchoatethoughts.com/launching-xbmc-with-a-windows-media-center-remote#comments</comments>
		<pubDate>Sun, 14 Feb 2010 04:29:57 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Green Button]]></category>
		<category><![CDATA[Media Center]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[XBMC]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=306</guid>
		<description><![CDATA[I recently took up the task of switching my media center software from Windows 7 Media Center to the Windows version of XBMC. I found XBMC easier to get working with obscure encodings of video files (it uses mplayer instead of the normal codec engine). But, my reasons for switching are not the point of [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_307" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2010/02/xbmc.png"><img class="size-medium wp-image-307" title="XBMC" src="http://inchoatethoughts.com/wp-content/uploads/2010/02/xbmc-300x176.png" alt="XBMC" width="300" height="176" /></a><p class="wp-caption-text">XBMC</p></div>
<p style="text-align: left;">I recently took up the task of switching my media center software from Windows 7 Media Center to the Windows version of XBMC. I found XBMC easier to get working with obscure encodings of video files (it uses mplayer instead of the normal codec engine). But, my reasons for switching are not the point of this post. The point here is that switching to XBMC from Windows Media Center has a few challenges. One such challenge is getting the Windows Media Center remote to work in a nice way. Luckily, some <a href="http://xbmcmce.sourceforge.net/">excellent work</a> has been done on that front. People have already provided premade media center remote configurations for XBMC. However, the &#8220;start&#8221; button on the media center remote <a href="http://forum.xbmc.org/showthread.php?t=65088">still had the nasty habit of launching the Windows 7 Media Center app instead of launching XBMC</a>.</p>
<p style="text-align: left;">I looked around the ol&#8217; Internet for a solution to this problem. Turns out, the behavior of that &#8220;Start&#8221; or &#8220;Green&#8221; button on the media center remote is to cause a special key combination to be pressed. This key combination is bound to launching &#8220;C:\Windows\ehome\ehshell.exe.&#8221; The quickest workaround to the problem is to change ehshell.exe to something that launches XBMC. I then saw some people had written some batch files that launched XBMC. They then used a batch-to-exe converter to make it an executable and replaced ehshell.exe. That was great, but it still had a weakness. If, for some reason, XBMC was taken out of the foreground, it wouldn&#8217;t come back. Bummer. So I fixed it!</p>
<p style="text-align: left;">I wrote a little application to launch XBMC. It does a few things. First, it will check if XBMC is already running. If it is, it will bring it to the foreground for you. If it isn&#8217;t running, it will launch it. It will first try using the install location in the registry to find where to launch XBMC from. If it can&#8217;t find that, it will try the default location of the XBMC.exe file (both 32-bit and 64-bit versions).</p>
<p style="text-align: left;">Installing it still requires replacing ehshell.exe, which admittedly, is fairly annoying, but it is better than nothing!</p>
<p style="text-align: left;"><a title="XBMC Launcher" href="http://inchoatethoughts.com/files/XbmcLauncher.zip" target="_blank">Download The Launcher</a> (source code and Visual Studio project are included)</p>
<p style="text-align: left;">Install instructions:</p>
<p style="text-align: left; padding-left: 30px;">We need to change permissions on the default launcher so we can copy over it:<br />
1. Go to &#8220;C:\Windows\ehome&#8221;<br />
2. In the &#8220;ehome&#8221; directory, right click &#8220;ehshell.exe&#8221; and choose &#8220;Properties&#8221;<br />
3. Click on the &#8220;Security&#8221; tab and click on the &#8220;Advanced&#8221; button at the bottom.<br />
4. Click on the &#8220;Owner&#8221; tab and click the &#8220;Edit&#8221; button.<br />
5. Select &#8220;Administrators&#8221; and hit &#8220;OK.&#8221;<br />
6. Click &#8220;OK&#8221; in the &#8220;Advanced Security Settings for ehshell.exe&#8221; dialog.<br />
7. In the &#8220;ehshell.exe Properties&#8221; dialog, click on &#8220;Administrators&#8221; under &#8220;Group or user names&#8221; and click the &#8220;Edit&#8221; button.<br />
8. Select &#8220;Administrators&#8221; (or add that group if it isn&#8217;t already there) and check the &#8220;Full Control&#8221; box in the Allow column.<br />
9. &#8220;OK&#8221; out of all the properties and permissions dialogs.<br />
10. While in &#8220;C:\Windows\ehome&#8221;, copy ehshell.exe and paste it somewhere safe as a backup, in case you ever need to restore.</p>
<p style="padding-left: 30px;">Now, we can copy the new launcher.<br />
11. From this folder (the one this readme file is in), copy ehshell.exe<br />
12. Paste the modified &#8220;ehshell.exe&#8221; in the &#8220;C:\Windows\ehome&#8221; directory.</p>
<p>Finally, here is the (very simple) source code:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Diagnostics</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Runtime.InteropServices</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.Win32</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">namespace</span> XbmcLauncher<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> Program<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#91;</span>DllImport<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;user32.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">extern</span> <span style="color: #6666cc; font-weight: bold;">bool</span> SetForegroundWindow<span style="color: #008000;">&#40;</span>IntPtr hWnd<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// The main entry point for the application.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Process<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> processes <span style="color: #008000;">=</span> Process<span style="color: #008000;">.</span><span style="color: #0000FF;">GetProcessesByName</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;XBMC&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>processes<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">!=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// If XBMC is currently running, bring it to the foreground</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IntPtr hWnd <span style="color: #008000;">=</span> processes<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">MainWindowHandle</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetForegroundWindow<span style="color: #008000;">&#40;</span>hWnd<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OpenXbmc<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> OpenXbmc<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> xbmcPath <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Attempt to find the XBMC executable location via the registry</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegistryKey key <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OpenSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;Software\XBMC&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>key <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span> <span style="color: #008080; font-style: italic;">// If the path is in the registry use it to open XBMC</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xbmcPath <span style="color: #008000;">=</span> key<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">as</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>LaunchXbmcProcess<span style="color: #008000;">&#40;</span>xbmcPath <span style="color: #008000;">+</span> <span style="color: #666666;">@&quot;\XBMC.exe&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #008080; font-style: italic;">// Otherwise, we'll try to use the default locations</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> x86Path <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;C:\Program Files\XBMC\XBMC.exe&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> x64Path <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;C:\Program Files (x86)\XBMC\XBMC.exe&quot;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>LaunchXbmcProcess<span style="color: #008000;">&#40;</span>x86Path<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LaunchXbmcProcess<span style="color: #008000;">&#40;</span>x64Path<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">bool</span> LaunchXbmcProcess<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> path<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>path <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;&amp;</span> File<span style="color: #008000;">.</span><span style="color: #0000FF;">Exists</span><span style="color: #008000;">&#40;</span>path<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Process proc <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Process<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc<span style="color: #008000;">.</span><span style="color: #0000FF;">StartInfo</span> <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> ProcessStartInfo<span style="color: #008000;">&#40;</span>path<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc<span style="color: #008000;">.</span><span style="color: #0000FF;">Start</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/launching-xbmc-with-a-windows-media-center-remote/feed</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>foo_g15lcd 0.3c</title>
		<link>http://inchoatethoughts.com/foo_g15lcd-0-3c</link>
		<comments>http://inchoatethoughts.com/foo_g15lcd-0-3c#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:29:20 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Foobar2000]]></category>
		<category><![CDATA[foo_g15lcd]]></category>
		<category><![CDATA[Logitech]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=296</guid>
		<description><![CDATA[This is just a quick little update to let everyone know I&#8217;ve recompiled the foo_g15lcd component against the latest release version of Foobar 1.0. No new features, but everything still seems to be in excellent working order! Grab it here: Download foo_g15lcd 0.3c]]></description>
			<content:encoded><![CDATA[<div id="attachment_297" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2010/01/foog1503c.png"><img class="size-medium wp-image-297" title="foo_g15lcd 0.3c" src="http://inchoatethoughts.com/wp-content/uploads/2010/01/foog1503c-300x135.png" alt="" width="300" height="135" /></a><p class="wp-caption-text">foo_g15lcd 0.3c</p></div>
<p style="text-align: center;">
<p>This is just a quick little update to let everyone know I&#8217;ve recompiled the foo_g15lcd component against the latest release version of Foobar 1.0. No new features, but everything still seems to be in excellent working order!</p>
<p>Grab it here: <a href="http://www.inchoatethoughts.com/foo_g15lcd/foo_g15lcd_0_3_c.zip">Download foo_g15lcd 0.3c</a></p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/foo_g15lcd-0-3c/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Transcription: Alkaline Trio &#8211; &#8220;Sadie&#8221;</title>
		<link>http://inchoatethoughts.com/transcription-alkaline-trio-sadie</link>
		<comments>http://inchoatethoughts.com/transcription-alkaline-trio-sadie#comments</comments>
		<pubDate>Thu, 17 Dec 2009 05:16:23 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Drums]]></category>
		<category><![CDATA[Alkaline Trio]]></category>
		<category><![CDATA[Sheet Music]]></category>
		<category><![CDATA[Transcriptions]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=18</guid>
		<description><![CDATA[Here is how this works. I often find myself learning drum parts to songs that other people have written. This can be for my own amusement or out of obligation. Either way, I can get pretty obsessive about learning all the intricate subtleties of a song, as my drum teacher can attest. I rarely find [...]]]></description>
			<content:encoded><![CDATA[<p>Here is how this works. I often find myself learning drum parts to songs that other people have written. This can be for my own amusement or out of obligation. Either way, I can get pretty obsessive about learning all the intricate subtleties of a song, as my drum teacher can attest. I rarely find myself satisfied with just learning the basic beat and improvising the rest (not that there is anything wrong with this). So, to help satisfy my compulsions, I&#8217;ll sit down in the living room with my laptop and a pair of headphones and watch reruns of Mythbusters while I transcribe the song. The process of writing out each note tends to make me notice things that I would have otherwise missed.</p>
<p>This leaves me with a nice transcription and a better understanding of the song. Sweet. But wouldn&#8217;t it be nice if other people could get something out of the time I spent transcribing? I think so too. So here you go.</p>
<p>Without futher ado, I present my first transcription. I&#8217;ve gone with Alkaline Trio&#8217;s &#8220;Sadie.&#8221; This is appropriate for a few reasons. First, it&#8217;s a great song with some incredible drum parts. Second, it was the first song I learned under the instruction of a drum teacher. In hindsight, this song required WAY more skill than I had at the time. Oh well, it pushed me that much harder. I encourage you to give this song a listen and a try on the drums.</p>
<p><a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie.pdf" target="_blank">Download Transcription PDF</a></p>
<p><center><a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_1.jpg" target="_blank"><img src="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_1_th.png" alt="Alkaline Trio - " /></a> <a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_2.jpg" target="_blank"><img src="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_2_th.png" alt="Alkaline Trio - " /></a> <a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_3.jpg" target="_blank"><img src="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_3_th.png" alt="Alkaline Trio - " /></a> <a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_4.jpg" target="_blank"><img src="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_4_th.png" alt="Alkaline Trio - " /></a> <a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_5.jpg" target="_blank"><img src="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_5_th.png" alt="Alkaline Trio - " /></a> <a href="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_6.jpg" target="_blank"><img src="http://www.inchoatethoughts.com/transcriptions/Alkaline_Trio-Sadie/Sadie_Page_6_th.png" alt="Alkaline Trio - " /></a></center></p>
<p>Buy The Album: <a href="http://www.amazon.com/Crimson/dp/B001OFSVB0/ref=sr_1_1/177-8037269-2432817?ie=UTF8&amp;s=dmusic&amp;qid=1246219750&amp;sr=8-1" target="_blank">MP3</a> <a href="http://www.amazon.com/Crimson-Alkaline-Trio/dp/B000BYRBXY/ref=sr_1_2/177-8037269-2432817?ie=UTF8&amp;s=music&amp;qid=1246219750&amp;sr=8-2" target="_blank">CD</a></p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/transcription-alkaline-trio-sadie/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending ZenLibrary &#8211; Creating New Rules</title>
		<link>http://inchoatethoughts.com/extending-zenlibrary-creating-new-rules</link>
		<comments>http://inchoatethoughts.com/extending-zenlibrary-creating-new-rules#comments</comments>
		<pubDate>Sun, 13 Sep 2009 19:56:20 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ZenLibrary]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=218</guid>
		<description><![CDATA[Hello everyone, this is an article about my ZenLibrary program aimed at those programmers who wish to either extend it or just know more about what&#8217;s going on behind the scenes. If you&#8217;re just interested in obtaining the program, click here. I&#8217;ve *attempted* to make it easy for any programmer to extend the rules in [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone, this is an article about my <a href="http://inchoatethoughts.com/zenlibrary">ZenLibrary</a> program aimed at those <em>programmers </em>who wish to either extend it or just know more about what&#8217;s going on behind the scenes. If you&#8217;re just interested in obtaining the program, <a href="http://inchoatethoughts.com/zenlibrary">click here</a>.</p>
<p>I&#8217;ve *attempted* to make it easy for any programmer to extend the rules in ZenLibrary. Since I&#8217;m releasing this tutorial at roughly the same time as the actual program, I haven&#8217;t actually had a chance to get any feedback on how I might improve the extensibility interface. I do, however, want to make it clear I have no interest in making an elaborate end-user based rule scripting engine. Doing so would a.) screw up the simplicity of the program and b.) drastically change the scope of this software. Throwing in some user-defined regular expressions is about as far as I am willing to go.</p>
<h3><strong>Part 0 &#8211; Getting Set Up and Getting The Source</strong></h3>
<p>Creating new rules in ZenLibrary does NOT require getting the source code. One simply needs to reference &#8220;ZenLibrary.RuleBase.dll&#8221; that comes with the program (version 0.3 and later). However, I think having the source on hand will make debugging things a bit easier on your part. But, it&#8217;s all your call.</p>
<p>This project was done in C#, using WPF, and in Visual Studio 2008. Hopefully none of that made you too uncomfortable. You&#8217;ll pretty much need Visual Studio 2008 to deal with this solution. I suppose the Express edition of C# could work, but I haven&#8217;t tried it.</p>
<p>The source code is controlled in subversion. Everyone has read permissions on the repository. If you&#8217;d like to contribute to the project and need write access, drop me a line. This is an open source project, released using the LGPL.</p>
<address>ZenLibrary SVN Host: http://inchoatethoughts.com/zenlibrarysvn</address>
<h3><strong>Part 1 &#8211; How It Works</strong></h3>
<p>Before we get into how to add our own rules, let&#8217;s talk a bit about how this program runs. First, the user chooses a directory to scan through and the rules he wants to test against, and then he presses start. The program now launches a new thread (as to not stall the user interface thread) and begins to scan each directory. This is where our first set of tests begins to run. There are two different types of tests, or &#8220;rules&#8221; (I&#8217;ll be using the terms interchangeably). There are &#8220;per-directory&#8221; rules. These rules run on any directory with music files. These sorts of rules are useful for doing things like checking for the existence of a particular image file (e.g. album artwork) inside the directory. After the &#8220;per-directory&#8221; tests run, a set of &#8220;per-file&#8221; tests will be run against each of the MP3 files in the directory. The &#8220;per-files&#8221; are useful for checking the content of specific tags, checking for proper file name, etc.</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/09/ZenLibraryFlow.png"><img class="size-medium wp-image-250" title="Rule Scanning Flow" src="http://inchoatethoughts.com/wp-content/uploads/2009/09/ZenLibraryFlow-300x154.png" alt="Rule Scanning Flow" width="300" height="154" /></a><p class="wp-caption-text">Rule Scanning Flow</p></div>
<p>Forgive the terrible flowchart. Continuing on. This is a .NET program, so anyone extending this software will have the full .NET library at their disposal, which is pretty powerful in and of itself. However, since this is an audio library scanner, the program also makes use of <a title="TagLib#" href="http://developer.novell.com/wiki/index.php/TagLib_Sharp" target="_blank">TagLib#</a>. TagLib, for those who aren&#8217;t already familiar, is a pretty powerful tag reader. It actually works on all sorts of media, not just MP3s with ID3 tags. TagLib# is then a .NET version of TagLib. It&#8217;s released under the LGPL, much like ZenLibrary, so packaging it and distributing it with this software is not a problem. ZenLibrary references TagLib, so when designing rules, don&#8217;t forget you have a good hunk of tagging technology to make us of. If you&#8217;re looking to do things with tags, just add a reference to &#8220;taglib-sharp.dll&#8221; as well.</p>
<h3><strong>Part 2 &#8211; Creating a Rule</strong></h3>
<p>Our task today is to essentially create one of the rules/tests that make up the meat of this program. I&#8217;ve done some work to make this as easy as possible. Here is what you&#8217;ll need to do:</p>
<ul>
<li>Inherit from the &#8220;Rule&#8221; class</li>
<li>Give the rule a name (overload the Name property)</li>
<li>Define the TestType (&#8220;per-file&#8221; or &#8220;per-directory&#8221;)</li>
<li>Give it some test logic</li>
</ul>
<p>That&#8217;s it! If you want a more elaborate rule with configurations that are persisted between application sessions, there is a ConfigurableRule class to inherit from and a few more overloads you&#8217;ll need to provide. But, let&#8217;s ignore that for now. We&#8217;re going to create a very simple rule. It&#8217;s purpose will be to detect for the presence of the &#8220;discnumber&#8221; tag in all of our music files.</p>
<div id="attachment_263" class="wp-caption aligncenter" style="width: 245px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/09/RuleClassDiagram.png"><img class="size-medium wp-image-263" title="Diagram for Abstract Rule Classes" src="http://inchoatethoughts.com/wp-content/uploads/2009/09/RuleClassDiagram-235x300.png" alt="Diagram for Abstract Rule Classes" width="235" height="300" /></a><p class="wp-caption-text">Diagram for Abstract Rule Classes</p></div>
<p><strong>Set Up The Project</strong></p>
<p>First order of business is getting our add-in project created. Open up Visual Studio and create a new &#8220;Class Library&#8221; project. It doesn&#8217;t really matter what you name it, but you may want to indicate your name and that it is a file with ZenLibrary Rules in it. Pretend your name is Billy Bob. You might name the project &#8220;ZenLibrary.BillyBobsRules.&#8221; I&#8217;ve named my project &#8220;SampleRuleLibray.&#8221; Once you&#8217;ve created the Class Library project, go to your references folder, right click and select &#8220;Add Reference,&#8221; click the browse tab and go find &#8220;ZenLibrary.RuleBase.dll&#8221; (it comes packaged with ZenLibrary releases). For this particular &#8220;Discnumber&#8221; tag rule, we&#8217;re also going to be using the TagLib# library as well. Once again, add a reference using &#8220;Browse&#8221; and select &#8220;taglib-sharp.dll,&#8221; which should also be in the ZenLibrary directory.</p>
<div id="attachment_266" class="wp-caption aligncenter" style="width: 337px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/09/References.PNG"><img class="size-full wp-image-266" title="References Defined" src="http://inchoatethoughts.com/wp-content/uploads/2009/09/References.PNG" alt="References Defined" width="327" height="321" /></a><p class="wp-caption-text">References Defined</p></div>
<p><strong>Inherit From The Rule Class</strong></p>
<p>Now that we have our project set up, we can go ahead and create our rule class. Create a new class file (I called mine &#8220;SampleRule.cs&#8221;). This class should inherit from &#8220;ZenLibrary.RuleBase.Rule.&#8221;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ZenLibrary.RuleBase</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">namespace</span> SampleRuleLibrary<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SampleRule <span style="color: #008000;">:</span> Rule<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Give The Rule A Name</strong></p>
<p>The rule needs a name. The name shows up in ZenLibrary&#8217;s rule panel on the left side and is how the user will identify your rule from the other rules. To specify a name, just override the &#8220;Name&#8221; property&#8217;s get. Pretty simple!</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ZenLibrary.RuleBase</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">namespace</span> SampleRuleLibrary<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SampleRule <span style="color: #008000;">:</span> Rule<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #666666;">&quot;Discnumber Tag&quot;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Define The Test Type</strong></p>
<p>The test type determines if your test will be run per music directory or per file. It&#8217;s just a simple optimization effort, really. The per-directory test exists so that we don&#8217;t have to check for the existence of &#8220;folder.jpg&#8221; in the directory on every file scan. Conversely, the per-file test exists so we don&#8217;t have to rewrite logic to scan all of the files every time we run on a music directory. To define our Test Type, we override the &#8220;TestType&#8221; property&#8217;s get and specify &#8220;TestType.FileScan&#8221; for per-file and &#8220;TestType.DirectoryScan&#8221; for per-directory. Our test case is something that needs to be done a per-file basis, so we&#8217;ll use &#8220;TestType.FileScan&#8221; in the example.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ZenLibrary.RuleBase</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">namespace</span> SampleRuleLibrary<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SampleRule <span style="color: #008000;">:</span> Rule<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #666666;">&quot;Discnumber Tag&quot;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> TestType TestType<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> TestType<span style="color: #008000;">.</span><span style="color: #0000FF;">FileScan</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Give The Test Some Logic</strong></p>
<p>Finally, the meat of the program. Our test. This is where the magic happens. The magic that you define, that is. Anything can happen here, really. Override the &#8220;RunTest()&#8221; method. You&#8217;ll be provided with either a &#8220;System.IO.FileInfo&#8221; for the file you&#8217;re scanning (on a per-file scan) or a &#8220;System.IO.DirectoryInfo&#8221; for the scanning directory (on a per-directory scan). If the scan is per-file, the DirectoryInfo parameter will be the directory where the file is. If the scan is per-directory, the FileInfo parameter will be null. From here on out, it&#8217;s up to you what to do with them. All that matters now is that you return a &#8220;RuleTestResult&#8221; at the end indicating whether the test has passed or failed. If the test has passed, mark &#8220;TestPassed&#8221; in the &#8220;RuleTestResult.IsPassed&#8221; property to true and return it. If it is has failed, mark &#8220;RuleTestResult.IsPassed&#8221; as false. Also, assign the &#8220;RuleTestResult.RuleTestFailedString.&#8221; This string is the message that will be displayed in the results box on the ZenLibrary UI. Additionally, you&#8217;ll want to specify the location where it failed by assigning &#8220;RuleTestResult.ResultPath.&#8221; This can pretty much always be the &#8220;FullName&#8221; property of the provided &#8220;DirectoryInfo.&#8221;</p>
<p>For the sample test case, I&#8217;ve added some logic, using TagLib#, to check whether the &#8220;Discnumber&#8221; tag is &#8220;0.&#8221; This is an indication that the &#8220;Discnumber&#8221; tag has not been assigned, and thus, fails our test.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ZenLibrary.RuleBase</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">namespace</span> SampleRuleLibrary<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SampleRule <span style="color: #008000;">:</span> Rule<br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #666666;">&quot;Discnumber Tag&quot;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> TestType TestType<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> TestType<span style="color: #008000;">.</span><span style="color: #0000FF;">FileScan</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> RuleTestResult RunTest<span style="color: #008000;">&#40;</span><span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">DirectoryInfo</span> directoryInfo, <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">FileInfo</span> fileInfo<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TagLib<span style="color: #008000;">.</span><span style="color: #0000FF;">File</span> file <span style="color: #008000;">=</span> TagLib<span style="color: #008000;">.</span><span style="color: #0000FF;">File</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span>fileInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">FullName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RuleTestResult result <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> RuleTestResult<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>file<span style="color: #008000;">.</span><span style="color: #0000FF;">Tag</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Disc</span> <span style="color: #008000;">!=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result<span style="color: #008000;">.</span><span style="color: #0000FF;">TestPassed</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> result<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result<span style="color: #008000;">.</span><span style="color: #0000FF;">ResultPath</span> <span style="color: #008000;">=</span> directoryInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">FullName</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result<span style="color: #008000;">.</span><span style="color: #0000FF;">RuleTestFailedString</span> <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;File <span style="color: #008080; font-weight: bold;">\&quot;</span>{0}<span style="color: #008080; font-weight: bold;">\&quot;</span> does not have the discnumber tag defined.&quot;</span>, fileInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">FullName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result<span style="color: #008000;">.</span><span style="color: #0000FF;">TestPassed</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> result<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Boom! We&#8217;re done! Yep, that&#8217;s really all there is to it. Compile your Class Library and drop the output DLL in the same directory as ZenLibrary.exe. You don&#8217;t need to register it or anything. ZenLibrary will automatically detect its presence and instantiate any rules within.</p>
<div id="attachment_274" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/09/CustomRuleRunning.png"><img class="size-medium wp-image-274" title="The Sample Rule Running!" src="http://inchoatethoughts.com/wp-content/uploads/2009/09/CustomRuleRunning-300x193.png" alt="The Sample Rule Running!" width="300" height="193" /></a><p class="wp-caption-text">The Sample Rule Running!</p></div>
<p>If you want to see more elaborate rules with custom configuration dialogs and the likes, you can grab the source code from the subversion repository and check out the included rules in the ZenLibrary.RuleBase assembly. You may also want to check out how to write a light plug-in infrastructure via reflection by taking a look in &#8220;RuleSet.cs&#8221; to see how I instantiate all the rules without programmers having to manually register them. </p>
<p>You can also <a href="http://inchoatethoughts.com/files/SampleRule.zip">download the sample rule project here.</a></p>
<p>Thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/extending-zenlibrary-creating-new-rules/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ZenLibrary &#8211; Cleanse Your Music Library (And Thus Your Soul)</title>
		<link>http://inchoatethoughts.com/zenlibrary</link>
		<comments>http://inchoatethoughts.com/zenlibrary#comments</comments>
		<pubDate>Fri, 11 Sep 2009 04:49:01 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Media Library]]></category>
		<category><![CDATA[MP3 Tagging]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[ZenLibrary]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=199</guid>
		<description><![CDATA[Here&#8217;s my latest &#8220;weekend project.&#8221; It was supposed to be a little tool I wrote for myself on a lazy Sunday afternoon. Then I decided I would release it to you all, and that causes a project to really balloon in scope. I had to worry about it crashing, clean up my code so no [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_204" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/09/ZenLibrary.png"><img class="size-medium wp-image-204" title="ZenLibrary's Main Screen" src="http://inchoatethoughts.com/wp-content/uploads/2009/09/ZenLibrary-300x193.png" alt="ZenLibrary's Main Screen" width="300" height="193" /></a><p class="wp-caption-text">ZenLibrary&#39;s Main Screen</p></div>
<p>Here&#8217;s my latest &#8220;weekend project.&#8221; It was supposed to be a little tool I wrote for myself on a lazy Sunday afternoon. Then I decided I would release it to you all, and that causes a project to really balloon in scope. I had to worry about it crashing, clean up my code so no one could blackmail me with it later, restructure the architecture to be generic, blah, blah, blah. But, I&#8217;ll save all those boring details for the next blog post aimed at programmers. This is supposed to be the post where I tell you what this project does.</p>
<p>Thus, I present to you: ZenLibrary. It&#8217;s a simple tool for all of you people as obsessed with sanitizing your media library as I am. You give it your music library, and it tells you all the things wrong with it (presumably so you can fix them). Step 1, you tell it where your music library is. Step 2, you choose what rules you want to test against your music library. Step 3, you fix the problems it finds.</p>
<p>Here&#8217;s the feature list:</p>
<ul>
<li>Simple, streamlined UI.</li>
<li>Comes with a set of common criteria for sanitizing a music library</li>
<li>Easily extensible rule architecture</li>
<li>User preferences saved between sessions.</li>
<li>Integrates with MP3Tag to quickly launch an editor on any errors it finds.</li>
<li>Double clicking any result takes you straight to that folder (again, for easy editing)</li>
</ul>
<p>Requirements:</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;displaylang=en">.NET Framework 3.5 SP1</a></li>
</ul>
<p><a href="http://inchoatethoughts.com/files/ZenLibrary_0.4.zip">Download ZenLibrary 0.4</a></p>
<p>For people interested in extending it or getting their hands on the source code, <a href="http://inchoatethoughts.com/extending-zenlibrary-creating-new-rules">be sure to check out my next post on doing just that.</a></p>
<h2>Version Updates:<em><strong> </strong></em></h2>
<p><strong>9-14-2009:</strong> Release 0.4</p>
<p>- Fixed icon error causing crashes in Windows XP and Vista<br />
- Moved included rules out to their own assembly.</p>
<p><strong>9-13-2009:</strong> Release 0.3</p>
<p>- Created ZenLibrary.Rulebase.dll for plugin support</p>
<p><strong>9-12-2009:</strong> Release 0.2</p>
<p>- Added initial support for M4A, OGG, and FLAC files.<br />
- Added detailed error information for tests that are unable to complete (red exclamation circles).<br />
- Changed &#8220;Stereo&#8221; test method to a simple check on the number of audio channels.<br />
- Fixed bug in album art directory scanning<br />
- Disabled rule options while scanning (to prevent thread collisions)</p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/zenlibrary/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom Drawing Controls in C# &#8211; Manual Double Buffering</title>
		<link>http://inchoatethoughts.com/custom-drawing-controls-in-c-manual-double-buffering</link>
		<comments>http://inchoatethoughts.com/custom-drawing-controls-in-c-manual-double-buffering#comments</comments>
		<pubDate>Sat, 15 Aug 2009 18:43:10 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[BufferedGraphicsContext]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Double Buffering]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=168</guid>
		<description><![CDATA[I feel like this article is about four years too late. All the cool kids have moved on to WPF or something really awesome, like XNA, for their graphics needs. However, there are still a lot of us playing around in the .NET 2.0 mucky muck for various reasons. Of those still doing .NET 2.0 [...]]]></description>
			<content:encoded><![CDATA[<p>I feel like this article is about four years too late. All the cool kids have moved on to WPF or something really awesome, like XNA, for their graphics needs. However, there are still a lot of us playing around in the .NET 2.0 mucky muck for various reasons. Of those still doing .NET 2.0 / WinForms / GDI+ programming, I&#8217;m surprised to see how many people draw their custom controls the wrong way. Yep, I said &#8220;wrong.&#8221; I blame the majority of the C# books out there. Most of them, in the chapter on System.Drawing, just tell everyone to draw their stuff in OnPaint() or in response to a paint event. PLEASE, STOP DOING THIS. I&#8217;ll explain why.</p>
<p>One should not have a lot going on in one&#8217;s OnPaint method. It should be very small, very straight forward. In 95% of my custom controls, my paint event looks something like this:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnPaint<span style="color: #008000;">&#40;</span>PaintEventArgs e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>isDisposing <span style="color: #008000;">&amp;&amp;</span> backbufferGraphics <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; backbufferGraphics<span style="color: #008000;">.</span><span style="color: #0000FF;">Render</span><span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">Graphics</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>That&#8217;s it. Just two lines. Here&#8217;s what&#8217;s going on. OnPaint is the .NET equivalent of the Win32 WM_PAINT message being raised. It happens when a region of your control is &#8220;invalidated.&#8221; Invalidation occurs when Windows thinks your control needs to be redrawn for some reason. Examples include your control being resized, another window moving in front of it, your window losing and regaining focus, etc. Because OnPaint() is called so frequently and unpredictably, it is not wise to have a lot of complex and CPU-intensive operations going on inside of it.</p>
<p>You may be wondering what we do instead. You be smart and efficient about it. Because the drawing logic is often complex and expensive, you&#8217;ll want to do it only as often as necessary. This means having an off-screen buffer that you draw to. When it comes time to actually paint your control on to the screen, your control can just go take a look at our off-screen buffer and copy it to the display. Pretty simple. Now, there is added complexity when you consider that you may be drawing to this buffer at the exact same time your control needs to draw it to the screen. In this scenario, your control would have to site around and wait with an invalidated region until you&#8217;ve finished drawing to your buffer. What this usually looks like to the end user is an irritating flicker on the control. The flicker they see is a rapid switch between invalidated control regions (which are usually painted pure white, black, or some other random bit of color) and the drawn buffer.</p>
<p>A quick look around the net will reveal that the solution to flicker is &#8220;double buffering.&#8221; Now, mind you, none of this is a new concept. People have been doing this for about as long as computer graphics have existed. The difference is, it&#8217;s a lot easier now. .NET literally makes it as easy as setting a property on your forms or controls. Beyond that, a programmer used to have to actually manage two buffers manually and swap between them. This is more automated with the introduction of the BufferedGraphics and BufferedGraphicsContext classes. Basically, you draw to the BufferedGraphics class, and it takes care of the double buffering for you. Here is an example constructor and buffer creation routine.</p>
<p>Constructor setting up the form&#8217;s double buffering properties:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> DoubleBufferedControl<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; InitializeComponent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Set the control style to double buffer.</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">SetStyle</span><span style="color: #008000;">&#40;</span>ControlStyles<span style="color: #008000;">.</span><span style="color: #0000FF;">AllPaintingInWmPaint</span> <span style="color: #008000;">|</span> ControlStyles<span style="color: #008000;">.</span><span style="color: #0000FF;">UserPaint</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">SetStyle</span><span style="color: #008000;">&#40;</span>ControlStyles<span style="color: #008000;">.</span><span style="color: #0000FF;">SupportsTransparentBackColor</span>, <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">SetStyle</span><span style="color: #008000;">&#40;</span>ControlStyles<span style="color: #008000;">.</span><span style="color: #0000FF;">OptimizedDoubleBuffer</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Assign our buffer context.</span><br />
&nbsp; &nbsp; backbufferContext <span style="color: #008000;">=</span> BufferedGraphicsManager<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; initializationComplete <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; RecreateBuffers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; Redraw<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>And here is an example of creating the buffers</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> RecreateBuffers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Check initialization has completed so we know backbufferContext has been assigned.</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Check that we aren't disposing or this could be invalid.</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>initializationComplete <span style="color: #008000;">||</span> isDisposing<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// We recreate the buffer with a width and height of the control. The &quot;+ 1&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// guarantees we never have a buffer with a width or height of 0.</span><br />
&nbsp; &nbsp; backbufferContext<span style="color: #008000;">.</span><span style="color: #0000FF;">MaximumBuffer</span> <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Size<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Width</span> <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span>, <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Height</span> <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Dispose of old backbufferGraphics (if one has been created already)</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>backbufferGraphics <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; backbufferGraphics<span style="color: #008000;">.</span><span style="color: #0000FF;">Dispose</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Create new backbufferGrpahics that matches the current size of buffer.</span><br />
&nbsp; &nbsp; backbufferGraphics <span style="color: #008000;">=</span> backbufferContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Allocate</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">CreateGraphics</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>,<br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Rectangle<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span>, Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Max</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Width</span>, <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span>, Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Max</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Height</span>, <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Assign the Graphics object on backbufferGraphics to &quot;drawingGraphics&quot; for easy reference elsewhere.</span><br />
&nbsp; &nbsp; drawingGraphics <span style="color: #008000;">=</span> backbufferGraphics<span style="color: #008000;">.</span><span style="color: #0000FF;">Graphics</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// This is a good place to assign drawingGraphics.SmoothingMode if you want a better anti-aliasing technique.</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Invalidate the control so a repaint gets called somewhere down the line.</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Invalidate</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Now, there is one critical place where we make sure to call RecreateBuffers(). That is when the control is resized. The buffers we create in RecreateBuffers() are all sized to match the control&#8217;s size. If the buffer wasn&#8217;t the size of the control, the control would repaint with a large region of invalid graphics. So, just make sure you have a call to RecreateBuffers in OnResize for your control:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnResize<span style="color: #008000;">&#40;</span>EventArgs e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OnResize</span><span style="color: #008000;">&#40;</span>e<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; RecreateBuffers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; Redraw<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>That&#8217;s pretty much all you need to get a custom double buffered control going. You may have noted that I made a few calls to &#8220;Redraw().&#8221; Redraw() is where I put my actual drawing logic. What goes in Redraw() is the meat of how you render your control. Just remember, call it only when needed. Don&#8217;t go and put the call to Redraw() in OnPaint(). That would be against everything this article tried to teach. This method of rendering is very powerful and I&#8217;ve created a number of real-time fast-rendering controls with this mechanism. I&#8217;ve been using this method for many years now, so it is tried and true. One of the first times I started double buffering on a custom control was for a custom chart and spectrogram I made for some spectrum analyzer software I was working on. Here is a screenshot:</p>
<div id="attachment_185" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/08/graph-spectrogram.png"><img class="size-medium wp-image-185" title="Realtime Graph and Spectrogram" src="http://inchoatethoughts.com/wp-content/uploads/2009/08/graph-spectrogram-300x225.png" alt="Realtime Graph and Spectrogram" width="300" height="225" /></a><p class="wp-caption-text">Realtime Graph and Spectrogram</p></div>
<p>Thanks for reading. If it helps anyone, I&#8217;ve attached a very simple sample project below that contains all the code I&#8217;ve shown above. If you have any questions or comments, feel free to use the comments below.</p>
<p><a href="http://inchoatethoughts.com/uploads/BufferedGraphicsContextExample.zip">Download Sample Project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/custom-drawing-controls-in-c-manual-double-buffering/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone Apps for Drummers</title>
		<link>http://inchoatethoughts.com/iphone-apps-for-drummers</link>
		<comments>http://inchoatethoughts.com/iphone-apps-for-drummers#comments</comments>
		<pubDate>Thu, 13 Aug 2009 04:07:16 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Drums]]></category>
		<category><![CDATA[Drummers]]></category>
		<category><![CDATA[Drumming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Apps]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=154</guid>
		<description><![CDATA[There are a lot of iPhone apps out there, and a lot of them are aimed at drummers. There are metronomes, practice tools, tuners, drum machines, recorders, etc. I&#8217;ll be honest. I&#8217;ve bought a lot of them. Of those I&#8217;ve bought or downloaded, I actually use an incredibly small percentage of of them on any [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of iPhone apps out there, and a lot of them are aimed at drummers. There are metronomes, practice tools, tuners, drum machines, recorders, etc. I&#8217;ll be honest. I&#8217;ve bought a lot of them. Of those I&#8217;ve bought or downloaded, I actually <em>use</em> an incredibly small percentage of of them on any sort of regular basis. In fact, I&#8217;d wager I&#8217;ll never touch 90% of them again. However, some of the ones I use regularly are incredibly useful, so I figured I would share.<strong> </strong></p>
<p style="text-align: center;"><a title="Amazing Slow Downer" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=308998718&amp;mt=8" target="_blank"><strong>Amazing Slow Downer</strong></a></p>
<p style="text-align: left;"><strong> </strong></p>
<div id="attachment_156" class="wp-caption aligncenter" style="width: 210px"><strong><strong><a href="http://inchoatethoughts.com/wp-content/uploads/2009/08/IMG_0144.PNG"><img class="size-medium wp-image-156" title="Amazing Slow Downer" src="http://inchoatethoughts.com/wp-content/uploads/2009/08/IMG_0144-200x300.PNG" alt="Amazing Slow Downer" width="200" height="300" /></a></strong></strong><p class="wp-caption-text">Amazing Slow Downer</p></div>
<p>Amazing Slow Downer is, hands down, the best tool in my arsenal for learning how to play (or transcribe) other people&#8217;s music. What it does is simple in a sense. It slows down the song, but manages to keep the pitch. How much you slow down the song is variable. As you can see from the screenshot, there&#8217;s a whole host of sliders you can adjust, and they&#8217;re all pretty useful.  Aside from slowing down songs, Amazing Slow Downer is incredibly useful for setting up and repeating difficult parts of songs. At $14.99 at the time of this writing, Amazing Slow Downer is one of the more expensive applications in the iTunes App Store. However, it&#8217;s totally worth it. And, compared to the $49.95 the Mac/PC version costs, it doesn&#8217;t feel like a bad deal at all.</p>
<p style="text-align: center;"><a title="Setlist Metronome" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307349853&amp;mt=8" target="_blank"><strong>Setlist Metronome</strong></a></p>
<p style="text-align: left;">
<div id="attachment_159" class="wp-caption aligncenter" style="width: 210px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/08/IMG_0145.PNG"><img class="size-medium wp-image-159" title="Setlist Metronome" src="http://inchoatethoughts.com/wp-content/uploads/2009/08/IMG_0145-200x300.PNG" alt="Setlist Metronome" width="200" height="300" /></a><p class="wp-caption-text">Setlist Metronome</p></div>
<p>There are way too many metronomes available for the iPhone. I&#8217;ve tried quite a few of them, both paid-for and free. This has been my favorite of the bunch. For a drummer, any metronome that uses only audible cues is pretty worthless. Setlist Metronome is, of course, a metronome with both visual and audible cues (otherwise it wouldn&#8217;t be earning my recommendation).  Beyond that, what sets it apart, and earns it its name, is the ability to create a setlist. You define a bunch of tempos and time signatures, load them all in a certain order, and then go play your gig/practice using them. Easy as that! It really doesn&#8217;t do much more, but why would you want it to? Keep it simple and useful. This is another one that costs a bit more than most apps  ($7.99 when this was written). Personally, I still find it worth it.</p>
<p style="text-align: center;"><strong><a title="Cleartune - Chromatic Tuner" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=286799607&amp;mt=8" target="_blank">Cleartune &#8211; Chromatic Tuner</a><br />
</strong></p>
<p style="text-align: left;">
<div id="attachment_161" class="wp-caption aligncenter" style="width: 210px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/08/IMG_0149.PNG"><img class="size-medium wp-image-161 " title="Cleartune - Chromatic Tuner" src="http://inchoatethoughts.com/wp-content/uploads/2009/08/IMG_0149-200x300.PNG" alt="Cleartune" width="200" height="300" /></a><p class="wp-caption-text">Cleartune - Chromatic Tuner</p></div>
<p>I don&#8217;t know if this is something all drummers would need or use, but I&#8217;m one of those that relies on a tuner when I&#8217;m doing my snare and toms, at least to get me started. There are also a lot of tuners out there. This one seemed to be the best (most accurate and quick to respond) of the tuners I tried. It works great on guitars and other &#8220;normal&#8221; instruments, but it&#8217;s quick enough to react to a drum hits too. At $3.99 during this writing, I&#8217;d say it is definitely a solid purchase.</p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/iphone-apps-for-drummers/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Acoustic to Electric Drum Conversion</title>
		<link>http://inchoatethoughts.com/acoustic-to-electric-drum-conversion</link>
		<comments>http://inchoatethoughts.com/acoustic-to-electric-drum-conversion#comments</comments>
		<pubDate>Sun, 19 Jul 2009 06:21:40 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Drums]]></category>
		<category><![CDATA[Acoustic To Electric]]></category>
		<category><![CDATA[Conversion]]></category>
		<category><![CDATA[Electric Drums]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=115</guid>
		<description><![CDATA[Here&#8217;s something I&#8217;ve been meaning to do a writeup on for a while now. About four or five years ago, I decided I was going to play the drums. Now, by that point in my life, I had already realized I possessed the hand-eye coordination of a cantaloupe. Nay, a cantaloupe that has Down syndrome [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something I&#8217;ve been meaning to do a writeup on for a while now. About four or five years ago, I decided I was going to play the drums. Now, by that point in my life, I had already realized I possessed the hand-eye coordination of a cantaloupe. Nay, a cantaloupe that has Down syndrome and has suffered a stroke. Anyone within earshot of me playing an acoustic drum set would suffer a fate far, far worse than any Guantanamo detainee ever did. Under threat of U.N. sanctions, I decided I would do the world a favor and buy an electric drum set and practice with headphones. I went down and picked up a <a href="http://www.rolandus.com/products/productdetails.php?ProductId=597" target="_blank">Roland TD-6S</a>.</p>
<p>Now, this was a good little drum set, but the weaknesses of an electric set are realized fairly quickly. Problem 1: they have all the aesthetic value of a worn black leather boot humping a power transformer. Problem 2: the pads are small and aligned oddly. Roland designed the kits to have a layout similar to one an actual drum set would have, but it is never quite the same. Long story short, it&#8217;s really hard to have delusions of being an awesome rock star while playing one of these electric kits.</p>
<div id="attachment_119" class="wp-caption aligncenter" style="width: 283px"><img class="size-medium wp-image-119" title="td6s" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/V-TOUR_01_600_FNL-5ec0d559117a669528123910923e94bb-273x300.jpg" alt="Pretty damn hard to look cool while playing this." width="273" height="300" /><p class="wp-caption-text">Pretty damn hard to look cool while playing this.</p></div>
<p>Around the same time I was getting a bit frustrated with the dorky electric set, I found out you could take an acoustic set, gut it, put some magical shit inside, and have it work like a silent electric set. Hell yeah! Now that&#8217;s what I&#8217;m talking about. I could still practice without bothering people, and look and feel cooler doing it. It was officially <strong>on</strong>. I bought a nice looking black Tama superstar kit for my conversion. In hindsight, I probably should have gone for an even cheaper drum set, but oh well.</p>
<div id="attachment_125" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/tama1.jpg" target="_blank"><img class="size-medium wp-image-125" title="tama1" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/tama1-300x225.jpg" alt="My Tama drum set before I converted it." width="300" height="225" /></a><p class="wp-caption-text">My Tama drum set before I converted it.</p></div>
<p>So, step one was understanding what the hell turned me whacking some random pad into sounds that came out of a little magic box. Turns out it is all about the &#8220;piezo.&#8221; Piezos, as far as I can tell, are magical relics left by elves of the middle ages. If you whack them, they turn the whack into electricity. If you shock them, they move. It&#8217;s crazy, really. I implore you to <a href="http://en.wikipedia.org/wiki/Piezoelectricity" target="_blank">read all about them</a>. Unfortunately, the piezos are a bit fragile. Smacking them with a drumstick is pretty much guaranteed to break them, so you need something to dampen the blow. In electric drums, this is often done with a foam cone. The tip of the cone touches the drum head, and the cone sits on top of the piezo.</p>
<div id="attachment_118" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-118" title="cone_assembly" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/cone_assembly.png" alt="cone_assembly" width="300" height="223" /><p class="wp-caption-text">A diagram of the cone assembly.</p></div>
<p style="text-align: left;">Piezos solved the problem of how to turn my drum stick hits into something that can be interpreted by my magical drum computer. However, I still had the problem of getting them in the drum and making the drum silent. Let&#8217;s start with mounting the cone assembly in the drum. Most drums have a lot of little screws inside them that hold the lugs on.</p>
<p style="text-align: left;">
<div id="attachment_121" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/building1.JPG" target="_blank"><img class="size-medium wp-image-121" title="building1" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/building1-300x225.jpg" alt="The inside of my snare with lots of little screws useful for attaching things to." width="300" height="225" /></a><p class="wp-caption-text">The inside of my snare with lots of little screws useful for attaching things to.</p></div>
<p style="text-align: left;">A little creative (or not-so-creative) metal work and I had things all attached and set up. I have a slotted bracket on each side of the drum that is held to the drum shell by the lug screws. I then have a bar that runs the length of the drum attached to the brackets. Sitting on the bar is my cone assembly. On most drums, I also wired four more piezos to the shell so that I can detect when I hit the rim instead of the drum head (or both at the same time).</p>
<p style="text-align: left;">
<div id="attachment_123" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/IMG_0854.jpg" target="_blank"><img class="size-medium wp-image-123" title="Electric Snare Internals" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/IMG_0854-300x225.jpg" alt="Here is the snare with the electric components all mounted inside of it. Note the snare wire serves absolutely no purpose here." width="300" height="225" /></a><p class="wp-caption-text">Here is the snare with the electric components all mounted inside of it. Note the snare wire serves absolutely no purpose here.</p></div>
<p style="text-align: left;">Next, making the drum silent. Turns out, this is fairly easy. Drums make noise because striking the drum head causes a big burst of air to travel down. It&#8217;s the same way a speaker cone moves and makes sound. Poke enough holes in a drum heads, and the air will just escape out the top or bottom and you won&#8217;t get much sound at all. It&#8217;s like knocking on the screen part of a screen door versus knocking on a nice hollow wood door. In fact, that&#8217;s almost exactly how we handle it with drum heads. One can buy &#8220;mesh&#8221; drum heads. They&#8217;re basically screen door material that is stretched really tight. You hit them, and it moves the cone and triggers the piezo. But, the air escapes easily so it produces very little sound. There are a handful of brands of mesh drum heads one can purchase. The best ones are made by Roland, but they really dislike people doing these sorts of projects and have stopped selling most of the mesh head sizes needed for a kit like this.</p>
<p style="text-align: left;">
<div id="attachment_127" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase1complete.jpg" target="_blank"><img class="size-medium wp-image-127" title="phase1complete" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase1complete-300x225.jpg" alt="Acoustic kit after converting the drums to electric." width="300" height="225" /></a><p class="wp-caption-text">Acoustic kit after converting the drums to electric.</p></div>
<p>I converted all of my shells to electric drums and thus completed the first phase of my acoustic to electric conversion. I could have stopped there but I wasn&#8217;t satisfied yet. It worked pretty well, but it could be better. The first thing I was really unhappy with was the cymbals. Especially that lame TD-6 hi-hat setup. I found a company called Smartrigger that made these incredibly realistic looking electric cymbals. I thought I would give them a try.</p>
<div id="attachment_129" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase2complete.jpg" target="_blank"><img class="size-medium wp-image-129" title="phase2complete" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase2complete-300x225.jpg" alt="The acoustic to electric drum set with the Smartrigger cymbals." width="300" height="225" /></a><p class="wp-caption-text">The acoustic to electric drum set with the Smartrigger cymbals.</p></div>
<p>As you can see, the Smartrigger cymbals looked nice. There was a problem though. They kept breaking almost immediately. I sent one back for repair and the company even made me pay for shipping. A week after I got it back, it broke again, and soon after that, another broke. I said screw it and cut my losses. I was done with that company. I decided to go with Roland for my cymbal needs. </p>
<div id="attachment_130" class="wp-caption aligncenter" style="width: 235px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase3complete.JPG" target="_blank"><img class="size-medium wp-image-130" title="phase3complete" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase3complete-225x300.jpg" alt="The almost final layout of my acoustic to electric set." width="225" height="300" /></a><p class="wp-caption-text">The almost final layout of my acoustic to electric set.</p></div>
<p>The Roland cymbals were a little more lame looking, but they triggered better and wouldn&#8217;t break on me. At the same time, I replaced my TD-6 module with a TD-20 and built this awesome audio rack. As far as an authentic feel goes, nothing in the electronic cymbal realm beats the VH-12 hi-hats. They trigger beautifully and use a standard hi-hat stand.</p>
<div id="attachment_141" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase3-1.jpg" target="_blank"><img class="size-medium wp-image-141" title="phase3-1" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/phase3-1-300x225.jpg" alt="From the front, it still almost looks like an acoustic set!" width="300" height="225" /></a><p class="wp-caption-text">From the front, it still almost looks like an acoustic set!</p></div>
<p>Kit mostly complete (my current setup has one extra cymbal), I started learning of all the cool things an electric kit allows me to do. Beyond practicing without pissing off everyone around me, I&#8217;m also able to play <a href="http://mainori-se.sakura.ne.jp/dtxmania/">DTXMania</a>. If you&#8217;ve ever played the drums in the video game Rock Band, then you kind of know what DTXMania is. However, it much better because it uses my much more realistic feeling set and allows for more triggers than Rock Band does.</p>
<div id="attachment_133" class="wp-caption aligncenter" style="width: 310px"><a href="http://inchoatethoughts.com/wp-content/uploads/2009/07/goneaway.jpg" target="_blank"><img class="size-medium wp-image-133" title="goneaway" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/goneaway-300x225.jpg" alt="A DTXMania scoring screen after playing a song." width="300" height="225" /></a><p class="wp-caption-text">A DTXMania scoring screen after playing a song.</p></div>
<p>So that&#8217;s the story on my electric drum set that looks like an acoustic one. If you want to learn a whole lot more about these sorts of acoustic to electric conversions, check out the <a href="http://vdrums.com/forum/" target="_blank">VDrums.com forums</a>. Aside from tutorials on how to build one of these things, they also have product reviews on mesh heads and just about any other kind of information you could want relating to electric drum sets.</p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/acoustic-to-electric-drum-conversion/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Drum Tech: Run Devil Run at The Roxy</title>
		<link>http://inchoatethoughts.com/drum-tech-run-devil-run-at-the-roxy</link>
		<comments>http://inchoatethoughts.com/drum-tech-run-devil-run-at-the-roxy#comments</comments>
		<pubDate>Sun, 05 Jul 2009 05:23:52 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Drums]]></category>
		<category><![CDATA[Drum Tech]]></category>
		<category><![CDATA[Run Devil Run]]></category>

		<guid isPermaLink="false">http://inchoatethoughts.com/?p=94</guid>
		<description><![CDATA[Every so often, I get the opportunity to act as a &#8220;drum tech&#8221; for my drum teacher and his band, Run Devil Run. This is a great deal of fun because I get to hang backstage and watch band interactions with bands that are at a higher level than anyone I&#8217;ve ever played with. I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Every so often, I get the opportunity to act as a &#8220;drum tech&#8221; for my drum teacher and his band, <a title="Run Devil Run Myspace site." href="http://www.myspace.com/rundevilrunmusic" target="_blank">Run Devil Run</a>. This is a great deal of fun because I get to hang backstage and watch band interactions with bands that are at a higher level than anyone I&#8217;ve ever played with. I&#8217;ll share some of these behind-the-scene details with all of you. My task as a drum tech is pretty simple; I must help get the drums set up and torn down as quickly as possible. Dave doesn&#8217;t have some crazy Neil Peart-sized kit, so this isn&#8217;t rocket science. That&#8217;s usually the end of my responsibility. Only once have I had to run out mid-set (to give Dave a drum key at the House of Blues). My final task, and perhaps the most important, is to keep Dave conscious with a constant stream of Red Bulls.</p>
<div id="attachment_95" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-95" title="roxyshow1" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/show1.jpg" alt="Dave doing his microphone level check before the curtains open." width="400" height="300" /><p class="wp-caption-text">Dave doing his microphone level check before the curtains open.</p></div>
<p>So, I have it pretty easy (unlike the guitar tech who actually has stuff to do during the set). This leaves me with plenty of time to stand around and judge people. My findings are:</p>
<ul>
<li>All of the band members I have talked to at the various venues, including everyone in Run Devil Run, have been nothing but extremely laid back and cool. Never seen any band member (from any band) act like a jerk to me or anyone else.</li>
<li>The staff at the venues have been a mixed bag. Some are cool, some are a bit uptight and douchey. It&#8217;s actually never been the security staff that I&#8217;ve had an issue with. It&#8217;s usually some of the other people that have had egos that were a bit too large. This night, however, everyone was very cool. The stage manager (who I had never met before) was especially friendly.</li>
</ul>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-97" title="roxyshow2" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/show2.jpg" alt="Dave rocking it up!" width="400" height="300" /><p class="wp-caption-text">Dave rocking it up!</p></div>
<p>The show went pretty damn well. Run Devil Run appeared to be the most popular band of the evening, but they weren&#8217;t the last to go on. When the curtains closed, there was an encore chant. This was one of those situations where the band really had no plans to do an encore. There was a hurried negotiation with the stage manager to deliver the encore the crowd was calling for. Then there was an even more hurried decision between band members as to which song they were going go out with. It&#8217;s refreshing to see an encore performance that was genuine (unplanned).</p>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-98" title="roxyshow3" src="http://inchoatethoughts.com/wp-content/uploads/2009/07/show3.jpg" alt="The rest of the band kicking ass." width="400" height="300" /><p class="wp-caption-text">The rest of the band kicking ass.</p></div>
<p>After the show ended, we got the drums out of there, and I needed to load them up in a vehicle while Dave chatted with lots of adoring fans. This is like the world&#8217;s hardest game of Tetris. There is a very specific order to which thing goes in the car, and I always screw it up. Despite the gear being rugged, there are still fragile points on a drum set and it&#8217;d be a shame to scratch one of the shells. There you have it!</p>
]]></content:encoded>
			<wfw:commentRss>http://inchoatethoughts.com/drum-tech-run-devil-run-at-the-roxy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
