IPB

Welcome Guest ( Log In | Register )

125 Pages V  « < 78 79 80 81 82 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
Emerelle
post Jan 10 2013, 22:39
Post #1976





Group: Members
Posts: 142
Joined: 3-November 11
Member No.: 94918



Awesome new samples Marc! Many thanks for the new sample and changing your mind smile.gif

One more question about adjusting the tag script...if I want to have a transparent background, I tried disabling the line "p.draw_background(gr);" but that seems to break the script. In the simple text reader script this worked for me though.
Any quick way to make the background transparent?

Again, many thanks for your hard work, love all of your samples.
Go to the top of the page
+Quote Post
marc2003
post Jan 11 2013, 10:13
Post #1977





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



QUOTE
I tried disabling the line "p.draw_background(gr);" but that seems to break the script.


are you sure? dry.gif add double backslashes to comment it out and the text should turn green in the editor. or just delete it....

This post has been edited by marc2003: Jan 11 2013, 10:14
Go to the top of the page
+Quote Post
Emerelle
post Jan 11 2013, 11:20
Post #1978





Group: Members
Posts: 142
Joined: 3-November 11
Member No.: 94918



I always use double slash for commenting things out - the panel turned white causing me thinking I broke it with the comment; anyways I only forgot to tick "transparent background" in the editor - sorry mate!!
Go to the top of the page
+Quote Post
Yeksfys
post Jan 14 2013, 15:38
Post #1979





Group: Members
Posts: 6
Joined: 16-December 12
Member No.: 105215



marc2003 this can serve to "Custom folder" in your scripts. wink.gif

CODE
//Flags  http://msdn.microsoft.com/en-us/library/bb773205.aspx
var BROWSEINFO_FLAG = 0x00000010 // BIF_EDITBOX

function showFolderDialog() {
    var shell = new ActiveXObject("Shell.Application");
    var folder = shell.BrowseForFolder(0, "Select the folder", BROWSEINFO_FLAG);
    
    if (folder == null) {
        return;
    }
    
    return folder.items().item().path;
}

fb.trace(showFolderDialog());
Go to the top of the page
+Quote Post
marc2003
post Jan 15 2013, 10:26
Post #1980





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



nice, i didn't know you could do that sort of thing.

but it's not really any use for my scripts because it would be extremely rare for anyone to specify a hardcoded single folder. most people will be using foobar2000 title formatting so the folder names are dynamic based on track metadata.
Go to the top of the page
+Quote Post
motorhorst
post Jan 16 2013, 12:36
Post #1981





Group: Members
Posts: 12
Joined: 22-February 12
Member No.: 97334



I have an idea for a script but I'm not sure if this is possible, maybe someone could comment on that.

I keep my playlists in a central container (e.g. a dropbox folder) and would like to use them on several computers (filepaths / libraries are the same on all machines).

I'd like a script that lists all playlists in that folder. By clicking on one of these files in foobar that list should be added as a playlist (and played, but that isn't the most important part).

As far as I see it, I need these functions:
- Read all files in a directory/folder
- File > Load Playlist after clicking the title of one file (something like fb.RunMainMenuCommand with the selected playlist as filename).

Is that possible?
Go to the top of the page
+Quote Post
motorhorst
post Jan 16 2013, 17:58
Post #1982





Group: Members
Posts: 12
Joined: 22-February 12
Member No.: 97334



Version 2:

