IPB

Welcome Guest ( Log In | Register )

60 Pages V  « < 58 59 60  
Reply to this topicStart new topic
WSH Panel Mod, foo_uie_wsh_panel_mod
emte
post Aug 27 2013, 14:14
Post #1476





Group: Members
Posts: 93
Joined: 11-February 10
Member No.: 78081



I'd like to get panel stack splitter global variable through wsh panel mod but it's not possible or is it?
Go to the top of the page
+Quote Post
marc2003
post Aug 27 2013, 14:19
Post #1477





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



not possible.
Go to the top of the page
+Quote Post
kjllmeplz
post Aug 27 2013, 14:26
Post #1478





Group: Members
Posts: 30
Joined: 7-January 13
Member No.: 105671



@emte : read this
http://www.hydrogenaudio.org/forums/index....st&p=842532
Go to the top of the page
+Quote Post
marc2003
post Aug 27 2013, 14:30
Post #1479





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



that's setting something through WSH panel mod to be read by PSS - completely the opposite of what was asked.
Go to the top of the page
+Quote Post
kjllmeplz
post Aug 27 2013, 15:37
Post #1480





Group: Members
Posts: 30
Joined: 7-January 13
Member No.: 105671



ah, sorry, I misunderstood. sad.gif
Go to the top of the page
+Quote Post
cgooey
post Aug 29 2013, 04:33
Post #1481





Group: Members
Posts: 1
Joined: 29-August 13
Member No.: 109854



Hey, I hope this is an appropriate place to post this but I am looking for some help as to anchoring a WSH volume slider script to a Panel Stack Splitter. It currently moves out when resizing the window and I'd like it to stay at a consistent distance away from the edge of the window when resizing. Here's what I have so far;

CODE
// ==PREPROCESSOR==
// @import "%fb2k_path%\resources\Common.h"
// @import "%fb2k_path%\resources\UI.h"
// ==/PREPROCESSOR==


// Based on human hearing curve
// 0 <= p <= 1
// return a value value: -100 <= vol <= 0
function pos2vol(p) {
return (50 * Math.log(0.99 * p + 0.01) / Math.log(10));
}

function vol2pos(v){
var p=((Math.pow(10,v/50)-0.01)/0.99);
return(p);
}

//-----------------------------------

var muted = false;
var volume = fb.Volume;

var path = fb.FoobarPath + "resources\\";
var volume_img = gdi.Image(path + "volume.png");
var mute_button_img = gdi.Image(path + "bt_volume.png");
var mute_button_img_h = gdi.Image(path + "bt_volume.png");
var knob_img = gdi.Image(path + "knob.png");
var bar_left_img = gdi.Image(path + "bar_left.png");
var bar_mid_img = gdi.Image(path + "bar_mid.png");
var bar_right_img = gdi.Image(path + "bar_right.png");

var VolumeBar = new Dragbar();
var MuteButton = new Button(5,-1,26,21,mute_button_img,mute_button_img_h,mute_button_img,"Mute");

function on_size() {
ww = window.Width;
wh = window.Height;
VolumeBar.SetSize(30,5,165,10);
}

function on_paint(gr){
//gr.FillSolidRect(0,0,ww,wh,RGBA(25,25,25,255));
var p = parseInt(vol2pos(fb.Volume) * VolumeBar.W);
VolumeBar.Pos = p>0 ? p : 0;

gr.FillSolidRect(VolumeBar.X,VolumeBar.Y + 0,VolumeBar.Pos,9,RGBA(179,179,179,255))

MuteButton.Draw(gr);

var i = 0;
var vol = fb.Volume;

if(vol == -100){
if(muted)i = 0;
else i = 1;
}
if(vol>-100 && vol<-20)i = 2;
if(vol>=-20 && vol<-8)i = 3;
if(vol>=-8)i = 4;

gr.Drawimage(volume_img,19,3,10,14,i*10,0,10,14,0);

gr.Drawimage(bar_left_img,VolumeBar.X,VolumeBar.Y+0,0,5,0,0,2,5,0);
gr.Drawimage(bar_mid_img,VolumeBar.X,VolumeBar.Y+0,VolumeBar.W,9,0,0,10,5,0);
gr.Drawimage(bar_right_img,VolumeBar.X+VolumeBar.W,VolumeBar.Y+0,0,5,0,0,2,5,0);

var knob_x = (VolumeBar.Pos<5 ? 5: VolumeBar.Pos) + VolumeBar.X - 5;
knob_x = VolumeBar.Pos+5>VolumeBar.W ? VolumeBar.W+VolumeBar.X-10 : knob_x;
gr.Drawimage(knob_img,knob_x,VolumeBar.Y,10,10,0,0,10,10,0);
}

