IPB

Welcome Guest ( Log In | Register )

126 Pages V  « < 99 100 101 102 103 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
Rarn
post Jul 26 2013, 09:13
Post #2501





Group: Members
Posts: 12
Joined: 26-July 11
Member No.: 92568



Well, I've found a solution if anybody else turns out to be curious, no thanks to me, but to finding the necessary code in a coverflow panel by "Br3tt aka Falstaff." smile.gif

It used this function (very slightly modified to remove dependencies):
CODE
function ShowNowPlaying() {
    if(fb.IsPlaying) {
        if(plman.PlaylistItemCount(plman.PlayingPlaylist)==0) {
            return true;
        };
        plman.ClearPlaylistSelection(plman.PlayingPlaylist);
        var nowplaying = plman.GetPlayingItemLocation();
        var pid = nowplaying.PlaylistItemIndex;
        if(pid>=0 && pid<plman.PlaylistItemCount(plman.PlayingPlaylist)) {
            plman.SetPlaylistFocusItem(plman.PlayingPlaylist, pid);
            plman.SetPlaylistSelectionSingle(plman.PlayingPlaylist, pid, true);
            plman.ActivePlaylist = plman.PlayingPlaylist;
        };
    } else {
        if(plman.PlaylistItemCount(plman.ActivePlaylist)==0 || !fb.GetFocusItem(false)) return true;
        plman.ClearPlaylistSelection(plman.ActivePlaylist);
        var pid = plman.GetPlaylistFocusItemIndex(plman.ActivePlaylist);
        plman.SetPlaylistFocusItem(plman.ActivePlaylist, pid);
        plman.SetPlaylistSelectionSingle(plman.ActivePlaylist, pid, true);
    };
};


I'm not sure what the purpose of the code in the else statement is though, it appears to behave the same without it.
Go to the top of the page
+Quote Post
SardonicWrath
post Jul 26 2013, 18:11
Post #2502





Group: Members
Posts: 70
Joined: 11-January 09
Member No.: 65452



when I last worked on my foobar config, WSH panel was just released... and turns out I completely underestimated the potential of this component. What you guys accomplished is beyond amazing smile.gif

@Marc2003:
I am just trying to adapt some of your great panels for my config, and I stumbled upon a small issue concering the last.fm panel (and similar) when using "Selection Mode / Use Display Preferences" (set to "prefer current selection" in Preferences):
When I select a group in el_playlist by clicking on the group header, the panels switch back to the now playing artist for a very brief moment. Only happens during playback/pause, its fine while stopped.
Some function (item_focus_change() I think) is triggered twice, probably because el_playlist clears the selection before making a new one, or something like that.

I tried fixing it myself by adding a tiny delay time in various parts of the script, without success (obviously...). I'm afraid this is to difficult for me, just having started with WSH panel and having next to no JScript experience unsure.gif

Anyways, thanks for those awesome scripts smile.gif

This post has been edited by SardonicWrath: Jul 26 2013, 18:11
Go to the top of the page
+Quote Post
marc2003
post Jul 26 2013, 22:22
Post #2503





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



i can't seem to reproduce that issue but i know the selection can change back to now playing when the playlist loses focus. i guess you're seeing this.

instead you can right click panel>selection mode>follow selected track. that should always stay with selection even when the playlist loses focus.
Go to the top of the page
+Quote Post
Bratman
post Jul 27 2013, 00:05
Post #2504





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



That album background camouflage effect is cool I always wished this was possible with channel spectrum so the spectrum bars changed colour with the album art above.
Go to the top of the page
+Quote Post
SardonicWrath
post Jul 27 2013, 14:27
Post #2505





Group: Members
Posts: 70
Joined: 11-January 09
Member No.: 65452



QUOTE (marc2003 @ Jul 26 2013, 23:22) *
i can't seem to reproduce that issue but i know the selection can change back to now playing when the playlist loses focus. i guess you're seeing this.

instead you can right click panel>selection mode>follow selected track. that should always stay with selection even when the playlist loses focus.

