NSStatusItem

I’m currently rewriting iTunesRating to allow for half-star ratings. This is a program that sits in the menubar, and displays the rating of the current song, and allows it to be changed. I’ve learned a lot about how to create a NSStatusItem already tonight, and I’m working on getting the AppleScript interface to properly with it. It builds a bit on iTunesRater, a program I wrote in AppleScript Studio, which allows for the same thing, although this will have a much smaller screen footprint. If only I could get hold of the original source code - I could fix it in a few seconds, I suspect. More updates later.

Arse Kickin’ Lady From The NorthwestTim Rogers And The Twin SetWhat Rhymes With Cars And Girls ★★★★½

Memory Leak

iTunesRater seems to be leaking memory, and I think I know where. I discovered this by just watching the amount of memory it used, and each time a new track plays, the memory usage goes up. I think it’s to do with the artwork display: I thought I deleted the image being displayed, but maybe I don’t. Before I update the image with a new one, I use the code:

        delete image of image view “Artwork”

(both times: when I replace the artwork in the main window, and the previous track drawer). However, unless I’m missing something else, this is where the leak is!

iTunesRater / Interface Builder Bug

There seems to be some sort of a layering bug with Interface Builder - I notice it sometimes in development builds of iTunesRater: Itunesraterbug-2 As you can see, some of the widgets, sorry, views, are partially obscured. Sometimes it is worse than others, with all of the fwd/play/rev buttons covered. Sometimes it is fine. I generally have to just play around shifting different views to the front to get it all okay. Needless to say, it looks fine in Interface Builder.

Canon in D Major from the album “Adagio Karajan” by Berlin Philharmonic Orchestra

Ratings on the Fly

So far, the program I’ve written does this: Monitor the current track, and how much of it has been played. Wait for a click on the Next (» ) button, and when it occurs, rate the song up or down according to the modifier: abs((amount played / song length) * 15) - 5 Thus, when a song is skipped immediately, it loses 5 rating points, songs that are clicked at the end receive a +10 modifier. The only problem is that this is only triggered when this program wants the next track. I need a robust method of…I’ve just thought of something. I’m getting close to getting this to work - when the song is changed, the track id is used to find the song in the library, and the last known rating modifier will be applied to the song’s rating. It just doesn’t do that yet!