avegav2
5th March 2004, 03:40
I was trying to write a slider bar for the main window that would appear only when the mouse is over its area. So I wrote this script (showseeker.maki):
#include "../../../lib/std.mi"
Global Group SeekerGrp;
Global Text SongInfoTxt;
Global Layer SeekbarBG, SeekbarInv;
Global Slider Seeker, SeekerGhost;
System.onScriptLoaded() {
SeekerGrp = System.getScriptGroup();
SongInfoTxt = SeekerGrp.getObject("infoline");
SeekbarBG = SeekerGrp.getObject("seekbar");
SeekbarInv = SeekerGrp.getObject("seekbarinv");
Seeker = SeekerGrp.getObject("seeker");
SeekerGhost = SeekerGrp.getObject("seekerghost");
}
SeekbarInv.onEnterArea() {
Seeker.SetXMLParam("thumb","player.slider");
Seeker.SetXMLParam("downthumb","player.slider");
SeekerGhost.SetXMLParam("thumb","player.slider");
SeekerGhost.SetXMLParam("downthumb","player.slider");
SeekbarBG.show();
}
SeekbarInv.onLeaveArea() {
Seeker.SetXMLParam("thumb","player.slider.invisible");
Seeker.SetXMLParam("downthumb","player.slider.invisible");
SeekerGhost.SetXMLParam("thumb","player.slider.invisible");
SeekerGhost.SetXMLParam("downthumb","player.slider.invisible");
SeekbarBG.hide();
}
The elements are defined like this:
<elements>
<bitmap id="player.seekbar" file="player/player_seekbar.png" />
<bitmap id="player.seekbar.invisible" file="player/player_seekbar_invisible.png" />
<bitmap id="player.slider" file="player/player_slider.png" />
<bitmap id="player.slider.invisible" file="player/player_slider_invisible.png" />
</elements>
The bitmaps "player.seekbar.invisible" and "player.slider.invisible" are totally transparent. The first one define the area where the mouse should activate the script when the mouse is over, the second one defines an invisible slider.
<groupdef id="playerticker" name="Player Ticker" w="318" h="23" >
<layer id="seekbar" image="player.seekbar" x="50" y="14"/>
<layer id="seekbarinv" image="player.seekbar.invisible" x="50" y="14"/>
<slider
id="seeker"
action="SEEK"
x="50" y="14"
w="144" h="7"
thumb="player.slider"
downThumb="player.slider"
orientation="horizontal"
/>
<slider
id="seekerghost"
action="SEEK"
x="50" y="14"
w="144" h="7"
thumb="player.slider"
downThumb="player.slider"
orientation="horizontal"
/>
<script id="showseeker" file="scripts/showseeker.maki" />
</groupdef>
But the script only works when Winamp is stopped. I wonder if I can anidate events in MAKI, something like this:
System.onPlay {
SeekbarInv.onEnterArea {
... etc.
Any help is welcomed.
#include "../../../lib/std.mi"
Global Group SeekerGrp;
Global Text SongInfoTxt;
Global Layer SeekbarBG, SeekbarInv;
Global Slider Seeker, SeekerGhost;
System.onScriptLoaded() {
SeekerGrp = System.getScriptGroup();
SongInfoTxt = SeekerGrp.getObject("infoline");
SeekbarBG = SeekerGrp.getObject("seekbar");
SeekbarInv = SeekerGrp.getObject("seekbarinv");
Seeker = SeekerGrp.getObject("seeker");
SeekerGhost = SeekerGrp.getObject("seekerghost");
}
SeekbarInv.onEnterArea() {
Seeker.SetXMLParam("thumb","player.slider");
Seeker.SetXMLParam("downthumb","player.slider");
SeekerGhost.SetXMLParam("thumb","player.slider");
SeekerGhost.SetXMLParam("downthumb","player.slider");
SeekbarBG.show();
}
SeekbarInv.onLeaveArea() {
Seeker.SetXMLParam("thumb","player.slider.invisible");
Seeker.SetXMLParam("downthumb","player.slider.invisible");
SeekerGhost.SetXMLParam("thumb","player.slider.invisible");
SeekerGhost.SetXMLParam("downthumb","player.slider.invisible");
SeekbarBG.hide();
}
The elements are defined like this:
<elements>
<bitmap id="player.seekbar" file="player/player_seekbar.png" />
<bitmap id="player.seekbar.invisible" file="player/player_seekbar_invisible.png" />
<bitmap id="player.slider" file="player/player_slider.png" />
<bitmap id="player.slider.invisible" file="player/player_slider_invisible.png" />
</elements>
The bitmaps "player.seekbar.invisible" and "player.slider.invisible" are totally transparent. The first one define the area where the mouse should activate the script when the mouse is over, the second one defines an invisible slider.
<groupdef id="playerticker" name="Player Ticker" w="318" h="23" >
<layer id="seekbar" image="player.seekbar" x="50" y="14"/>
<layer id="seekbarinv" image="player.seekbar.invisible" x="50" y="14"/>
<slider
id="seeker"
action="SEEK"
x="50" y="14"
w="144" h="7"
thumb="player.slider"
downThumb="player.slider"
orientation="horizontal"
/>
<slider
id="seekerghost"
action="SEEK"
x="50" y="14"
w="144" h="7"
thumb="player.slider"
downThumb="player.slider"
orientation="horizontal"
/>
<script id="showseeker" file="scripts/showseeker.maki" />
</groupdef>
But the script only works when Winamp is stopped. I wonder if I can anidate events in MAKI, something like this:
System.onPlay {
SeekbarInv.onEnterArea {
... etc.
Any help is welcomed.