well, thats probably because I have a kind of unusual setup... I use two playlists that are visible all the time, one for playback and one for viewing the library. The playback one is always kept active (I use a script for that).
"Follow selected track" doesn't work well for that, it sticks to one playlist
Still a bit confused how all of this works, with focused/selected items/playlists....

Anyway, I found a solution:
CODE
function on_selection_changed() {
    nowplaying = fb.GetNowPlaying()
    focused = fb.GetSelection()
    if (fb.IsPlaying && fb.TitleFormat("%artist%").EvalWithMetadb(nowplaying) == fb.TitleFormat("%artist%").EvalWithMetadb(focused)){
        var timer
        timer = window.SetTimeout(function (){
            p.item_focus_change();
        }, 200);
    } else {
        p.item_focus_change();
    }
}

Same for on_item_focus_change
I know, hideous code, there gotta be a more elegant method of comparing the playing and the selected item, but I couldn't figure it out and used something i found somewhere.
But it solved my problem and only adds this tiny delay when its necessary.

What could improve this solution is if I could determine the reason for the selection change- wether it was because I made a new selection or whatever el_playlist does on group selection that causes the selection to jump to now playing.
But I guess thats not possible, or is it?
Doesn't really matter, what I got now is good enough smile.gif
Go to the top of the page
+Quote Post
Solynth
post Aug 1 2013, 07:41
Post #2506





Group: Members
Posts: 37
Joined: 20-February 12
Member No.: 97273



I wonder if you guys could help me. I'm using Br3tt/Falstaff's WSH Playlist this one here, and I'm trying to get the artist image to display as a wallpaper.
I CAN get it to work when I place the artist.jpg in the album folder. BUT, some artists I have have over 20 albums or so, and rather than having the same artist image in every folder, I would like to just have the artist.jpg saved in the I:\Music\Artist folder. My Library is set up "Music\Artist\Albums".
I am using Biography Server which automatically downloads the artist.jpg from last.fm, the script I am using to save the image to the artist folder is

CODE
$replace($directory_path(%path%),\%directory%,)\artist


Which is working fine. What I am struggling with however, is getting the WSH Playlist to look here for the artist image.



I've also tried using the same code in Preferences>Display>Artist, but it's not working.

This post has been edited by Solynth: Aug 1 2013, 07:41
Go to the top of the page
+Quote Post
Falstaff
post Aug 1 2013, 08:44
Post #2507





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



CUSTOM Default Wallpaper Path is ... for the default Wallpaper when no "artist" pic is found, so just point the path to a single picture you want to use for this usage.

so, now, to get artist picture from a centralized folder like you want (and like i do), it's quite easy:

1) be sure that all your artists images are saved in this folder and named with the artist name plus the file extension (.jpg i asume)
2) in fb2k Preferences > Display > "artitst" tab, enter the path of this centralized folder with the pattern thaht match the filename of the image of course, in our case, the TAG %artist% give the name of the filname right ?
so enter this: I:\Music\Artist\%artist%.jpg
3) nothing else, the WSH panel properties are already set : CUSTOM Show Wallpaper AND CUSTOM Use Artist Image As Wallpaper are already set to TRUE smile.gif

HTH


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Solynth
post Aug 1 2013, 09:07
Post #2508





Group: Members
Posts: 37
Joined: 20-February 12
Member No.: 97273



QUOTE (Falstaff @ Aug 1 2013, 15:44) *
CUSTOM Default Wallpaper Path is ... for the default Wallpaper when no "artist" pic is found, so just point the path to a single picture you want to use for this usage.

so, now, to get artist picture from a centralized folder like you want (and like i do), it's quite easy:

1) be sure that all your artists images are saved in this folder and named with the artist name plus the file extension (.jpg i asume)
2) in fb2k Preferences > Display > "artitst" tab, enter the path of this centralized folder with the pattern thaht match the filename of the image of course, in our case, the TAG %artist% give the name of the filname right ?
so enter this: I:\Music\Artist\%artist%.jpg
3) nothing else, the WSH panel properties are already set : CUSTOM Show Wallpaper AND CUSTOM Use Artist Image As Wallpaper are already set to TRUE smile.gif

