/************************by Boricuaso******************************************
this puts the a crossfade in a small popup layer not menu,
when you leftclick the crossfade buton normaly it activetes the crossfade
When you rightclick the crossfade the crossfader popsup, if you right click
but dont feel like changing anything the popup will go away, but wills stay up
aslong as you are making changes.
******************************************************************************\
/******************************************************************************
add this to your .xml for script to work.
******************************************************************************/
/*****************************************************************************
add this items below to the layout some where
*******************************************************************************/
#include
Function setTempText(String txt);
Function emptyTempText();
Global Group frameGroup;
Global Group Grouped;
Global Timer areatimer;
Global Layer MouseTrap;
Global Slider cfslider;
Global Text fadertext;
Global Button CFIncrease, CFDecrease;
Global ToggleButton Crossfade, CrossfadeLED;
Global Layer DisplayOverlay, MouseTrap;
Global Text Songticker;
Global Timer Songtickertimer;
System.onScriptLoaded() {
areatimer = new Timer; //created a timer
areatimer.setDelay(700); //sets the timer delay
Songtickertimer = new Timer; //created a timer
Songtickertimer.setDelay(1000); //sets the timer delay
frameGroup = getScriptGroup();
Grouped = frameGroup.findObject("Crossfadegroup");
cfslider = frameGroup.findObject("sCrossfade");
fadertext = frameGroup.findObject("CFDisplay");
CFIncrease = frameGroup.findObject("CrossfadeIncrease");
CFDecrease = frameGroup.findObject("CrossfadeDecrease");
Crossfade = frameGroup.findObject("Crossfade");
DisplayOverlay = frameGroup.findObject("crossfade.display.overlay");
CrossfadeLED = frameGroup.findObject("CrossfadeLED");
MouseTrap = frameGroup.findObject("layerback");
Songticker =frameGroup.findObject("Songticker");
Grouped.hide(); //the group gets hiden on script load
cfslider.onSetPosition(cfslider.getPosition()); //gets the position of the slider
if (Crossfade.getActivated()) DisplayOverlay.hide(); //it hides this layer if Crossfade active
}
cfslider.onSetPosition(int val) { // gets slider postion and assings it an int of val
String s = IntegerToString(val); //turns the int val to string s
fadertext.setText(s); // the string is displayed
setTempText("crossfade is now " + (s) + " Percent");
}
CFIncrease.onLeftClick() { //when this gets clicked
cfslider.SetPosition(cfslider.getPosition()+1); //find the slider current position and +1 to it
}
CFIncrease.onEnterArea() { //if mouse enters here
areatimer.stop(); // the timer stops
}
CFDecrease.onLeftClick() { //when this gets clicked
cfslider.SetPosition(cfslider.getPosition()-1); //find the slider current position and +1 to it
}
CFDecrease.onEnterArea() { //if mouse enters here
areatimer.stop(); // the timer stops
}
Crossfade.onToggle(boolean on) { // whe pressed it sets the value to on
if (on) DisplayOverlay.hide(); else DisplayOverlay.show(); //if its on hide this layer
} //else if its of hide this layer
Crossfade.onRightButtonUp(int x, int y) { //when this button is right clicked
Grouped.show(); // the drawer group shows
complete; // keeps system menu from poping up
}
Crossfade.OnLeaveArea(){ //when mouse leaves the crossfade area
areatimer.start(); // the timer starts
}
Crossfade.onEnterArea(){ //if you return to the crossfade button
areatimer.stop(); //before the time expires, the timer stops
}
MouseTrap.onEnterArea() { //if mouse enters here
areatimer.stop(); // the timer stops
}
DisplayOverlay.onEnterArea() { //if mouse enters here
areatimer.stop(); // the timer stops
}
CrossfadeLED.onEnterArea() { //if mouse enters here
areatimer.stop(); // the timer stops
}
MouseTrap.OnLeaveArea(){ //when the mouse leaves this area
areatimer.start(); //the timer starts
}
areatimer.onTimer() { //when the timer starts
Grouped.hide(); //the group hides
stop(); // then the timer stops
}
Songtickertimer.onTimer() {
Songticker.setText("");
stop();
}
setTempText(String txt) {
Songtickertimer.stop();
Songticker.setText(txt);
Songtickertimer.start();
}
emptyTempText() {
Songticker.setText("");
Songtickertimer.stop();
}
System.onScriptUnloading() { //when script unloads
delete areatimer; //the timer gets deleted
delete Songtickertimer; //the timer gets deleted
}