function on_mouse_move(x,y){
if(VolumeBar.Drag(x,y)){
var p = VolumeBar.Pos/VolumeBar.W;
fb.Volume = pos2vol(p);
}
MuteButton.Activate(x,y);
}

function on_mouse_lbtn_down(x,y){
if(VolumeBar.Click(x,y)){
var p = VolumeBar.Pos/VolumeBar.W;
fb.Volume = pos2vol(p);
}
MuteButton.Down();
}

function on_mouse_lbtn_up(x,y){
VolumeBar.Reset();

if(MuteButton.Click()){
if(muted){
fb.Volume = volume;
}
else{
if(fb.Volume > -100){
volume = fb.Volume;
muted = true;
fb.RunMainMenuCommand("Playback/Volume/Mute");
}
}
}

MuteButton.Reset();
}

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

function on_volume_change(vol){
if (vol > -100 && muted)muted = false;
if(!muted)volume = fb.Volume;
window.Repaint();
}


Any help would be greatly appreciated.
Go to the top of the page
+Quote Post
Falstaff
post Sep 1 2013, 10:13
Post #1482





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



QUOTE (Falstaff @ Jul 7 2013, 18:02) *
@vothanhdat

you can't retreive it with WSH panel mod. the best way is to work with an autoplaylist that contains the whole library (e.g %path% PRESENT) and to browse it with plman.

HTH


i see that helped, your panels are very good, except the populating function that can be optimized a lot, i'll post here the optimized version asap.

for those interrested by the scripts of vothanhdat, check his DA page: http://thanhdat1710.deviantart.com/


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
fuffi
post Oct 13 2013, 02:14
Post #1483





Group: Members
Posts: 194
Joined: 10-February 07
From: kölle an rhein
Member No.: 40490



just want to say thank you for this great plugin, and thanks to all the ppl, who share their scripts!!
Go to the top of the page
+Quote Post
MordredKLB
post Oct 14 2013, 05:48
Post #1484





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



In my theme, I've got a playlist manager I ripped from ExtremeHunter (thanks!) and I noticed that I was getting a LOT of on_playlist_items_reordered events being fired when no items were actually being reordered. After a little testing I realized that it only happened in auto-playlists, and specifically my autoplaylist which checks if a song has been played in the last 70 minutes. Watching the clock I realized that the playlist was updating itself every minute to check for that clause. Items still weren't being reordered though. I also verified that if a song had eclipsed the 70 minute threshold and was removed from the list, that the on_playlist_items_removed() was fired, and on_playlist_items_added() was fired at the appropriate time as well, but that dang on_playlist_items_reordered was also fired. I added a check to only refresh the playlist in on_playlist_items_reordered if:
CODE
playlist == activeList && !fb.IsAutoPlaylist(playlist)

which is wrong if the sort order changes, but that's a rare occurrence in my situation.

As far as I can tell, you can't manually reorder auto playlists. It seems that the only time the reorder event should fire is if the sort order for the auto playlist actually changes. Am I missing something else, or is this a bug?
Go to the top of the page
+Quote Post
marc2003
post Oct 14 2013, 06:45
Post #1485





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



