SZap PyGtk

I was using the tandem of xawtv for viewing and szap to select the satellite channel where the latter is a command line util. Switching channels on the next ad break required to call up the xterm, control-c the szap command, type in the next channel, and let it go. And still, one does not know what channels exist as the szap channel.conf can be very big for the many dvb-s digital transponder lists on astra.

So what, I did want to have a gui for it but there was no need to have a full-fledged project for it. It was supposed to be simple so that I could modify it to my needs. Among those is the need to select the second adapter as I have two dvb-s cards in my computer where first card points to hotbird transponders and the second card points to astra transponders - and only the second one has a hardware mpeg decoder.

So here you are with a gui for dvb-s viewing which has just four python source files. It is fully object-oriented so it should be easy for an average contemporary programmer to modify the sources. It builds on the external programs "xawtv" and "szap" which should be available on most systems. Apart from that you need to have the pygtk wrappers around the gtk gui libraries of course, any version will do.

The gui itself is very simple - you need to give the full path to the channel.conf that should be shown. That file gets parsed and represented internally in a SZapList.py. The channel names are extracted and pushed into a gtk ComboBox. There is first default value being empty so that right after starting the gui there is no sat channel activated. Upon activating a non-empty name in the combobox will spawn a "szap" process with than name as the command argument. As an extra, the existance of a xawtv process is checked and possibly spawned. Pushing the "Close" button will kill these childs as well before exiting the the gui program.

The internals are little bit more beefy as I did want to be able to simply use the up/down arrow keys to activate another channel. However the szap dvb channel selection is a rather slow process which blocks for some tenths of a second until it is tuned on the air channel. That would make for quite some delays or multi process hickups when trying to get up/down by multiple entries in the gui. So effectivly the gui runs multiple threads to disentangle gui selection and hardware channel activation using a bunch of timers.

The license is again the python license which is close to LGPL. If you have some good use for it then it would be nice if you could drop me a mail. And patches and extensions are always welcome, ye know, it's a bit like a quick hack with some additional packaging and website generation. It works for me in the current state but it would be nice to have the thing a bit more generalized as some things are still hardcoded without much command line options or configuration file persistance.

Next thing on my whishlist: add a button to start immediate recording via "ts2pes" from the dvb mpegtools package. That would convert the channel name to the filename base which is extended by start date and time of the recording. Perhaps that's already done when you read this documentation, we'll see....

Have fun, Guido Draheim ("guidod") 2004-11-24

Download: guidod-pygtk-2004-1124.tar.bz2