<?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>about:benjie &#187; MythPyWii</title>
	<atom:link href="http://www.benjiegillam.com/category/mythpywii/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benjiegillam.com</link>
	<description>Benjie Gillam's blog, and home of MythPyWii - probably the best Wii remote (Wiimote) interface to MythTV - see sidebar.</description>
	<lastBuildDate>Tue, 06 Apr 2010 14:14:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MythPyWii &#8211; now on Google Code</title>
		<link>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/</link>
		<comments>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 18:58:10 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=335</guid>
		<description><![CDATA[Fancy submitting to MythPyWii? Let me know! It&#8217;s now on Google Code.
Code, documentation, bugs, bugfixes, etc all welcome!
]]></description>
			<content:encoded><![CDATA[<p>Fancy <a href="http://code.google.com/p/mythpywii/">submitting to MythPyWii</a>? Let me know! It&#8217;s now on Google Code.</p>
<p>Code, documentation, bugs, bugfixes, etc all welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MythPyWii Power Update (v17)</title>
		<link>http://www.benjiegillam.com/2009/10/mythpywii-power-update-v17/</link>
		<comments>http://www.benjiegillam.com/2009/10/mythpywii-power-update-v17/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 17:37:58 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=242</guid>
		<description><![CDATA[



Image via Wikipedia



Thanks to Matthew Zimmerman for sending me his modified version of MythPyWii, it now has power-saving &#8211; after 35 minutes of inactivity the Wiimote turns off. You can download the latest version, as always, here; or you can get this specific version (v17) here.
I love open source!

]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 282px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Myth_tv_logo.png"><img title="Myth tv logo" src="http://upload.wikimedia.org/wikipedia/commons/6/6a/Myth_tv_logo.png" alt="Myth tv logo" width="272" height="91" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Myth_tv_logo.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Thanks to Matthew Zimmerman for sending me his modified version of MythPyWii, it now has power-saving &#8211; after 35 minutes of inactivity the Wiimote turns off. You can download the latest version, as always, <a title="Latest MythPyWii version" href="http://www.benjiegillam.com/code/myth_py_wii.py" target="_blank">here</a>; or you can get this specific version (v17) <a title="MythPyWii revision 17" href="http://www.benjiegillam.com/code/myth_py_wii.r17.py" target="_blank">here</a>.</p>
<p>I love open source!</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/422a939e-dfa7-48f3-9059-6e69acd0420a/"><img class="zemanta-pixie-img" style="border: medium none ; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=422a939e-dfa7-48f3-9059-6e69acd0420a" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/10/mythpywii-power-update-v17/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Calling All Southampton Hackers!</title>
		<link>http://www.benjiegillam.com/2009/05/calling-all-southampton-hackers/</link>
		<comments>http://www.benjiegillam.com/2009/05/calling-all-southampton-hackers/#comments</comments>
		<pubDate>Wed, 20 May 2009 09:36:48 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Personal computer]]></category>
		<category><![CDATA[Southackton]]></category>
		<category><![CDATA[Southampton]]></category>
		<category><![CDATA[Wii]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=199</guid>
		<description><![CDATA[



Image via Wikipedia




Before we start, just to be clear &#8211; this is not for crackers (people who illegally break in to computer systems) but for hackers (people who modify the software or hardware of their computer system including building, rebuilding, modifying and creating software and electronic hardware either to make it better, faster, give added [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Southampton_-_Bargate.JPG"><img title="City of Southampton" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Southampton_-_Bargate.JPG/300px-Southampton_-_Bargate.JPG" alt="City of Southampton" width="300" height="216" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Southampton_-_Bargate.JPG">Wikipedia</a></dd>
</dl>
</div>
</div>
<blockquote>
<p style="text-align: right;">Before we start, just to be clear &#8211; this is not for <a title="Crackers are Black Hat Hackers" href="http://en.wikipedia.org/wiki/Hacker_(computer_security)#Black_hat" target="_blank">crackers</a> (people who illegally break in to computer systems) but for <a title="Wikipedia Hacker (hobbyist) article" href="http://en.wikipedia.org/wiki/Hacker_(hobbyist)" target="_blank">hackers</a> (people who modify the software or hardware of their computer system including building, rebuilding, modifying and creating software and electronic hardware either to make it better, faster, give added features or to make it do something it was never intended to do).</p>
</blockquote>
<p><strong>UPDATE</strong>: we have a google group: <a title="Southackton Google Group" href="http://groups.google.com/group/southackton" target="_blank">http://groups.google.com/group/southackton</a></p>
<p>I&#8217;m intending on setting up a &#8220;<a title="Hackerspace Wikipedia Article" href="http://en.wikipedia.org/wiki/Hackerspace" target="_blank">Hackerspace</a>&#8221; in <a class="zem_slink" title="Southampton" rel="wikipedia" href="http://en.wikipedia.org/wiki/Southampton">Southampton</a> targeted around software programming (for fun) and <a class="zem_slink" title="Hacker (hobbyist)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hacker_%28hobbyist%29">hardware hacking</a> (e.g. robotics). I anticipate that people would attend the hackerspace either with their own personal projects (such as <a title="MythPyWii" href="http://www.benjiegillam.com/mythpywii-installation/" target="_blank">controlling their television using a Wii remote</a>), or looking to join in on a cool project. The idea is that we can all share knowledge and help each other out in a fun and innovative environment.</p>
<p>I am provisionally calling this project Sout<span style="color: #ff0000;">hack</span>ton, though I expect (hope!) a better name will surface once more people are interested! If you or anyone you know is interested, please contact me via email (my name at benjiegillam.com) or by leaving a comment on this post.</p>
<p>The ultimate goal would be having an &#8220;office&#8221; somewhere in Southampton where members can drop in any time (within reason) and get to work on their project/just hang out with fellow hackers. If you work from home you could even work form the Hackerspace directly &#8211; it wouldn&#8217;t be so lonely! I am, however, expecting that we would run it as a &#8220;club&#8221; until we have enough interested members to make it feasible. Whether this club be weekly, fortnightly, monthly, or bi-monthly is a matter for interested persons to discuss &#8211; get in contact and let me know what you think!</p>
<p>As you may know if you read this blog (doubtful!), I am a great fan of <a class="zem_slink" title="Open source" rel="wikipedia" href="http://en.wikipedia.org/wiki/Open_source">open source</a>, and have been a dedicated <a class="zem_slink" title="Linux" rel="wikipedia" href="http://en.wikipedia.org/wiki/Linux">GNU/Linux</a> user for almost 10 years now, so Linux users would be cool to have as they tend to be interested in tweaking hardware/software, however everyone would be welcome independent of their choice of <a class="zem_slink" title="Operating system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Operating_system">operating system</a>. Yes, that&#8217;s right &#8211; even Windows users!</p>
<p>Further, there is no required skill level. I&#8217;m happy to have people attend who want to acheive something (e.g. making a webcam recognise who is sat at the PC and change the computers background to a related picture/have their favourite teddy walk towards them) but have no idea how to go about it, so long as they are patient and willing to learn!</p>
<p>I hope you&#8217;re interested &#8211; let me know!</p>
<p><strong>UPDATE</strong>: if you&#8217;re interested, sign up to our google group: <a title="Southackton Google Group" href="http://groups.google.com/group/southackton" target="_blank">http://groups.google.com/group/southackton</a>.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/3a5211f8-7322-41da-89fa-0b90fecabf9a/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=3a5211f8-7322-41da-89fa-0b90fecabf9a" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/05/calling-all-southampton-hackers/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>MythPyWii Bugfixes and Enhancements</title>
		<link>http://www.benjiegillam.com/2008/09/mythpywii-bugfixes-and-enhancements/</link>
		<comments>http://www.benjiegillam.com/2008/09/mythpywii-bugfixes-and-enhancements/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 19:17:52 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[bugfixes]]></category>
		<category><![CDATA[timestretch]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=157</guid>
		<description><![CDATA[

I&#8217;ve just updated MythPyWii to handle the connection to Mythfrontend more smoothly, and to give feedback via the wiimote on error/disconnect. (i.e. if myth closes, the wiimote shakes, and the LED pattern changes to [ . # # . ] instead of [ # . . # ] just before the wiimote turns itself off). [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img zemanta-action-click">
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/16419724@N00/282707058"><img title="Software Bugs" src="http://farm1.static.flickr.com/113/282707058_02305d3cce_m.jpg" alt="Software Bugs" height="211" width="240"></a><p class="wp-caption-text">Image by FastJack via Flickr</p></div>
</div>
<p>I&#8217;ve just updated MythPyWii to handle the connection to Mythfrontend more smoothly, and to give feedback via the wiimote on error/disconnect. (i.e. if myth closes, the wiimote shakes, and the LED pattern changes to [ . # # . ] instead of [ # . . # ] just before the wiimote turns itself off). This means if there are issues connecting to Mythfrontend you can retry again simply by pressing 1&amp;2 once more (fix any issues first though &#8211; e.g. closed mythfrontend/no remote interface enabled).</p>
<p>I&#8217;ve fixed a little bug with timestretching, and have also improved the timestretch responsiveness by emulating not just the left/right keys but also the up/down keys (which increase/decrease timestretch by 0.25 instead of just 0.05).</p>
<p>As always, download the latest version of MythPyWii <a href="http://www.benjiegillam.com/mythpywii-installation/">here</a>.</p>
<p>Ah hah, an update to <a class="zem_slink" title="Zemanta" rel="homepage" href="http://www.zemanta.com">Zemanta</a> has just been released! Integration with Facebook and Flickr, eh? I best sign up for a Flickr account then, I suppose&#8230; Argh! They seem to have broken images with my theme &#8211; I fixed it by adding this CSS to my theme (copied from firebug):</p>
<p><code class="source">
.alignright {
  float:right;
}

.wp-caption {
  -moz-border-radius-bottomleft:3px;
  -moz-border-radius-bottomright:3px;
  -moz-border-radius-topleft:3px;
  -moz-border-radius-topright:3px;
  background-color:#F3F3F3;
  border:1px solid #DDDDDD;
  margin:10px;
  padding-top:4px;
  text-align:center;
}
</code>
</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.zemanta.com/blog/new-release-my-friends-my-flickr-and-filter/">New release: My Friends, My Flickr and Filter</a></li>
<li class="zemanta-article-ul-li"><a href="http://blogs.talis.com/nodalities/2008/09/zemanta-gets-personal.php">Zemanta gets personal</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/archives/zemanta_releases_major_upgrade.php">Zemanta Releases Major Upgrade &#8211; Now It&#8217;s All About You</a></li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/0bc437ae-68b8-4224-93a6-1ff26b41280f/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=0bc437ae-68b8-4224-93a6-1ff26b41280f" alt="Reblog this post [with Zemanta]"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2008/09/mythpywii-bugfixes-and-enhancements/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New (Minor) MythPyWii Release (r15)</title>
		<link>http://www.benjiegillam.com/2008/09/new-minor-mythpywii-release-r15/</link>
		<comments>http://www.benjiegillam.com/2008/09/new-minor-mythpywii-release-r15/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 08:08:45 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[feedback]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=150</guid>
		<description><![CDATA[Image via Wikipedia 
Thanks to a heads up from Sam, I have updated the MythPyWii script with better error handling and more informative feedback messages. Hopefully now when you run the script you will know what to do! I&#8217;ve also fixed a few minor bugs in the documentation.
As always, you can download the latest version [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; float: right; display: block;"><a href="http://commons.wikipedia.org/wiki/Image:Bash_screenshot.png"><img style="border: medium none; display: block;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Bash_screenshot.png/202px-Bash_screenshot.png" alt="Screenshot of a sample Bash session, taken on ..." /></a><span class="zemanta-img-attribution">Image via <a href="http://commons.wikipedia.org/wiki/Image:Bash_screenshot.png">Wikipedia</a> </span></div>
<p>Thanks to a heads up from Sam, I have updated the MythPyWii script with better error handling and more informative feedback messages. Hopefully now when you run the script you will know what to do! I&#8217;ve also fixed a few minor bugs in the documentation.</p>
<p>As always, you can download the latest version of MythPyWii <a title="MythPyWii latest version download and instructions" href="http://www.benjiegillam.com/mythpywii-installation/">here</a>.</p>
<p>I should probably make a GUI for MythPyWii at some point&#8230; though it seems a little pointless at the moment. I could allow you to change the controls to your liking, I spose&#8230;</p>
<p><strong>UPDATE</strong>: If you&#8217;re getting errors like:</p>
<blockquote><p>$ myth_py_wii.py<br />
Please open Mythfrontend and then press 1&amp;2 on the wiimote&#8230;<br />
Connected to a wiimote <img src='http://www.benjiegillam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Logged in to MythFrontend<br />
TypeError: wmcb() takes exactly 2 arguments (3 given)<br />
TypeError: wmcb() takes exactly 2 arguments (3 given)<br />
TypeError: wmcb() takes exactly 2 arguments (3 given)<br />
TypeError: wmcb() takes exactly 2 arguments (3 given)</p></blockquote>
<p>Then you have a more up to date version of cwiid than me. The fix is simple &#8211; change line 141:<br />
def wmcb(self, messages):<br />
to:<br />
def wmcb(self, messages<strong>, timeIgnore</strong>):</p>
<p>Thanks to Mike H for pointing out this issue.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.linux.com/feature/145949">Dress up your Python scripts with EasyGui</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/cee41f52-af92-4108-aa88-c7472551c21d/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=cee41f52-af92-4108-aa88-c7472551c21d" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2008/09/new-minor-mythpywii-release-r15/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MythPyWii Video</title>
		<link>http://www.benjiegillam.com/2008/09/mythpywii-video/</link>
		<comments>http://www.benjiegillam.com/2008/09/mythpywii-video/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 22:26:39 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Instructions]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Video editing]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=136</guid>
		<description><![CDATA[Here&#8217;s the short version:

Despite having got up at 3:30am this morning and being extremely tired, it&#8217;s been quite a good day. I finished setting up the media centre, hooked it up to the TV and got it working, sound and all. It seems the PC doesn&#8217;t run video smoothly at 1080p (not suprisingly, it was [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the short version:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/Fx8uoTlZXF0" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/Fx8uoTlZXF0"></embed></object></p>
<p>Despite having got up at 3:30am this morning and being extremely tired, it&#8217;s been quite a good day. I finished setting up the media centre, hooked it up to the TV and got it working, sound and all. It seems the PC doesn&#8217;t run video smoothly at 1080p (not suprisingly, it was bought a good few years ago on a budget, it&#8217;s an onboard graphics card too!) &#8211; but that&#8217;s OK. I dropped it down to ~720p and it seems to run great.</p>
<p>It&#8217;s completely diskless, it&#8217;s only purpose being to play MythTV videos from my main mythbackend. It might find itself playing some DVDs at some point also, we&#8217;ll see.</p>
<p>I installed <a title="MythPyWii is a wiimote interface to MythTV" href="http://www.benjiegillam.com/2008/09/mythpywii-a-wiimote-interface-to-mythtv-using-python/" target="_blank">MythPyWii</a> on it, using my new MythPyWii Install Instructions, which I wrote today and you can <a title="MythPyWii Installation Instructions Ubuntu" href="http://www.benjiegillam.com/mythpywii-installation/" target="_blank">find here</a>. (I also made a page detailing the controls, <a title="MythPyWii Controls" href="http://www.benjiegillam.com/mythpywii-2-controls/" target="_blank">here</a>. Both links can also be found in my sidebar.) Everything went smoothly, so I made the video I had been promising. This is my first time *ever* doing any video editing, and this video was all filmed in one take with no rehersals, so please bear with me! The longer version is better if you need help during the install/etc, and is linked to on the instructions page.</p>
<p>Here goes, I know it&#8217;s a bit long&#8230; perhaps I will make a scripted version sometime which is shorter:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/fqacVgG394I" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/fqacVgG394I"></embed></object></p>
<p>For anyone wondering, I used &#8220;Kino&#8221; to edit the video. It&#8217;s OK, took me a little while to figure it out. &#8220;Add text to&#8221; is a filter under FX called &#8220;Tilter&#8221; &#8211; Text fILTER, I guess&#8230; How intuitive&#8230; <img src='http://www.benjiegillam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2008/09/mythpywii-video/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Zombie MythPyWii Update</title>
		<link>http://www.benjiegillam.com/2008/09/zombie-mythpywii-update/</link>
		<comments>http://www.benjiegillam.com/2008/09/zombie-mythpywii-update/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 03:37:33 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Diskless Booting]]></category>
		<category><![CDATA[OhSoTired]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Wiimote]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=119</guid>
		<description><![CDATA[I can&#8217;t sleep, so I thought it would be wise to give you an update on my previous post about MythPyWii, despite feeling a bit like the living dead must feel. (And having to frequently remove Artie from the keyboard, bless her.)
Unfortunately I have not been able to get a video of MythPyWii yet because [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t sleep, so I thought it would be wise to give you an update on my <a title="MythPyWii is born" href="http://www.benjiegillam.com/2008/09/mythpywii-a-wiimote-interface-to-mythtv-using-python/" target="_blank">previous post about MythPyWii</a>, despite feeling a bit like the <a title="Wikipedia Zombie Article" href="http://en.wikipedia.org/wiki/Zombie" target="_blank">living dead</a> must feel. (And having to frequently remove Artie from the keyboard, bless her.)</p>
<p>Unfortunately I have not been able to get a video of MythPyWii yet because &#8211; minor technical hitch &#8211; I can&#8217;t find a VGA cable to connect my PC to my TV! (Wanted to show off the TV at the same time, it&#8217;s a good excuse!) I have, however, set up completely <a title="Diskless Mythbuntu Installation Instructions" href="https://help.ubuntu.com/community/MythTV/Install/Hardy/Diskless" target="_blank">diskless booting</a> on the old PC &#8211; and it&#8217;s working great! Took me a little bit of hacking (2 hours) to get it working well with my setup mind, not bad for my first ever diskless box! Hopefully it gives me a chance to outline every required piece of software on mythbuntu too. <img src='http://www.benjiegillam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve also been hacking away at MythPyWii, it now has the following improvements:</p>
<ul>
<li>Button repeats are sensible (if you hold &#8220;up&#8221;, it will simulate pressing up, pause 0.5 seconds, and then repeat every 0.15 seconds)</li>
<li>Manually repeating a button works better (previously we ignored any button press 0.5s after the previous one. Now, instead, we reset the delay every time a different key is pressed/released on the Wiimote, so you can tap up as fast as you want (and as fast as mythfrontend can handle))</li>
<li>Slowmo/doubletime &#8211; I&#8217;ve added time stretching. To activate, hold the wiimote flat, hold B and A together, and then twist, as with fast forwarding. When you let go, myth will be left in slowmo, if this is not what you want, adjust timestretch to 1x using the same method! Enjoy!</li>
<li>Fractionally tidier code. This is a mess already (as you would expect for a first attempt at a programming language) &#8211; if anyone out there rocks at Python, any tips would be appreciated!</li>
</ul>
<p>Here&#8217;s the latest code:</p>
<p><code class="source">
<span class="enscript-comment">#!/usr/bin/env python
</span><span class="enscript-string">&quot;&quot;&quot;
Copyright (c) 2008, Benjie Gillam
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    * Neither the name of MythPyWii nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
&quot;&quot;&quot;</span>
<span class="enscript-comment"># By Benjie Gillam http://www.benjiegillam.com/mythpywii/
</span>
<span class="enscript-keyword">import</span> cwiid, time, StringIO, sys, asyncore, socket
<span class="enscript-keyword">from</span> math <span class="enscript-keyword">import</span> log, floor, atan, sqrt, cos, exp

<span class="enscript-comment"># Note to self - list of good documentation:
</span><span class="enscript-comment"># cwiid: http://flx.proyectoanonimo.com/proyectos/cwiid/
</span><span class="enscript-comment"># myth telnet: http://www.mythtv.org/wiki/index.php/Telnet_socket
</span>
<span class="enscript-keyword">def</span> <span class="enscript-function-name">do_scale</span>(input, max, divisor=None):
	<span class="enscript-keyword">if</span> divisor <span class="enscript-keyword">is</span> None: divisor = max
	<span class="enscript-keyword">if</span> (input &gt; 1): input = 1
	<span class="enscript-keyword">if</span> (input &lt; -1): input = -1
	input = int(input * divisor)
	<span class="enscript-keyword">if</span> input&gt;max: input = max
	<span class="enscript-keyword">elif</span> input &lt; -max: input = -max
	<span class="enscript-keyword">return</span> input


<span class="enscript-keyword">class</span> MythSocket(asyncore.dispatcher):
	firstData = True
	data = <span class="enscript-string">&quot;&quot;</span>
	prompt=<span class="enscript-string">&quot;\n# &quot;</span>
	owner = None
	buffer = <span class="enscript-string">&quot;&quot;</span>
	callbacks = []
	oktosend = True
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">__init__</span>(self, owner):
		self.owner = owner
		asyncore.dispatcher.__init__(self)
		self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
		self.connect((<span class="enscript-string">&quot;localhost&quot;</span>, 6546))
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">handle_connect</span>(self):
		<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Connected&quot;</span>
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">handle_close</span>(self):
		<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Closed&quot;</span>
		self.close()
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">handle_read</span>(self):
		self.data = self.data + self.recv(8192)
		<span class="enscript-keyword">while</span> len(self.data)&gt;0:
			a = self.data.find(self.prompt)
			<span class="enscript-keyword">if</span> a&gt;-1:
				self.oktosend = True
				result = self.data[:a]
				self.data = self.data[a+len(self.prompt):]
				<span class="enscript-keyword">if</span> <span class="enscript-keyword">not</span> self.firstData:
					<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;&lt;&lt;&lt;&quot;</span>, result
					cb = self.callbacks.pop(0)
					<span class="enscript-keyword">if</span> cb:
						cb(result)
				<span class="enscript-keyword">else</span>:
					<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Logged in to MythFrontend&quot;</span>
					self.firstData = False
			<span class="enscript-keyword">else</span>:
				<span class="enscript-keyword">break</span>;
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">writable</span>(self):
		<span class="enscript-keyword">return</span> (self.oktosend) <span class="enscript-keyword">and</span> (len(self.buffer) &gt; 0) <span class="enscript-keyword">and</span> (self.buffer.find(<span class="enscript-string">&quot;\n&quot;</span>) &gt; 0)
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">handle_write</span>(self):
		a = self.buffer.find(<span class="enscript-string">&quot;\n&quot;</span>)
		sent = self.send(self.buffer[:a+1])
		<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;&gt;&gt;&gt;&quot;</span>, self.buffer[:sent-1]
		self.buffer = self.buffer[sent:]
		self.oktosend = False
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">cmd</span>(self, data, cb = None):
		self.buffer += data + <span class="enscript-string">&quot;\n&quot;</span>
		self.callbacks.append(cb)
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">raw</span>(self, data):
		cmds = data.split(<span class="enscript-string">&quot;\n&quot;</span>)
		<span class="enscript-keyword">for</span> cmd <span class="enscript-keyword">in</span> cmds:
			<span class="enscript-keyword">if</span> len(cmd.strip())&gt;0:
				self.cmd(cmd)
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">ok</span>(self):
		<span class="enscript-keyword">return</span> len(self.callbacks) == len(self.buffer) == 0


<span class="enscript-keyword">class</span> WiiMyth:
	wii_calibration = False
	wm = None
	ms = None
	wii_calibration = None
	<span class="enscript-comment">#Initialize variables
</span>	reportvals = {<span class="enscript-string">&quot;accel&quot;</span>:cwiid.RPT_ACC, <span class="enscript-string">&quot;button&quot;</span>:cwiid.RPT_BTN, <span class="enscript-string">&quot;ext&quot;</span>:cwiid.RPT_EXT,  <span class="enscript-string">&quot;status&quot;</span>:cwiid.RPT_STATUS}
	report={<span class="enscript-string">&quot;accel&quot;</span>:True, <span class="enscript-string">&quot;button&quot;</span>:True}
	state = {<span class="enscript-string">&quot;acc&quot;</span>:[0, 0, 1]}
	lasttime = 0.0
	laststate = {}
	responsiveness = 0.15
	firstPress = True
	firstPressDelay = 0.5
	maxButtons = 0
	<span class="enscript-comment">#wii_rel = lambda v, axis: float(v - self.wii_calibration[0][axis]) / (
</span>	<span class="enscript-comment">#	self.wii_calibration[1][axis] - self.wii_calibration[0][axis])
</span>	<span class="enscript-keyword">def</span> <span class="enscript-function-name">wii_rel</span>(self, v, axis):
		<span class="enscript-keyword">return</span> float(v - self.wii_calibration[0][axis]) / (
		self.wii_calibration[1][axis] - self.wii_calibration[0][axis])
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">wmconnect</span>(self):
		<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Please press 1&amp;2 on the wiimote...&quot;</span>
		try:
			self.wm = cwiid.Wiimote()
		<span class="enscript-keyword">except</span>:
			self.wm = None
			<span class="enscript-keyword">if</span> self.ms <span class="enscript-keyword">is</span> <span class="enscript-keyword">not</span> None:
				self.ms.close()
				self.ms = None
			<span class="enscript-keyword">return</span> None
		self.ms = MythSocket(self)
		<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Connected...&quot;</span>
		self.wm.rumble=1
		time.sleep(.2)
		self.wm.rumble=0
		<span class="enscript-comment"># Wiimote calibration data (cache this)
</span>		self.wii_calibration = self.wm.get_acc_cal(cwiid.EXT_NONE)
		<span class="enscript-keyword">return</span> self.wm
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">wmcb</span>(self, messages):
		state = self.state
		<span class="enscript-keyword">for</span> message <span class="enscript-keyword">in</span> messages:
			<span class="enscript-keyword">if</span> message[0] == cwiid.MESG_BTN:
				state[<span class="enscript-string">&quot;buttons&quot;</span>] = message[1]
			<span class="enscript-comment">#elif message[0] == cwiid.MESG_STATUS:
</span>			<span class="enscript-comment">#	print &quot;\nStatus: &quot;, message[1]
</span>			<span class="enscript-keyword">elif</span> message[0] == cwiid.MESG_ERROR:
				<span class="enscript-keyword">if</span> message[1] == cwiid.ERROR_DISCONNECT:
					self.wm = None
					<span class="enscript-keyword">if</span> self.ms <span class="enscript-keyword">is</span> <span class="enscript-keyword">not</span> None:
						self.ms.close()
						self.ms = None
					<span class="enscript-keyword">continue</span>
				<span class="enscript-keyword">else</span>:
					<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;ERROR: &quot;</span>, message[1]
			<span class="enscript-keyword">elif</span> message[0] == cwiid.MESG_ACC:
				state[<span class="enscript-string">&quot;acc&quot;</span>] = message[1]
			<span class="enscript-keyword">else</span>:
				<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Unknown message!&quot;</span>, message
			laststate = self.laststate
			<span class="enscript-keyword">if</span> (<span class="enscript-string">'buttons'</span> <span class="enscript-keyword">in</span> laststate) <span class="enscript-keyword">and</span> (laststate[<span class="enscript-string">'buttons'</span>] &lt;&gt; state[<span class="enscript-string">'buttons'</span>]):
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">'buttons'</span>] == 0:
					self.maxButtons = 0
				<span class="enscript-keyword">elif</span> state[<span class="enscript-string">'buttons'</span>] &lt; self.maxButtons:
					<span class="enscript-keyword">continue</span>
				<span class="enscript-keyword">else</span>:
					self.maxButtons = state[<span class="enscript-string">'buttons'</span>]
				self.lasttime = 0
				self.firstPress = True
				<span class="enscript-keyword">if</span> laststate[<span class="enscript-string">'buttons'</span>] == cwiid.BTN_B <span class="enscript-keyword">and</span> <span class="enscript-keyword">not</span> state[<span class="enscript-string">'buttons'</span>] == cwiid.BTN_B:
					del state[<span class="enscript-string">'BTN_B'</span>]
					self.ms.cmd(<span class="enscript-string">'play speed normal'</span>)
				<span class="enscript-keyword">if</span> (laststate[<span class="enscript-string">'buttons'</span>] &amp; cwiid.BTN_A <span class="enscript-keyword">and</span> laststate[<span class="enscript-string">'buttons'</span>] &amp; cwiid.BTN_B) <span class="enscript-keyword">and</span> <span class="enscript-keyword">not</span> (state[<span class="enscript-string">'buttons'</span>] &amp; cwiid.BTN_A <span class="enscript-keyword">and</span> state[<span class="enscript-string">'buttons'</span>] &amp; cwiid.BTN_B):
					del state[<span class="enscript-string">'BTN_AB'</span>]
					<span class="enscript-comment">#self.ms.cmd('play speed normal')
</span>			<span class="enscript-keyword">if</span> self.ms.ok() <span class="enscript-keyword">and</span> (self.wm <span class="enscript-keyword">is</span> <span class="enscript-keyword">not</span> None) <span class="enscript-keyword">and</span> (state[<span class="enscript-string">&quot;buttons&quot;</span>] &gt; 0) <span class="enscript-keyword">and</span> (time.time() &gt; self.lasttime+self.responsiveness):
				self.lasttime = time.time()
				wasFirstPress = False
				<span class="enscript-keyword">if</span> self.firstPress:
					wasFirstPress = True
					self.lasttime = self.lasttime + self.firstPressDelay
					self.firstPress = False
				<span class="enscript-comment"># Stuff that doesn't need roll/etc calculations
</span>				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_HOME:
					self.ms.cmd(<span class="enscript-string">'key escape'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_A:
					self.ms.cmd(<span class="enscript-string">'key enter'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_MINUS:
					self.ms.cmd(<span class="enscript-string">'key d'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_UP:
					self.ms.cmd(<span class="enscript-string">'key up'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_DOWN:
					self.ms.cmd(<span class="enscript-string">'key down'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_LEFT:
					self.ms.cmd(<span class="enscript-string">'key left'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_RIGHT:
					self.ms.cmd(<span class="enscript-string">'key right'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_PLUS:
					self.ms.cmd(<span class="enscript-string">'key p'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_1:
					self.ms.cmd(<span class="enscript-string">'key i'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_2:
					self.ms.cmd(<span class="enscript-string">'key m'</span>)
				<span class="enscript-comment"># Do we need to calculate roll, etc?
</span>				<span class="enscript-comment"># Currently only BTN_B needs this.
</span>				calcAcc = state[<span class="enscript-string">&quot;buttons&quot;</span>] &amp; cwiid.BTN_B
				<span class="enscript-keyword">if</span> calcAcc:
					<span class="enscript-comment"># Calculate the roll/etc.
</span>					X = self.wii_rel(state[<span class="enscript-string">&quot;acc&quot;</span>][cwiid.X], cwiid.X)
					Y = self.wii_rel(state[<span class="enscript-string">&quot;acc&quot;</span>][cwiid.Y], cwiid.Y)
					Z = self.wii_rel(state[<span class="enscript-string">&quot;acc&quot;</span>][cwiid.Z], cwiid.Z)
					<span class="enscript-keyword">if</span> (Z==0): Z=0.00000001 <span class="enscript-comment"># Hackishly prevents divide by zeros
</span>					roll = atan(X/Z)
					<span class="enscript-keyword">if</span> (Z &lt;= 0.0):
						<span class="enscript-keyword">if</span> (X&gt;0): roll += 3.14159
						<span class="enscript-keyword">else</span>: roll -= 3.14159
					pitch = atan(Y/Z*cos(roll))
					<span class="enscript-comment">#print &quot;X: %f, Y: %f, Z: %f; R: %f, P: %f; B: %d    \r&quot; % (X, Y, Z, roll, pitch, state[&quot;buttons&quot;]),
</span>					sys.stdout.flush()
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] &amp; cwiid.BTN_B <span class="enscript-keyword">and</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] &amp; cwiid.BTN_LEFT:
					self.ms.cmd(<span class="enscript-string">'play seek beginning'</span>)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] &amp; cwiid.BTN_B <span class="enscript-keyword">and</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] &amp; cwiid.BTN_A:
					speed=do_scale(roll/3.14159, 20, 25)
					<span class="enscript-keyword">if</span> (speed&lt;-10): speed = -10
					state[<span class="enscript-string">'BTN_AB'</span>] = speed
					cmd = <span class="enscript-string">&quot;&quot;</span>
					<span class="enscript-comment"># on first press,  press a,
</span>					<span class="enscript-comment"># after then use the diff to press left/right
</span>					<span class="enscript-keyword">if</span> <span class="enscript-keyword">not</span> <span class="enscript-string">'BTN_AB'</span> <span class="enscript-keyword">in</span> laststate:
						<span class="enscript-comment"># # query location
</span>						<span class="enscript-comment"># Playback Recorded 00:04:20 of 00:25:31 1x 30210 2008-09-10T09:18:00 6523 /video/30210_20080910091800.mpg 25
</span>						cmd += <span class="enscript-string">&quot;play speed normal\nkey a\n&quot;</span><span class="enscript-comment">#&quot;play speed normal\n&quot;
</span>					<span class="enscript-keyword">else</span>:
						speed = speed - laststate[<span class="enscript-string">'BTN_AB'</span>]
					<span class="enscript-keyword">if</span> speed &gt; 0:
						cmd += abs(speed)*<span class="enscript-string">&quot;key right\n&quot;</span>
					<span class="enscript-keyword">elif</span> speed &lt; 0:
						cmd += abs(speed)*<span class="enscript-string">&quot;key left\n&quot;</span>
					<span class="enscript-keyword">if</span> speed &lt;&gt; 0:
						self.wm.rumble=1
						time.sleep(.05)
						self.wm.rumble=0
					<span class="enscript-keyword">if</span> cmd <span class="enscript-keyword">is</span> <span class="enscript-keyword">not</span> None <span class="enscript-keyword">and</span> cmd:
						self.ms.raw(cmd)
				<span class="enscript-keyword">if</span> state[<span class="enscript-string">&quot;buttons&quot;</span>] == cwiid.BTN_B:
					speed=do_scale(roll/3.14159, 8, 13)
					state[<span class="enscript-string">'BTN_B'</span>] = speed
					<span class="enscript-keyword">if</span> <span class="enscript-keyword">not</span> <span class="enscript-string">'BTN_B'</span> <span class="enscript-keyword">in</span> laststate:
						<span class="enscript-comment"># # query location
</span>						<span class="enscript-comment"># Playback Recorded 00:04:20 of 00:25:31 1x 30210 2008-09-10T09:18:00 6523 /video/30210_20080910091800.mpg 25
</span>						cmd = <span class="enscript-string">&quot;&quot;</span><span class="enscript-comment">#&quot;play speed normal\n&quot;
</span>						<span class="enscript-keyword">if</span> speed &gt; 0:
							cmd += <span class="enscript-string">&quot;key .\n&quot;</span>
						<span class="enscript-keyword">elif</span> speed &lt; 0:
							cmd += <span class="enscript-string">&quot;key ,\n&quot;</span>
						<span class="enscript-keyword">if</span> speed &lt;&gt; 0:
							cmd += <span class="enscript-string">&quot;key &quot;</span>+str(abs(speed)-1)+<span class="enscript-string">&quot;\n&quot;</span>
						<span class="enscript-comment">#print cmd
</span>					<span class="enscript-keyword">elif</span> laststate[<span class="enscript-string">'BTN_B'</span>]&lt;&gt;speed:
						self.wm.rumble=1
						time.sleep(.05)
						self.wm.rumble=0
						<span class="enscript-keyword">if</span> speed == 0:
							cmd = <span class="enscript-string">&quot;play speed normal&quot;</span>
						<span class="enscript-keyword">elif</span> ((laststate[<span class="enscript-string">'BTN_B'</span>] &gt; 0) <span class="enscript-keyword">and</span> (speed &gt; 0)) <span class="enscript-keyword">or</span> ((laststate[<span class="enscript-string">'BTN_B'</span>] &lt; 0) <span class="enscript-keyword">and</span> (speed &lt; 0)):
							cmd = <span class="enscript-string">&quot;key &quot;</span>+str(abs(speed)-1)+<span class="enscript-string">&quot;\n&quot;</span>
						<span class="enscript-keyword">elif</span> speed&gt;0:
							cmd = <span class="enscript-string">&quot;key .\nkey &quot;</span>+str(abs(speed)-1)+<span class="enscript-string">&quot;\n&quot;</span>
						<span class="enscript-keyword">else</span>:
							cmd = <span class="enscript-string">&quot;key ,\nkey &quot;</span>+str(abs(speed)-1)+<span class="enscript-string">&quot;\n&quot;</span>
					<span class="enscript-keyword">else</span>:
						cmd = None
					<span class="enscript-keyword">if</span> cmd <span class="enscript-keyword">is</span> <span class="enscript-keyword">not</span> None:
						self.ms.raw(cmd)
			self.laststate = state.copy() <span class="enscript-comment">#NOTE TO SELF: REMEMBER .copy() !!!
</span>	<span class="enscript-keyword">def</span> <span class="enscript-function-name">mythLocation</span>(self, data):
		<span class="enscript-comment">#Playback Recorded 00:00:49 of 00:25:31 1x 30210 2008-09-10T09:18:00 1243 /video/30210_20080910091800.mpg 25
</span>		<span class="enscript-comment">#PlaybackBox
</span>		temp = data.split(<span class="enscript-string">&quot; &quot;</span>)
		output = {}
		output[<span class="enscript-string">'mode'</span>] = temp[0]
		<span class="enscript-keyword">if</span> output[<span class="enscript-string">'mode'</span>] == <span class="enscript-string">&quot;Playback&quot;</span>:
			output[<span class="enscript-string">'position'</span>] = temp[2]
			output[<span class="enscript-string">'max'</span>] = temp[4]
		<span class="enscript-keyword">return</span> output
	<span class="enscript-keyword">def</span> <span class="enscript-function-name">main</span>(self):
		<span class="enscript-keyword">while</span> True:
			<span class="enscript-keyword">if</span> self.wm <span class="enscript-keyword">is</span> None:
				<span class="enscript-comment">#Connect wiimote
</span>				self.wmconnect()
				<span class="enscript-keyword">if</span> self.wm:
					<span class="enscript-comment">#Tell Wiimote to display rock sign
</span>					self.wm.led = cwiid.LED1_ON | cwiid.LED4_ON
					self.wm.rpt_mode = sum(self.reportvals[a] <span class="enscript-keyword">for</span> a <span class="enscript-keyword">in</span> self.report <span class="enscript-keyword">if</span> self.report[a])
					self.wm.enable(cwiid.FLAG_MESG_IFC | cwiid.FLAG_REPEAT_BTN)
					self.wm.mesg_callback = self.wmcb
			asyncore.loop(timeout=0, count=1)
			time.sleep(0.05)
		<span class="enscript-keyword">print</span> <span class="enscript-string">&quot;Exited Safely&quot;</span>

<span class="enscript-comment"># Instantiate our class, and start.
</span>inst = WiiMyth()
inst.main()
</code>
<span style="display: block; text-align: center;">Download this code: <a href="http://www.benjiegillam.com/code/myth_py_wii.r14.py" title="Download the above code as a text file.">/code/myth_py_wii.r14.py</a></span></p>
<p>Hopefully tomorrow I can have it up and running, get a video up, and decent install instructions. Hopefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2008/09/zombie-mythpywii-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