QUOTE (MordredKLB @ Oct 14 2013, 05:48) *
As far as I can tell, you can't manually reorder auto playlists.


this would depend on whether you have SORT BY in your query or it's force sorted through its properties. if not, you can manually re-order tracks. but if they are sorted, i think it's perfectly normal for the playlist added to get triggered when a track meets the criteria to get on the playlist. presumably it gets added to the end of the playlist (like using file>add files) and then the reorder callback kicks in to put in the right place.

also, i'm guessing these callbacks are all triggered by the foobar core itself so it's unlikely to be a bug.
Go to the top of the page
+Quote Post
MordredKLB
post Oct 14 2013, 15:28
Post #1486





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



QUOTE (marc2003 @ Oct 14 2013, 00:45) *
QUOTE (MordredKLB @ Oct 14 2013, 05:48) *
As far as I can tell, you can't manually reorder auto playlists.


this would depend on whether you have SORT BY in your query or it's force sorted through its properties. if not, you can manually re-order tracks. but if they are sorted, i think it's perfectly normal for the playlist added to get triggered when a track meets the criteria to get on the playlist. presumably it gets added to the end of the playlist (like using file>add files) and then the reorder callback kicks in to put in the right place.

also, i'm guessing these callbacks are all triggered by the foobar core itself so it's unlikely to be a bug.
Thanks for the info. I do have force sorted selected on all my auto-playlists. I'm guessing there's no way to tell if a playlist has that setting though.

It does make sense when a song gets added or removed (although it's redundant in my case), but if nothing is changing in the playlist, and the auto-playlist is just checking to see if something should be added or removed, then I don't understand why it's getting triggered.
Go to the top of the page
+Quote Post
marc2003
post Oct 14 2013, 16:24
Post #1487





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



QUOTE (MordredKLB @ Oct 14 2013, 15:28) *
I'm guessing there's no way to tell if a playlist has that setting though.


correct. as you already know, you can tell if a playlist is an autoplaylist but that's it.

QUOTE
but if nothing is changing in the playlist, and the auto-playlist is just checking to see if something should be added or removed, then I don't understand why it's getting triggered.


i've managed to re-create what you're seeing and it is odd. i'm assuming you're using foo_playcount? i created my own autoplaylist using %LAST_PLAYED% DURING LAST 60 MINUTES SORT DESCENDING BY %LAST_PLAYED%

like yourself, i'm seeing the reordered event getting triggered even when nothing else is getting removed/added. it's about every minute or so.

is this a real issue that affects your script or is it something that just bugs you?

This post has been edited by marc2003: Oct 14 2013, 16:25
Go to the top of the page
+Quote Post
MordredKLB
post Oct 14 2013, 18:38
Post #1488





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



QUOTE (marc2003 @ Oct 14 2013, 10:24) *
i've managed to re-create what you're seeing and it is odd. i'm assuming you're using foo_playcount? i created my own autoplaylist using %LAST_PLAYED% DURING LAST 60 MINUTES SORT DESCENDING BY %LAST_PLAYED%

like yourself, i'm seeing the reordered event getting triggered even when nothing else is getting removed/added. it's about every minute or so.

is this a real issue that affects your script or is it something that just bugs you?


It's a real issue that will probably only really effect me. The issue is that when I get an on_playlist_items_reordered I have to throw away the playlist data I have and rebuild it from scratch. That's pretty fast, but the artwork (typically 3-4 images are visible at any time) has to be retrieved again. Even on the same machine this causes flashing from the images disappearing and then reappearing (which is probably more from the script than actually the images) but over wifi it gets pretty bad since the images I save are usually big and it can take 2-3 seconds to retrieve the 3-4 MB of artwork needed.

I've implemented local image caching to cut down on network transfer times, but just checking image sizes of the remote images to determine if we have a valid cache hit still takes about half a second. If this only happened when a song was added or removed from the playlist it wouldn't be a big deal, but once a minute seeing it flash is awfully distracting.
Go to the top of the page
+Quote Post
marc2003
post Oct 15 2013, 00:07
Post #1489





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



QUOTE
I've implemented local image caching to cut down on network transfer times, but just checking image sizes of the remote images to determine if we have a valid cache hit still takes about half a second.


surely this is complete overkill? i'd only check once only per foobar restart.

edit: have you tried falstaff's WSH playlist viewer to see how that performs? http://www.deviantart.com/art/WSH-Playlist...0-0-8-368997689

i'll freely admit, it's all beyond me. tongue.gif

This post has been edited by marc2003: Oct 15 2013, 00:20
Go to the top of the page
+Quote Post
MordredKLB
post Oct 15 2013, 01:56
Post #1490





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



QUOTE (marc2003 @ Oct 14 2013, 18:07) *
surely this is complete overkill? i'd only check once only per foobar restart.
Probably it is. It works great for just album art because you never notice the delay between switching tracks, but when the playlist art work blanks, and then takes any amount of time to load, you see the delay. Originally I was going to do once per day, but then I changed some artwork and got annoyed that it wasn't reflected immediately (and I don't have a flush cache button). Maybe for the tiny playlist images it doesn't matter.

