<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mateu Batle&#039;s Blog</title>
	<atom:link href="http://mbatle.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mbatle.wordpress.com</link>
	<description>Pursuing the art of Ninja Hackery</description>
	<lastBuildDate>Tue, 23 Oct 2012 14:28:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mbatle.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/452494218bdbef7f57603b4c7a571419?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Mateu Batle&#039;s Blog</title>
		<link>http://mbatle.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mbatle.wordpress.com/osd.xml" title="Mateu Batle&#039;s Blog" />
	<atom:link rel='hub' href='http://mbatle.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Illusions in the Web: a real-time video editor built in HTML5</title>
		<link>http://mbatle.wordpress.com/2011/11/02/illusions-in-the-web-a-real-time-video-editor-built-in-html5/</link>
		<comments>http://mbatle.wordpress.com/2011/11/02/illusions-in-the-web-a-real-time-video-editor-built-in-html5/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:36:29 +0000</pubDate>
		<dc:creator>mbatle</dc:creator>
				<category><![CDATA[Collabora]]></category>
		<category><![CDATA[Free Desktop]]></category>
		<category><![CDATA[gstreamer]]></category>
		<category><![CDATA[webkit]]></category>
		<category><![CDATA[HTML5 video multimedia webkit webkit-gtk gstreamer GES webrtc webaudio MediaStream MediaStreamAPI timeline MediaTimeline]]></category>

		<guid isPermaLink="false">http://mbatle.wordpress.com/?p=78</guid>
		<description><![CDATA[I am excited to blog about the current project I am working on and deeply enjoying. In Collabora, we have developed a tech demo of a simple video editor application running in the WebKit based web browser using HTML5 video technology. Well to be honest, not just plain HTML5 video, but we will get to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=78&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I am excited to blog about the current project I am working on and deeply enjoying. In <a href="http://www.collabora.com/">Collabora</a>, we have developed a tech demo of a simple video editor application running in the <a HREF="http://www.webkit.org/">WebKit</a> based web browser using <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#video">HTML5 video</a> technology. Well to be honest, not just plain HTML5 video, but we will get to that point later on. Keep in mind it is not a fully functional application, just a demo with some basic functionality like:</p>
<ul>
<li>Media library browser for images and videos.</li>
<li>Drag and drop clips to build the media timeline.</li>
<li>Set the inpoint and outpoint for each video clip.</li>
<li>Real-time seamless preview of the media timeline.</li>
<li>Basic touch based interface, although there is room for a lot of improvement here.</li>
</ul>
<p>The main advantage is that all processing is done locally and all the data is kept locally too, so no need to upload all the source material to a server or download the final video from a server, which might take some time specially when working with HD resolutions. Another nice feature is that you can actually preview the final video in real-time, instead of waiting for the server to process it.</p>
<h3>Some leftover Halloween (eye) candy</h3>
<p>All this stuff was shown by Collabora last week in Prague, during the <a href="https://events.linuxfoundation.org/events/linuxcon-europe">LinuxCon Europe</a> and <a href="http://gstreamer.freedesktop.org/conference/">GStreamer conference</a>. Thanks Collabora for sponsoring my visit to the conferences by the way.</p>
<p>Let me show a screenshot and a screencast of how the the demo looks like.</p>
<p><a href="http://mbatle.files.wordpress.com/2011/11/screenshot-witivi.png"><img src="http://mbatle.files.wordpress.com/2011/11/screenshot-witivi.png?w=320" alt="" title="Video editor web application" width="320" class="alignnone size-large wp-image-62" /></a></p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='425' height='349' src='http://www.youtube.com/embed/xdRSEx18GRY?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>You can even try this out if you wish. Install the Ubuntu package named <b>witivi</b> located in <A HREF="https://launchpad.net/~zdra/+archive/prague-demo">zdra/prague-demo</A>, kindly packaged by Xavier Claessens. Additionally, you will need to get some videos to enjoy it. Just contact me if you need instructions on how to make it run.</p>
<p><H3>Current trends in the web</H3></p>
<p>As the title of this blog post might suggest you, all this is not yet possible with current state of HTML5 video spec, so we had to cheat a little bit by adding some extensions to WebKit in order to make it real.<br />
However, there are a lot of efforts around the multimedia on the web nowadays, so evolution could certainly make it possible in a hopefully near future. Some of the current hot spots in <A HREF="http://www.whatwg.org/">WHATWG</A> and <A HREF="http://www.w3.org/">W3C</A> seems to be <A HREF="http://www.webrtc.org/">WebRTC</A>, <A HREF="https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html">WebAudio API</A> and even <A HREF="http://www.w3.org/community/ar/">Augmented Reality</A>. Things are really moving fast to make web apps more and more powerful specially regarding multimedia features. </p>
<p>Just in case you haven&#8217;t heard before, let me introduce briefly these technologies. <b>WebRTC</b> aims to provide real-time communication built-in HTML5 without additional plugins, so imagine audio and video calls possible from any html application with a simple Javascript API. <b>WebAudio</b> allows to do sample processing and synthesis from Javascript. </p>
<p>An interesting proposal which I discovered recently is <A HREF="https://wiki.mozilla.org/MediaStreamAPI">MediaStream API</A>, which is being promoted by Robert O&#8217;Callahan from Mozilla, looks like it could lead to have video editing functionality in HTML5 and it tries to integrate nicely with the other existing specs like WebRTC and HTML5 video.</p>
<p><H3>General architecture</H3></p>
<p>There are two main parts in this demo, the extension to WebKit for video editing and the video editor webapp (the user interface). The Webkit extension has been fairly easy to implement by using the <A HREF="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-editing-services/html/">Gstreamer editing services (GES) module</A>, so having video editing features seemed like a breeze. The video playback of the media timeline has been accomplished through a special webkit gstreamer sink using a fake url, although we are checking how to do it with blob URLs similarly to how it is done in WebRTC. Even though the current implementation is not really very intrusive into WebKit codebase, it would be better to keep the changes separate from WebKit for now since there is no standard for this yet. We still have to investigate for the best way to achieve this. But it depends on how the whole things evolves.</p>
<p>The video editor web application has been implemented using <A HREF="http://jquery.com/">jQuery</A>, <A HREF="http://jqueryui.com/">jQuery UI</A> and <A HREF="http://layout.jquery-dev.net/">jQuery layout</A> libraries. Implementing the video demo webapp has not been exactly a bed of roses, but good documentation and lots of examples from the aforementioned libs helped a lot indeed.</p>
<p><H3>Show me the code</H3></p>
<p>Here you have the git repos in case you want to sneak on how we did it:</p>
<p>* <A HREF="http://cgit.collabora.com/git/user/mbatle/GESWebKit.git/log/?h=media-timeline">GES WebKit</A>. To compile GES WebKit make sure you specify &#8211;enable-mediatimeline option on configure. GES WebKit depends on GES and gnonlin.</p>
<p>* <A HREF="http://cgit.collabora.com/git/user/mbatle/webvideoeditor.git/">Web Video editor demo</A>, also know as Witivi in reference to our beloved <A HREF="http://www.pitivi.org/">pitivi</A>. You can find here all the html, javascript and css magic used to build the user interface.</p>
<p><H3>Future extensions</H3></p>
<p>Here is a list of things that potentially could be done for the following versions:</p>
<p>* Transitions and effects on video clips (in progress).<br />
* Adapt to MediaStream API.<br />
* Move to BLOB URLs.<br />
* Create text and apply them on videos.<br />
* Render to a local file.<br />
* Push video to server.<br />
* Media timeline support for multiple layers.<br />
* Integrate with webrtc to do some collaborative video editing.<br />
* And many many more &#8230;</p>
<p><H3>Related work [Update]</H3></p>
<p>Apart of this demo where Gustavo Boiko and I have been working on (with contributions from Alvaro Soliverez and Abner Silva), there are some very cool related demos developed by Collabora, all of them were shown at LinuxCon in Prague. We hope you enjoy them as much as we do:</p>
<p> * <A HREF="http://labs.danilocesar.com/blog/2011/11/03/prague-telepathy-and-html-5-im-client/">IM client running in the Webkit browser</A>. An IM client with chat and video calls running in the browser mostly done in Javascript and HTML using <A HREF="http://telepathy.freedesktop.org/wiki/">Telepathy</A> framework.</p>
<p> * <A HREF="http://blogs.gnome.org/thos/2011/11/01/media-explorer-0-2-0-and-0-3-2-mx-1-4/">Video call plugin on Media Explorer</A>. A telepathy plugin to media explorer to be able to call our contacts, integrated nicely in media explorer UI.</p>
<p>Stay tuned.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mbatle.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mbatle.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=78&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mbatle.wordpress.com/2011/11/02/illusions-in-the-web-a-real-time-video-editor-built-in-html5/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b45f89a31b44fe5a859eb9943923a8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbatle</media:title>
		</media:content>

		<media:content url="http://mbatle.files.wordpress.com/2011/11/screenshot-witivi.png?w=1024" medium="image">
			<media:title type="html">Video editor web application</media:title>
		</media:content>
	</item>
		<item>
		<title>Open Collaboration Services and libattica on MeeGo</title>
		<link>http://mbatle.wordpress.com/2010/10/16/open-collaboration-services-and-libattica-on-meego/</link>
		<comments>http://mbatle.wordpress.com/2010/10/16/open-collaboration-services-and-libattica-on-meego/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 12:07:02 +0000</pubDate>
		<dc:creator>mbatle</dc:creator>
				<category><![CDATA[Collabora]]></category>
		<category><![CDATA[Free Desktop]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://mbatle.wordpress.com/?p=40</guid>
		<description><![CDATA[I am going to write about my most recent contributions to libattica. Libattica, is a library in KDE implementing a client for the Open Collaboration Services protocol (OCS). OCS is a Free Desktop specification, with the purpose of integrating web communities and web based services into desktop applications. This is very general though, more specifically, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=40&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I am going to write about my most recent contributions to <strong><A HREF="http://api.kde.org/kdesupport-api/kdesupport-apidocs/attica/html/index.html">libattica</A></strong>. <strong>Libattica, </strong> is a library in <strong><a href="http://www.kde.org/">KDE</a></strong> implementing a client for the <A HREF="http://www.freedesktop.org/wiki/Specifications/open-collaboration-services"><strong>Open Collaboration Services</strong></A> protocol (OCS). <strong>OCS</strong> is a <A HREF="http://www.freedesktop.org/"><strong>Free Desktop</strong></A> specification, with the purpose of integrating web communities and web based services into desktop applications. This is very general though, more specifically, it allows users to browse and share content like applications, wallpapers, etc. All this done with the typical social features, a user can write comments, rate content, contact other people, access knowledge base, etc.</p>
<p>Thanks to <A HREF="http://www.intel.com/"><strong>Intel</strong></A> hiring <A HREF="http://www.collabora.co.uk"><strong>Collabora</strong></A> for sponsoring all the work I have done in libattica so far. The efforts have been mainly directed to make use of the OCS protocol in the <A HREF="http://meego.com/garage">MeeGo Garage</A> project. The MeeGo Garage Client uses libattica to connect with the OCS servers. OCS is actually quite large, and we are just using using a small part of it (just the content and the comments modules), and I would even say we are using it in a way it was not originally meant, but that in the end it matched the requirements we had.</p>
<p>I also want to give thanks to <A HREF="http://www.collabora.co.uk/">Collabora</A>, the company I work for, for sponsoring my attendance to Akademy 2010, my first Akademy actually, and I hope to be there every year <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I met in Finland a lot of nice people in th KDE world, and we had several meetings regarding OCS stuff with the people interested in it, Frank Karlitschek, Frederik Gladhorn, Daniel Wilms, Henri Bergius, Cornelius Schumacher among many others. In particular we made good progress on drafting next version of OCS spec, with several updates needed by MeeGo Garage project and other projects. The <a href="http://www.freedesktop.org/wiki/Specifications/open-collaboration-services-draft">OCS draft spec 1.6</a> is online. Most of the features are already implemented and tested and will be ready to use in upcoming release of libattica 0.2.0. Just to mention some features where I put some effort: </p>
<ul>
<li>Comments (for content and other items)</li>
<li>New scale for voting</li>
<li>GPG fingerprint and signatures</li>
<li>New download type to describe a content specified by a package name and repository</li>
<li>Summary field in content</li>
<li>Icons in content items</li>
<li>Licenses</li>
<li>Video files in content items</li>
<li>Home page entries</li>
<li>Distributions</li>
</ul>
<p>Not only that, but there were a lot of ideas generated that had to be postponed to OCS version 2.0 version, which I hope we can start to work soon.</p>
<p>Frank has been very helpful in providing test servers available for me to test the client, and implement in the server the parts of the spec I needed to test the client. Fredrik was very helpful in making me become a KDE contributor.</p>
<p>Finally, libattica seems will be part of MeeGo, since it is a Qt-only library, no real dependency on other KDE stuff. In case you want to dig more on OCS and/or libattica you can check the following places:</p>
<ul>
<li><a href="http://www.open-collaboration-services.org/">Open Collaboration Services</a></li>
<li><a href="http://www.socialdesktop.org/library/">Reference implementations for client and server</a></li>
<li>Join to the mailing list ocs@lists.freedesktop.org</li>
<li>Join to the IRC channel #ghns in irc.freenode.net</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mbatle.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mbatle.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=40&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mbatle.wordpress.com/2010/10/16/open-collaboration-services-and-libattica-on-meego/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b45f89a31b44fe5a859eb9943923a8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbatle</media:title>
		</media:content>
	</item>
		<item>
		<title>10 secret Ninja weapons for Qt Quick QML developers</title>
		<link>http://mbatle.wordpress.com/2010/10/05/10-secret-ninja-weapons-for-qt-quick-qml-developers/</link>
		<comments>http://mbatle.wordpress.com/2010/10/05/10-secret-ninja-weapons-for-qt-quick-qml-developers/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 13:09:59 +0000</pubDate>
		<dc:creator>mbatle</dc:creator>
				<category><![CDATA[Collabora]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[QtQuick]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[ninja]]></category>
		<category><![CDATA[orientation]]></category>
		<category><![CDATA[qml]]></category>
		<category><![CDATA[qml script]]></category>
		<category><![CDATA[qmldump]]></category>
		<category><![CDATA[qmlviewer]]></category>
		<category><![CDATA[qtquick]]></category>
		<category><![CDATA[reload]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[warnings]]></category>

		<guid isPermaLink="false">http://mbatle.wordpress.com/?p=22</guid>
		<description><![CDATA[You might be asking yourself what has to do Qt Quick or QML and Ninjas. Well, let me introduce you the coding Ninja,  our cool mascot at Collabora. And as you know real ninjas are almost invisible and use very lethal weapons. But let&#8217;s go to the point and see what secret stuff are using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=22&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>You might be asking yourself what has to do <strong><a href="http://qt.nokia.com/products/qt-quick/" target="_blank">Qt Quick or QML</a></strong> and Ninjas. Well, let me introduce you the <strong>coding Ninja</strong>,  our cool mascot at <strong><a href="http://www.collabora.co.uk/" target="_blank">Collabora</a></strong>. And as you know real ninjas are almost invisible and use very lethal weapons. But let&#8217;s go to the point and see what secret stuff are using coding Ninjas. Let me show you some useful tricks discovered while playing with <strong><a href="http://qt.nokia.com/products/qt-quick/" target="_blank">Qt Quick and QML</a></strong> stuff at <strong><a href="http://www.collabora.co.uk/" target="_blank">Collabora</a></strong>, which might not be secret really but there is  little documentation about them anyway, so they could be missed easily.</p>
<p><img class="alignleft" title="Coding Ninja" src="http://people.collabora.co.uk/~mbatle/images/Ninja-pounce.jpg" alt="" width="408" height="308" /></p>
<ol>
<li><strong>QML Viewer scripts</strong>. This is really great tool for demos  and as a testing aid, unfortunately there is no documentation on it yet  except the (<strong>-help</strong> and<strong> -scriptopts help</strong> command line options). Basically  when you record a script, it generates a QML file which contains the input  commands (keys, mouse, &#8230;) and some frame output information (png and  frame output hashes). You can record test scripts and replay them later. The tool automatically  test if the recorded output images are still the same and check for  errors during the script run. It is actually checking every frame. But  don&#8217;t panic it will not store an image for every frame, it will just  store a combination, roughly an image every second and a hash for every frame.  When you test the images output, it will tell you which frames don&#8217;t match and even save a  copy of the rejected frames if they don&#8217;t. Of course in most apps you are not guaranteed to  have repeatable results among different runs of the program, due to  animations, little differences in time, event happening at different  times, using random functions, etc. Nevertheless a useful tool, it  can be used for error reporting, automating tests, coverage tests, demo  run of applications, etc.</li>
<li><strong>Use F5 to reload in QML Viewer</strong>. You can have qmlviewer running your QML scripts and you can edit the source code at the same time, just use F5 to reload the script. Of course this restarts the application.</li>
<li><strong>Use F3 to take snapshots in QML Viewer</strong>. Be careful with F3 since will overwrite existing snapshots.</li>
<li><strong>Use F9 to start / stop video</strong> <strong>recording</strong> <strong>in QML Viewer</strong>. It is recommended to tweak the video format  and other settings in the video settings dialog for better performance. You  can also use the -recordfile option from the command line to be able to  record from the application startup. You can record on multiple PNG  files, on a animated GIF file or using any video format supported by your ffmpeg installation .</li>
<li><strong>Slow down animations</strong> <strong>in QML Viewer</strong>. If you have not the sight and powers of a Ninja, you might need this to slow down animations, so you can see the bullets coming just like in Matrix. Unfortunately it does not work very well my <a title="Zij Lost game" href="http://mbatle.wordpress.com/2010/09/30/how-to-mingle-qml-tetrominos-and-ninjas/" target="_blank">Zij Lost tetris like game</a>, specially in game mode. The reason is that the game update function checks the real elapsed time  between ticks to provide a better simulation. The game update function  is called from the Timer QML object, which is affected by the slow down  animations feature (as well as any QML Animation object). This can be  fixed by just assuming the time between game updates is fixed, but still  it is not working properly. The Timer callback does not seem to get  called at regular intervals. The slowdown looks like 5 times slower, but  sometimes it stops working for a few seconds. By the way, I saw the QML  viewer released with SDK and the one from Qt creator have some  differences. But that is probably due to the fact I&#8217;m using  a Qt  Creator snapshot.</li>
<li><strong>Change orientation in QML Viewer with Ctrl-T or F10</strong>. You can change from portrait to landscape.</li>
<li><strong>Check the command line of QML Viewer with -help</strong>. There are some useful features like<strong> -borderless</strong>, <strong>-fullscreen</strong> among others.</li>
<li><strong>Check the warnings window</strong> <strong>in QML Viewer</strong>. There you can get your console.log, but  there you can find also useful messages that might help you when there  is something wrong in your application.</li>
<li><strong>QML dump</strong>. <strong>qmldump</strong> is a tool included in the SDK Qt bin directory, which  gives you information about properties and signals of the classes  available in QML. The information is provided in XML format, which might be useful to create other tools or to see the guts of some QML classes which are not fully documented.</li>
<li><strong>Press F1 for help text about debugging features in QML Viewer.</strong> It shows some interesting debug options  like F2 save test script, F4 show time and state, F6 show object tree  and F7 show timing. Although they don&#8217;t seem to work in my version. They are not fully implemented or broken in my Qt Creator snapshot version, but it is worth to know they might be implemented in next versions.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mbatle.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mbatle.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=22&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mbatle.wordpress.com/2010/10/05/10-secret-ninja-weapons-for-qt-quick-qml-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b45f89a31b44fe5a859eb9943923a8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbatle</media:title>
		</media:content>

		<media:content url="http://people.collabora.co.uk/~mbatle/images/Ninja-pounce.jpg" medium="image">
			<media:title type="html">Coding Ninja</media:title>
		</media:content>
	</item>
		<item>
		<title>How to mingle QML, Tetrominos and Ninjas</title>
		<link>http://mbatle.wordpress.com/2010/09/30/how-to-mingle-qml-tetrominos-and-ninjas/</link>
		<comments>http://mbatle.wordpress.com/2010/09/30/how-to-mingle-qml-tetrominos-and-ninjas/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 15:12:46 +0000</pubDate>
		<dc:creator>mbatle</dc:creator>
				<category><![CDATA[Collabora]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[QtQuick]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ninja]]></category>
		<category><![CDATA[qml]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[qtquick]]></category>
		<category><![CDATA[tetris]]></category>
		<category><![CDATA[tetromino]]></category>

		<guid isPermaLink="false">http://mbatle.wordpress.com/?p=7</guid>
		<description><![CDATA[Zij Lost is a simple tetris like game done entirely in QML and Javascript, written to learn Qt Quick technology. While waiting for a new and exciting project to land on my table after finishing my assignments in last project, Collabora gave me the opportunity to start tinkering with the hot Qt Quick, recently released [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=7&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>Zij Lost</strong> is a simple tetris like game done entirely in <strong>QML</strong> and <strong>Javascript</strong>, written to learn Qt Quick technology.</p>
<p>While waiting for a new and exciting project to land on my table after finishing my assignments in last project,  <strong><a href="http://www.collabora.co.uk">Collabora</a></strong> gave me the opportunity to start tinkering with the hot <a href="http://qt.nokia.com/products/qt-quick/">Qt Quick</a>, recently released in <a href="http://labs.qt.nokia.com/2010/09/21/qt-4-7-0-now-available/">Qt 4.7</a> by Trolltech people. I had already read a bit about it in the past, and even attended some talks and demos at <a href="http://akademy.kde.org/">Akademy 2010 in Tampere, Finland</a>. So I spent first days mainly reading docs, running and reading examples. But to really learn something I have to get my hands dirty with it, so I decided to create a small tetris-like game with QML, just for learning purposes, just for fun. After a few days, I had a basic implementation of the game which I am using as a testbed to experiment with QML.</p>
<p>The <a href="http://doc.troll.no/4.7/declarative-tutorials-samegame-samegame1.html">QML Advanced Tutorial</a> was really useful, since it also implements the game &#8220;Same Game&#8221; just using QML and Javascript. No C++ required. My goal was similar create a whole game logic just with QML and Javascript, without C++ involved. Note that this might not be the recommended design pattern for real world QML applications, but I just wanted to pursue the limits of this new technology, get used to it and see if I could reach some boundaries in my expression power with just QML and Javascript.</p>
<p>I started creating the tetrominos in QML. I did not use images for them, I just build them with rectangles. This way it is  easier to apply animations and special effects to them. At the moment I have  effects for piece rotation and line completed. Then added a Timer QML object which calls the game loop. All game logic is of course written in Javascript, things like checking collisions, movement, game loop, game rules, etc. So in the end it has been useful to refresh a bit my rusty Javascript skills. Afterwards, I added some states to the main.qml in order to add a start screen, game mode and game over screen. I found the <a href="http://doc.qt.nokia.com/4.7-snapshot/qdeclarativestates.html">QML State</a> abstraction very useful and it helps to create more clean and maintainable code.</p>
<p>Well, it has been fun. QML is fun. I have enjoyed programming with it. Scripting languages are nice with good tools, and Qt Creator did not dissapoint me.</p>
<p>You can find the source code the git repository at:</p>
<p><strong>git://git.collabora.co.uk/git/user/mbatle/zijlost.git</strong></p>
<p>Also you can find a release in a <strong>zip file</strong> at:</p>
<p><strong><a href="http://people.collabora.co.uk/~mbatle/zijlost/zijlost.zip">http://people.collabora.co.uk/~mbatle/zijlost/zijlost.zip</a></strong></p>
<p>Note: I named the game &#8220;<strong>Zij Lost</strong>&#8220;, just a mixing of all the tetromino  letters, which happens to mean something in Dutch, even although it  does not have much sense without a context.</p>
<p><strong>New link</strong>: just found a <a href="http://labs.qt.nokia.com/2010/08/12/a-guide-to-writing-games-with-qml/">guide to game creation in QML</a> which is interesting.</p>
<p>Some images and videos.</p>
<p><img class="alignnone" title="Zij Lost Start Screen" src="http://people.collabora.co.uk/~mbatle/zijlost/snapshot1.png" alt="" width="570" height="640" /><img class="alignnone" title="Playing Zij Lost" src="http://people.collabora.co.uk/~mbatle/zijlost/snapshot2.png" alt="" width="570" height="640" /></p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='450' height='284' src='http://www.youtube.com/embed/3YP8mc0bt6s?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mbatle.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mbatle.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mbatle.wordpress.com&#038;blog=6929866&#038;post=7&#038;subd=mbatle&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mbatle.wordpress.com/2010/09/30/how-to-mingle-qml-tetrominos-and-ninjas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b45f89a31b44fe5a859eb9943923a8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbatle</media:title>
		</media:content>

		<media:content url="http://people.collabora.co.uk/~mbatle/zijlost/snapshot1.png" medium="image">
			<media:title type="html">Zij Lost Start Screen</media:title>
		</media:content>

		<media:content url="http://people.collabora.co.uk/~mbatle/zijlost/snapshot2.png" medium="image">
			<media:title type="html">Playing Zij Lost</media:title>
		</media:content>
	</item>
	</channel>
</rss>
