Finally, it’s done. Thanks to some hints in the source code of Jokosher I was able to implement selectable layers in PiTiVi.
The problem is that some widgets in Gtk+ don’t have gdk screens. This means that you can not change their background color, which is a really important thing for showing if a layer is selected or not.
The solution for this problem is to derive the widget from EventBox. This gives the possibility to modify the background using the modify_bg(…) function.
Based on that work I was able to implement proper selectable layers. So if you click on a layer control widget or a
layer in the canvas now, the layer gets selected and changes its background color. You can see a selected layer in the following screenshot. Note that I disabled all non-functional widgets (the entry, sliders, buttons…) for now, so this isn’t the final look.
This work builds the base for more nice stuff like drag and drop layer reordering or menu actions on layers. I’ll cover these in the next post.
Back from holidays I worked on including the newly created widgets in the user interface.
Before all video or audio layers only had one label. Now we want one widget for every audio/video layer. Therefore I had to change the internal logic quite a bit.
Afterwards I noticed that hard coded layer heights didn’t work well with the new widgets. The more layers you had the more you saw that they weren’t properly aligned. My solution for this problem is that I adjust the layer height to the height of the layer control widget. This also gives us basic folding support as well.
The current UI now looks like this:
You can find my branch on github. I’m also happy to hear your comments, hints or whatever you want to say 🙂
Because I didn’t have time to work on my project after the official start because of exams and vacation I started working the weeks before.
The first part consisted of designing and implementing new control widgets for layers with more functionality. After some inital atteps that didn’t look good, nekohayo (btw my super helpful mentor) jumped in and helped me to review and improve the designs. We ended with these mockups in Glade:
Then I started implementing them using pygtk. Unfortunately we still have to use Gtk+ 2 so we don’t get the cool new style. Furthermore I didn’t yet find a way to make a container widget selectable, so I added the ‘Delete’ button to delete layers. However this should be gone in the final version.
The next step was to use these new widgets in the PiTiVi interface. I’ll cover this in the next post!
I’m happy to announce that my project proposal for the summer of code 2012 has been accepted!
About my project:
The current approach of layers in PiTiVi does not provide more functionality than grouping video and audio sources in different levels. I want to add an advanced layer system to the PiTiVi video editor to improve the video editing workflow and user experience. This is based on two ideas. On the one hand putting more functionality into layers helps to avoid repetitive tasks like adjusting volume and panning, muting or applying effects to clips. On the other hand improving the management of layers by offering to name, reorder, fold and resize them makes working with layers more convenient.