Archive for the ‘gtkD’ category

GtkD now supports Mac OS X


Since yesterday or so, I was happy to find out that the svn trunk version of GtkD is supporting Mac OS X. This adds the supported platforms up to three. Linux and Windows are of course the other platforms.

Currently you’ll need to use the semi-official GTK+ Framework (the native Quartz port), or then if you absolutely must use the X11 version, you’ll have to edit some paths inside GtkD.

A screenshot will follow.

GtkD running on OS X

Just a screenshot to keep things looking like somethings happening



It seems I haven’t posted a screenshot in a long time. So, here goes. This one shows the “fullscreen” mode that I added this week. Nothing much there, but it’s nice to have some more room for the video monitor. Hmm. I think I need some audio monitors there too. There’s also some little polishing on the widget’s layout to get some more space for the monitor. The timecode display was moved to the bottom statusbar. Hmm. I wonder if that’s a good idea. It saves space. I’ll keep it there for a while, and see how it feels. Also the “media buttons” – play, pause, rewind etc. – moved to the center toolbar. Now you can pretty much get almost a fullscreen viewing experience when you move the panes to their maximums. Maybe I’ll put that to the next video demonstration. That’ll be out somewhere in 6 months during the next release… 🙂

Lots of functionality still missing. I should rewrite SceneChain and Track. Unify them into a class called Sequence!(T). Well, I’ll see if that’s possible.

Ok. Lots of things happened. But not that much to Pihlaja. Updated to Feisty Fawn finally. Updated to new version of Tango. Less crashes, I hope. Crashes immediately if I use console output, so that issue has reversed itself! Can’t use the newest version of gtkD. Gradually learning to use git and changing Pihlaja to use that too. Should really end Pihlaja development and start doing my “final work”. 🙂

Pihlaja 003 alpha released


I tried to embed this video, but it didn’t work out, but you can click the link. It’s a small three minute example showing the Pihlaja user interface and even a crash in the middle.

Release notes for Pihlaja 003 alpha (”Well, it’s a start of some sort”)

Six months (or four years if you count the earlier versions) of work has culminated into this very buggy and crashy piece of software that is called Pihlaja. You can get the binary for Ubuntu Feisty Fawn from the sourceforge page. I really hope I haven’t forgotten anything in this busy process. The source is there too, and in the svn over Hope it works! Some more release notes will follow in the end of this post. But first for a small update on my life, and a small appeal:

This alpha release comes just before a weird period starts in my life: The Finnish state is putting me to prison for three weeks. I’m not kidding.

The reason for this is that in Finland there is an obligatory military service for all men (excluding Jehova’s witnesses), it’s duration is either 6 months, 8 months or 12 months. I want to emphasize that a large majority of the people who go to military service get the 6 months. Only some special areas demand the longer 8 or 12 months. Then there’s also the alternative service called ”civilian service” for conscientious objectors (like me). It’s duration is 13 months, which is considered a punishment for not doing military service, and to keep people from going to civilian service. Most people choose the (propably) 6 months military service instead of the 13 months alternative. Yet there are some thousands of people who still go to civilian service each year..

I started my civilian service some three years ago, and stopped it after 11 and a half months as a protest to the punishmental duration of civilian service, and the fact that conscientious objectors are released from the military only during peace time. I had 41 days before my service would have ended.

A long juridical process started and I eventually had my trial a couple of months ago. I was convicted quilty of ”civilian service crime”, and (as is the standard) the court ordered me to jail for half of my remaining service, which (rounded to full days) was 20 days. I complained to the upper court level, but the result didn’t change. And now I’m starting at the Kerava prison on 3th of July. It is a normal closed prison. (In Finland there are also so called ”open prisons”, where non-violent prisoners who have done less serious crimes might be able to get to.) So for the next three weeks I will not be able to code on Pihlaja and I’ll only be able to see my two year old daughter during visiting hours on the weekends. I’ll propably spend my time mostly reading books.

Since 1999 Amnesty international has considered Finnish ”total objectors” as prisoners of conscience, because of the punitive length of the civilian service. Also in the recent years many international bodies (including UN’s Human Rights Committee) have demanded Finland to take measures to improve the legislation concerning conscientious objectors. There are about 50 people going to jail each year as ”total objectors”. Some of them have to spend 6 and a half months in a prison, if they don’t even start doing any civilian service at all. More info about these issues is available here.

If you too feel like that this punishment that I’m getting is a bit over the top, then I’d like to ask you to take up a little of your time to write one letter (or even a postcard) to either

A) a random member of the Finnish parliament, who could decide to end this

Pick a random parlamentarian from this list, and send the letter to this address:

