Week 21

Welcome to week 21 and the official start of the summer for those in the northern hemisphere (at least it is meant to be from what I’ve been told :o) ). Up front this weeks update is going to be dull as it’s main involved code re-organisation / replacement rather than working on new shiny things.

So as was already alluded to last weeks combo update, some of the work done was updating the shared libraries that are made use off. So in addition to updating libpng to v1.6.23 and fully enabling the SSE2 related optimisations, libjpeg-turbo (as used for JPEG file handling) saw a 1.5 release (as the 1.5 beta release was being used).

One small but helpful change was patching the local library search support to have the search thread which is used to gather the results to run at a higher priority which from testing shaves a few milliseconds off the time to get search results on average. However it’s main benefit from testing is that making this change makes the search time more consistent between test runs compared to it not being enabled. Obviously the impact off this change on different setups will vary but the boost may help on some setups more so than others.

A bigger piece of work which was covered at the end of last week’s update was the /AGENT mode which I’ve finished so it’s actually usable especially with changing settings in it’s menus being reflected on the Winamp preference page and vice-versa (as it makes things feel more consistent which is not something that was the case with the native implementation).

One thing I did find whilst finishing this off is that (most likely something I broke when I had an official hat on is that) changing the notification icon in the Winamp preferences isn’t being correctly applied if the original agent (winampa.exe) is running (i.e. it’s meant to change to match the Winamp preference setting when changed).


So just above is what is the final version of the preferences page which for those who even use the agent mode, will notice that the option to hide the icon is no longer present. I decided to not emulate that mode as it made no sense to have the means to hide the notification icon when the agent doesn’t do anything else in the background (unlike the agent did many many years ago back in the 2.x days). Hopefully that makes sense and won’t cause grumbles that I’ve taken away a (pointless) long standing option but you do get three new options in it’s place, heh.

Related to finishing the /AGENT mode off, I decided it’d be simpler to make a way to share the code used for the notification icon tooltip from the gen_tray plug-in to also be used by the /AGENT mode.

Why do this…? Well it’s because the gen_tray implementation is much nicer (is something I’d coded a number of years back) compared to just a generic now playing title as it can show the play / pause / stop state and for me it looks nicer (and probably should be used for Winamp’s own notification icon / taskbar preview text :o) ).

The rest of the achieved work done is the continuation of splitting out functionality from the JTFE plug-in and moving it into the loader and related parts.

This is going a lot slower than I’d like as to do certain aspects ‘right’ (e.g. the file association handling for icon packs), it’s meant I’m having to code up replacements for things like the elevation / UAC functionality so that things can be done within the loader and not within Winamp original (as it’s too late to do do some of the aspects correctly without causing duplication of processing once Winamp and the plug-ins have been loaded which is not ideal).

Finally what I thought would be a simple thing to do in adding a means to disable the skin / language pack install prompt via a simple patch turned out not to be due to a race condition that means most of the time the patch works but then it’ll just fail and the prompt will re-appear. This was something that I’d looked at whilst I was stumped on something else related to the code re-organisation mentioned above (oh how I ended up going down the rabbit hole on this one!).

The purpose of the skin / language pack install prompt was to resolve a security vulnerability in people just blindly clicking on skin links (language packs as we now know them didn’t exist at the time) and that potentially leading to bad things being done from within Winamp. However for skin (and language pack) developers, that prompt can be annoying if having to change things a lot. So the purpose is to have an option that allows for disabling it (opt-in).

So despite trying a number of ways to get the loader patching things earlier (which broke normal plug-in loading in one of the changes) I had to go back to the original code I’m using and instead implement the change in the loader and having it just not get passed to the original Winamp program file which maybe I should have just done to start with but a simple patch was quicker to do to start with.

Anyway all of this led to getting the elevation / UAC functionality done even sooner than I was planning but it means with the JTFE / loader re-working that I’m now in a position to do things right (as is the aim once the code changes have been finished off :o) ).

And with that (if you’ve made it this far), that’s this weeks brain dump off what I’ve been doing and I’ll now get back to coding after today’s detour with my family related IT support duties.


Add comment:

Fill out the form below to add your own comments