Richard Moore has been
working diligently on a rewrite of
KWinTV, the KDE
TV-card application. The "new" KWinTV (screenshots:
Wizard - Scanning;
Selection; and Main window) will be based on QtVision, a
Qt/Embedded TV application written by
He has some really great ideas for future development, such as a panel applet to display a small TV, a TV screensaver, a TV desktop background and teletext/videotex support. Even better, he
has asked the community for feedback on where to focus his efforts.
The KWinTV Rewrite
This document is an overview of the changes I have been making to the
rewrite of the KWinTV
code which George Staikos
(People page) added
to CVS last week. The rewrite is based on George's QtVision, a Qt/Embedded
TV application which is a basic but functional framework for using Video4Linux
As you will see, I have been pretty busy, so I tried to break things down
into manageable chunks. If you just want the raw data, then skip to the
bottom for links to the latest class documentation and the
ChangeLog. If you have any comments or suggestions please
I have been hacking at the newly imported KWinTV3 (Qtvision) code,
and the changes are becoming significant enough to warrant
some discussion. The main things I have done so far are as follows:
- Ported the code to Qt/KDE 3.
- Employed the XML GUI framework.
- Split the old main window class into two, with the back end being a
standalone QObject that can be reused.
- Written a generic I/O framework for channel files.
- Tried to make the code into a collection of reusable objects so that
it can be split into a library for accessing TV devices and a
collection of user interfaces that use the library.
- Cleaned things up a bit.
- Improved the scan wizard.
- Added a bunch of kdoc comments to explain how things work to other
- At the moment I cannot actually use this app as PAL support seems to
be broken, so obviously I plan to fix this.
- There are still more code cleanups needed.
- Write a channel editor.
There are a number of obvious improvements that can be made to the
channel wizard. At the moment the ones I am planning are:
- Get the region data from V2 working using the XML region data
- Extending the GUI to work with the region stuff.
- Adding the ability to import old channel files.
- Making the wizard look cooler.
I would like to provide a range of ways this code can be used, the things
that I am tempted to work on at the moment are:
- A KPart that can be embedded in Konqueror as a viewer for channel files.
- A kicker applet and extension that contains a small TV.
- A QWidget for displaying a TV.
- A screensaver that shows a TV.
- A hack that makes the desktop background a TV.
- A DCOP interface to the Qt-Vision back-end.
Wouldn't It Be Nice If...
There are a number of things my ideal TV application would have:
- An integrated TV listings viewer.
- The ability to set alarms that trigger when a program is starting.
- Teletext (videotex) support.
- A good way to channel hop and find what is on.
- Knowledge of the stations available in a given area, so that when
you have found your channels you can just say 'this one is BBC 1' and
the app will automatically assign the name, icons, a link to the
website, listings etc.
I have made various cleanups to the code while I have been working on it,
partly to make it work nicely with my other changes, and partly just
to make it easier to work with. I have tried to add kdoc comments to the
part of the code I have worked on to make it easier to understand how it
all works. I have also added a build target that creates a ChangeLog
file from the log recorded by CVS using cvs2cl (see links) so people
can keep track of what is being worked on. To make this useful, please
try to give a decent explanation when you commit changes.
I converted the QMainWindow of the embedded code into a KMainWindow
and ported it to use the XML GUI framework. In addition I have split the
code into two classes making the backend code and the application
shell independent. Finally, I have started re-adding some of the
features of the old KWinTV main window, with the aim of doing it all
cleanly this time.
Most of the basics are now in place and working, so it might even be
possible to use the app already. I have re-implemented the fullscreen,
hide all, and LCD channel number features of V2 as custom KActions,
this is much cleaner than the old code and it might be worth using
them in the next release of the V2 code too.
Channel File Handling
I have written a generic API for loading and saving channel files. The
framework is designed along the lines of KImageIO, and allows new
filters to be added as required. The code is independent of the
Video4Linux code, as shown by the command-line test_channelio tool
which converts between different channel formats.
The filters currently working are:
- KWinTV 0.8.x channel format version 4 (Read-Only).
- CSV format of the original Qt-Vision code (Read-Write).
- A new XML channel format (Read-Write).
The only other formats I see a need for are the XawTV format and the
format used by the win32 TV app that came with my Haupage card.
The channel wizard in the embedded version of Qt-Vision could afford to
block the UI, but that is not acceptable here so I have rewritten it to
be non-blocking. I also made the actual scanning code stand-alone so
it should be possible to write a command line version etc. later.
I have started adding the ability to use the region the user is in to
speed up the scan. The data for a region is loaded from another XML
file (instead of being hard-coded C++ as in the old KWinTV) so it
should be easy to add new regions. You can test this using the
test_channelscannerregion tool. At the moment this code does not work
as there are problems converting the frequency data I have into
something the V4LDev class can understand.
I have put a copy of the
and the latest
kdoc output on my website so you can take a look even if you do not want
to download the code.
The code is in the KDE cvs in the directory kdenonbeta/kwintv3/ which
be seen online via WebCVS.
This is a great tool that builds a ChangeLog file by analyzing the
logs recorded by cvs.