Skip to main content

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

0 Members and 1 Guest are viewing this topic.
  • PeteG
  • [*][*]
WSH Panel Mod script discussion/help
Reply #2300
^i now use the $crc32 title formatting function on the path. hopefully that will resolve it.

Yes, problem solved!
Very nice with the enhanced right click possibilities and that parametric changes are reflected immediately. Thanks a lot.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2301
marc2003

I'm trying to tweak your "WSH Vinyl Turntable" script a little more . . .

I want to add a right-click context menu item named "View with external viewer" (i.e. opens with system default image viewer).
Could you give me a few quick code lines I can add to the script please.

_____________________________________________________________________________________________


QUICK TIP to anybody else using this panel . . .
I added a really cool enhancement to the interface:

          Mouse Left Click  Down on spinning disc pauses playback / Mouse Left Click Up continues playback
          . . . giving the effect of putting your finger on the turntable platter, stopping it from spinning.

Add these lines to the script configuration:
Code: [Select]
function on_mouse_lbtn_down(x, y) {
    fb.Pause();
}
function on_mouse_lbtn_up(x, y) {
    fb.Play();
}

The code above replaces the original lines added by marc2003 (these original lines by marc2003 didn't do anything useful!! ...as far as I can tell):
Code: [Select]
function on_mouse_lbtn_up(x, y) {
    if (trace(x, y)) fb.PlayOrPause();
}


_____________________________________________________________________________________________

ANOTHER INTERESTING EFFECT POSSIBILITY . . .

          Mouse-left-click-down-and-moving in the disc area changes playback tempo/speed, giving the effect of interactivity
          . . . analogous to playing the record by spinning it with your finger
          . . . no mouse movement = no sound | movement = sound | faster movement = sound+faster tempo | slower movement = sound+slower tempo
          . . . if you could move (spin) the disc at default display speed then you would get exact playback speed !!!

What do you think marc ?
  • Last Edit: 27 April, 2013, 10:12:45 AM by derty2

WSH Panel Mod script discussion/help
Reply #2302
I just dropped by to say that my WSH playlist is released here with my new theme.

If you find some bugs please let me know!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2303
(these original lines by marc2003 didn't do anything useful!! ...as far as I can tell):


it was only code to make the start/stop button work on the image. 

i should have documented that..... oh wait, i did. it's the first line of the notes at the top of the script.

i think it's more practical than sitting there holding down your mouse button to pause playback. but whatever works best for you....

@ExtremeHunter, nice. i'll definitely be checking that out later.
  • Last Edit: 27 April, 2013, 10:06:17 AM by marc2003

WSH Panel Mod script discussion/help
Reply #2304
marc2003

throw it, kick it, shake it, smash it,  I'm sure there are some bugs lurking in the dark corners.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2305
> marc2003: "it was only code to make the start/stop button work on the image."

So, leaving your lines enabled AND including my lines is the right approach for my case, yes?

    *EDIT*
    disregard that question . . . the answer is obviously a choice: "mine or yours" .
    But I must say, enabling/disabling your lines had no effect on whether the start/stop buttons work on the image ...unless I am misunderstanding your description of this.

Could you pass me a few lines to add for the context menu item please.
  • Last Edit: 27 April, 2013, 10:49:29 AM by derty2

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2306
@ExtremeHunter, really liking the playlist. i could never, ever make something like that. i'm far too stupid.

only one bug found so far. when you click an item that isn't selected, moving your mouse up/down should select tracks above/below. but your script starts moving it straight away. other playlists only do that when the item you've clicked on is already selected.

Quote
But I must say, enabling/disabling your lines had no effect on whether the start/stop buttons work on the image ...unless I am misunderstanding your description of this.


my original script works. perhaps you didn't undo your modifications properly? fb.PlayOrPause() is self explanatory really.

if playback is stopped, it plays.
if playback is um... playing, it pauses.
if playback is paused, it plays.

the image stops/starts spinning accordingly.

and of course you can have the panel do different things on mouse clicks. it not a case of either/or. that would be stupid. you just have to track where the mouse is clicked which is what i do to detect it's over the button.

open image feature added here: https://dl.dropboxusercontent.com/u/2280132...h/turntable.txt
turntable image: https://dl.dropboxusercontent.com/u/2280132...h/turntable.jpg
  • Last Edit: 27 April, 2013, 12:14:08 PM by marc2003

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2307
       > marc2003: "..i could never, ever make something like that. i'm far too stupid.."

No fucking way in the world i can believe that marc. To me you are a JS guru (with different motivations to the other gurus).

Honest question: if your life depended on making something like that, what chance do you give yourself of making it?

________________________

       > if playback is stopped, it plays.
       > if playback is playing, it pauses.
       > if playback is paused, it plays.

Got it . . . I see what your code does. I think I'll stick to my edit, but I might add a descriptive note next to your (disabled) code in the script.

Thanks again for your help marc ++++++++
  • Last Edit: 27 April, 2013, 01:24:09 PM by derty2

WSH Panel Mod script discussion/help
Reply #2308
marc2003

Glad you like it

I don't consider that as a bug, it just that this feature is not available in my Playlist, maybe I should add it in the future.

He he and who is stupid here?

One day I looked your biography script and thought how hard can it be to make my self a nice bio panel,
but huh ... that web stuff is not for my poor brain.
  • Last Edit: 27 April, 2013, 01:32:10 PM by ExtremeHunter

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2309
it just that this feature is not available in my Playlist


ha, ok then.

i find the web stuff easy because you can always google for help.

i must admit my major flaw is that i give up too easily when i get stuck. i did start a playlist sometime ago but gave up after awhile. i just didn't have the patience.

WSH Panel Mod script discussion/help
Reply #2310
EDIT: Wow, I figured it out by accident: 

Renaming on_timer to on_timer1 fixed it!


ORIGINAL post:

I made a seekbar/progressbar based on Marc2003's but it seems to update in real-time, instead of every 1 second, which looks ugly. Other WSH scripts around seem to have the same issue.

Does anyone have a solution to this?
Code: [Select]
// ==PREPROCESSOR==
// @name "Simple Seekbar"
// @author "marc2003"
// ==/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_drag = 0;
var g_drag_seek = 0;
var g_timer = window.CreateTimerInterval(1000);
var g_font = gdi.Font("Tahoma", 12, 0);


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

function on_paint(gr) {
  
   var x;   
   gr.DrawRect(4, 3, ww-7, wh-7, 1,RGB(72,66,58)); //BACKGROUND RECTANGLE
   if (fb.IsPlaying && fb.PlaybackLength > 0) {

if (g_drag) //WHEN DRAGGING SEEKBAR
           {
t = fb.PlaybackLength * g_drag_seek;
h = Math.floor(t / 3600);
m = Math.floor((t -= h * 3600) / 60);
s = Math.floor(t -= m * 60);
pos = ww * g_drag_seek;
//text = (h > 0 ? h + ":" + (m < 10 ? "0" + m : m) : m) + ":" + (s < 10 ? "0" + s : s);

           // prevent slider from being obscured by borders
               if (pos<5) {x=5;}
               else if (ww-pos<5) {x=ww-5;}
               else {x=pos;}       
                        
                    
             gr.FillGradRect(1, 1, pos-2, wh-2, 90, RGBA(112,106,98,255), RGBA(82,76,68,255)); //PROGRESS RECTANGLE
           gr.FillGradRect(x-(wh/2), 1, wh-2,  wh-2, 90, RGB(161,115,74), RGB(121,75,34)); //SLIDER
          
          
          
}
       else { //NORMAL PASSIVE DISPLAY
      
pos = ww * (fb.PlaybackTime / fb.PlaybackLength);
            
             // prevent slider from being obscured by borders
               if (pos<5) {x=5;}
               else if (ww-pos<5) {x=ww-5;}
               else {x=pos;}       
                        
          
                      
           //GRAY SEEKBAR RGB(185,145,40), RGB(125,85,0)
          
           gr.FillGradRect(1, 1, pos-2, wh-2, 90, RGBA(112,106,98,255), RGBA(82,76,68,255)); //PROGRESS RECTANGLE
           gr.FillGradRect(x-(wh/2), 1, wh-2,  wh-2, 90, RGB(161,115,74), RGB(121,75,34)); //SLIDER
          
          
           }
 
     }


}

function on_timer(g_timer) {
if (!fb.IsPlaying || fb.IsPaused) return;
window.Repaint();
}

function on_playback_seek(time) {
window.Repaint();
}

function on_playback_stop() {
window.Repaint();
}

function on_mouse_wheel(delta) {
fb.PlaybackTime = fb.PlaybackTime + delta;
}

function on_mouse_move(x, y) {
g_drag_seek = x < 0 ? 0 : x > ww ? 1 : x / ww;
if (y > wh) g_drag = 0;
if (g_drag) window.Repaint();
}

function on_mouse_lbtn_down(x, y) {
if (fb.IsPlaying && fb.PlaybackLength > 0) g_drag = 1;
}

function on_mouse_lbtn_up(x, y) {
if (!g_drag) return;
g_drag = 0;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
  • Last Edit: 28 April, 2013, 08:49:52 AM by Lucky Luciano

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2311
^that post is complete and utter gibberish. 

my script updates every 150ms which makes the seekbar movement look smooth(-ish). you actually want it to update just once a second? that looks like crap to me.
secondly, you've already edited the timer to 1000ms (1 second) which is what you want so i have no idea why you posted in the first place
lastly, by renaming that function so it doesn't run, the seekbar won't ever update during playback. :/

also, that is based on a very old script using obsolete functions. you'll see this message in your foobar2000 console...

Code: [Select]
WSH Panel Mod: Warning: Obsolete: window.CreateTimerInterval() is now obsolete, please use window.SetInterval() in new script.


WSH Panel Mod script discussion/help
Reply #2312
^that post is complete and utter gibberish. 

my script updates every 150ms which makes the seekbar movement look smooth(-ish). you actually want it to update just once a second? that looks like crap to me.
secondly, you've already edited the timer to 1000ms (1 second) which is what you want so i have no idea why you posted in the first place
lastly, by renaming that function so it doesn't run, the seekbar won't ever update during playback. :/

also, that is based on a very old script using obsolete functions. you'll see this message in your foobar2000 console...

Code: [Select]
WSH Panel Mod: Warning: Obsolete: window.CreateTimerInterval() is now obsolete, please use window.SetInterval() in new script.

-I did use SetInterval() subsequently which didn't change anything.
-The function needs to be renamed everywhere it appears, of course.
-Real-time updating maybe appears ugly only on old PCs(mine has an AthlonXP)


Code: [Select]
// ==PREPROCESSOR==
// @name "Simple Seekbar"
// @author "marc2003"
// ==/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_drag = 0;
var g_drag_seek = 0;



var g_timer = window.SetInterval(on_timer1,1000);
var g_font = gdi.Font("Tahoma", 12, 0);


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

function on_paint(gr) {
  
   var x;   
   gr.DrawRect(4, 5, ww-8, wh-10, 1,RGB(140,130,105)); //BACKGROUND RECTANGLE
   if (fb.IsPlaying && fb.PlaybackLength > 0) {

if (g_drag) //WHEN DRAGGING SEEKBAR
           {
t = fb.PlaybackLength * g_drag_seek;
h = Math.floor(t / 3600);
m = Math.floor((t -= h * 3600) / 60);
s = Math.floor(t -= m * 60);
pos = ww * g_drag_seek;
//text = (h > 0 ? h + ":" + (m < 10 ? "0" + m : m) : m) + ":" + (s < 10 ? "0" + s : s);

           // prevent slider from being obscured by borders
               if (pos<5) {x=5;}
               else if (ww-pos<5) {x=ww-5;}
               else {x=pos;}       
                        
                  
           gr.FillGradRect(1, 8, pos-2, wh-8, 90, RGBA(95,94,94,255), RGBA(55,55,55,255)); //PROGRESS RECTANGLE
           gr.FillGradRect(x-(wh/2), 1, wh-2,  wh-2, 90, RGB(181,135,94), RGB(121,75,34)); //SLIDER
          
          
          
}
       else { //NORMAL PASSIVE DISPLAY
      
pos = ww * (fb.PlaybackTime / fb.PlaybackLength);
            
             // prevent slider from being obscured by borders
               if (pos<5) {x=5;}
               else if (ww-pos<5) {x=ww-5;}
               else {x=pos;}       
                      
           //GRAY SEEKBAR
          
           gr.FillGradRect(3, 3, pos-2, wh-6, 90, RGBA(95,94,94,255), RGBA(55,55,55,255)); //PROGRESS RECTANGLE
           gr.FillGradRect(x-(wh/2), 1, wh-2,  wh-2, 90, RGB(181,135,94), RGB(121,75,34)); //SLIDER
           }
 
     }


}


function on_playback_seek(time) {
window.Repaint();
}

function on_playback_stop() {
window.Repaint();
}

function on_mouse_wheel(delta) {
fb.PlaybackTime = fb.PlaybackTime + delta;
}

function on_mouse_move(x, y) {
g_drag_seek = x < 0 ? 0 : x > ww ? 1 : x / ww;
if (y > wh) g_drag = 0;
if (g_drag) window.Repaint();
}

function on_mouse_lbtn_down(x, y) {
if (fb.IsPlaying && fb.PlaybackLength > 0) g_drag = 1;
}

function on_timer1(g_timer) {
if (!fb.IsPlaying || fb.IsPaused) return;
window.Repaint();
}

function on_mouse_lbtn_up(x, y) {
if (!g_drag) return;
g_drag = 0;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2313
now that you're using window.SetInterval, i see why you had to rename your function. it conflicts with the built in on_timer callback.

i still don't get why you posted originally. using the old timer functions with the interval of 1000ms would have done what you wanted.

anyway, so long as what you have is working now.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2314
Lucky Luciano

Try out this Seekbar config in a WSH panel and see what it does for you (edit it if you like) . . .
Code: [Select]
// ================================================================
// Script for foobar2000 component "WSH Panel Mod"
// Description........: Horizontal seekbar with 1-second refresh intervals, time display, and mouse hover effects: tooltips and glowing panel edges
// Author.............: Maxim Terpilovsky  (http://terpilovsky.ru)
//
// this edition modified by derty2
// ================================================================

var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_SINGLELINE = 0x00000020;
var DT_CALCRECT = 0x00000400;

function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }    //---orig--->  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);
}
//----------------------------------------------------------------------------




// gdi.Font is changed, the last paramter is style flags
// FontStyleRegular = 0,
// FontStyleBold = 1,
// FontStyleItalic = 2,
// FontStyleBoldItalic = 3,
// FontStyleUnderline = 4,
// FontStyleStrikeout = 8
// Here we are using 0, meaning FontStyleRegular
if ( utils.CheckFont( "Verdana" ) ) {          //---orig--->    if ( utils.CheckFont( "Segoe UI" ) ) {
var g_font = gdi.Font("Verdana", 11, 2);        //---orig--->    var g_font = gdi.Font("Segoe UI", 11);
} else {
var g_font = gdi.Font("Tahoma", 12);
}




var g_titlefmt = fb.TitleFormat("%playback_time% / %length%");        //--orig-->  //var g_titlefmt = fb.TitleFormat("$if(%ispaused%,Paused  '//'  ,)[%artist% - %title%  ]%playback_time% / %length%");
var g_fileinfo = null;

//---------------------------- COLOR SCHEMES FOR TIME ELAPSED BAR
//var g_colors = new Array(RGB(0,120,0), RGB(0,110,0), RGB(0,75,0), RGB(0,65,0));
//var g_colors = new Array(RGB(105,125,160), RGB(85,105,160), RGB(46,48,63), RGB(46,48,63));
//var g_colors = new Array(RGB(64,54,39), RGB(162,98,10), RGB(88,70,44), RGB(88,70,44));
//var g_colors = new Array(RGB(6,53,46), RGB(34,28,0), RGB(0,120,30), RGB(100,162,95));
//var g_colors = new Array(RGB(0,50,0), RGB(120,10,90), RGB(40,0,40), RGB(46,48,63));
var g_colors = new Array(RGB(0,0,0), RGB(0,0,0), RGB(0,0,0), RGB(46,48,63));

var g_drag = 0;
var g_drag_seek = 0;
var g_hover_seek;
var g_hover;
var g_clicked = 0;







//------------------------------------------------------------------ function on_paint(gr)  START

function on_paint(gr){

var ww = window.Width;
var wh = window.Height;
var spos = 0;
var length = fb.PlaybackLength;
var stxt;

  gr.SetSmoothingMode(2);

   if(length <= 0) { stxt = "0:00 / 0:00"; }

if(length > 0) {
        
if ( g_drag && g_drag_seek ) {
spos = window.Width * g_drag_seek;
stxt = "Seek " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
else if ( g_drag ) {
spos = window.Width;
stxt = "Seek " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
   spos = window.Width * (fb.PlaybackTime / length);
   stxt = g_titlefmt.Eval();
      
  }

else if ( fb.PlaybackTime ) { stxt = "Streaming..."; }



gr.FillSolidRect(0, 80, ww-20, wh+20, RGB(0,0,0));      //---orig--->    gr.FillSolidRect(0, 0, ww, wh, RGB(120,120,120));
  
gr.FillGradRect( 0, 0, spos, wh, 10, g_colors[2], g_colors[1], g_colors[1]);      //---orig--->    gr.FillGradRect( 0, 0, spos, wh, 90, g_colors[0], g_colors[2]);

   //--- fills unused space with color:
   // gr.FillGradRect( spos, 0, ww-spos, wh, 90, RGB(100,100,100), RGB(140,140,140));  <<<<<<<<<<<< original
   // gr.FillGradRect( spos, 0, ww-spos, wh, 0, RGB(64,70,85), RGB(80,70,85));        <<<<<<<<<<<< previous = mid-grey
   gr.FillGradRect( spos, 0, ww-spos, wh, -90, RGB(20,20,20), RGB(40,40,40));

gr.GdiDrawText(stxt, g_font, RGB(214,147,95), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);      //--orig:  gr.GdiDrawText(stxt, g_font, RGB(255,255,255), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);

gr.DrawRect( ww-1, 0, 0, wh, 1.0, RGB(0,0,0));
  
   //--- draws thin border
   // gr.DrawRect(-1,0, ww+1, wh-1, 1.0, RGB(150,150,150));  <<<<<<<<<<<< original
// gr.DrawRect(0, 0, ww-1, wh-1, 1.0, RGB(116,90,90));    <<<<<<<<<<<< my previous = orange-grey
   // gr.DrawRect(0, 0, ww-1, wh-1, 1.0, RGB(64,77,85));      <<<<<<<<<<<< previous
   gr.DrawRect(0, 0, ww-1, wh-1, 1.0, RGB(64,120,85));      //<<<<<<<<<<<< Green
  
  
  
   if ( g_clicked ) {
       gr.DrawRoundRect(0, 0, ww-1, wh-1, 1, 1, 1, RGBA(70,240,60,200));      //---orig--->  gr.DrawRoundRect(0, 0, ww-1, wh-1, 4, 4, 1, RGBA(255,255,255,200));
   }
   else if ( g_hover ) {
       //--- displays a thin border frame when mouse hovers over the panel:
       //    gr.DrawRoundRect(0, 0, ww-1, wh-1, 4, 4, 1, RGBA(255,255,255,100));  <<<<<<<<<<<<<<< Original
       //    gr.DrawRoundRect(0, 0, ww-1, wh-1, 1, 1, 1, RGBA(207,121,5,200));    <<<<<<<<<<<<<<< My previous choice = orange, thin
       //    gr.DrawRoundRect(0, 0, ww-1, wh-1, 1, 1, 1, RGBA(20,20,20,20));      <<<<<<<<<<<<<<< My previous choice = black-grey
       gr.DrawRoundRect(0, 0, ww-1, wh-1, 1, 1, 1, RGBA(117,231,172,120)); 
   }



if ( g_hover_seek ) {
var text_w = gr.CalcTextWidth(g_hover_seek, g_font) + 5;
if ( (g_hover + text_w) > ww) g_hover -= text_w + 4;
gr.FillSolidRect(g_hover - 2, 3, text_w + 2, wh-6, RGB(0,0,150));
gr.GdiDrawText(g_hover_seek, g_font, RGB(255,255,255), g_hover, 4, text_w, wh-8, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_CALCRECT);
}
  
}
//------------------------------------------------------------------ function on_paint(gr)  END





function on_mouse_lbtn_down(x,y){

g_drag = 1;
   g_clicked = 1;
   g_hover = 0;

on_mouse_move(x,y);
}





function on_mouse_lbtn_up(x,y){
if( g_drag ) {
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
   g_clicked = 0;
}







function on_mouse_move(x,y) {
window.SetCursor(32649);

if(g_drag) {
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
}

   g_hover_seek = null;
  
  if ( x <= window.Width && fb.PlaybackLength > 0) {
g_hover_seek = x / (window.Width);
g_hover_seek = (g_hover_seek<0) ? 0 : (g_hover_seek<1) ? g_hover_seek : 1;
g_hover_seek = TimeFmt(g_hover_seek * fb.PlaybackLength);
  }
 
   else { g_hover_seek = null; }
  
g_hover = x + 4;
window.Repaint();
}







function on_mouse_leave() {
g_hover_seek = null;
   g_hover = null;
   g_clicked = 0;
window.SetCursor(32512);
window.Repaint();
}




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




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){
window.Repaint();
}




function on_playback_time(time){
window.Repaint();
}




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

//EOF
  • Last Edit: 28 April, 2013, 11:24:36 AM by derty2

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2315
Hi,

Here my new Playlist Viewer script, i hope you'll give it a try and report me any bugs you may found. Thanks

http://fav.me/d63owft

preview of the rendering into a WSH Panel Mod panel:

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2316
^nice. i'll be giving that a test later. 

just a little bugfix for my spectrogram seekbar

https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

Code: [Select]
7.2013.05.01.02

"Spectrogram seekbar". Fix marker not showing on
very short tracks.


right click>Update script to fix.

full download here: https://dl.dropboxusercontent.com/u/22801321/samples.zip

files changed:
Code: [Select]
marc2003\common7.js

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2317
@falstaff, first of all, that is some seriously impressive stuff making customisable/drag-able columns. i'll definitely be using this as it's so easy to customise.

a few things:

drag/drop doesn't appear to work. tried from album list/esplaylist.
some useless (to me) stuff is written to the console eg init groups delay = 1 /handleList count=37
using ctrl+click doesn't de-select group headers. i think it should.
could the title headers align to match the contents? (such as time being right aligned)
could you move the edit column option so it's not under the columns submenu. <<i understand if you don't want to do this one as it's your choice.
  • Last Edit: 01 May, 2013, 07:50:01 AM by marc2003

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2318
thanx for this reporting marc

drag/drop doesn't appear to work. tried from album list/esplaylist.

you are trying to drag external items to the playlist viewer ? ok i'll check
(opposit isn't possible due to WSH panel mod limitation or it can be mimics to another WSH panel mod)

some useless (to me) stuff is written to the console eg init groups delay = 1 /handleList count=37

well see, i'll remove that trace

using ctrl+click doesn't de-select group headers. i think it should.

my behaviour choice, but i may reconsider it... will see

could the title headers align to match the contents? (such as time being right aligned)

i saw it just before posting, it will be done in next release

could you move the edit column option so it's not under the columns submenu. <<i understand if you don't want to do this one as it's your choice.

it makes sense, i will.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2319
WSH Playlist Viewers everywhere!
Excellent work Falstaff, congratulations ++++++

Having said that . . .

I wish somebody would script the WSH equivalent of the CUI Library Filters columns.

That would be super useful, especially for DUI users,
foobar2000 out-of-the-box does not have this library viewing functionality; the only way to have this is to use the "foo_facets (Facets)" component. However, there are numerous "features" built into Facets which can not be disabled to allow a simple layout of Filter columns ONLY. i.e., if you choose to use Facets, then you must have the kitchen sink!, you cannot completely detach the Filters functionality from the rest of the components other features.

An interesting advantage to making a Library Filter Columns panel using WSH Panel Mod,
is the fact that this is one of the few ways you can bypass the limitations of color usage when using the Default User Interface. i.e., you can program panels for DUI using color functions ("$RGB(x,y,z)") and emulate panels from CUI.

Summing up,
I believe a WSH panel containing customizable columns of Library Filters would be a superb JS scripting project for the benefit of ALL foobar2000 users. It would help build a bridge for current CUI users who want to eventually migrate to DUI . . . especially given the fact that CUI is now classed as "Seemingly Abandonware" and the developer ("musicmusic") has not set foot at HydrogenAudio since 2011 !!!!!!!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2320
not possible because there are no library functions in WSH panel mod.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2321
That's great! So one can program Playlist Viewers even NASA programmers would be proud of . . . but trying to create a bunch of simple Library Filter columns is not possible!!!!!!

So what is the solution, how can this limitation be overcome?

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2322
if it's so simple, you can always write a native foobar component using the SDK here: http://www.foobar2000.org/SDK

or if you want to extend WSH panel mod to include this functionality, the source code is here: http://code.google.com/p/foo-wsh-panel-mod/source/checkout

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2323
WSH playlist Viewer updated!

http://fav.me/d63owft

[Change Log]
* v0.0.2 (2013-05-01 15:05 GMT+1):
- toolbar headers now are following column text alignment
- column name "N°" changed to "#" because of some problem with asian code pages ...
- Right click context menu on toolbar Header => Edit Column moved to top of the menu, no more in "Columns" submenu
- drag'n drop in this panel => support added
- some useless traces still wrote to the console removed!
[Change Log]

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2324
Putting my "faux-developer" cap on for a moment . . .

So I have a choice between
(1) programming a C++ component from scratch
(2) updating a current C++ component whose source code is freely available.

If I was to do this, then
if I choose (1), then I can not bypass the limited DUI color usage options, therefore the advantages are minimal when compared to Facets (foo_facets_.
if I choose (2), then we open up a new world of exploration for DUI users and programmers, and can bypass foobar2000 built-in limitations, and help bridge the gap between "DUI" and "[Seemingly Abandonware] CUI"

I would choose (2).