IPB

Welcome Guest ( Log In | Register )

121 Pages V  « < 87 88 89 90 91 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
pupil
post Mar 30 2013, 14:56
Post #2201





Group: Members
Posts: 4
Joined: 30-March 13
Member No.: 107454



QUOTE (marc2003 @ Mar 30 2013, 10:49) *
i've updated my now playing script. you can now toggle various elements on or off via the context menu. because displaying an artist bio is now optional, i've ditched the separate script i had for that.

here are 2 instances running side by side: screenshot

https://dl.dropbox.com/u/22801321/samples.zip

files changed:
CODE
marc2003\common6.js
samples\now playing.txt
samples\now playing with last.fm & wikipedia biography <<deleted


Great scripts, really appreciate your work on these. Could you make the track info and rating elements separate? I'd like to display the track info but I don't use the rating stars and would like to remove these. I do it manually by editing the script already, but it would be easier if it was selectable in the menu. Many thanks.
Go to the top of the page
+Quote Post
marc2003
post Mar 30 2013, 16:40
Post #2202





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



the trouble with making the rating separate, is where to put it if people turn the track info off. i'll try and think of something.
Go to the top of the page
+Quote Post
pupil
post Mar 30 2013, 16:56
Post #2203





Group: Members
Posts: 4
Joined: 30-March 13
Member No.: 107454



QUOTE (marc2003 @ Mar 30 2013, 15:40) *
the trouble with making the rating separate, is where to put it if people turn the track info off. i'll try and think of something.


Thanks Marc, I think the ratings location won't be a problem, it would look fine where it is without the track info. If someone has got to the point where they are using your scripts, they would know what all of the separate elements do, I'm sure.

Thanks again.
Go to the top of the page
+Quote Post
marc2003
post Mar 30 2013, 20:24
Post #2204





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (pupil @ Mar 30 2013, 15:56) *
it would look fine where it is without the track info.


it looks ok with CD cover off but not when it's on. it looks stupid sat next to it on it's own. tongue.gif

anyway, rather than make it independent, the script now checks for foo_playcount. if it's missing, the rating will not display.

https://dl.dropbox.com/u/22801321/samples.zip

files changed:
CODE
marc2003\common6.js
samples\now playing.txt


to make it easier for people to edit the track info display, i've put this at the top of the script.

CODE
var line1 = {text: "", tf: "%artist%", font: gdi.Font("Segoe UI", 30, 1), colour: RGB(240, 240, 240), y: 0}
var line2 = {text: "", tf: "%title%", font: gdi.Font("Segoe UI", 22, 1), colour: RGB(210, 210, 210), y: 0}
var line3 = {text: "", tf: "[[%album%] '('%date%')']", font: gdi.Font("Segoe UI", 18, 1), colour: RGB(180, 180, 180), y: 0}


leave the text empty. customise 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:

CODE
    Regular: 0,
    Bold: 1,
    Italic: 2,
    BoldItalic: 3,
    Underline: 4,
    Strikeout: 8


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.




This post has been edited by marc2003: Mar 30 2013, 20:44
Go to the top of the page
+Quote Post
pupil
post Mar 30 2013, 22:46
Post #2205





Group: Members
Posts: 4
Joined: 30-March 13
Member No.: 107454



QUOTE (marc2003 @ Mar 30 2013, 19:24) *
QUOTE (pupil @ Mar 30 2013, 15:56) *
it would look fine where it is without the track info.


it looks ok with CD cover off but not when it's on. it looks stupid sat next to it on it's own. tongue.gif

anyway, rather than make it independent, the script now checks for foo_playcount. if it's missing, the rating will not display.


Hi thanks again. This work around wouldn't actually work for me as I do have foo_playcount installed so that I can record a files %added% data, but not for rating the tracks. So, for me, the rating stars will still appear even though I won't be using foo_playcount for that function. Any other way you can think to remove the stars where you'll be happy with the layout?

Really appreciate this, thanks.
Go to the top of the page
+Quote Post
marc2003
post Mar 30 2013, 22:56
Post #2206





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