HTH



YES, thank you it's working.

In the Biography Server Last.fm section, I have the cache file path set to:

CODE
I:\Documents\Foobar\Artist\%artist%


And under Preferences>Display>Artist I have:

CODE
I:\Documents\Foobar\Artist\%artist%.jpg
I:\Documents\Foobar\Artist\%artist%.png
I:\Documents\Foobar\Artist\%artist%.jpeg


Thanks again, man. Such a good WSH Playlist.
Go to the top of the page
+Quote Post
Falstaff
post Aug 1 2013, 09:23
Post #2509





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



one line is enough smile.gif
CODE
I:\Documents\Foobar\Artist\%artist%.*


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Solynth
post Aug 1 2013, 09:25
Post #2510





Group: Members
Posts: 37
Joined: 20-February 12
Member No.: 97273



QUOTE (Falstaff @ Aug 1 2013, 16:23) *
one line is enough smile.gif
CODE
I:\Documents\Foobar\Artist\%artist%.*


Ah, learn something new every day. Cheers.
Go to the top of the page
+Quote Post
cliffflip
post Aug 2 2013, 19:51
Post #2511





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



Hi marc,
can you show me how to turn the rating panel from horizontal mode to vertical? pretty much like this :



by the way thanks for your help on previous posts, I'm sure I posted thanks but it's deleted somehow.

This post has been edited by cliffflip: Aug 2 2013, 19:51
Go to the top of the page
+Quote Post
marc2003
post Aug 2 2013, 20:17
Post #2512





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



it would take very large changes to make that work. i might have a go if i get bored over the weekend.
Go to the top of the page
+Quote Post
cliffflip
post Aug 3 2013, 04:59
Post #2513





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



QUOTE (marc2003 @ Aug 3 2013, 02:17) *
it would take very large changes to make that work. i might have a go if i get bored over the weekend.


I have found a way for that, thanks smile.gif
Go to the top of the page
+Quote Post
PeteG
post Aug 3 2013, 05:10
Post #2514





Group: Members
Posts: 52
Joined: 10-June 12
From: Denmark
Member No.: 100577



QUOTE (cliffflip @ Aug 3 2013, 04:59) *
I have found a way for that, thanks smile.gif

Eh?
Meaning you found a solution and then signed a NDA with yourself?


Edit: Typo

This post has been edited by PeteG: Aug 3 2013, 05:12
Go to the top of the page
+Quote Post
marc2003
post Aug 3 2013, 05:25
Post #2515





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



doing it top/down is easy enough. but i was thinking it would look better with 1 star at the bottom and working upwards towards 5. that would have required a bit more effort. which way did you do it?
Go to the top of the page
+Quote Post
cliffflip
post Aug 3 2013, 08:43
Post #2516





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



QUOTE (PeteG @ Aug 3 2013, 11:10) *
QUOTE (cliffflip @ Aug 3 2013, 04:59) *
I have found a way for that, thanks smile.gif

Eh?
Meaning you found a solution and then signed a NDA with yourself?


Edit: Typo


sorry I don't understand what you mean blink.gif

QUOTE (marc2003 @ Aug 3 2013, 11:25) *
doing it top/down is easy enough. but i was thinking it would look better with 1 star at the bottom and working upwards towards 5. that would have required a bit more effort. which way did you do it?


from top to bottom, it's more suitable on my skin.
Since I also use the default horizontal layout, I copy the code from common7.js file, paste it to WSH Panel then edit it.

CODE
// ==PREPROCESSOR==
// @import "%fb2k_path%skins\tests\Scripts\common7.js"
// @name "Rating"
// @author "marc2003"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==

