Hello all,
im using Dark-One 1.6 theme by br3tt and i came across the cool component foo_menu_addons by Acropolis and i wanted to implement the A-B repat function in the interface on the WSH pane using JScript.
I put 4 buttons [E] [A] [R]
E to enable the repeat
A and B to set the markers
R to reset.
What i can do :
- A and B cannot be turned ON if E is not turned ON (and it works )
- Toggle A, B and E on and off (and works)
- When i press R the E button should stay enabled and toggle off only A and B ( i didnt do that yet but i think i can figure this out easily)
What i cant do:
- when i skip track E should get disabled and disable automatically also A and B markers. Anyone can help on this?
i used this code :
var A_on = {normal: imgPath + "AOn.png", hover: imgPath + "AOn.png"};
var A_off = {normal: imgPath + "AOff.png", hover: imgPath + "AOn.png"};
var a_tooltip = "Set A Marker";
var B_on = {normal: imgPath + "BOn.png", hover: imgPath + "BOn.png"};
var B_off = {normal: imgPath + "BOff.png", hover: imgPath + "BOn.png"};
var b_tooltip = "Set B Marker";
var E_on = {normal: imgPath + "EOn.png", hover: imgPath + "EOn.png"};
var E_off = {normal: imgPath + "EOff.png", hover: imgPath + "EOn.png"};
var e_tooltip = "Enable A-B";
var R_on = {normal: imgPath + "ROn.png", hover: imgPath + "ROn.png"};
var R_off = {normal: imgPath + "ROff.png", hover: imgPath + "ROn.png"};
var r_tooltip = "Reset A-B";
var a_sw = false;
var b_sw = false;
var e_sw = false;
function genAImageSrc() {
return (a_sw & e_sw) ? A_on : A_off;
}
function switch_a() {
a_sw = !a_sw;
Buttons.A.alterImage(genAImageSrc());
Buttons.A.repaint();
}
function genBImageSrc() {
return (b_sw & e_sw) ? B_on : B_off;
}
function switch_b() {
b_sw = !b_sw;
Buttons.B.alterImage(genBImageSrc());
Buttons.B.repaint();
}
function genEImageSrc() {
return (e_sw) ? E_on : E_off;
}
function switch_e() {
e_sw =!e_sw
Buttons.E.alterImage(genEImageSrc());
Buttons.E.repaint();
if (!e_sw){
Buttons.A.alterImage(A_off);
Buttons.A.repaint();
Buttons.B.alterImage(B_off);
Buttons.B.repaint();
}
}
Buttons["E"] = new Button(0, 0, 13, 11, genEImageSrc(), function () { fb.RunMainMenuCommand("Playback/Repeat A-B/Enable");switch_e();}, e_tooltip);
Buttons["A"] = new Button(10, 0, 13, 11, genAImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark A");switch_a();}, a_tooltip);
Buttons["B"] = new Button(20, 0, 13, 11, genBImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark B");switch_b();}, b_tooltip);
Buttons["R"] = new Button(30, 0, 13, 11, R_off, function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Reset");}, r_tooltip);
That's the first time i use JScript so dont blame me if the code is lame =P
Any help would be really appreciated
Thanks !