IPB

Welcome Guest ( Log In | Register )

126 Pages V  « < 58 59 60 61 62 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
Falstaff
post Apr 19 2012, 19:10
Post #1476





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



QUOTE (romka18 @ Apr 17 2012, 09:49) *
anybody knows something about my question?


not me, can't make it working better than you, not changes if PREPROCESSOR feature used or not


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
rawny
post Apr 22 2012, 02:52
Post #1477





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



Hi there,

I've written a script which displays a vertical volume bar with a tooltip showing the volume (based on "Simple Seekbar" by marc2003 and "Volbar with GdiDrawText" by T.P. Wang). The code is below if anyone is interested smile.gif

CODE
// ==PREPROCESSOR==
// @name "Volume-bar with tooltip"
// @author "rawny"
// ==/PREPROCESSOR==

// Based somewhat on:
// -> "Volbar with GdiDrawText" by T.P Wang
// -> "Simple Seekbar" by marc2003

var a = 25;
var g_drag = 0;
var g_drag_seek = 0;
var g_tooltip = window.CreateTooltip();
var g_trackingMouse = false;
var old_x;
var old_y;

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

function on_size() {
ww = window.Width;
wh = window.Height;
}

function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var volume = fb.Volume;
if(g_drag){
pos = wh * g_drag_seek;
}else{
pos = wh * Math.exp(fb.Volume/a);
}
gr.FillGradRect(0, wh-pos, ww, wh, 90, RGB(0,0,255), RGB(70,90,200));
gr.FillGradRect(0, 0, ww, wh-pos, 90, RGB(0,0,0), RGB(50,50,50));
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(100,100,100));
}

function on_mouse_move(x,y){
g_drag_seek = 1-y/wh;
g_drag_seek = (g_drag_seek<Math.exp(-100/a)) ? Math.exp(-100/a) : (g_drag_seek<1) ? g_drag_seek : 1;
if(x > ww){
g_drag = 0;
}
if(g_drag){
window.Repaint();
}
if(!g_trackingMouse){
g_tooltip.Activate();
g_tooltip.TrackActivate = true;
g_trackingMouse = true;
}
if(x != old_x || y != old_y){
txt = Math.ceil(a*Math.log(g_drag_seek))+"dB ("+Math.ceil(g_drag_seek*100)+"%)";
g_tooltip.Text = txt;
g_tooltip.TrackPosition(x,y-20);
old_x = x;
old_y = y;
}
}

function on_mouse_leave(){
g_trackingMouse = false;
g_tooltip.TrackActivate = false;
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(!g_drag){
return;
}
g_drag = 0;
var v = 1-y/wh;
v = (v<Math.exp(-100/a)) ? Math.exp(-100/a) : (v<1) ? v : 1;
fb.Volume = a*Math.log(v);
}
function on_mouse_wheel(delta){
if(delta>0){
fb.VolumeUp();
}else{
fb.VolumeDown();
}
}

function on_volume_change(val){
window.Repaint();
}


This post has been edited by rawny: Apr 22 2012, 03:09
Go to the top of the page
+Quote Post
rawny
post Apr 22 2012, 03:31
Post #1478





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



Also, does anyone know how to produce glowing text with GdiDrawText?

As in this sample (but with GdiDrawText):
CODE
// ==PREPROCESSOR==
// @name "Glow Text Sample"
// @author "T.P Wang"
// ==/PREPROCESSOR==

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

var g_font = gdi.Font("Segoe UI", 22, 1);
var g_drag = false;
var g_textrender = gdi.CreateStyleTextRender();
var g_bkclr = RGB(0, 0, 0);

function on_paint(gr) {
gr.SetTextRenderingHint(5);
gr.SetSmoothingMode(4);
gr.SetInterpolationMode(7);

var ww = window.Width;
var wh = window.Height;

// Draw background first
gr.FillSolidRect(0, 0, ww, wh, g_bkclr);

g_textrender.GlowText(RGB(0, 0, 64), RGBA(255, 255, 0, 30), 12);

// Clear previous shadow setting
g_textrender.EnableShadow(true);
g_textrender.ResetShadow();

g_textrender.RenderStringRect(gr, "Glow Text Sample", g_font, 0, 0, ww, wh, 0x11005000);
}