function rating(x, y, bs) {
    this.draw = function(gr) {
        if (!p.metadb) return;
        for (i = 1; i < 6; i++) {
            this.img = i > (this.hover ? this.lrating : this.rating) ? this.off_img : this.on_img;
            p.draw_image(gr, this.img, this.x, this.y + this.bs * (i - 1), this.bs, this.bs, "centre");
        }

    }
    
    this.metadb_changed = function() {
        if (!p.metadb) return false;
        this.hover = false;
        this.rating = p.eval("$if2(%rating%,0)");
        this.tiptext = p.eval(this.tiptext_tf);
        this.lrating = this.rating;
        window.RepaintRect(this.x, this.y, this.bs, this.w);
        return true;
    }
        
        this.trace = function(x, y) {
        return x > this.x && x < this.x + this.bs && y < this.y + (this.bs * 5) && y > this.y;
    }
    
    this.move = function(x, y) {
        if (!this.trace(x, y)) {
            if (this.hover) this.leave();
            return false;
        }
        if (p.metadb) {
            if (y > this.y) p.tt(this.tiptext);
            this.hover = true;
            this.lrating = Math.ceil((y - this.y) / this.bs);
            window.RepaintRect(this.x, this.y, this.bs, this.w);
        }
        return true;
    }
    
    this.lbtn_up = function(x, y) {
        if (!this.trace(x, y)) return false;
        if (this.check) {
            if (this.lrating != this.rating && this.hover == 1) fb.RunContextCommandWithMetadb("Rating/" + (this.lrating == 0 ? "<not set>" : this.lrating), p.metadb, 8);
        } else {
            p.MsgBox(this.error_text, 0, p.name);
            p.browser("http://www.foobar2000.org/components/view/foo_playcount");
        }
        return true;
    }
    
    this.leave = function() {
        p.ttd();
        this.hover = false;
        window.RepaintRect(this.x, this.y, this.bs, this.w);
    }
    
    this.x = x;
    this.y = y;
    this.bs = bs;
    this.w = this.bs * 5;
    this.hover = false;
    this.rating = null;
    this.lrating = null;
    this.img = null;
    this.off_img = gdi.Image(p.images_path + "off.png");
    this.on_img = gdi.Image(p.images_path + "on.png");
    this.check = utils.CheckComponent("foo_playcount", true);
    this.error_text = "This script requires foo_playcount.";
    this.tiptext_tf = this.check ? 'Rate "%title%" by "%artist%"' : this.error_text;
}


var p = new panel("Rating", ["custom_background", "metadb"]);
p.version = "7.2013-04-02.01";
p.filename = "rating.txt";
var r = new rating(0, 0, 18);
p.check_version();

on_item_focus_change();

function on_size() {
    p.size();
    r.x = Math.round((p.w - r.w) / 52);
    r.y = Math.round((p.h - r.bs) / 5);
}

function on_paint(gr) {
    p.draw_background(gr);
    r.draw(gr);
}

function on_metadb_changed() {
    r.metadb_changed();
}

function on_mouse_move(x, y) {
    r.move(x, y);
}

function on_mouse_lbtn_up(x, y) {
    r.lbtn_up(x, y);
}


I need a smaller panel, so I resized it too.

This post has been edited by cliffflip: Aug 3 2013, 08:43
Go to the top of the page
+Quote Post
MordredKLB
post Aug 4 2013, 20:32
Post #2517





Group: Members
Posts: 198
Joined: 1-May 09
From: Austin, TX
Member No.: 69413



QUOTE (cliffflip @ Jul 15 2013, 07:58) *
sorry my bad laugh.gif

here's what I meant anyway : http://tinypic.com/r/2iup7oj/5

I noticed no one responded to your question about this. I can't give you exact code for your theme, but this should give you a place to start.

You'll need to have two copies of the album art. This code assumes you're loading the album art into an image called albumart. I'd suggest, loading it once and then drawing it into the background image like so:
CODE
    bgImage = gdi.CreateImage(1920,1080);
    background = bgImage.GetGraphics();
    background.DrawImage(albumart, 0, 0, 1920, 1080, 0, 0, albumart.Width, albumart.Height);
    bgImage.ReleaseGraphics(background);
    bgImage.BoxBlur(40, 5);


I went with a medium amount of BoxBlur and then 5 iterations which should give you a nice diffuse background image.

