Thanks .... it works now, and here is my tweaked script below. I only changed the placement of the rating and the web links.
(Please note the common6b.js at the beginning).
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common6b.js"
// @name "Now Playing"
// @author "marc2003"
// @version "6.2013-04-01.03"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
var line1 = {text: "", tf: "$if($strcmp($strstr(%artist%,','),0),%artist%,$cut(%artist%,$sub($strstr(%artist%,','),1)))", font: gdi.Font("Segoe UI", 48, 1), colour: RGB(250, 250, 250), y: 0}
var line2 = {text: "", tf: "%title%", font: gdi.Font("Segoe UI", 36, 1), colour: RGB(230, 230, 230), y: 55}
var line3 = {text: "", tf: "[[%album%] '('%date%')']", font: gdi.Font("Segoe UI", 28, 1), colour: RGB(190, 190, 190), y: 100}
/*
leave the text empty. customise tf (title formatting) how you like. changing the font is easy too. it's simply font/size/style.
the style set to 1 indicates bold text. other values:
0: Regular
1: Bold
2: Italic
3: BoldItalic
4: Underline
8: Strikeout
colour is straight forward again and you can tweak the value of y. this is used to shift the vertical position from it's default.
you might need to do this if changing font sizes. negative numbers shift up and postive goes down.
*/
var p = new panel("Now Playing", ["custom_background", "now_playing", "lastfm_bio_mod", "remap"]);
p.selection_mode = 1;
var np_cd = window.GetProperty("np_cd", true);
var np_cd_size = window.GetProperty("np_cd_size", 200);
var np_track = window.GetProperty("np_track", true);
var np_track_top = window.GetProperty("np_track_top", false);
var np_buttons = window.GetProperty("np_buttons", true);
var np_bio = window.GetProperty("np_bio", true);
var np_cd_size = window.GetProperty("np_cd_size", 200);
var np_rating = window.GetProperty("np_rating", true);
window.GetProperty("thumbs_mode", "off");
var c = new cd(0, 0, np_cd_size, np_cd_size);
var r = new rating(0, 0, 24);
var t = new text(0, 0, 0, 0);
var im = new images(0, 0, 0, 0);
var th = new thumbs(0, 0 , 0, 0)
var b = new buttons();
var bar1y = 0;
var bar1h = 0;
var bar2y = 0;
var bar2h = 0;
b.buttons = {}
b.update = function() {
if (p.metadb) {
var artist = encodeURIComponent(p.eval("%artist%"));
var title = encodeURIComponent(p.eval("%title%"));
var myspace = "http://www.myspace.com/search/music?q=" + artist;
var lastfm = "http://www.last.fm/music/" + artist + "/_/" + title;
var youtube = "http://www.youtube.com/results?search_query=" + artist + "+" + title;
var discogs = "http://www.discogs.com/search?q=" + artist;
var allmusic = "http://www.allmusic.com/search/artists/" + artist;
b.buttons = {
/*
but5: new button(im.x + im.w - 160, bar2y - 1, 32, 32, {normal: "myspace.png", hover: "myspace_h.png"}, function() { p.browser(myspace); }, myspace),
but6: new button(im.x + im.w - 128, bar2y - 1, 32, 32, {normal: "lastfm.png", hover: "lastfm_h.png"}, function() { p.browser(lastfm); }, lastfm),
but7: new button(im.x + im.w - 96, bar2y - 1, 32, 32, {normal: "youtube.png", hover: "youtube_h.png"}, function() { p.browser(youtube); }, youtube),
but8: new button(im.x + im.w - 64, bar2y - 1, 32, 32, {normal: "discogs.png", hover: "discogs_h.png"}, function() { p.browser(discogs); }, discogs),
but9: new button(im.x + im.w - 32, bar2y - 1, 32, 32, {normal: "allmusic.png", hover: "allmusic_h.png"}, function() { p.browser(allmusic); }, allmusic)
*/
but5: new button(im.x + p.w - 160, np_track_top ? -1 : im.y + im.h - 33, 32, 32, {normal: "myspace.png", hover: "myspace_h.png"}, function() { p.browser(myspace); }, myspace),
but6: new button(im.x + p.w - 128, np_track_top ? -1 : im.y + im.h - 33, 32, 32, {normal: "lastfm.png", hover: "lastfm_h.png"}, function() { p.browser(lastfm); }, lastfm),
but7: new button(im.x + p.w - 96, np_track_top ? -1 : im.y + im.h - 33, 32, 32, {normal: "youtube.png", hover: "youtube_h.png"}, function() { p.browser(youtube); }, youtube),
but8: new button(im.x + p.w - 64, np_track_top ? -1 : im.y + im.h - 33, 32, 32, {normal: "discogs.png", hover: "discogs_h.png"}, function() { p.browser(discogs); }, discogs),
but9: new button(im.x + p.w - 32, np_track_top ? -1 : im.y + im.h - 33, 32, 32, {normal: "allmusic.png", hover: "allmusic_h.png"}, function() { p.browser(allmusic); }, allmusic)
/*
but5: new button(p.w - 163, 0, 32, 32, {normal: "myspace.png", hover: "myspace_h.png"}, function() { p.browser(myspace); }, myspace),
but6: new button(p.w - 131, 0, 32, 32, {normal: "lastfm.png", hover: "lastfm_h.png"}, function() { p.browser(lastfm); }, lastfm),
but7: new button(p.w - 99, 0, 32, 32, {normal: "youtube.png", hover: "youtube_h.png"}, function() { p.browser(youtube); }, youtube),
but8: new button(p.w - 67, 0, 32, 32, {normal: "discogs.png", hover: "discogs_h.png"}, function() { p.browser(discogs); }, discogs),
but9: new button(p.w - 35, 0, 32, 32, {normal: "allmusic.png", hover: "allmusic_h.png"}, function() { p.browser(allmusic); }, allmusic)
*/
}
}
window.RepaintRect(0, 0, 160, 32);
}
on_item_focus_change();
function on_playback_time(time) {
im.playback_time(time);
}
function on_size() {
p.size();
th.calc();
c.x = im.x;
switch(true) {
case np_track_top:
c.y = im.y - (np_cd_size * 0.05);
//bar1y = 0;
//bar1h = np_track ? 100 : 0;
//bar2y = bar1h;
bar1y = 35;
bar1h = np_track ? 145 : 0;
bar2y = bar1h + bar1y;
//bar2h = np_buttons || np_rating ? 30 : 0;
bar2h = 0;
//t.y = bar1h + bar2h;
t.y = bar1y + bar1h + bar2h;
break;
default:
c.y = im.y + im.h - np_cd_size + (np_cd_size * 0.05);
//bar1y = im.y + (np_rating || np_buttons ? im.h - 130 : im.h - 100);
bar1y = im.y + im.h - 180;
bar1h = np_track ? 145 : 0;
bar2y = im.y + im.h - 30;
//bar2h = np_buttons || np_rating ? 30 : 0;
bar2h = 0;
t.y = im.y;
break;
}
//r.y = bar2y + 3;
r.y = bar1y + 10;
line1.ny = bar1y + line1.y;
line2.ny = bar1y + line2.y;
line3.ny = bar1y + line3.y;
t.x = im.x + im.w - Math.round(im.w / 3);
t.w = im.x + im.w - t.x - 15;
//t.h = im.h - bar1h - bar2h;
t.h = im.h - bar1h - 35 - bar2h;
t.size();
b.update();
}
function on_paint(gr) {
p.draw_background(gr);
if (im.images.length > 0) {
th.draw(gr);
if (th.mode == "grid") {
if (th.overlay) p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, "centre");
} else {
p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, im.type);
}
}
tix = im.x + (np_cd ? np_cd_size : 10);
//r.x = tix;
r.x = p.w - 130;
if (np_track) {
//gr.FillSolidRect(im.x, bar1y, im.w, bar1h, RGBA(0, 0, 0, 196));
gr.FillSolidRect(im.x, bar1y, p.w, bar1h, RGBA(0, 0, 0, 156))
//p.left_text(gr, line1.text, line1.font, line1.colour, tix, line1.ny, im.w - tix - 10, line1.font.Height);
//p.left_text(gr, line2.text, line2.font, line2.colour, tix, line2.ny, im.w - tix - 10, line2.font.Height);
//p.left_text(gr, line3.text, line3.font, line3.colour, tix, line3.ny, im.w - tix - 10, line3.font.Height);
p.left_text(gr, line1.text, line1.font, line1.colour, tix, line1.ny, np_rating ? p.w - tix - 140 : p.w - tix - 10, line1.font.Height);
p.left_text(gr, line2.text, line2.font, line2.colour, tix, line2.ny, p.w - tix - 10, line2.font.Height);
p.left_text(gr, line3.text, line3.font, line3.colour, tix, line3.ny, p.w - tix - 10, line3.font.Height);
}
if (np_rating || np_buttons) gr.FillSolidRect(im.x, bar2y, im.w, bar2h, RGBA(0, 0, 0, 136));
if (np_cd) c.draw(gr);
if (np_rating) r.draw(gr);
if (np_buttons) b.draw(gr);
if (np_bio) {
gr.FillSolidRect(t.x - 15, t.y, t.w + 30, t.h, RGBA(0, 0, 0, 156));
t.draw(gr, RGB(240, 240, 240));
}
}
function on_metadb_changed() {
b.update();
c.metadb_changed();
r.metadb_changed();
im.metadb_changed();
t.metadb_changed();
if (p.metadb) {
line1.text = p.eval(line1.tf);
line2.text = p.eval(line2.tf);
line3.text = p.eval(line3.tf);
}
window.Repaint();
}
function on_playback_stop() {
on_item_focus_change();
b.update();
}
function on_playback_pause() {
b.update();
}
function on_playback_starting() {
b.update();
}
function on_get_album_art_done(metadb, art_id, im, ip) {
c.get_album_art_done(im, ip);
}
function on_mouse_wheel(step) {
if (np_cd && c.trace(p.mx, p.my)) {
np_cd_size += step * 25;
if (np_cd_size < 200) np_cd_size = 200;
if (np_cd_size > 400) np_cd_size = 400;
window.SetProperty("np_cd_size", np_cd_size);
c.y = Math.round(np_track_top ? im.y - (np_cd_size * 0.05) : im.y + im.h - np_cd_size + (np_cd_size * 0.05));
c.w = np_cd_size;
c.h = np_cd_size;
window.Repaint();
return;
}
if (th.wheel(step)) return;
if (np_bio && t.wheel(step)) return;
im.wheel(step);
}
function on_mouse_move(x, y) {
p.move(x, y);
if (np_rating && r.move(x, y)) return;
if (np_buttons && b.move(x,y)) return;
if (th.move(x, y)) return;
if (np_bio && t.move(x, y)) return;
if (np_cd && c.move(x, y)) return;
}
function on_mouse_lbtn_up(x, y) {
if (np_rating && r.lbtn_up(x, y)) return;
if (np_buttons && b.lbtn_up(x, y)) return;
if (th.lbtn_up(x, y)) return;
if (np_bio && t.lbtn_up(x, y)) return;
}
function on_mouse_lbtn_dblclk(x, y) {
if (np_cd && c.lbtn_dblclk(x, y)) return;
if (im.lbtn_dblclk(x, y)) return;
}