There is another way how I could tackle my problem.
I can get my playlists via a web service (they're saved to a mysql-Database).

Then I could create a new playlist and add all the items sent as json.

In this case the functions I need are:
- Create a new playlist
- Add items to a specific playlist.

Is this possible? Easier than my first request?
Go to the top of the page
+Quote Post
marc2003
post Jan 17 2013, 10:32
Post #1983





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



i'm not sure why you don't get dropbox to monitor your normal playlists folder? then you can use the default playlist manager??? unsure.gif

but if you really want to add a new playlist....

CODE
fb.RunMainMenuCommand("New playlist");


then look at utils.glob for getting all files from a folder into an array. then loop through the array for displaying and mouse click code. then run foobar2000.exe with the /add parameter to the full path of one of your playlists.
Go to the top of the page
+Quote Post
marc2003
post Jan 17 2013, 10:36
Post #1984





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



samples updated: use Update script on the context menu or the full download is here: http://db.tt/BInQ3Abm

last.fm charts: fix crash when switching between populated and empty feeds.
artreader / simple image viewer: open containing folder did not work when path had spaces in. rolleyes.gif

files changed:
CODE
marc2003\common6.js


This post has been edited by marc2003: Jan 17 2013, 11:01
Go to the top of the page
+Quote Post
motorhorst
post Jan 17 2013, 13:20
Post #1985





Group: Members
Posts: 12
Joined: 22-February 12
Member No.: 97334



QUOTE (marc2003 @ Jan 17 2013, 10:32) *
i'm not sure why you don't get dropbox to monitor your normal playlists folder? then you can use the default playlist manager??? unsure.gif


Hi marc,
great idea, maybe too obvious for me...
Part 1 on computer 1 worked fine, I just have to check at home how it works out.

Edit/Resolved
Does anyone know where playlist organizer saves changes to folders, structures, order? Also in the playlists folder or somewhere else?
Answer: It's stored in theme.fth


Thanks for your help!

This post has been edited by motorhorst: Jan 17 2013, 13:35
Go to the top of the page
+Quote Post
MDMA
post Jan 17 2013, 13:59
Post #1986





Group: Members
Posts: 75
Joined: 23-May 10
Member No.: 80861



QUOTE (marc2003 @ Dec 24 2012, 12:02) *
samples updated: http://db.tt/BInQ3Abm

new script: discogs

this is a quick and dirty bodge so report any bugs. it only contains master releases and will only display the first 100. i won't be adding support for pagination.
i looked at using releases to get more results but that can return thousands of hits for popular artists so i ditched that idea... tongue.gif



files added/changed:
CODE
marc2003\common6.js
samples\discogs.txt


@ngonngon, use utils.GetAlbumArtEmbedded to always prefer embedded art. using the other methods, the core artreader may decide other images are better.



You are a hero, thanks so much for this!
Go to the top of the page
+Quote Post
marc2003
post Jan 19 2013, 12:23
Post #1987





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



samples updated: use Update script on the context menu or the full download is here: http://db.tt/BInQ3Abm

news/reviews/blogs: fix ugly text drawing bug
last.fm similar artists: the top tags feed now has autoplaylist buttons to search your library for matching files against genre tags.

files changed:
CODE
marc2003\common6.js


although i try not to change panel scripts very much (as most code is in the common file), i've made a few minor changes over the last few days. you can check the versions here: http://dl.dropbox.com/u/22801321/wsh/versions.txt

Go to the top of the page
+Quote Post
nikolai4ik
post Jan 20 2013, 18:55
Post #1988





Group: Members
Posts: 81
Joined: 8-July 08
Member No.: 55500



Hey guys, would really appreciate some help. I've updated from 1.3.x to the current version and two panels stopped working for me (aw crashed), volume and seekbar.
Maybe somene can quickly glance over it and find the corrupt code?
CODE
// Knob button by Br3tt
// Modified by T.P Wang

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

var g_drag = false;
// foobar path, SHOULD be replaced
var g_btn_img1 = gdi.Image(fb.ComponentPath.replace("components","images") + "curacao/bt/volbutton50.png");
var g_btn_img2 = gdi.Image(fb.ComponentPath.replace("components","images") + "curacao/bt/voldot.png");

var g_angle = 270;
var g_R = 12;

function calc_theta(x,y){
x = x - 25.5;
y = y - 25.5;
theta = Math.atan2(y,x) / Math.PI * 180;
if (theta <= 90 && theta > 45)
return g_angle;
if (theta > 90 && theta < 135)
return 0;
if (theta >= 0) {
if (theta > 90)
return theta - 135;
else
return theta + 225;
} else {
return theta + 225;
}
}

function on_paint(gr){
ww = window.Width;
wh = window.Height;
theta = (Math.pow(10, fb.Volume / 50) - 0.01) / 0.99 * g_angle;
// Volume 'Round Button' by Br3tt (13-08-2008)
posA = (theta - 45) * Math.PI / 180;
cosinusA = Math.cos(posA);
sinusA = Math.sin(posA);
posX = 25 - (cosinusA * 12) - 4 ;
posY = 25 - (sinusA * 12) - 4 ;
gr.FillGradRect( 0, 0, ww, wh, 90, RGB(042,042,047), RGB(042,042,047));
gr.DrawImage(g_btn_img1,-4,-4,55,55,0,0,55,55);
gr.DrawImage(g_btn_img2,posX,posY,5,5,0,0,5,5);
}

function on_mouse_lbtn_down(x,y){
g_drag = true;
}

function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = false;
}

