home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 November
/
CDVD1105.ISO
/
Util
/
Winamp
/
Skins
/
Anime_Shogo.wal
/
scripts
/
frame.m
< prev
next >
Wrap
Text File
|
2004-08-17
|
6KB
|
197 lines
#include <lib/std.mi>
Function UpdateVU(Int LeftFrame, Int RightFrame);
Global Group frameGroup, content, titlebar;
Global String x, y, w, h, rx, ry, rw, rh;
Global Layer mouselayer, playleft, playmid, playright, vuleft, vuright;
Global Text titletext;
Global Button Sysmenu;
Global Timer VUTimer;
Global Double LeftLevel, RightLevel;
Global Boolean StdVUState;
Function setNewGroup(String groupid);
System.onScriptLoaded() {
frameGroup = getScriptGroup();
titletext = frameGroup.findObject("window.titlebar.title");
playleft = frameGroup.findObject("component.play.left");
playmid = frameGroup.findObject("component.play.middle");
playright = frameGroup.findObject("component.play.right");
String param = getParam();
x = getToken(param, ",", 0);
y = getToken(param, ",", 1);
w = getToken(param, ",", 2);
h = getToken(param, ",", 3);
rx = getToken(param, ",", 4);
ry = getToken(param, ",", 5);
rw = getToken(param, ",", 6);
rh = getToken(param, ",", 7);
sysmenu = frameGroup.findObject("sysmenu");
vuleft = frameGroup.findObject("component.vu.left");
vuright = frameGroup.findObject("component.vu.right");
StdVUState = getPrivateInt(getSkinName(), "StdVU", 1);
VUTimer = new Timer;
VUTimer.setDelay(30);
VUTimer.start();
}
System.onSetXuiParam(String param, String value) {
if (param == "content") {
setNewGroup(value);
titlebar = frameGroup.findObject("wasabi.titlebar");
mouselayer = titlebar.findObject("mousetrap");
}
if (param == "padtitleright" || param == "padtitleleft") {
if (titlebar != NULL) titlebar.setXmlParam(param, value);
}
if (param == "shade") {
if (mouselayer != NULL) mouselayer.setXmlParam("dblclickaction", "switch;"+value);
else messagebox("Cannot set shade parameter for StandardFrame object, no mousetrap found", "Skin Error", 0, "");
}
}
// backward compatibility for prerelease notify trick
frameGroup.onNotify(String cmd, String param, int a, int b) {
String _command = getToken(cmd, ",", 0);
String _param = getToken(cmd, ",", 1);
if (_command == "content" || _command == "padtitleright" || _command == "padtitleleft" || _command == "shade") {
onSetXuiParam(_command, _param);
}
}
setNewGroup(String groupid) {
content = newGroup(groupid);
if (content == NULL) {
messagebox("group \"" + groupid + "\" not found", "ButtonGroup", 0, "");
return;
}
content.setXmlParam("x", x);
content.setXmlParam("y", y);
content.setXmlParam("w", w);
content.setXmlParam("h", h);
content.setXmlParam("relatx", rx);
content.setXmlParam("relaty", ry);
content.setXmlParam("relatw", rw);
content.setXmlParam("relath", rh);
content.init(frameGroup);
}
Sysmenu.onLeftClick() {
LayoutStatus _status = frameGroup.findObject("sysmenu.status");
_status.callme("{system}");
}
playleft.onEnterArea() {
titletext.setXmlParam("default", "Double Click To Play");
playleft.setXmlParam("image", "frame.play.left.hover");
playmid.setXmlParam("image", "frame.play.middle.hover");
playright.setXmlParam("image", "frame.play.right.hover");
}
playmid.onEnterArea() {
titletext.setXmlParam("default", "Double Click To Play");
playleft.setXmlParam("image", "frame.play.left.hover");
playmid.setXmlParam("image", "frame.play.middle.hover");
playright.setXmlParam("image", "frame.play.right.hover");
}
playright.onEnterArea() {
titletext.setXmlParam("default", "Double Click To Play");
playleft.setXmlParam("image", "frame.play.left.hover");
playmid.setXmlParam("image", "frame.play.middle.hover");
playright.setXmlParam("image", "frame.play.right.hover");
}
playleft.onLeaveArea() {
titletext.setXmlParam("default", ":componentname");
playleft.setXmlParam("image", "frame.play.left");
playmid.setXmlParam("image", "frame.play.middle");
playright.setXmlParam("image", "frame.play.right");
}
playmid.onLeaveArea() {
titletext.setXmlParam("default", ":componentname");
playleft.setXmlParam("image", "frame.play.left");
playmid.setXmlParam("image", "frame.play.middle");
playright.setXmlParam("image", "frame.play.right");
}
playright.onLeaveArea() {
titletext.setXmlParam("default", ":componentname");
playleft.setXmlParam("image", "frame.play.left");
playmid.setXmlParam("image", "frame.play.middle");
playright.setXmlParam("image", "frame.play.right");
}
playleft.onLeftButtonDblClk(int x, int y) {
System.play();
complete;
}
playmid.onLeftButtonDblClk(int x, int y) {
System.play();
complete;
}
playright.onLeftButtonDblClk(int x, int y) {
System.play();
complete;
}
VUTimer.onTimer() {
LeftLevel = (System.getLeftVuMeter());
RightLevel = (System.getRightVuMeter());
if (StdVUState) UpdateVU(LeftLevel, RightLevel);
}
UpdateVU(Int LeftFrame, Int RightFrame){
vuleft.setTargetA(LeftFrame);
vuleft.setTargetSpeed(0.05);
vuleft.gotoTarget();
vuright.setTargetA(RightFrame);
vuright.setTargetSpeed(0.05);
vuright.gotoTarget();
}
vuleft.onLeftButtonUp(int x, int y) {
if (StdVUState) {
StdVUState = 0;
vuleft.setTargetA(0);
vuleft.setTargetSpeed(0.5);
vuleft.gotoTarget();
vuright.setTargetA(0);
vuright.setTargetSpeed(0.5);
vuright.gotoTarget();
} else StdVUState = 1;
}
vuright.onLeftButtonUp(int x, int y) {
if (StdVUState) {
StdVUState = 0;
vuleft.setTargetA(0);
vuleft.setTargetSpeed(0.5);
vuleft.gotoTarget();
vuright.setTargetA(0);
vuright.setTargetSpeed(0.5);
vuright.gotoTarget();
} else StdVUState = 1;
}
System.onScriptUnloading() {
setPrivateInt(getSkinName(), "StdVU", StdVUState);
VUTimer.stop();
delete VUTimer;
}