edit line 36:

CODE
var np_rating_check = utils.CheckComponent("foo_playcount", true);


to become

CODE
var np_rating_check = false;
Go to the top of the page
+Quote Post
pupil
post Mar 31 2013, 00:05
Post #2207





Group: Members
Posts: 4
Joined: 30-March 13
Member No.: 107454



QUOTE (marc2003 @ Mar 30 2013, 21:56) *
edit line 36:

CODE
var np_rating_check = utils.CheckComponent("foo_playcount", true);


to become

CODE
var np_rating_check = false;


Brilliant, that's perfect, many thanks!
Go to the top of the page
+Quote Post
FooChick
post Mar 31 2013, 18:30
Post #2208





Group: Members
Posts: 2
Joined: 31-March 13
From: DK
Member No.: 107466



Hello Marc - I really love your scripts.
I would love to edit the width of the biography txt column. Something like this:



Thanx in advance
Natasha



Go to the top of the page
+Quote Post
marc2003
post Mar 31 2013, 18:43
Post #2209





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



line 74 is

CODE
t.x = p.w - Math.round(p.w / 3);


that represents 1/3 of the panel width. you could try changing it to 4 for a quarter. or you can fix the size in pixels....

CODE
t.x = p.w - 200;
Go to the top of the page
+Quote Post
FooChick
post Mar 31 2013, 20:07
Post #2210





Group: Members
Posts: 2
Joined: 31-March 13
From: DK
Member No.: 107466



Marc, - line 74

Beautiful!
4 is fine, and 5 is nice for fullscreen (1920x1080)

Thank you Marc2003!
Go to the top of the page
+Quote Post
NEMO7538
post Apr 1 2013, 09:56
Post #2211





Group: Developer
Posts: 814
Joined: 28-November 03
Member No.: 10088



Thanks Marc for your nice work
I have tweaked () the NP script, see below (quick and dirty: larger albumart size + placed on top with track info + merged thumbs + large track info fonts)
CODE
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common6.js"
// @name "Now Playing"
// @author "marc2003"
// @version "6.2013-03-27.01"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
var th = new thumbs();
//first argument is any arbitrary text to name the panel. it will use in the console and popup boxes.
//seconds argument is an array of features. i'll post a full list of acceptable/required values at some point. it's mostly for handling right click menus.
var p = new panel("Now Playing", ["remap", "cd", "images", "metadb", "thumbs"]);
//force the panel to always prefer the playing track regardless of selection
p.selection_mode = 1;
//setup a new cd cover: x, y co-ords and width & height
//var c = new cd(10, p.h - 190, 200, 200);
var c = new cd(0, -20, 360, 360);
//setup rating, x, y co-ords and button size
//var r = new rating(220, p.h - 35, 24);
//note that because some co-ords are relative to panel size (p.w is width, p.h is height), we need to update these values in the on_size function later

//setup images, x, y, width, height,
var im = new images(0, 0, p.w, p.h);
//setup buttons
/*
var b = new buttons();
b.buttons = {}
b.update = function() {
//only add web link buttons if we have a valid selection
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(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);
}
*/
//setup 3 lines of text for the display. editing this should be self explanaotory. if you change the font sizes, adjustments may need
//to be made to the positions in the on_paint function
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)}
var line2 = {text: "", tf: "%title%", font: gdi.Font("Segoe UI", 36, 1), colour: RGB(230, 230, 230)}
var line3 = {text: "", tf: "[[%album%] '('%date%')'] ['['# %tracknumber%']']", font: gdi.Font("Segoe UI", 28, 1), colour: RGB(190, 190, 190)}

//startup
on_item_focus_change();
//b.update();

function on_playback_time(time) {
//this function handles the cycling of images if enabled.
im.playback_time(time);
}

function on_size() {

//always call p.size to update the values of p.w and p.h
p.size();
//cd case y co-ord updated relative to bottom of panel
//c.y = p.h - 190;
//further updates to co-ords/sizes
//r.y = p.h - 35;
//im.w = p.w;
//im.h = p.h;
//b.update();
th.calc();
}

