Qball's Weblog

Custom TreeModel

Tags General 

I said: “Now I (someday) plan to write a custom GtkTreeModel.”
That night I couldn’t sleep, looked on the internet for some example code.
Found a nice example implementation of a custom tree store. 1 hour later I had a nice treemodel that displays the current playlist.

After some more fiddeling around it now keeps the playlist in sync with the mpd server (using libmpd), highlights the playing song, allow you change the markup on the fly. (something I couldn’t easily do with the old system.). But the real nice thing is, that the structure returned by libmpdclient (and all sub-fields), in the optimised linked list from libmpd is directly used in the treemodel, withouth coping.. this should save alot of malloc’s and free’s.
Because I have the mpd_Song structure of every song in the playlist availible, this should also makes some things easier in gmpc (less (re-)fetching data from mpd).
I don’t think this will be part of gmpc-0.13, but I will implement it in 0.14.
Having done that, and realising how easy it is, I have thought of several other situations I can use this. Now if only I had more time.

I bought a new amplifier yesterday, and ordered a set of speakers. It’s not very fancy, but the audio quality should be great.
Amplifier: NAD C 320BEE
Speakers: KEF Cresta 10.

This is to replace:
Amplifier: Braun Atelier 1 (It needs several seconds to stop making weird noises and the switches are so old, I constanly loose one channel.)
Speakers: From a Sharp stereo.

I’ve been getting alot of e-mails around gtodo again lately, people translating, offering patches and more. So instead of writing the custom treemodel, I’ve should have been giving the old gtodo some love, and make a release.
I am still looking for help with gtodo, I don’t use it myself alot atm and somehow can’t find the motivation/time to work on it.
I don’t use it mostly because I forget to make a note (I’ll write it down in a minute) and forgetting about it the next second. (I didn’t write the program for nothing, now if I can only force myself to use it.)

Music: I’ve been enjoying Yann Tiersen alot. It does sound better with the new amp… If only my new speakers would arrive…….