My current poor-man's version is to draw multiple copies of the text in the glow colour underneath the actual text:
CODE
// ==PREPROCESSOR==
// @name "Poor-man's glowing Gdi text"
// @author "rawny"
// ==/PREPROCESSOR==

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

var text = "foobar2000";

var textFont = gdi.Font("Tahoma", 50, 1);

var textX = 100;
var textY = 100;

var glowSpacing = 4;

var rightGlowTextX = textX+glowSpacing;
var rightGlowTextY = textY+glowSpacing;

var actualTextX = textX+(glowSpacing/2);
var actualTextY = textY+(glowSpacing/2);

var bgColour = RGB(0,0,0);
var glowColour = RGBA(0, 0, 255, 222);
var textColour = RGBA(255, 255, 255, 222);

function on_size() {
ww = window.Width;
wh = window.Height;
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, bgColour);
gr.GdiDrawText(text, textFont, glowColour, textX, textY, ww, wh);
gr.GdiDrawText(text, textFont, glowColour, textX, rightGlowTextY, ww, wh);
gr.GdiDrawText(text, textFont, glowColour, rightGlowTextX, textY, ww, wh);
gr.GdiDrawText(text, textFont, glowColour, rightGlowTextX, rightGlowTextY, ww, wh);
gr.GdiDrawText(text, textFont, textColour, actualTextX, actualTextY, ww, wh);
}

I'm fairly happy with this effect, but I was wondering if there was a way to do it properly? smile.gif

This post has been edited by rawny: Apr 22 2012, 03:44
Go to the top of the page
+Quote Post
Falstaff
post Apr 22 2012, 17:03
Post #1479





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



WSH Playlist Viewer v2 beta 5 : http://pastebin.com/u/Br3tt

example of use in a CUI config (opacity set to 0 in Properties of the panel in order to see the background which is a PanelStack Splitter that display the artist image of the current track)


This post has been edited by Falstaff: Apr 22 2012, 17:08


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
amalone
post Apr 23 2012, 17:13
Post #1480





Group: Members
Posts: 29
Joined: 22-February 10
Member No.: 78388



Playlist Viewer Beta 5. I would like to have a 1 line group header. This is what I get -

Streaming Radio - Streaming | undefinedundefined

FLAC Files - Artist | undefinedundefined

Is this how it should be? Beautiful playlist. Thank you.
Go to the top of the page
+Quote Post
Falstaff
post Apr 23 2012, 18:31
Post #1481





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



QUOTE (amalone @ Apr 23 2012, 18:13) *
Playlist Viewer Beta 5. I would like to have a 1 line group header. This is what I get -

Streaming Radio - Streaming | undefinedundefined

FLAC Files - Artist | undefinedundefined

Is this how it should be? Beautiful playlist. Thank you.


nope, a small bug, sorry wink.gif will be fixed in next beta


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
amalone
post Apr 24 2012, 03:02
Post #1482





Group: Members
Posts: 29
Joined: 22-February 10
Member No.: 78388



Playlist Viewer Beta 6. Group header bug fixed, thank you. In the Appearance settings I have turned off the light shadow border. But there is still a shadow border after last item in playlist. Is it possible to turn that off also? Thank you.
Go to the top of the page
+Quote Post
Falstaff
post Apr 24 2012, 07:15
Post #1483





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



QUOTE (amalone @ Apr 24 2012, 04:02) *
Playlist Viewer Beta 6. Group header bug fixed, thank you. In the Appearance settings I have turned off the light shadow border. But there is still a shadow border after last item in playlist. Is it possible to turn that off also? Thank you.


no. but you can edit the script to fit your needs, just remove the lines of code that draw this shadow (near line 622)

CODE
            if (this.id == list.total - 1) {
                gr.FillSolidRect(this.x, this.y + this.h + 0, this.w - vscrollbar.w, 1, RGBA(0, 0, 0, 75));
                gr.FillSolidRect(this.x, this.y + this.h + 1, this.w - vscrollbar.w, 1, RGBA(0, 0, 0, 35));
                gr.FillSolidRect(this.x, this.y + this.h + 2, this.w - vscrollbar.w, 1, RGBA(0, 0, 0, 12))
            };


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
amalone
post Apr 24 2012, 08:16
Post #1484