function on_mouse_move(x,y){
if (g_drag){
// Calc Volume
d = calc_theta(x,y) / g_angle;
v = 50 * Math.log(0.99 * d + 0.01) / Math.LN10;
if (fb.Volume != v)
fb.Volume = v;
}
}

function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

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

//EOF



CODE
var weight_normal =400;
var weight_bold =800;
var italic_no =0;
var italic =1;
var uline_no =0;
var uline =1;
//--------
var align_top =0;
var align_middle=1;
var align_bottom=2;

var align_left =0;
var align_center=1;
var align_right =2;

var trim_no =0;
var trim_chara =1;
var trim_word =2;
var trim_elips_chara =3;
var trim_elips_word =4;
var trim_elips_path =5;

var flag_rtl =0x0001;
var flag_vert =0x0002;
var flag_nofit =0x0004;
var flag_dispctrl =0x0020;
var flag_nofallback =0x0400;
var flag_trailspace =0x0800;
var flag_nowrap =0x1000;
var flag_linelimit =0x2000;
var flag_noclip =0x4000;

var g_btn_img1 = gdi.Image(fb.ComponentPath.replace("components","images") +

"curacao/bt/seeker10.png");

function StrFmt(alignH,alignV,trim,flag){ return ((alignH<<28)|(alignV<<24)|(trim<<20)|flag);

}
//--------
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 TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
//----------------------------------------------------------------------------
var g_titlefmt = fb.TitleFormat("");
var g_fileinfo = null;

var g_drag = 0;
var g_drag_seek = 0;

function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var length = fb.PlaybackLength;
var txt;

ww = ww-20;

if(length > 0){
if(g_drag){
pos = ww * g_drag_seek;
txt = "Seek " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt

(length) + 00;
}
else{
pos = ww * (fb.PlaybackTime / length) + 00;
txt = g_titlefmt.Eval();
}
}

// background
gr.FillGradRect( 0, 0, window.Width+2, window.Height+2, 90, RGB(042,042,047), RGB

(042,042,047));

gr.FillGradRect( 11, 04, window.Width-22, 3, 90, RGB(0,0,0), RGB(0,0,0));

// orange progress bar
//gr.FillGradRect( 10, 04, pos+1, 3, 90, RGB(220,155,75), RGB(080,055,25));
//blue progress bar
gr.FillGradRect( 10, 04, pos+1, 3, 90, RGB(035,145,255), RGB(025,055,080));
//green progress bar
//gr.FillGradRect( 10, 04, pos+1, 3, 90, RGB(055,255,055), RGB(065,080,065));

gr.FillGradRect( 10, 03, window.Width-20, 1, 90, RGB(010,010,010), RGB(010,010,010));

gr.FillGradRect( 10, 08, window.Width-20, 1, 90, RGB(070,070,070), RGB(070,070,070));
gr.FillGradRect( 09, 04, 1, 4, 90, RGB(000,000,000), RGB(000,000,000));
gr.FillGradRect( window.Width-10, 4, 1, 4, 90, RGB(060,060,060), RGB(060,060,060));

gr.DrawImage(g_btn_img1,pos+2,1,17,17,0,0,17,17);

}

function on_size(){
}

function on_focus(gr){
//fb.trace("focus " + focused);
}