function on_paint(gr) {
//my own helper functions. note some things need to layered on top of each other.
//first draw the background. you'll only see this if there are no images to display
p.draw_background(gr);
//now we draw the background image as everything else goes on top
//im.images is an array of images. im.index is the current image. this value changes when scrolling the mouse or when cycling is enabled
//p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, im.type);
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);
}
} else {
p.centre_text(gr, p.metadb ? "[no image]" : "[no selection]", p.normal_font, p.textcolour, 0, 0, p.w, p.h);
}
//"crop" can also be "centre" or "stretch"
//this function also takes 2 additional arguments: border colour and alpha eg.
//a red border
//p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, "crop", RGB(255, 0, 0));
//no border but alpha level of 128. values can be between 0 and 255
//p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, "crop", null, 128);

//draw the slightly transparent rectangle at bottom
gr.FillSolidRect(0, 35, p.w, 145, RGBA(0, 0, 0, 156));
//draw the cd cover
c.draw(gr);
//web link buttons
//b.draw(gr);
//draw the rating panel
//r.draw(gr);
//draw the text. the last 4 values are x,y,w,h
p.left_text(gr, line1.text, line1.font, line1.colour, 365, 45, p.w - 365, 40);
p.left_text(gr, line2.text, line2.font, line2.colour, 365, 95, p.w - 365, 32);
p.left_text(gr, line3.text, line3.font, line3.colour, 365, 145, p.w - 365, 20);
}

function on_metadb_changed() {
//call these functions when selection changes/tag updates are made
//buttons. links are based off artist/track metadata
//b.update();
//cd
c.metadb_changed();
//rating
//r.metadb_changed();
//images
im.metadb_changed();
//only update text if we have a valid selection
if (p.metadb) {
line1.text = p.eval(line1.tf);
line2.text = p.eval(line2.tf);
line3.text = p.eval(line3.tf);
}
window.Repaint();
}

//we need to update buttons whenever their state could be changed. as these are playback buttons, we need to call
//updates when this happens.

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) {
//used by cd cover for updates
c.get_album_art_done(im, ip);
}

function on_mouse_wheel(step) {
th.wheel(step);
//this scrolls through multiple images
im.wheel(step);
}

function on_mouse_move(x, y) {
//we only need to call p.move if there elements in our panel which require scrollling as i need to track where the mouse is. do not return after it.
p.move(x, y);
th.move(x, y);
//if mouse detected over rating, no point in checking the rest
//if (r.move(x, y)) return;
//buttons -update tooltips
//if (b.move(x,y)) return;
//cd - tooltip
if (c.move(x, y)) return;
//note the order. because the buttons are on top of the cd, we need to check that first
}

function on_mouse_lbtn_up(x, y) {
//check for button clicks
//if (b.lbtn_up(x, y)) return;
//check for rating clicks
//if (r.lbtn_up(x, y)) return;
th.lbtn_up(x, y);
}

function on_mouse_lbtn_dblclk(x, y) {
//double click to open images
//cd
if (c.lbtn_dblclk(x, y)) return;
//image
if (im.lbtn_dblclk(x, y)) return;
//again we need to check order because the image covers the whole panel so we need to return if the cd was double clicked first
}


So here are a few suggestions :
  • Option to put the album art + track info on top (/bottom)
  • Option to right-justify the weblinks
  • Option to left-justify the bio (above/below album art)
  • Property to control the album art size (and adjust track info placement accordingly)
  • Merge thumbs (as I did), very nice effect when thumbs are right justified


This post has been edited by NEMO7538: Apr 1 2013, 10:01
Go to the top of the page
+Quote Post
marc2003
post Apr 1 2013, 12:17
Post #2212





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



i like what you've done. i'll have a go at implementing those things.
Go to the top of the page
+Quote Post
marc2003
post Apr 1 2013, 18:03
Post #2213





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



now playing updated: https://dl.dropbox.com/u/22801321/samples.zip

files changed:
CODE
marc2003\common6.js
samples\now playing.txt


