<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D08AQH09fyp7ImA9WxBSEk8.&quot;"><id>tag:blogger.com,1999:blog-29273208</id><updated>2009-12-19T13:30:41.367+01:00</updated><title>Hawk's blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://hawkcode.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/jqYS" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;DkAEQXg4eyp7ImA9WxNUE0s.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-9171174473353448265</id><published>2009-10-31T15:08:00.028+01:00</published><updated>2009-11-04T20:58:20.633+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-04T20:58:20.633+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="swf" /><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="impress" /><category scheme="http://www.blogger.com/atom/ns#" term="flash" /><category scheme="http://www.blogger.com/atom/ns#" term="openoffice" /><title /><content type="html">&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;How to embed OpenOffice.org ODP (or office ppt)  files as flash content on your webpages (including controls).&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;I spent some time working on this. It would have been nice to avoid "inventing" this stuff on my own, so I'm going to share it here for others to read.&lt;br /&gt;My purpose was to convert my presentations to flash and then to embed them int my webpages along with nice controls. Something similar to what slideshare.com allows, but:you can do it on your websitethe slides are converted to flash using a nice and small script (which uses openoffice)First of all you need to convert your odp (or ppt or anything openoffice can read) into flash: to achieve this just open the file in openoffice and export as flash (really! openoffice can do that out of the box).&lt;br /&gt;Now you can put your files on the web and serve them. If you are happy you are done :-)&lt;br /&gt;If you would like to embed the flash content into the webpage you need to write something like the following into your webpage:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;div class="slides"&amp;gt;&lt;br /&gt;&amp;lt;object&lt;br /&gt; type="application/x-shockwave-flash"&lt;br /&gt; width="600"&lt;br /&gt; height="450"&lt;br /&gt; data="&amp;lt;?php echo $filename; ?&amp;gt;"&lt;br /&gt; id="&amp;lt;?php echo $filename; ?&amp;gt;"&lt;br /&gt; &amp;gt;&lt;br /&gt; &amp;lt;param&lt;br /&gt;   name="&amp;lt;?php echo $filename; ?&amp;gt;"&lt;br /&gt;   value="&amp;lt;?php echo $filename; ?&amp;gt;"&lt;br /&gt; &amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Of course &amp;lt;?php echo $filename; ?&amp;gt; must be replaced with your filename if you are not using php :-)&lt;br /&gt;Now your slides are embedded but you can't control how they are played. Let's add some controls. First of all you need some javascript functions: &lt;pre&gt;&lt;br /&gt;   function RewindSlides(slides)&lt;br /&gt;   {&lt;br /&gt;     var text = document.getElementById("Page_"+slides);&lt;br /&gt;     text.value = 1;&lt;br /&gt;     SlideGoto(slides);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function SlidePrev(slides)&lt;br /&gt;   {&lt;br /&gt;     SlideMove(slides, -1);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function SlideNext(slides)&lt;br /&gt;   {&lt;br /&gt;     SlideMove(slides, 1);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function SlideMove(slides, movement)&lt;br /&gt;   {&lt;br /&gt;     var flashSlide=document.getElementById(slides);&lt;br /&gt;     var text = document.getElementById("Page_"+slides);&lt;br /&gt;     text.value = parseInt(text.value)+movement;&lt;br /&gt;     SlideGoto(slides);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function SlideGoto(slides)&lt;br /&gt;   {&lt;br /&gt;     var flashSlide=document.getElementById(slides);&lt;br /&gt;     var totalFrames = flashSlide.TotalFrames();&lt;br /&gt;&lt;br /&gt;     var text = document.getElementById("Page_"+slides);&lt;br /&gt;     var n = text.value;&lt;br /&gt;&lt;br /&gt;     if (n&amp;lt;1)&lt;br /&gt;       n=1;&lt;br /&gt;     else if (n&gt;totalFrames/2)&lt;br /&gt;       n = parseInt(totalFrames/2);&lt;br /&gt;     text.value = n;&lt;br /&gt;  &lt;br /&gt;     if (n*2 &gt;= totalFrames - 1 )&lt;br /&gt;       flashSlide.GotoFrame(totalFrames - 5);&lt;br /&gt;     else if (n&lt;2)&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;And then you can just out the following controls into your HTML: &lt;/span&gt;&lt;/span&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;input type="button" value="Rewind" name="Rewind" &lt;br /&gt;    onClick="RewindSlides('&amp;lt;?php echo $filename; ?&amp;gt;');"&amp;gt;&lt;br /&gt; &amp;lt;input type="button" value="Prev" name="Prev" &lt;br /&gt;    onClick="SlidePrev('&amp;lt;?php echo $filename; ?&amp;gt;');"&amp;gt;&lt;br /&gt; &amp;lt;input type="button" value="Next" name="Next" &lt;br /&gt;    onClick="SlideNext('&amp;lt;?php echo $filename; ?&amp;gt;');"&amp;gt;&lt;br /&gt; &amp;lt;input type="button" value="Goto" name="Goto" &lt;br /&gt;    onClick="SlideGoto('&amp;lt;?php echo $filename; ?&amp;gt;');"&amp;gt;&lt;br /&gt; &amp;lt;input type="text"   &lt;br /&gt;    value="1" name="Page_&amp;lt;?php echo $filename; ?&amp;gt;" &lt;br /&gt;    id="Page_&amp;lt;?php echo $filename; ?&amp;gt;"&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The end result can be shown on &lt;a href="http://www.dii.unisi.it/%7Edimassa/Didattica/2009/Informatica/"&gt;my page&lt;/a&gt;:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-9171174473353448265?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DNRiEMnCwYpzwLuATL06ZrFPMtk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DNRiEMnCwYpzwLuATL06ZrFPMtk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DNRiEMnCwYpzwLuATL06ZrFPMtk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DNRiEMnCwYpzwLuATL06ZrFPMtk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/16iU3AoqrS4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/9171174473353448265/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=9171174473353448265" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/9171174473353448265?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/9171174473353448265?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/16iU3AoqrS4/how-to-embed-openoffice.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2009/10/how-to-embed-openoffice.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4NQnw-fyp7ImA9WxRbGEk.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-4466782850297388663</id><published>2008-12-09T17:27:00.003+01:00</published><updated>2008-12-09T18:33:13.257+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T18:33:13.257+01:00</app:edited><title /><content type="html">&lt;span style="font-size:130%;"&gt;After a long time... here it is a &lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;New Post&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Since Google gave us &lt;a href="http://www.google.com/friendconnect/"&gt;friend connect&lt;/a&gt;, I felt I had to start using it from the very beginning.&lt;br /&gt;I have just invited some friends to join my blog but... the last post was from Summer 2006: I guess they would not be pleased to be invited to read such old info, so I'm writing this very short blog post.&lt;br /&gt;&lt;br /&gt;Who knows... maybe I could start blogging if I have enough fun!&lt;br /&gt;The topic for new posts will   probably still be &lt;a href="http://www.kde.org/"&gt;KDE4&lt;/a&gt;: I just love it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-4466782850297388663?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PrcqnpfJjmtNLooi4Nqj95LI1hg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PrcqnpfJjmtNLooi4Nqj95LI1hg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PrcqnpfJjmtNLooi4Nqj95LI1hg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PrcqnpfJjmtNLooi4Nqj95LI1hg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/jLnILMpCuCM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/4466782850297388663/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=4466782850297388663" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/4466782850297388663?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/4466782850297388663?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/jLnILMpCuCM/after-long-time-here-it-is-new-post.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2008/12/after-long-time-here-it-is-new-post.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4FRH4yfip7ImA9WBNUFE0.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-115740306799939811</id><published>2006-09-04T21:20:00.000+01:00</published><updated>2006-09-04T22:05:15.096+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-09-04T22:05:15.096+01:00</app:edited><title /><content type="html">&lt;span style="font-size:180%;"&gt;Phonon-NMM Status after SoC.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Wow. After months of coding together with Marco and Matthias, I could finally see the results of my efforts.&lt;br /&gt;The code is on the &lt;a href="http://websvn.kde.org/trunk/KDE/kdemultimedia/phonon-nmm/"&gt;KDE4 svn&lt;/a&gt;.&lt;br /&gt;I could not add many new features: my main goal has been to make the backend usable in everyday use. I proof tested it to work on corner case events (short media file, multiple files played at the same time, file played to multiple AudioOutput, user pressing commands at random...) and made sure it works in a predictable manner without crashing.&lt;br /&gt;I also added to the backend the ability to play files from protocols NMM does not understand (like smb:// tar:// media:// fish:// and all the ones KIO can read). I did that implementing the Phonon ByteStream protocol as an NMM plugin. That plugin is not Phonon specific: developers can use the NMM::ByteStreamNode plugin to push theyr own data into an NMM flow graph.&lt;br /&gt;Apart from that I did a complete refactor of GraphHnadler, which now has almost the same API (just some bits added) but is internally coded following the Object Oriented paradigm. The immediate benefit of the refactoring is the ability of adding multiple sinks to a a branch. The code is also more readable.&lt;br /&gt;Talking to my mentors has been very instructive: I have learnt theyr code so deeply that I could suggest modification in both Phonon (stop/buffering functionality) and NMM (GraphHandler, progress update).&lt;br /&gt;&lt;br /&gt;It has been fun working with NMM and Phonon (kde) developers. NMM and Phonon are both implementations of a very smart idea: I have no doubt those ideas will have success even is the projects are still in a quite early stage of adoption. I plan to go on coding with them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-115740306799939811?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6hvL1kD7uNx6e8a2eFHZSqf4mjI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6hvL1kD7uNx6e8a2eFHZSqf4mjI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6hvL1kD7uNx6e8a2eFHZSqf4mjI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6hvL1kD7uNx6e8a2eFHZSqf4mjI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/LHwnRQQwGJw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/115740306799939811/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=115740306799939811" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115740306799939811?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115740306799939811?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/LHwnRQQwGJw/phonon-nmm-status-after-soc.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/09/phonon-nmm-status-after-soc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04ARng_fip7ImA9WBNWFEs.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-115546194763628798</id><published>2006-08-13T09:54:00.000+01:00</published><updated>2006-08-13T10:39:07.646+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-08-13T10:39:07.646+01:00</app:edited><title /><content type="html">&lt;span style="font-size:180%;"&gt;Bugs, bugs and ... bugs!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;During the last days I did not much progress on implementing new functionality.&lt;br /&gt;My new schedule is to...&lt;br /&gt;1) fix the backend to make &lt;span style="font-family: courier new;"&gt;ByteStream&lt;/span&gt; work&lt;br /&gt;2) allow each branch of &lt;span style="font-family: courier new;"&gt;GraphHandler&lt;/span&gt; to have more sinks connected&lt;br /&gt;3) port fub's gui config app to dbus&lt;br /&gt;4) make kcm work (this involves frontend work as well)&lt;br /&gt;&lt;br /&gt;The reason for my slow process have been bugs.&lt;br /&gt;First I had to figure out that the Phonon &lt;span style="font-family: courier new;"&gt;ByteStream&lt;/span&gt;/&lt;span style="font-family: courier new;"&gt;MediaObject&lt;/span&gt; frontend states had problems... the KIO object setup was done only in &lt;span style="font-family: courier new;"&gt;setUrl().&lt;/span&gt;.. Matthias fixed it in a minute.&lt;br /&gt;Then I found corner cases where NMM/Phonon/KIO cooperation becomes difficolt: that is when the kio object finishes sending data before phonon-nmm has finished its initialization (happens when the media file is really short). Also this involved both backend and frontend changes.&lt;br /&gt;Then the other day I updated dbus from CVS and... bang!!!! Someone on 8/8/06 has introducd a really nice in configure in. It took an entire afternoon to make dbus work again (I'm not an autotools expert, I had to learn-try-fail-learn_more-...&lt;br /&gt;Then I found a nice bad bug in NMM &lt;span style="font-family: courier new;"&gt;MPEGDecodeNode.&lt;/span&gt; track_size is not initialized  and track_duration is computed from it. If you play a live stream (for example an mp3 file streamed from &lt;span style="font-family: courier new;"&gt;Phonon::Bytestream&lt;/span&gt;) track_duration can't be told... a random value was inserted into the &lt;span style="font-family: courier new;"&gt;CEvent&lt;/span&gt;. After fixing it I found that if track_duration is 0 progress events are not emitted; I can't see the reason for this: you can have progress even if you don't know where you are inside the file.&lt;br /&gt;I see from vlagrind output that there are some other uninitialized variblas on which a control statement depends on... but I was not able to fix those jet.&lt;br /&gt;&lt;br /&gt;Those were just the things I was able to fix!&lt;br /&gt;I still have some bugs. The big problem working on phonon-nmm is that you have to work on bleeding edge code (kdelibs, KIO, Phonon, NMM -should be the more stable here-, Qt4, dbus) and you have to do a lto of tricks to make them work. I have spend almost a week in the beginning writing a script to set up all the environment vars and daemons (I was inspired by a script sent to me by Matthias).&lt;br /&gt;The hardest problem is that Qt4/KDE4 code confuses debuggers and memory checkers like gdb and valgrind! So you have to fill the code with debug statements and recompile and... well, when you type make in the Qt, NMM, or kdelibs source trees... you'll heat your CPU for quite a lot of time! That is way icecream (&lt;span style="font-family: courier new;"&gt;icecc&lt;/span&gt;) comes in the story: this tool allows you to easily cluster your machines into a renderfarm. It is one of the pieces of code in the world, it saves so many compile time! But... a tiny little bug in the kubuntu package I had made me mad... so I had compile the latest svn version, find another little bug ,report it to the icecream main developer (coolo on #kde4-devel) and wait (minutes really) for the fix.&lt;br /&gt;Back to phonon-nmm my favourite bug is... &lt;span style="font-weight: bold;"&gt;UNKOWN&lt;/span&gt;! Maybe it is more than one bug.&lt;br /&gt;The symptoms are random. Sometimes kdeinit can't unload phonon-nmm because of NMM not releasing the soundcard device. Sometimes in &lt;span style="font-family: courier new;"&gt;ByteStreamNode&lt;/span&gt; I push_back into a list 23 &lt;span style="font-family: courier new;"&gt;Buffers*&lt;/span&gt; and then I iterate on 23 elements... Ah, that is ok, I know... buth the size of the first element is the sum of the others :-)&lt;br /&gt;I'm working on this bug right now. I hope to resolve this, but ATM I really don't know how to understand where it comes from.&lt;br /&gt;&lt;br /&gt;I must be crazy anyway. Because...&lt;br /&gt;&lt;br /&gt;I'm having fun!!!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-115546194763628798?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/czd1JvHzfvH1OAjKrK3fvYnNhkk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/czd1JvHzfvH1OAjKrK3fvYnNhkk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/czd1JvHzfvH1OAjKrK3fvYnNhkk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/czd1JvHzfvH1OAjKrK3fvYnNhkk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/vj1WPEkR3hw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/115546194763628798/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=115546194763628798" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115546194763628798?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115546194763628798?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/vj1WPEkR3hw/bugs-bugs-and.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/08/bugs-bugs-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQCR3w_fip7ImA9WBNRGEo.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-115287836623979299</id><published>2006-07-14T12:42:00.000+01:00</published><updated>2006-07-14T12:59:26.246+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-07-14T12:59:26.246+01:00</app:edited><title /><content type="html">&lt;span style="font-size:180%;"&gt;Bugs: no progress&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;During the last  days   I had problems with compiling kdelibs4. Matthias has updated phonon implementation in kdelibs4_snapshot, so I had to catch up whith that new code and install the new snapshot.&lt;br /&gt;KDE4 will ship with Qt 4.2.x: for this reason the KDE4 svn qt-copy has been updated to the new 4.2.0. This version is now required to install KDE4 libs.&lt;br /&gt;KDE svn hosts a copy of Qt where patches not already accepted by Qt developers are availabele: qt-copy. qt-copy has a patches subdir and an &lt;span style="font-family: courier new;"&gt;apply_patches&lt;/span&gt; script that applies them and keeps track of already applied patches.&lt;br /&gt;Well things changed and the &lt;span style="font-family: courier new;"&gt;apply_patches&lt;/span&gt; script has become buggy: some patches marked as already applied are not applied... booom. I had to figure out what the prbolem was, contacted David, and finally applied a patch to fix that script.&lt;br /&gt;The good news is that (after recompiling Qt, kdelibs &amp; C.o.) a bug that prevented &lt;span style="font-family: courier new;"&gt;ByteStream&lt;/span&gt; from working has vanished! Great! It must have been a cmake cuased bug, it was a nasty bug that made this pointer become 0x0 after a simple member function call... I was going mad figuring out where that bug was coming from and spent quite a lot of time on it! Luckily it is gone now!&lt;br /&gt;My next step will be &lt;span style="font-family: courier new;"&gt;AudioOutput.&lt;/span&gt;&lt;br /&gt;I'm really looking forward to make config-proxy work again using dbus.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-115287836623979299?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QnuZlEpIS7bFh6D2PNkppcf2WZM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QnuZlEpIS7bFh6D2PNkppcf2WZM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QnuZlEpIS7bFh6D2PNkppcf2WZM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QnuZlEpIS7bFh6D2PNkppcf2WZM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/LQpd2y5ItrE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/115287836623979299/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=115287836623979299" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115287836623979299?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115287836623979299?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/LQpd2y5ItrE/bugs-no-progress-during-last-days-i.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/07/bugs-no-progress-during-last-days-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EMQns9eCp7ImA9WBNSGEg.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-115185968353143250</id><published>2006-07-02T17:17:00.000+01:00</published><updated>2006-07-02T18:01:23.560+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-07-02T18:01:23.560+01:00</app:edited><title /><content type="html">&lt;span style="font-size:180%;"&gt;Yay! Some fast progress now!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After resolving the kdelibs problems I started trying to improve the already (somehow) working &lt;span style="font-family:courier new;"&gt;ByteStream.&lt;/span&gt; One of the first things I wanted to do was to reconsider the way time reporting is done in the backend: even if NMM can sent time progrss events, the backend was using an internal timer to do time reporting. Talking to My mentors and to fub (Bernard) they all agreed that a nice thing to do would have been to use the NMM events to signal time progress. Well I was just looking at it and... done. It was indeed quite easy. And I think it could have been done even in an easier way!&lt;br /&gt;&lt;br /&gt;In order to do it I:&lt;br /&gt;Moved the callback functions from &lt;span style="font-family:courier new;"&gt;MediaObject&lt;/span&gt; to &lt;span style="font-family:courier new;"&gt;AbstreactMediaProducer&lt;/span&gt; (so they will be usefull in &lt;span style="font-family:courier new;"&gt;ByteStream&lt;/span&gt; too one day)&lt;br /&gt;Added an &lt;span style="font-family:courier new;"&gt;Phonon::AudioPath::insertInto(NMM::GraphHandler)&lt;/span&gt; that inserts the &lt;span style="font-family:courier new;"&gt;AudioPath&lt;/span&gt;'s branch into the &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt;. This is called from &lt;span style="font-family:courier new;"&gt;internal_addBranch&lt;/span&gt; in &lt;span style="font-family:courier new;"&gt;Phonon::AbstreactMediaProducer&lt;/span&gt;.&lt;br /&gt;Made the &lt;span style="font-family:courier new;"&gt;Phonon::AudioOutput&lt;/span&gt; create a sink Node in the constructor (it will use info from &lt;span style="font-family:courier new;"&gt;kcm&lt;/span&gt; to decide the node type) and enabled &lt;span style="font-family:courier new;"&gt;setTimeProgress&lt;/span&gt; events from that node.&lt;br /&gt;Made &lt;span style="font-family:courier new;"&gt;Phonon::AudioPath&lt;/span&gt; add its &lt;span style="font-family:courier new;"&gt;Phonon::AudioOutput&lt;/span&gt;'s sink (already created) Node to the &lt;span style="font-family:courier new;"&gt;NMM::GraphHandler&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This changes make the backed architecture reflect the &lt;span style="font-family:courier new;"&gt;NMM::GraphHandler&lt;/span&gt; architecture better : &lt;span style="font-family:courier new;"&gt;Phonon::AudioOutput&lt;/span&gt; wraps a sink Node, &lt;span style="font-family:courier new;"&gt;Phonon::AudioPath&lt;/span&gt; wraps a brach in &lt;span style="font-family:courier new;"&gt;NMM::GraphHandler&lt;/span&gt;, and &lt;span style="font-family:courier new;"&gt;Phonon::AbstreactMediaProducer&lt;/span&gt; wraps the wole &lt;span style="font-family:courier new;"&gt;Phonon::AbstreactMediaProducer&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Thanks to this changes (that enable the sink node to send progrss events) it was easy to attach those events to callbacks in &lt;span style="font-family:courier new;"&gt;Phonon::AbstreactMediaProducer&lt;/span&gt; that report the event to KDE using QT signals.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-115185968353143250?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4omNG6VCQLe5vvabyN55DhUjUps/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4omNG6VCQLe5vvabyN55DhUjUps/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4omNG6VCQLe5vvabyN55DhUjUps/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4omNG6VCQLe5vvabyN55DhUjUps/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/8zUB6vK9V8o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/115185968353143250/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=115185968353143250" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115185968353143250?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115185968353143250?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/8zUB6vK9V8o/yay-some-fast-progress-now-after.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/07/yay-some-fast-progress-now-after.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4FRXsyeyp7ImA9WBNSFU4.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-115153325429233921</id><published>2006-06-28T22:01:00.000+01:00</published><updated>2006-06-28T23:48:34.593+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2006-06-28T23:48:34.593+01:00</app:edited><title /><content type="html">&lt;span style="font-size:180%;"&gt;Problems Resolved: Bugs and my understanding of NMM.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Part I kde bug.&lt;/span&gt;&lt;br /&gt;During the last 2 weeks I had to fight against a KDE4 (kdelibs) bug: I was no more able to build a proper KDE System Configuration Cache ksycoca. Everything was set up according to the docs, the debug output of kde apps was not spotting any problem, some components were even able to run... but I could not use kcmshell (the KDE control center application and framework).&lt;br /&gt;The problem with ksycoca was triggered by the presence of the &lt;span style="font-family:courier new;"&gt;/etc/xdg/menus/applications.menu&lt;/span&gt; file. That file is installed by the gnome-menus package on kubuntu dapper (the distro I'm using). The effect of the the bug is that kbuildsycoca is no more able to find the proper KDE4 .menu files after processing &lt;span style="font-family:courier new;"&gt;/etc/xdg/menus/applications.menu&lt;/span&gt;.&lt;br /&gt;Finding that out was really difficolt (I'd never been able to do that on my own, Vir and dfaure helped a lot on freenode #phonon and #kde4-devel): first we had to find out that the problem was ksycoca related, then we had to figure out that this problem was caused by the presence of &lt;span style="font-family:courier new;"&gt;/etc/xdg/menus/applications.menu&lt;/span&gt; even if kbuildsycoca does not print a single warning or error when analyzing that file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Part II: ByteStreamNode properly coded.&lt;/span&gt;&lt;br /&gt;My prevoius attempt to write the &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; was succesfull in practice, but it was coded without compliance to the NMM architecture (I was not skilled enought).&lt;br /&gt;Thanks to the the help of Marco (my menthor) I finally understood how to pass data to remote running nodes using NMM proxies and interface. NMM is a so powerfull architecture that understanding all of it at a time is hard even if the docs are very usefull and cover most aspect.&lt;br /&gt;Using sample code that Marco sent me I could code a proper  &lt;span style="font-family:courier new;"&gt;NMM::Interface&lt;/span&gt; for ByteStreamNode.&lt;br /&gt;The interface  is:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;module NMM{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  interface IByteStreamNode {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    void sendBuffer2(in TransferBuffer2 buffer);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    int getSize();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    int getMaxSize();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  };&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using ByteStreamNode and its interface IByteStreamNode it is possible to inject arbitrary data from applications into NMM flow graphs. To achieve this the application developer creates the flow graph as described in the NMM documentiation using &lt;span style="font-family:courier new;"&gt;NMM::ByteStreamNode&lt;/span&gt; as the source node and using its interface to send data to the node. Data sent to the node is buffered into a streamqueue from where &lt;span style="font-family:courier new;"&gt;processBuffer&lt;/span&gt; (the "main/core" function of NMM nodes) extracts it later. The application can query the current fill size and maximum allowed size of the internal streamqueue using the interface functions &lt;span style="font-family:courier new;"&gt;getSize&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;getMaxSize&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The only cave at for using &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; is that the first chunk of data must be passed to the node (using &lt;span style="font-family:courier new;"&gt;sendBuffer2)&lt;/span&gt; before &lt;span style="font-family:courier new;"&gt;initOutput&lt;/span&gt; is called in order to let &lt;span style="font-family:courier new;"&gt;initOutput&lt;/span&gt; to find data mime-type (using libmagic).&lt;br /&gt;&lt;br /&gt;The phonon nmm backend uses ByteStreamNode as a fallback when a NMM unsupported protocol is specified in the url to be played. For such urls NMM throws an exception in GraphHandler::stage1 which is catched by Phonon and used to trigger the creation of a Phonon::ByteStream object. That object is responsible for calling GraphHandler::stage1_bs and passing data to the returned IByteStreamNode interface. Another task for Phonon::ByteStream is to suspend and resume the KIO::TransferJob as soon as the ByteStreamNode's internal StreamQueue gets full or empty.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Part III: plans&lt;/span&gt;&lt;br /&gt;After all this learning and coding I'm becoming more experienced with both NMM andn Phonon.&lt;br /&gt;I thought I would have been able to proceed faster, but KDE4 beeing not mature and NMM beeing a completely new concept to me really slowed me down since now.&lt;br /&gt;&lt;br /&gt;My next steps will be:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Resurrect the config-app&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Implement AudioOutputDevice selection (the interface that let users chose which NMM audio output node to use)&lt;/li&gt;&lt;li&gt;VolumeControlNode: a software volume slider node&lt;/li&gt;&lt;/ol&gt;One idea I would like to implement is a app/user interface that detects other NMM hosts on the network and shows theyr speakers to the user. Using this is interface it would be possible to use a desktop computer and a laptop computer as a 4 speaker system (-almost- anyone has a laptop and a desktop nowdays).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-115153325429233921?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KvTWsPCu5cDiNiEUJaewU3bGUl0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KvTWsPCu5cDiNiEUJaewU3bGUl0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KvTWsPCu5cDiNiEUJaewU3bGUl0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KvTWsPCu5cDiNiEUJaewU3bGUl0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/bbM7FO47Tcg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/115153325429233921/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=115153325429233921" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115153325429233921?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/115153325429233921?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/bbM7FO47Tcg/problems-resolved-bugs-and-my.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/06/problems-resolved-bugs-and-my.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcHRHg_fSp7ImA9WBFTGEQ.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-114985074955370896</id><published>2006-06-09T11:14:00.000+01:00</published><updated>2007-02-08T01:53:55.645+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-02-08T01:53:55.645+01:00</app:edited><title /><content type="html">&lt;span style="font-size:180%;"&gt;The birth of the ByteStreamNode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:150%;"&gt;and its problems&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First of all let me explain how Phonon-nmm interaction works.&lt;br /&gt;Suppose a KDE4-NMM user whats to play an url, when behind the scenes the following happens:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Phonon looks for a Phonon backend (Phonon-NMM in this case) and loads it&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The backend configures its media framework (the backend is the &lt;span style="font-family:courier new;"&gt;Phonon::nmm::Backend&lt;/span&gt; object, the framework is NMM)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Phonon creates a &lt;span style="font-family:courier new;"&gt;Phonon:nmm::MediaObject&lt;/span&gt; and calls its &lt;span style="font-family:courier new;"&gt;setUrl()&lt;/span&gt;method&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If the setUrl call fails the &lt;span style="font-family:courier new;"&gt;MediaObject&lt;/span&gt; is destroied and a &lt;span style="font-family:courier new;"&gt;Phonon:nmm::ByteStream&lt;/span&gt; object is created which receives the raw stream  data  in a &lt;span style="font-family:courier new;"&gt;writeData()&lt;/span&gt; callback method (actually a qt-slot) from a KDE4 &lt;span style="font-family:courier new;"&gt;KIO::TransferJob&lt;/span&gt; instance.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;After an &lt;span style="font-family:courier new;"&gt;Phonon::nmm::AbstractMediaProducer&lt;/span&gt; subclass, &lt;span style="font-family:courier new;"&gt;MediaObject&lt;/span&gt; or the &lt;span style="font-family:courier new;"&gt;ByteStream&lt;/span&gt;, is setup Phonon assumes the media framework is ready to start&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The &lt;span style="font-family:courier new;"&gt;AbstractMediaProducer::play&lt;/span&gt; method is called which call the media framework playing functionality&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;The glue between NMM and Phonon is the &lt;span style="font-family:courier new;"&gt;NMM::GraphHandler&lt;/span&gt; class. This class is meant for creating  flowgraph from an URL and for playing it. If NMM  cannot understand the url (maybe because the protocol is not supported by NMM) &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt; throws an exception that Phonon detects (that functionality is in &lt;span style="font-family:courier new;"&gt;GraphHandler::stage1()&lt;/span&gt; which is called from &lt;span style="font-family:courier new;"&gt;MediaObject::setUrl()&lt;/span&gt; ). If &lt;span style="font-family:courier new;"&gt;stage1()&lt;/span&gt; throws any exception, Phonon (in the ByteStream class) calls &lt;span style="font-family:courier new;"&gt;GraphHandler::stage1_bs()&lt;/span&gt; from the &lt;span style="font-family:courier new;"&gt;ByteStream::writeData()&lt;/span&gt;.&lt;br /&gt;The &lt;span style="font-family:courier new;"&gt;writeData()&lt;/span&gt; method is responsible for coping the data packets incoming from the running &lt;span style="font-family:courier new;"&gt;KIO::TransferJob&lt;/span&gt; into a local buffer (actually an &lt;span style="font-family:courier new;"&gt;NMM::StreamBuffer&lt;/span&gt; instance) and for initaliazing the &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt; by means of calling its &lt;span style="font-family:courier new;"&gt;stage1_bs()&lt;/span&gt; when the first chunk of stream is available. Basically untill the the &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt; is initialized writeData pushes incoming data into the buffer and tries to initalize &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt; using that growing buffer.&lt;br /&gt;The &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt; initialization in &lt;span style="font-family:courier new;"&gt;stage1_bs()&lt;/span&gt; (whose prototype is &lt;span style="font-family:courier new;"&gt;void stage1_bs(NMMApplication&amp; app, StreamQueue* sq))&lt;/span&gt; creates a new &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; from the rgistry and registers the sq into the &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt;.&lt;br /&gt;For that purpose &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; implements the &lt;span style="font-family:courier new;"&gt;IByteStreamNode&lt;/span&gt; interface which just defines &lt;span style="font-family:courier new;"&gt;void setStreamQueue(in int sq)&lt;/span&gt;. As you can see this is really an awfull trick I did.&lt;br /&gt;That interface should take a &lt;span style="font-family:courier new;"&gt;StreamQueue*&lt;/span&gt; as input, but I was not able to define it that way (I need input from Marco here). The other alternative would be to create the the &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; from &lt;span style="font-family:courier new;"&gt;stage1_bs()&lt;/span&gt; without using the registry (and without defining any &lt;span style="font-family:courier new;"&gt;IByteStreamNode&lt;/span&gt;) and then getting its &lt;span style="font-family:courier new;"&gt;INode&lt;/span&gt; interface using &lt;span style="font-family:courier new;"&gt;getInterface&lt;inode&gt;()&lt;/inode&gt;&lt;/span&gt;; this way the ByteStreamNode could be compiled with &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt;, and not as a plugin. Maybe this is better?&lt;br /&gt;&lt;br /&gt;Once the &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; is started all it has to do in &lt;span style="font-family:courier new;"&gt;processBuffer&lt;/span&gt; is to get one buffer from the &lt;span style="font-family:courier new;"&gt;streamQueue&lt;/span&gt; filled by KIO and return it.&lt;br /&gt;The only other functionalty of &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; is stream type finding, done using the first buffer in the registered streamBuffer and passing its data to libmagic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-114985074955370896?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jTQEVXGhE9FaI05BahKOuThEffQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jTQEVXGhE9FaI05BahKOuThEffQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jTQEVXGhE9FaI05BahKOuThEffQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jTQEVXGhE9FaI05BahKOuThEffQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/NuZQ74gi2js" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/114985074955370896/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=114985074955370896" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/114985074955370896?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/114985074955370896?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/NuZQ74gi2js/birth-of-bytestreamnode-and-its.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/06/birth-of-bytestreamnode-and-its.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcMRH8_eip7ImA9WBFTGEQ.&quot;"><id>tag:blogger.com,1999:blog-29273208.post-114946828208322267</id><published>2006-06-05T01:43:00.000+01:00</published><updated>2007-02-08T01:54:45.142+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-02-08T01:54:45.142+01:00</app:edited><title /><content type="html">&lt;span style="font-weight: bold;font-size:180%;" &gt;SoC report&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This is the first report about my SoC phonon-nmm project.&lt;br /&gt;So far I have studied the Phonon and NMM code, tried to resolve an rtti bug in NMM event handling (my co mentor mkrez fixed it) and I added some functionality into the phonon nmm backend and in the GraphHandler class to support the phonon bytestream KIO data passing interface.&lt;br /&gt;&lt;br /&gt;At the moment I evolved &lt;span style="font-family:courier new;"&gt;NMM::GraphHandler&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;Phonon::nmm::ByteStream&lt;/span&gt; making them capable of using a &lt;span style="font-family:courier new;"&gt;ByteStreamNode&lt;/span&gt; (yet to be implemented) to pass data.&lt;br /&gt;&lt;br /&gt;What I did was to change the &lt;span style="font-family:courier new;"&gt;GraphHandler::stage1&lt;/span&gt; method to make it able to get an &lt;span style="font-family:courier new;"&gt;StreamQueue&lt;/span&gt; as optional input. What stage1 now does is to try to detect the media steram format from the &lt;span style="font-family:courier new;"&gt;NMM::Buffer&lt;/span&gt;s in the &lt;span style="font-family:courier new;"&gt;NMM::StreamQueue&lt;/span&gt;.In order to do that I added a tiny helper function that uses &lt;span style="font-family:courier new;"&gt;libmagic&lt;/span&gt; to detect mime type.&lt;br /&gt;&lt;br /&gt;On the Phonon side I implemented some functionality into &lt;span style="font-family:courier new;"&gt;ByteStream&lt;span style="font-family:georgia;"&gt;.&lt;br /&gt;The ByteStream object tries to initalize the &lt;span style="font-family:courier new;"&gt;GraphHandler&lt;/span&gt; object as soon as the first data chunck arrives (in the &lt;span style="font-family:courier new;"&gt;ByteStream::writeData&lt;/span&gt; member). The data to be passed to NMM is inserted into a &lt;span style="font-family:courier new;"&gt;StreamQueue&lt;/span&gt; object that is registered into the &lt;span style="font-family:courier new;"&gt;ByteStyreamNode&lt;/span&gt; during &lt;span style="font-family:courier new;"&gt;GraphHandler::stage1&lt;/span&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29273208-114946828208322267?l=hawkcode.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IWLm186Oe84OQUhzBGZlAy0Cxl4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IWLm186Oe84OQUhzBGZlAy0Cxl4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IWLm186Oe84OQUhzBGZlAy0Cxl4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IWLm186Oe84OQUhzBGZlAy0Cxl4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/jqYS/~4/ksYz2zGDntY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://hawkcode.blogspot.com/feeds/114946828208322267/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=29273208&amp;postID=114946828208322267" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/114946828208322267?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/29273208/posts/default/114946828208322267?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/jqYS/~3/ksYz2zGDntY/soc-report-this-is-first-report-about.html" title="" /><author><name>hawk</name><uri>http://www.blogger.com/profile/12879490062291392436</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08594140230806200628" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://hawkcode.blogspot.com/2006/06/soc-report-this-is-first-report-about.html</feedburner:origLink></entry></feed>
