Here's the complete script; this compiles with no trouble. You'll want to tweak the "std.mi" line to reference where you actually have the std.mi file.
From here, you would need objects in your XML named "cdanimstop" and "cdanimplay" (or whatever you want to call them; mine is a spinning CD). The second one would be a multiple-element file with frames, essentially. Winamp will "scroll" through the frames to display the animation. Let's say your non-animated file was 50 pixels by 100 pixels, and you wanted four different animation frames. You'd have a second file 50 pixels by 400 pixels, each 100 pixels vertically being a new frame of the animation.
If you design and define the graphical elements that way, and use the script below, you'll get what you're after.
Script:
From here, you would need objects in your XML named "cdanimstop" and "cdanimplay" (or whatever you want to call them; mine is a spinning CD). The second one would be a multiple-element file with frames, essentially. Winamp will "scroll" through the frames to display the animation. Let's say your non-animated file was 50 pixels by 100 pixels, and you wanted four different animation frames. You'd have a second file 50 pixels by 400 pixels, each 100 pixels vertically being a new frame of the animation.
If you design and define the graphical elements that way, and use the script below, you'll get what you're after.
Script:
XML - put this in whatever group/container you want the animation to live incode:
#include "..\..\..\lib\std.mi"
Global container main;
Global layer cdanimstop;
Global animatedlayer cdanimplay;
system.onScriptLoaded()
{
Group tickergroup = getcontainer("main").getLayout("normal");
cdanimstop = tickergroup.findobject("cdanimstop");
cdanimplay = tickergroup.findobject("cdanimplay");
if (getstatus())
{
cdanimplay.show();
cdanimstop.hide();
}
else
{
cdanimplay.hide();
cdanimstop.show();
}
}
system.onTitleChange(String s)
{
if (getstatus())
{
cdanimplay.show();
cdanimstop.hide();
}
else
{
cdanimplay.hide();
cdanimstop.show();
}
}
System.onPlay()
{
cdanimplay.show();
cdanimstop.hide();
}
System.onStop()
{
cdanimplay.hide();
cdanimstop.show();
}
code:
<layer id="cdanimstop" x="625" y="53" w="85" h="57"
image="cdanimstop" />
<animatedlayer id="cdanimplay" x="625" y="53" w="85" h="57"
image="cdanimplay" autoplay="1" move="0"
autoreplay="1" rectrgn="0" />
Comment