2008-01-04, 04:20 AM
Hi, got a GBPVRUiElement I want updated frequently to keep up with a song playing.
For a screen saver, that will contain album art, song title and the place within the song.
I can get it all displaying, but I'm hitting the GetRenderList quite frequently.
I don't really want to re-create the UIElement all the time. I can keep track of which song it is and only re-make the image when the track changes, but are there any nice ways of updating a string. If i have to, I'll create the text as a separate element.
For a screen saver, that will contain album art, song title and the place within the song.
I can get it all displaying, but I'm hitting the GetRenderList quite frequently.
I don't really want to re-create the UIElement all the time. I can keep track of which song it is and only re-make the image when the track changes, but are there any nice ways of updating a string. If i have to, I'll create the text as a separate element.
Code:
if (args == null)
args = new System.Collections.Hashtable();
args.Clear();
args["@ArtistSong"] = media.Artist + "-" + media.Title;
args["@Time"] = currentSong.ToString();
args["@AlbumArt"] = media.GetImage();
Image playingImage = skinHelper.getNamedImage("Playing", args);
uiElement = new GBPVR.Public.GBPVRUiElement("Playing", skinHelper.getPlacementRect("Playing"), playingImage);
items.Add(uiElement);