function on_key_down(key){
//fb.trace("key " + key);
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(g_drag){
x = x-10;
g_drag = 0;
g_drag_seek = x / (window.Width-20);
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}
function on_mouse_move(x,y){
if(g_drag){
x = x-10;
g_drag_seek = x / (window.Width-20);
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}
function on_mouse_wheel(delta){
//fb.trace("wheel " + delta);
}
//--------
function on_playback_starting(cmd, paused){
}
function on_playback_new_track(info){
window.Repaint();
}
function on_playback_stop(){
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_pause(state){
}
function on_playback_edited(){
}
function on_playback_dynamic_info(){
}
function on_playback_dynamic_info_track(){
}
function on_playback_time(time){
window.Repaint();
}
function on_volume_change(val){
}

//EOF
Go to the top of the page
+Quote Post
marc2003
post Jan 21 2013, 11:07
Post #1989





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



i can't see anything in the code that wouldn't work in new versions. are you sure you have the external images in the right place?
Go to the top of the page
+Quote Post
nikolai4ik
post Jan 21 2013, 17:46
Post #1990





Group: Members
Posts: 81
Joined: 8-July 08
Member No.: 55500



QUOTE (marc2003 @ Jan 21 2013, 14:07) *
i can't see anything in the code that wouldn't work in new versions. are you sure you have the external images in the right place?

Yes, nothing changed except the update of wsh plugin and I just rechecked with another path. I found the same knob script posted by Wang somewhere earlier in the thread and strangely it works (despite being the same). No luck with seekbar though sad.gif
Go to the top of the page
+Quote Post
marc2003
post Jan 22 2013, 11:20
Post #1991





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



i just tested both and they work fine if i comment out the lines in on_paint which draw the images (because i obviously don't have them).
Go to the top of the page
+Quote Post
nikolai4ik
post Jan 22 2013, 12:17
Post #1992





Group: Members
Posts: 81
Joined: 8-July 08
Member No.: 55500



QUOTE (marc2003 @ Jan 22 2013, 14:20) *
i just tested both and they work fine if i comment out the lines in on_paint which draw the images (because i obviously don't have them).

I'll try again, sorry if that was indeed the mistake, quite dumb from me then laugh.gif

br3tt, while I was trying to fix the seekbar I've tried all your other configs and now spending quite some time tinkering with foorazor which uses most of the scripts you posted here before. Is it possible in your WSH Playlist Viewer v2.1.0 to collapse non active groups (like elplaylist does) and is it possible to add an A-Z quick jump browser with WSH?


and I guess it's impossible to chande DUI's color of splitters/tabs/etc? It's controlled by OS?

This post has been edited by nikolai4ik: Jan 22 2013, 12:19
Go to the top of the page
+Quote Post
marc2003
post Jan 22 2013, 12:23
Post #1993





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



QUOTE (nikolai4ik @ Jan 22 2013, 11:17) *
and I guess it's impossible to chande DUI's color of splitters/tabs/etc? It's controlled by OS?


right. but you can get 3rd party themes. check somewhere like deviantart.com
Go to the top of the page
+Quote Post
antheo
post Jan 22 2013, 18:22
Post #1994





Group: Members
Posts: 8
Joined: 21-January 13
Member No.: 106077



@ marc2003, Falstaff or someone, could you please help me a simple script using WSH panel mod which can make an image (like a vinyl disc) rotate/stop when playing/stopping a song? thank you in advance. rolleyes.gif
Go to the top of the page
+Quote Post
ExtremeHunter
post Jan 22 2013, 20:31
Post #1995





Group: Members
Posts: 133
Joined: 5-October 08
From: Estonia
Member No.: 59398



antheo

Here's very simple script for rotating image on playback time.

CODE
var image = gdi.Image(fb.FoobarPath + "images\\vinyl.jpg");
var angle = 0;

function on_paint(gr) {

gr.DrawImage(image, 0, 0, 500, 500, 0, 0, image.width, image.height, angle);

}
function on_playback_time(time){

if(angle >= 360) angle = 0;
angle += 60;
window.Repaint();

}


I tested it with this Vinyl image smile.gif

This post has been edited by ExtremeHunter: Jan 22 2013, 20:50
Go to the top of the page
+Quote Post
Falstaff
post Jan 22 2013, 21:31
Post #1996





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



too slow smile.gif


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
antheo
post Jan 23 2013, 07:02
Post #1997





Group: Members
Posts: 8
Joined: 21-January 13
Member No.: 106077



QUOTE (ExtremeHunter @ Jan 22 2013, 21:31) *
antheo

Here's very simple script for rotating image on playback time.

CODE
var image = gdi.Image(fb.FoobarPath + "images\\vinyl.jpg");
var angle = 0;

function on_paint(gr) {

gr.DrawImage(image, 0, 0, 500, 500, 0, 0, image.width, image.height, angle);

}
function on_playback_time(time){

if(angle >= 360) angle = 0;
angle += 60;
window.Repaint();

}


I tested it with this Vinyl image smile.gif



Thank ExtremeHunter so much for this script, I already tested it but as Falstaff said it too slow, could you give me a little time to make it rotate faster? (at least 12 frames/per second).
Here is my skin and I like to update it with a vinyl disc rotate as a new visualization


Anyways, thank you again and look for your help.
Go to the top of the page
+Quote Post
ExtremeHunter
post Jan 23 2013, 10:00
Post #1998





Group: Members
Posts: 133
Joined: 5-October 08
From: Estonia
Member No.: 59398



Ok here's the faster one with timer tongue.gif.

Play with the values to make it faster/slower.

CODE
var vinylImage = gdi.Image(fb.FoobarPath + "images\\vinyl.jpg");
vinylImage = vinylImage.resize(300, 300);
var angle = 0;

var vinylX = 20;
var vinylY = 20;
var vinylW = vinylImage.width;
var vinylH = vinylImage.height;

function on_paint(gr) {

gr.DrawImage(vinylImage, vinylX, vinylY, vinylW, vinylH, 0, 0, vinylW, vinylH, angle);

}

var rotationInterval = 50;
var rotationTimer;
var rotationTimerStarted = false;

function onRotationTimer() {

if (!rotationTimerStarted) {

rotationTimer = window.SetInterval(function () {

if (angle >= 360) angle = 0;
angle += 10;
window.RepaintRect(vinylX, vinylY, vinylH, vinylH);

}, rotationInterval);



rotationTimerStarted = true;
}

}

function stopRotationTimer() {

window.ClearInterval(rotationTimer);
rotationTimerStarted = false;

}

function on_playback_stop(reason) {

if (reason != 2) {

stopRotationTimer();

}

}

function on_playback_pause(state) {

if (state) stopRotationTimer();
else onRotationTimer();

}

function on_playback_new_track() {

onRotationTimer();

}

Go to the top of the page
+Quote Post
antheo
post Jan 23 2013, 10:57
Post #1999





Group: Members
Posts: 8
Joined: 21-January 13
Member No.: 106077



QUOTE (ExtremeHunter @ Jan 23 2013, 11:00) *
Ok here's the faster one with timer tongue.gif.

Play with the values to make it faster/slower.

CODE
var vinylImage = gdi.Image(fb.FoobarPath + "images\\vinyl.jpg");
vinylImage = vinylImage.resize(300, 300);
var angle = 0;

var vinylX = 20;
var vinylY = 20;
var vinylW = vinylImage.width;
var vinylH = vinylImage.height;

function on_paint(gr) {

gr.DrawImage(vinylImage, vinylX, vinylY, vinylW, vinylH, 0, 0, vinylW, vinylH, angle);

}

var rotationInterval = 50;
var rotationTimer;
var rotationTimerStarted = false;

function onRotationTimer() {

if (!rotationTimerStarted) {

rotationTimer = window.SetInterval(function () {

if (angle >= 360) angle = 0;
angle += 10;
window.RepaintRect(vinylX, vinylY, vinylH, vinylH);

}, rotationInterval);



rotationTimerStarted = true;
}

}

function stopRotationTimer() {

window.ClearInterval(rotationTimer);
rotationTimerStarted = false;

}

function on_playback_stop(reason) {

if (reason != 2) {

stopRotationTimer();

}

}

function on_playback_pause(state) {

if (state) stopRotationTimer();
else onRotationTimer();

}

function on_playback_new_track() {

onRotationTimer();

}



Haha, good job ExtremeHunter, it work well and I will try to fix it with seekbar so let them work look like a vinyl disc player with a (seekbar) needle.

Thank so much biggrin.gif
Go to the top of the page
+Quote Post
derty2
post Jan 23 2013, 16:23
Post #2000





Group: Members
Posts: 580
Joined: 5-June 11
Member No.: 91257



That's a really nice disc spinner visualization you made there ExtremHunter, congrats +++++

Unfortunately for me, it won't resize to fill the whole panel window. I drag the panel edges open and the disc wants to stay one size at top left.
Is there any chance you can add more code to (A) center the disc in the panel and (B) make the disc auto-resize to fit the whole panel.

Great job on this, it would be nice if you continued to develop the script with more features :-) . . . . . Just off the top of my head, a super-cool feature would be if you could right-click the panel and choose menu items "Zoom In" or "Zoom Out" in incremental steps . . . . for example, if we continue to zoom in, then the disc stays always centered in the panel but the image goes beyond the edges of the panel, so with high enough zoom-in level we are looking at the hole in the middle of the disc filling the whole panel !!

I added this preamble header to the current script:
QUOTE
//////////////////////////////////////////////////////////////////////////////////////
// "Spinning Disc Image Viewer"
// WSH Panel Mod script by ExtremeHunter (Jan 23, 2013)
// creates a visual effect of a spinning disc as track is playing.
//
// script source:
// www.hydrogenaudio.org/forums/index.php?showtopic=77883&view=findpost&p=821699
///////////////////////////////////////////////////////////////////////////////////////


This post has been edited by derty2: Jan 23 2013, 16:41
Go to the top of the page
+Quote Post

125 Pages V  « < 78 79 80 81 82 > » 
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: 2nd August 2014 - 05:31