Then just draw bgImage to cover the panel and draw albumart on top of it. I didn't test this code, so apologies if there are any bugs.
Go to the top of the page
+Quote Post
cliffflip
post Aug 5 2013, 08:59
Post #2518





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



Hi, thanks for your response. I'll test it as soon as I can smile.gif
Go to the top of the page
+Quote Post
marc2003
post Aug 5 2013, 09:16
Post #2519





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



QUOTE (MordredKLB @ Aug 4 2013, 20:32) *
I noticed no one responded to your question about this.


um.... http://www.hydrogenaudio.org/forums/index....st&p=839573

admittedly mine uses a static background wallpaper so if yours generates nice colours on the fly then it is better. tongue.gif
Go to the top of the page
+Quote Post
mire777
post Aug 8 2013, 15:26
Post #2520





Group: Members
Posts: 350
Joined: 9-June 12
Member No.: 100550



QUOTE (ExtremeHunter @ Jan 22 2013, 21:31) *
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


ExtremeHunter please can you help me?
I use WSH panel mod 1.4.2. I can't use new version, because it brakes my skin.
This skript work's good, but it is slow. How to set speed in WSH panel mod 1.4.2?

Seems to older version don't recognize ''window.ClearInterval'' , ''window.SetInterval'' and simmilar action's..

This post has been edited by mire777: Aug 8 2013, 15:27
Go to the top of the page
+Quote Post
ExtremeHunter
post Aug 8 2013, 17:23
Post #2521





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



I slightly modified the old spinning disc script so that you can use it with 1.4.2 wsh panel mod. pastepin link

This post has been edited by ExtremeHunter: Aug 8 2013, 17:24
Go to the top of the page
+Quote Post
mire777
post Aug 8 2013, 17:37
Post #2522





Group: Members
Posts: 350
Joined: 9-June 12
Member No.: 100550



QUOTE (ExtremeHunter @ Aug 8 2013, 18:23) *
I slightly modified the old spinning disc script so that you can use it with 1.4.2 wsh panel mod. pastepin link


Oh, Thank's Extreme Hunter, you're the best smile.gif
Go to the top of the page
+Quote Post
phool
post Aug 8 2013, 18:57
Post #2523





Group: Members
Posts: 87
Joined: 10-April 08
Member No.: 52685



Hi ExtremeHunter, last time I tried your spinning disk script (for the current version of wsh panel mod, the rotation wan't as smooth as I expected. Is it possible to simulate the effect on this website: http://fanart.tv/artist/477b8c0c-c5fc-4ad2...uuren-van-armin (scroll down to the CDART section)? I'd also like to be able to have the image be linked to actual CDart saved in same folder as the album with the naming scheme: [CD Art] %album artist% - %album%

This post has been edited by phool: Aug 8 2013, 18:58
Go to the top of the page
+Quote Post
ExtremeHunter
post Aug 8 2013, 20:56
Post #2524





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



My spinning disc script already does that, you need to set disc image location in foobar Preferences->Display->Disc

"the rotation wasn't as smooth" This component is not meant for such a heavy animation.
Go to the top of the page
+Quote Post
drm200
post Aug 8 2013, 22:13
Post #2525





Group: Members
Posts: 10
Joined: 8-February 11
Member No.: 88007



I have a novice question as I am a novice .. but I've not been able to understand what is causing a panel to react as it does ..

I have some simple code that I downloaded that displays "now playing" info in a wsh panel. The panel works fine. But, when I right click on the mouse .. it shows a menu for properties and configuration and I can click on "configuration" and go into edit regardless of whether I have layout editing mode enabled or not. All of my other panels do not react to a right mouse click this way.

I want to disable the "configuration" menu unless I have "layout editing" enabled.

The code in this panel has no "right mouse" button functions defined ..
The code in this panel has no functions working with the popup context menu ...
There are no pre-processors loading other code. ...

Can someone explain why I get this context popup menu on right click with layout edit mode disabled (and not for other panels).... and how I may disable it so one can not go into configuration edit unless layout edit mode is enabled?
Go to the top of the page
+Quote Post

126 Pages V  « < 99 100 101 102 103 > » 
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 31st August 2014 - 08:55