firstname lastname
Eduskunta, Parliament of Finland


B) a random member of the European parliament, who could pressure Finnish parliamentarians to act on this issue. You can find contact information from:

I don’t think it would be good that the letter’s would all be the same, so I won’t make any example texts, so you’d might have to write it yourself. But if you do take the time to write one, then me (and yearly about 50 young finnish men, who are put to jail as prisoners of conscience) would much appreciate it. Thank you!


But back to the Pihlaja release notes:

Here’s a list of issues and a guide to survival:

Installing (is that even possible?)


You can get Pihlaja binaries from the sourceforge site. I’ve put the compiling from source section to the end, as that’s kind of hard to do, really. But you can get the source from svn in


What you can do


When you start Pihlaja, you are greeted with a project chooser dialog. Pihlaja is one of those nasty programs that manage your files for you. Currently you can’t even override that. So there’s no ”save as”. There is an autosave every 5 minutes. Ignore the users section, as it doesn’t affect anything yet, and focus on the projects section. You can alternatively edit the name of the ”New untitled project” into something meaningfull, or you can just select it and click OK, in which case it will ask the name in a dialog. If Pihlaja doesn’t crash before it closes you will find your project here the next time you start Pihlaja.


Now the project window opens up. On the left you have a list of all the movies, materials and bins in your project. On the right there’s some room for the monitor. And the lower part of the window is reserved for the editing canvas. On the editing canvas you can see two rectangles right next to each other, the ”Start” and the ”End” rectangle. Below the list of the movies, materials and bins you have a big button labeled ”Import material…”. Click on that and you’re presented with a file chooser dialog letting you to choose one or more files to import. Be sure to only import files with DV content (.dv, .mov and .avi should be fine as long as their contents are DV. I haven’t tested .avi myself though. I just tested some Quicktime files, and found out that when exporting from Final Cut Pro, you’ll have to ”export using quicktime conversion” and make the sound linear PCM with little endian. The default seems to be big endian and that doesn’t seem to work with Pihlaja). You can double click on files you want to import. When you’re done, you must click the close button (this way you can import many files easily).


If you’re lucky, your files will get recognized correctly and they’ll end up in the list. Now you should drag a file (or material in Pihlaja terminology) into the editing canvas. Bing. It’s there. And it hopefully didn’t crash, as it has never crashed for me at this stage! But you never know. Drag two more files somewhere else on the canvas. The objects that you just created that look like windows of an operating system are called scenes in Pihlaja. The scenes you created only contain two tracks, one video, one audio (if all went well). The tracks contain only one edit or clip each at this stage (haven’t yet decided on that terminology, as I’m not sure what those should be called in english. Feedback is welcome). The scenes could contain more edits, but let’s forget that, as that side of Pihlaja is not really working reliably yet (what part of Pihlaja is working reliably – one might ask).


The scene has a white ruler on it’s middle, separating the video and audio tracks. You can click on the ruler to see how buggy Pihlaja is this time. If you’re really really lucky, you’ll see a monitor appear on the right (Oh, it might have appeared there before too). Press space on the keyboard to make the scene play and to pause again. You can use the arrow keys to move around. Left and right for 1 frame and up and down for 10 frames movement.


There’s two ways to edit in Pihlaja.

1. You can grab the scene ”windows” from their headers, and put them one after each other (they’ll snap, and then you just release) to form chains of scenes.

2. Or you can move your mouse a little left from the ruler of a scene, to the outside of the ”scene window”, and from there start dragging a link to another scene. This way you can connect scenes, as if they we’re nodes.


Much of this doesn’t work the way it’s supposed to yet, so you can’t really reorder them or relink them, after you’ve done it the first time. So, you can just put them together, and watch the result. Trimming the scenes doesn’t work yet. And I didn’t get the export working yet, so that put’s Pihlaja in the “not really usable for anything” -category.