QUOTE
edit: have you tried falstaff's WSH playlist viewer to see how that performs? http://www.deviantart.com/art/WSH-Playlist...0-0-8-368997689

i'll freely admit, it's all beyond me. tongue.gif

I did a while ago, but long before I started writing my own stuff. The problem is that a lot of this stuff is interdependent. My theme is now about 9k lines long, split between four files, and I can't just switch in and out playlist viewers to see how they'd work with the rest of my system. I'll probably give it a go, just to see if it has the same issue though. I could have never written the playlist stuff on my own, but starting from Extreme Hunter's base I've been able to hack together something that works well. smile.gif

Edit: falstaff does his own internal caching where he keeps the resized artwork for the playlist which is pretty smart. I'm caching full files which is great for slow network connections and all the artwork I display, but is overkill for the 80x80 playlist images. I think my solution is going to be to do both. Keep an associative array of resized artwork for the playlist, and attempt to hit the local cache whenever we need full size artwork, or playlist artwork that we haven't stored in the internal playlist image cache.

This post has been edited by MordredKLB: Oct 15 2013, 02:40
Go to the top of the page
+Quote Post
Retract
post Dec 6 2013, 16:20
Post #1491





Group: Members
Posts: 9
Joined: 5-December 13
Member No.: 112945



Is it possible to create an art reader script so that when you select an artist, it displays an image of that artist, but then when you select an album or a song, it displays album art? Sorry if I explained that poorly, I've coded in MATLAB but that's about it, so my jscript skills are next to nothing.

This post has been edited by Retract: Dec 6 2013, 16:20
Go to the top of the page
+Quote Post
marc2003
post Dec 6 2013, 16:47
Post #1492





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



QUOTE (Retract @ Dec 6 2013, 15:20) *
select an artist


QUOTE
select an album or a song


no. these terms are meaningless as far as WSH panel mod is concerned. it cannot interact with other library viewers/panels so it has no concept of the "type" of selection.

you could try foo_facets or EsPlaylist as these allow you to browse your library with artist/album panels configured to show the appropriate artwork.

This post has been edited by marc2003: Dec 6 2013, 16:51
Go to the top of the page
+Quote Post
colagen
post Feb 19 2014, 12:13
Post #1493





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



HI,

Is there a way to drag & drop tracks between two panels ? I've try with notifyOthers() and on_notify_data(), but it seems that the callbacks functions on_mouse_xxx() don't work when you enter the panel while the mouse button is already pressed (which is the case when you try to drag an item from outside).

(I'm expecting a negative answer, so i've try to look at the source of wsh panel to edit it but finally hmmm... i'm not ready to hurt my brain that much yet)
Go to the top of the page
+Quote Post

60 Pages V  « < 58 59 60
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: 30th August 2014 - 09:43