And now for something completely different…

November 10, 2009

Palapeli is in kdereview, and I really got to cool down from the continued QGraphicsView hacking. I decided that the best way to do so would be some Phonon hacking. 😉 Actually, I have never worked with Phonon before, but here’s what I got after two hours of work:

Ljudfil, my own command-line music player

Actually, writing a GUI media player would have been easier, but I’ve grown accustomed to using command-line media players (mplayer and cvlc, to be exact) in combination with screen after a period when my X server crashed quite regularly.

The actual code of Ljudfil is exactly 100 lines long (according to sloccount). All it can do is play all files passed on the CLI in that order, then exit (no keyboard navigation). The name has been chosen with a proven procedure of mine: I opened the Wikipedia page of what the application does or what it handles (“audio file” in this case) and looked for the nicest-sounding translation. This time, it was the Swedish “ljudfil”. By this method, Palapeli’s name was chosen, too. (“palapeli” is Finnish for “jigsaw puzzle”.)

I originally had the intention to write a command-line media player with MPRIS support. There seems to be nothing like this. I would like my media player to survive every X server crash in its screen session, yet be controllable through the “Now playing” applet on my dashboard.

But during hacking together the minimal interface of Ljudfil, I noticed that there is no possibility in Qt to use advanced terminal features. You can only write line by line, although POSIX terminals have much more functions (see “man termios” for a first impression). So, to conclude with a question: Dear lazyweb, is there any library or stuff for Qt that gives me more control over terminal output? (Extra points if it’s portable to Windows.)

Advertisements

One Response to “And now for something completely different…”

  1. Sebastián Benítez Says:

    Send ANSI control codes? Wrap them in a little class/templates?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s