changes:

new common file has broken compatibility with now playing dated the 30th march rolleyes.gif people will have to update but older versions should still work because they don't have a context menus like these new ones.
implemented thumbs (off by default)
variable CD art size. just scroll your mouse wheel over it
top/bottom alignment for CD art/track info.
everything can be enabled/disabled from the context menu

a few example layouts here: screenshot
Go to the top of the page
+Quote Post
marc2003
post Apr 1 2013, 20:40
Post #2214





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



obviously i didn't test all combinations like i should have. there is a bug with top aligned thumbs and bottom aligned cd/track info.

updated: https://dl.dropbox.com/u/22801321/samples.zip

files changed:
CODE
samples\now playing.txt
Go to the top of the page
+Quote Post
Bratman
post Apr 1 2013, 21:40
Post #2215





Group: Members
Posts: 94
Joined: 30-June 12
From: England
Member No.: 101088



Marc noticed a few bugs in your thumbs script. The cycle of 5 seconds works fine but 10 and 20 are not changing the picture. The crop code isn't working, it does nothing.
Go to the top of the page
+Quote Post
marc2003
post Apr 1 2013, 22:01
Post #2216





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



because the context menu is controlled by my common file, you must have updated that but not the script in the panel. i did mention it when i pushed that update a few days back....

QUOTE (marc2003 @ Mar 28 2013, 10:13) *
and a reminder to anyone using thumbs or any now playing scripts and are finding the new crop/centre/stretch options have no effect. this means you need to download the latest zip and re-import the script.


i know i don't make it easy for people to keep a track of things. dry.gif

and cycle works fine for me. due to the way it's coded, if it works for one value, it has to work for others.
Go to the top of the page
+Quote Post
Bratman
post Apr 1 2013, 22:58
Post #2217





Group: Members
Posts: 94
Joined: 30-June 12
From: England
Member No.: 101088



Sorry I'm always in a rush when I get time to go on here so overlooked/forgot it.

Actually I updated the script using update script in the context menu, I just pasted the new sample in from the samples zip and it's working now but I thought that's what the update script option does? So it's not actually updating I still need to paste in the updated sample zip?

This post has been edited by Bratman: Apr 1 2013, 22:58
Go to the top of the page
+Quote Post
marc2003
post Apr 1 2013, 23:28
Post #2218





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (Bratman @ Apr 1 2013, 22:58) *
Sorry I'm always in a rush when I get time to go on here so overlooked/forgot it.


like i said, it's really not your fault -rather it's mine. you can't really be expected to trawl the thread looking for every update. i'll have to try and manage updates better - i have a few ideas.

the vast majority of code is in the common file and updates work well for the most part. this problem occurred because your updated common file had all the code for handling the context menu in it. but the basic layout and positioning of the image happens in the panel. that's why it needed updating - it was hardcoded to crop images and it did not recognise the fact that there were new user settings it could use.

my goal when doing my last major update was not to update panel scripts but i have had to do it far more often than i'd like. i guess that's the price i pay for being an amateur bodger. i never plan anything in advance.

This post has been edited by marc2003: Apr 1 2013, 23:42
Go to the top of the page
+Quote Post
Bratman
post Apr 2 2013, 01:09
Post #2219





Group: Members
Posts: 94
Joined: 30-June 12
From: England
Member No.: 101088



Lol well I don't mind keeping an eye on your samples, I guess I better bookmark the download link. Could you not put all the code into the common file that way updating the script will cover all of your new code changes? My apologies if that is a naive suggestion smile.gif

Also it's a shame the code doesn't retain when importing .flc skins as I share my layout with friends and family who want to use your scripts too.

This post has been edited by Bratman: Apr 2 2013, 01:11
Go to the top of the page
+Quote Post
marc2003
post Apr 2 2013, 01:32
Post #2220





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



panel script settings do get properly saved as part of .fcl files. remember you'd have to share the entire marc2003 folder as well for it to work. (and the WSH panel mod component) back when i used to use columns UI, i shared a few themes with no problems at all.

