Alternative Stop after current indicator using JScript Panel 3: https://hydrogenaud.io/index.php/topic,77883.msg797324.html#msg797324
Fixed version for JScript Panel 3 (1 function name replaced):
var ww = 0;
var wh = 0;
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_paint(gr) {
gr.FillRectangle(0, 0, ww, wh, fb.StopAfterCurrent ? RGB(255,0,0) : RGB(0,255,0));
}
function on_playlist_stop_after_current_changed() {
window.Repaint();
}
function on_mouse_lbtn_up() {
fb.StopAfterCurrent = !fb.StopAfterCurrent;
}
With repect to marc2k3 I hope my intrusion in this thread will be forgiven and overlooked.
Below is the exact script I use for my "Stop after current" indicator. The script is from the link you posted with the addition of a tooltip script. The tooltip script is from a sample that was included with WSH panel mod.
I have tried the below script in Spider Monkey Panel 1.6.1 and it worked. I have also tried it in JScript Panel 3 and it did not work. Now that you have posted the script so that it will function in JScript Panel 3, will the "tooltip" section of the below script also function in JScript Panel 3 or does a change need to be made to it too?
If any change does need to be made for it to work in JScript Panel 3 I am not knowledgeable to do it. I got lucky when I blended the tooltip script into marc's script.
If marc2k3 would just rather this all go away please do not answer my question.
I would check the script in JScript Panel 3 myself but it would be a few days before I would be able to do so.
var ww = 0;
var wh = 0;
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
// Tooltip script begins here
var g_tooltip = window.CreateTooltip();
var g_font = gdi.Font("Tahoma", 14);
var g_trackingMouse = false;
var g_oldX, g_oldY;
var ww, wh;
function on_mouse_move(x, y) {
if (!g_trackingMouse) {
g_tooltip.Activate();
g_tooltip.TrackActivate = true;
g_trackingMouse = true;
}
// Make sure the position is changed
if (g_oldX != x || g_oldY != y) {
g_tooltip.Text = "Playback / Stop after current";
g_tooltip.TrackPosition(x + 10, y + 20);
g_oldX = x;
g_oldY = y;
}
}
function on_mouse_leave() {
g_trackingMouse = false;
g_tooltip.TrackActivate = false;
}
// Tooltip script ends here
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, fb.StopAfterCurrent ? RGB(255,0,0) : RGB(220,226,234));
}
function on_playlist_stop_after_current_changed() {
window.Repaint();
}
function on_mouse_lbtn_up() {
fb.StopAfterCurrent = !fb.StopAfterCurrent;
}