Group: Members
Posts: 29
Joined: 22-February 10
Member No.: 78388



Thank you, that worked perfectly. Excellent playlist.
Go to the top of the page
+Quote Post
kareha
post Apr 24 2012, 17:36
Post #1485





Group: Members
Posts: 52
Joined: 1-September 11
Member No.: 93415



Whenever I try to sort either by Album or Artist using Playlistviewer Beta 6 it keeps crashing, this is what's coming up in the console:

CODE
Error: WSH Panel Mod (WSH Playlist Viewer v2 beta 6 v0.0.6.20120423.2349 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error:
Object doesn't support property or method 'SortByFormat'
File: <main>
Ln: 3482, Col: 3
<source text only available at compile time>
Go to the top of the page
+Quote Post
marc2003
post Apr 24 2012, 19:00
Post #1486





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



try updating WSH panel mod to the latest version. http://code.google.com/p/foo-wsh-panel-mod/downloads/list
Go to the top of the page
+Quote Post
kareha
post Apr 24 2012, 19:18
Post #1487





Group: Members
Posts: 52
Joined: 1-September 11
Member No.: 93415



QUOTE (marc2003 @ Apr 24 2012, 19:00) *
try updating WSH panel mod to the latest version. http://code.google.com/p/foo-wsh-panel-mod/downloads/list


Awesome that's fixed it, many thanks smile.gif
Go to the top of the page
+Quote Post
Falstaff
post Apr 24 2012, 19:44
Post #1488





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



don't forget to read Informations in the top of the script, like :

// [Requirements]
// * foobar2000 v1.1 or better >> http://foobar2000.org
// * WSH panel Mod v1.5.3.1 or better >> http://code.google.com/p/foo-wsh-panel-mod/downloads/list
...

wink.gif

This post has been edited by Falstaff: Apr 24 2012, 19:44


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
kareha
post Apr 24 2012, 19:56
Post #1489





Group: Members
Posts: 52
Joined: 1-September 11
Member No.: 93415



QUOTE (Falstaff @ Apr 24 2012, 19:44) *
don't forget to read Informations in the top of the script, like :

// [Requirements]
// * foobar2000 v1.1 or better >> http://foobar2000.org
// * WSH panel Mod v1.5.3.1 or better >> http://code.google.com/p/foo-wsh-panel-mod/downloads/list
...

wink.gif


Doh smile.gif
Go to the top of the page
+Quote Post
Mod-Ular
post Apr 25 2012, 00:10
Post #1490





Group: Members
Posts: 47
Joined: 17-April 12
Member No.: 98918



Falstaff, i get an error at startup (with a filled autoplaylist selected):


CODE
Foobar2000 v1.1.11 + Windows Scripting Host Panel Modded v1.5.3.1 (Build: 19:48:41, Apr 20 2012)
W7x64

Console:
Error: WSH Panel Mod (WSH Playlist Viewer v2 beta 6 v0.0.6.20120423.2349 by Br3tt aka Falstaff >> http://br3tt.deviantart.com):
Microsoft JScript runtime error:
Object doesn't support this property or method
File: <main>
Ln: 541, Col: 4
<source text only available at compile time>

something goin' wrong at:
if (typeof this.id == "undefined") {
if (this.metadb) {
541 this.group_key = tf_group_key.EvalWithMetadb(this.metadb);



But after that is seems to run ok.
Go to the top of the page
+Quote Post
Falstaff
post Apr 25 2012, 07:15
Post #1491





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



thanx Mod-Ular, it has already be reported to me (same bug), it should be fixed for the next beta smile.gif


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Falstaff
post Apr 25 2012, 11:39
Post #1492





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



WSH Playlist Viewer v2 beta 7 : http://pastebin.com/u/Br3tt

- bug on launch (for who's encountered it) fixed (i hope, tell me about it)
- queue info added for queued tracks + special "Queue content playlist" added to see the queued tracks as a special playlist (check settings menu from the toolbar)

This post has been edited by Falstaff: Apr 25 2012, 11:39


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Mod-Ular
post Apr 25 2012, 14:38
Post #1493





Group: Members
Posts: 47
Joined: 17-April 12
Member No.: 98918



CODE
Error: WSH Panel Mod (WSH Playlist Viewer v2 beta 7 v0.0.7.20120424.2339 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error:
'list.item[...].id' is null or not an object
File: <main>
Ln: 1814, Col: 3
<source text only available at compile time>


Still getting an error.. huh.gif .
Go to the top of the page
+Quote Post
onv
post Apr 25 2012, 15:16
Post #1494





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Mod-Ular @ Apr 25 2012, 15:38) *
Still getting an error.. huh.gif .

The same, with 1.5.3.1 & with 1.5.2.
Go to the top of the page
+Quote Post
Falstaff
post Apr 25 2012, 18:03
Post #1495





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



QUOTE (Mod-Ular @ Apr 25 2012, 15:38) *
CODE
Error: WSH Panel Mod (WSH Playlist Viewer v2 beta 7 v0.0.7.20120424.2339 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error:
'list.item[...].id' is null or not an object
File: <main>
Ln: 1814, Col: 3
<source text only available at compile time>


Still getting an error.. huh.gif .


yep, but not the same sad.gif

could you gimme more info on how it happens ? (playlist content (large, small number of items), action you where doing, ... all that could help me because i can't reproduce this bug, thanx)


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Mod-Ular
post Apr 25 2012, 21:02
Post #1496





Group: Members
Posts: 47
Joined: 17-April 12
Member No.: 98918



Fallstaff,
In my case the script only fails at fb2k startup. (with a huge Media Library, not tested otherwise)

Medium sized Autoplaylists containing 75-125Gig and 5,000-7500 items.
Everything autosorted by %path_sort%

I see u added queueing functions. Maybe worthwhile to mention the related components i use?
foo_keep_queue: Keep Queue 0.3.5 (by Andreas "Qtax" Zetterlund, Prevents the playback queue from being removed when changing song manually or exiting)
foo_queuecontents: Queue Contents Editor 0.5.1 (by Sami Salonen)

Good luck bug-hunting wink.gif
Go to the top of the page
+Quote Post
Falstaff
post Apr 25 2012, 22:21
Post #1497





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



@Mod-Ular

thanx for the reply, i've tried both (foo_queuecontents and foo_keep_queue) but i can't make it crashes ...

have you installed the last version of WSH panel mod at least? v1.5.3.1 ?

have you try to clear the panel Properties ?


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Mod-Ular
post Apr 25 2012, 22:45
Post #1498





Group: Members
Posts: 47
Joined: 17-April 12
Member No.: 98918



Yes, Windows Scripting Host Panel Modded v1.5.3.1 (Build: 19:48:41, Apr 20 2012)

I've reset the properties. (I only adjusted a few settings in the USER-fields.)
But i'm getting the same error at Foobar Startup as mentioned above.

In console i see the script initialising without problems:
WSH Panel Mod (WSH Playlist Viewer v2 beta 7 v0.0.7.20120424.2339 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): initialized in 10 ms

After console shows startup time (everything is loaded), it crashes:
Startup time : 0:37.911965
Error: WSH Panel Mod (WSH Playlist Viewer v2 beta 7 v0.0.7.20120424.2339 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error:
'list.item[...].id' is null or not an object
File: <main> Ln: 1814, Col: 3 <source text only available at compile time>
Go to the top of the page
+Quote Post
Falstaff
post Apr 25 2012, 23:01
Post #1499





Group: Members
Posts: 2800
Joined: 12-November 06
Member No.: 37463



could you try with this debug version it adds some info to the console before the crash. thanx for reporting to me the content of the console with this version please.

http://br3tt.free.fr/files/WSH/v2_wsh_play...beta7_DEBUG.zip



--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Mod-Ular
post Apr 25 2012, 23:10
Post #1500





Group: Members
Posts: 47
Joined: 17-April 12
Member No.: 98918



Fallstaff, I cannot open that zip-archive. Downloaded it 3 times but it seems to be corrupted...
Go to the top of the page
+Quote Post

126 Pages V  « < 58 59 60 61 62 > » 
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: 21st September 2014 - 00:04