Skip to main content

Topic: WSH Panel Mod script discussion/help (Read 842750 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
WSH Panel Mod script discussion/help
Reply #2000
derty2

you can get zoomable/resizable version here (zoom with Shift+mouse wheel or Shift+up/down arrow keys),
but keep in mind that larger your image goes, more CPU it takes.
  • Last Edit: 23 January, 2013, 12:44:33 PM by ExtremeHunter

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2001
Fantastic work eXtremeHunter, the code works great +++++++

This looks really nice when using a PNG disc image with transparent background and a custom panel background color.

If anybody here wants to edit the script to have custom panel background colors then add these lines to the script:

add this:
Quote
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var backgrcolor = RGB(34,28,28) //<<<<<<<<<< color is dark brown

and add this:
Quote
function on_paint(gr) {
    gr.FillGradRect(0, 0, window.Width, window.Height, 90, backgrcolor, RGB(50,0,0)); //<<<<<<<<<< color is gradient dark brown-maroon
    gr.DrawImage(resizedVinylImage, vinylX, vinylY, vinylW, vinylH, 0, 0, resizedVinylImage.Width, resizedVinylImage.Height, angle);
}


HOW TO CREATE A 'PNG' DISC IMAGE WITH TRANSPARENT BACKGROUND
Quote
For this example I am using Photoshop CS3,

Open image in Photoshop,

At the left-side toolbar select the "Elliptical Marquee Tool",

Place the mouse cursor somewhere in the middle of the image,

Hold down SHIFT+ALT keys, then click-drag the mouse cursor outwards from the middle of the image,

You will see a perfect selection circle radiating out from the middle of the image,

Keep dragging outwards until you reach the edge of the disc,

Let go of the mouse cursor and then let go of the keys,

You should now have a perfect circular selection,

Right click in the selection and choose "Layer Via Copy",

At the right-side layers panel you will now have two Layers named "Layer 1" and "Background",

Click on the "eyeball" of the "Background" layer to de-select it,

You will now see the main image showing in Photoshop will have a checkerboard background pattern,

This checkerboard pattern means the background is transparent,

Save this image as 'PNG' and you are done.

!!! IMPORTANT !!! do not save as 'JPG' because you will lose the transparent background.


  • onv
  • [*][*]
WSH Panel Mod script discussion/help
Reply #2002

WSH Panel Mod script discussion/help
Reply #2003
Mmm, good old times comes to mind 
  • Last Edit: 24 January, 2013, 03:47:38 AM by ExtremeHunter

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2004
just a post to say if you use the right click>Update script option on my scripts from today, the last.fm charts and autoplaylists script panels will break. you just need to import those again from the full download here. http://db.tt/BInQ3Abm

i've also tidied up a few things and bumped all the version numbers on my scripts but there are no functional changes.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2005
eXtremeHunter, I have one more feature request for your "Spinning Disc Image Viewer" script please. . .

I am getting bored looking at the same spinning disc for every track.
Can you modify the code so that the script searches for a disc named "disc.png" at same directory as playing track,
else if "disc.png" is not found then default disc image is displayed.

Thankyou.

WSH Panel Mod script discussion/help
Reply #2006
Updated Spinning disc script here

Added: Display now playing disc first, if not available  display default disc image.
(set source in Preferences/Display-Album art Disc)

Added: gradient background.
Added: disc mask. (now you can display non transparent disc images like  jpg. just use correctly cropped images (edge to edge)).

screen-shot with jpg disc image


  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2007
Thanks for the new code eXtremeHunter , it works great ++++

Here is a quick 'No Disc' image I made (1000x1000px, PNG):         

  • nikolai4ik
  • [*][*][*]
WSH Panel Mod script discussion/help
Reply #2008
Hey guys, my some of my wsh panels flicker on pause/play if I set the panels to pseudo transparency, is it fixable?

  • nikolai4ik
  • [*][*][*]
WSH Panel Mod script discussion/help
Reply #2009
Can't edit the post, sorry for the double post
Can anyone please change this function from opening external program to playing/pausing foobar playback?

function on_mouse_lbtn_clk(x, y, mask) {

   var path = Image.Items[Image.Index].path;
   if (!path || hbtn) return;
   if (path.indexOf("file://") >= 0 || path == Properties.Image.DefaultCoverPath) {
      return;
   }
   ShellObj.ShellExecute('"' + path + '"', "", "", "open", 1);
}

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2010
not sure what callback you're trying to use there??

Code: [Select]
function on_mouse_lbtn_up(x, y) {
    fb.PlayOrPause();
}


that's single click. if you want double click then use on_mouse_lbtn_dblclk

  • nikolai4ik
  • [*][*][*]
WSH Panel Mod script discussion/help
Reply #2011
not sure what callback you're trying to use there??

Code: [Select]
function on_mouse_lbtn_up(x, y) {
    fb.PlayOrPause();
}


that's single click. if you want double click then use on_mouse_lbtn_dblclk

That's a script from another config which opens the cover in the external image viewer on double click.

Your script works well, thanks, I was trying this function but with on_mouse_lbtn_clk which doesn't work. But it counts my double clicks too so when I double click on the cover it quickly pauses and then keeps playing, is it possible to make wsh see the difference between a quick double click and a single click?

  • kjllmeplz
  • [*]
WSH Panel Mod script discussion/help
Reply #2012
Hi everyone, i'm starting mod the PlaylistSwitcher in the skin Mizo.

Initially, I made it to show the number of songs in each playlist, but this number didn't change immediately every time I added or deleted some songs in playlist, can someone help me 

Sorry for my bad English.

This is my script :

https://dl.dropbox.com/u/22999146/FB/playlistsw.txt
  • Last Edit: 25 January, 2013, 01:40:51 PM by kjllmeplz

WSH Panel Mod script discussion/help
Reply #2013
kjllmeplz

add these functions to your script


Code: [Select]
function on_playlist_items_removed(){
   RefreshPlaylists();
   window.Repaint();
}

function on_playlist_items_added(){
   RefreshPlaylists();
   window.Repaint();
}


  • kjllmeplz
  • [*]
WSH Panel Mod script discussion/help
Reply #2014
so fast
thanks u very much
  • Last Edit: 25 January, 2013, 02:22:31 PM by kjllmeplz

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2015
is it possible to make wsh see the difference between a quick double click and a single click?


i don't think so. perhaps you should make a pause button rather than have the whole panel respond to a single click.

  • nikolai4ik
  • [*][*][*]
WSH Panel Mod script discussion/help
Reply #2016
is it possible to make wsh see the difference between a quick double click and a single click?


i don't think so. perhaps you should make a pause button rather than have the whole panel respond to a single click.

I'm not a great wsh/foobar coder as you may have noticed  I've been using an old Br3tt's config curacao for four years now and constantly modify it. It has a pause button but it's very small so pausing on clicking album art is an important feature for me (which I added with your help). Does WSH recognize middle mouse clicks then? Maybe I could remap the double click to that. Anyway it's not that big of a deal, it's not like I'll be using double clicks much so it won't bother me.

  • WilB
  • [*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2017
Yes, there are several other mouse functions you could use, e.g.

function on_mouse_mbtn_down
function on_mouse_mbtn_up
function on_mouse_mbtn_dblclk
function on_mouse_rbtn_down
function on_mouse_rbtn_up
function on_mouse_rbtn_dblclk

See the callbacks doc that comes with wsh panel mod for more info.

  • nikolai4ik
  • [*][*][*]
WSH Panel Mod script discussion/help
Reply #2018
Yes, there are several other mouse functions you could use, e.g.

function on_mouse_mbtn_down
function on_mouse_mbtn_up
function on_mouse_mbtn_dblclk
function on_mouse_rbtn_down
function on_mouse_rbtn_up
function on_mouse_rbtn_dblclk

See the callbacks doc that comes with wsh panel mod for more info.

Great, thanks a lot!

  • antheo
  • [*]
WSH Panel Mod script discussion/help
Reply #2019
Hello ExtremeHunter,

- Thanks for your great script and the reel-to-reel tape rotated very smooth in CC direction (the blue arrow) but when I made it rotate in CCW direction as in the real (the red arrow) by changing this line: " angle += 10;" to " angle += -10;", the reel-to-reel tape to be shaken sometimes.



Once again, thank you so much.
  • Last Edit: 27 January, 2013, 05:24:31 AM by antheo

WSH Panel Mod script discussion/help
Reply #2020
antheo

Here's reel-to-reel example.

now you only need some tape reels with transparent holes. 

  • antheo
  • [*]
WSH Panel Mod script discussion/help
Reply #2021
antheo

Here's reel-to-reel example.

now you only need some tape reels with transparent holes. 


Wow, very quick!  I'm very excited with your script in my new CUI layout.

Thank you for your kindness and help, I'll try it right now.
  • Last Edit: 27 January, 2013, 11:14:22 PM by antheo

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2022
eXtremeHunter, your "Spinning Disc Image Viewer" only displays JPG files in path of playing track; it refuses to load other image file types.
Sometimes I want to save as GIF or PNG or BMP  or TIF images. Is there any way you can make your code accept all other image files as input?
Even nicer would be a config field in Properties where the user can add a list of file extensions to suit himself.
I tried editing your script, but I can not see any reference to a file extension (except for the default disc image).

That reel-to-reel image above is giving me further questions . . . .
Is it possible to have a picture of a turntable as the background of the "Spinning Disc Image Viewer" panel, and then overlay the spinning disc on top of it?

One more question . . . .
Is it possible to make an animated GIF image from a video clip and make it "play" in a WSH Panel ?
What is on my mind here is this idea: Shooting a video clip of vertical vinyl cover turning around the North-South axis so we get to see all facets of the cover . . . Front-Turning-Spine-Turning-Back-Turning-Spine-Turning-Front . . . we make an animated GIF from the video and it plays inside a WSH Panel Mod panel . . . . . . . . . . . . . . . . . . . . . is this possible?

Thanks +++++
  • Last Edit: 27 January, 2013, 11:56:21 PM by derty2

  • onv
  • [*][*]
WSH Panel Mod script discussion/help
Reply #2023
eXtremeHunter
now still have to add a different rotational speed for modes (play, rew, ff), two straight lines tangent to the roll with tape... 
  • Last Edit: 28 January, 2013, 04:58:32 AM by onv

WSH Panel Mod script discussion/help
Reply #2024
derty2

1. You can use wildcards to display different file types
example: foobar Preferences/Display-Album art Disc

*disc.*
*cd.*
*dvd.*

2. Yes, just add background image source and then use gr.DrawImage(background... before spinning disc and set spinning disc alpha to see through it.

3. AFAIC no. You can display only still gif images.


onv

just decrease rotationInterval value when rew/ff