A list of things not to do (feel free to do them if you want to test the limits)


  • Holding your mouse button pressed and moving it on the Ruler might sometimes result in Pihlaja crashing while it has grabbed the mouse. This will make your system look like it’s crashed, but it’s not. You should avoid dragging on the ruler to avoid this, but if you happen to come to crash while dragging, then do the following (you should write this down on a piece of paper): CTRL-ALT-F4 to create a new terminal session(?). Log in with your username. Write: ”ps -x”. This will list the running processes. Locate Pihlaja on the list and look it’s process id – it should be the first number in the front. Then write: ”kill 8712” – and replace the 8712 with the number of the Pihlaja process you just checked with ps -x. CTRL-ALT-F7 to get back to your X session. Great! Now it’s working again.

  • Don’t do anything that you’d think should work. It will propably not work, or it will crash.

  • Saving works, but loading can be a little unreliable. So don’t do any real work with this version.

  • Sometimes your monitor might disappear, because of screensaver or some window blocking it. You usually can move the pane handles(?) to resize the monitor so it will be redrawn. (This is a bug with me not getting the expose event handled correctly with the xoverlay.)

  • You should propably avoid using multiple movies, or selecting the materials. So, just use that one movie, and test editing the scenes and scenechains with that. Selecting other movies will eventually lead to crashes, and before that you’ll propably not be able to select scenes and see them in the monitor anymore. (So, sometimes the gstreamer pads don’t get connected correctly. This is propably my fault, because of not fully understanding how to do stuff correctly.)

  • Changing the scenes order doesn’t work yet.

  • Editing the edits/clips inside the scene doesn’t work that great yet, so don’t do it.

  • Trimming the edits isn’t good, so forget about that too, for now.


A huge thanks to the freenode channels #d, #d.tango and #gstreamer for much appreciated help on various issues. Pihlaja reuses some code from the Pitivi project and heavily relies on Gnonlin for it’s functionality, so a big thank you goes out to bilboed.


Compiling from source


Umm. It might be hard. But here’s a list of what you need:

Get the Pihlaja 003 alpha source package from sourceforge. It will also include my personal branch of gtkD and gstreamerD, because I didn’t have the time to merge it with the official version found from Pihlaja only works on Linux. Some other Unixes might work too. I’m currently using Ubuntu 6.10 Dapper Drake (never had the time to backup my files and update).

  • You should have the usual GCC stuff installed. You also need GStreamer (and the plugins) and Gnonlin installed.

  • Get the DMD D compiler from I’m currently using version 1.014. To be sure, get that version. Don’t get the experimental 2.0 beta version. (You might also try GDC, but it appears there’s not yet a version that matches DMD 1.014. But it might work anyway… Haven’t tested it yet.)

  • Get DSSS from Try to find some installation instructions.

  • Get the Tango library from There’s propably a way to install Tango with DSSS too, so if you find that, you can use it. It will be easier. It has something to do with dsss net install tango, but I’ve never used it yet.

  • You also need the Tangobos library. You can propably install that with dsss net install, somehow.

  • In the dir where you’ve got the patched version of gtkD and gstreamerD, run command: dsss build. If that finishes without errors, and you’ve got libraries called libSgtkD.a and libSgstreamerD.a, then you can run the command: sudo dsss install.

  • In the Pihlaja directory called pihlaja/src/ again run command: dsss build. You don’t have to run install. After you’ve made some changes to the code, you should run dsss clean and after that dsss build to build it again. Run ../pihlaja to try it out.

  • The build process will be much more simpler after I’ll find the time to merge with the official branch of gtkD, which doesn’t need Tangobos. Hopefully it will be as easy as dsss net install pihlaja.

  • To get the latest Pihlaja source after this release you can do:

    svn co

Some Pihlaja related websites (ideally there should be only one): The Pihlaja development blog is the number one source of information regarding Pihlaja development and news. This is going to be a promotional site for using Pihlaja. Currently it just links to the old sourceforge pages. The sourceforge page is currently used for binary releases, but that might change in the future. Development wiki and subversion repository. Pihlaja forums for all feedback and questions.


XOverlay is (almost) working now. Export is next.


Now the xoverlay works finally (and the dynamic pads are solved too, if you missed the comment I wrote on the “Not yet”-post.)(UPDATE: Nope. The dynamic pads are initially connected correctly now, but as soon as the user tries to switch to another movie and then back again to the original one, the pads don’t get connected. And when the user repeats this action once more, the program crashes). It was really difficult and my current branch of gtkD and gstreamerD are quite hand edited on some parts now. I’m not sure how to do some of that stuff automatically with gtkWrapper, but it doesn’t matter on the functionality part.
The only thing not quite working with the xoverlay is the expose(). For some reason it doesn’t really have an effect, and if some other window overlaps it, there will be hole in the video overlay. So you’ll have to resize the monitor widget to get it working normally again. But that’s of minor importance for now. (Thanks to many people over at #gstreamer and #d).

Next is export. I hope I get it sorted out by 30th. The release is going to be a wacky binary release inside a And you’ll propably need to put the two libraries (libgtkD and libgstreamerD) to somewhere inorder for it to work (And it will also be made on Ubuntu Dapper, but I’ve tested that it works on Feisty too). I’ll also release my branch of gtkD and gstreamerD as a, as I don’t have time to merge it with the official version now. The release will be almost usable for something, but totally alpha. But you’ll hopefully be able to see some good(UPDATE: mediocre 🙂 ) stuff there too.