Hi Dag,
On 04.06.05, Dag Wieers wrote:
I'm writing a JumpTo plugin, which will follow the currently playing song if the playlistwin has focus and a song changes. This is to get the behaviour that the cursor is moving the current song whenever the playlist is begin focussed. As was mentioned in a previous thread, I think this is was people actually expect.
Have you actually tried the new pre-release which allows you to change what is being displayed in the item info window (press ctrl-v). I still think that this pretty much allows you to achieve what you want.
Anyway, when doing the implementation, the plugin has to jump to the currently playing song, but the only information I have is the name of the song and apparently the selectbyname() functionality of the slist class bails out when using this:
Using the playbackinfochanged event is not the correct approach because it only gives you information about the song but not about the position in the playlist. Since the same song can appear more the once in the playlist, you hence cannot decide about it's position. In order to get the information about the playlist, you have to subscribe to the playlistchanged event.
Anyway, I think that such a thing is probably stretching a bit to far the notion of a plugin. Maybe it's better to make this add a configuration option to turn such a feature on and off.
Jörg