you'll find most themes on deviant art have WSH panels as well.

putting all the code in external files is a nice idea but it doesn't really suit me at the moment. it's something i might think about looking at again. i dunno. tongue.gif

This post has been edited by marc2003: Apr 2 2013, 01:45
Go to the top of the page
+Quote Post
NEMO7538
post Apr 2 2013, 16:13
Post #2221





Group: Developer
Posts: 814
Joined: 28-November 03
Member No.: 10088



Marc .... I am tweaking the NP script and have this error sometimes ... when changing the rating
CODE
Error: WSH Panel Mod (Now Playing v6.2013-04-01.03 by marc2003): Erreur d'exécution Microsoft JScript:
Dépassement de capacité (Capacity overflow)
File: C:\Program Files (x86)\foobar 1.2\marc2003\common6.js
Ln: 1328, Col: 3
<source text only available at compile time>


This post has been edited by NEMO7538: Apr 2 2013, 16:33
Go to the top of the page
+Quote Post
marc2003
post Apr 2 2013, 16:58
Post #2222





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



reproduced here when using the top style - using bottom, it's fine. i have to say i'm completely stumped. that line is refers to this inside my CD drawing function.

CODE
window.RepaintRect(this.x, this.y, this.w, this.h);


you could replace it with a simple

CODE
window.Repaint();


to make it work for now. i'll try and find the cause and a proper solution.

EDIT: i'm finding even more unrelated bugs inside the now playing script now. it's been removed from my samples.zip to stop anyone else stumbling across it. rolleyes.gif

This post has been edited by marc2003: Apr 2 2013, 17:06
Go to the top of the page
+Quote Post
NEMO7538
post Apr 2 2013, 17:18
Post #2223





Group: Developer
Posts: 814
Joined: 28-November 03
Member No.: 10088



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).
CODE
// ==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;
}


Go to the top of the page
+Quote Post
marc2003
post Apr 2 2013, 20:32
Post #2224





Group: Members
Posts: 4337
Joined: 27-January 05
From: England
Member No.: 19379



samples updated: https://dl.dropbox.com/u/22801321/samples.zip

-major version bumpage meaning full marc2003 folder has be extracted again and all scripts imported again to take advantage of it. all old scripts will continue to work as normal as this does not affect them.
-a changelog which i promise to update blink.gif

CODE
02-04-2013

NEW: Can now check if scripts in panels are current after using "Update script". You will be prompted if they need updating.
NEW: Add "pattern" option to "Background" menu in some scripts such as "Now playing", "Thumbs" and "CD Jewel Case".
FIX: Lots of bugs squished in "Now playing".
CHG: Renamed lots of settings internally for consistency so you might find a few of them have been "forgotten". Just use the right click menu to set them again.
     All important data such as cached images, online feed data, saved autoplaylist queries and last.fm username are untouched.


-using Update script on previous versions now results in nothing happening. because i deleted the online copy, you will see a 404 error from dropbox in the console. i removed the file so you don't get the false impression it's up to date. that's what would happen if i left it there.

edit: and i'm off to a bad start already. found and fixed a few more bugs in now playing since i posted. starting to hate this script now tongue.gif

This post has been edited by marc2003: Apr 2 2013, 21:11
Go to the top of the page
+Quote Post
Dario
post Apr 2 2013, 22:40
Post #2225





Group: Members
Posts: 158
Joined: 20-September 11
Member No.: 93842



Guys, can you please comment on the efficiency of using a shared *.js script and importing it everywhere instead of copy-pasting things (the ones which are needed, obviously).

I currently use these two panels:

http://pastebin.com/Nd81uR23 (used to display CUETools logs named either rip.txt, or rip (%discnumber%).txt for multi-disc albums)
http://pastebin.com/b9M83BxQ (used to display album art)

And I'm wondering if there are ways I could improve them. Huge thanks to marc2003 for the basics + inspiration.

This post has been edited by Dario: Apr 2 2013, 22:41
Go to the top of the page
+Quote Post

121 Pages V  « < 87 88 89 90 91 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th April 2014 - 09:59