Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Xchange v3 (Read 337548 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Xchange v3

Reply #825
Had a similar issue just reloaded the FCL file again and it sorted it.

Xchange v3

Reply #826
Xchange 3.5 improved a lot! Thanks for your hard work!
But I found some misalignment of text in art mode.
No one seems to mentioned it yet (is it just me?).
Link to picture


Xchange v3

Reply #828


Init Scripting Engine Failed (HWND: 0xa066e, CODE: 0x8000ffff): Error catastrófico

I'm using the last version of Xchange & foobar. And I installed all the components, plugins & Fonts.



I am getting the same problem (in english of course) using win 7 7100 evaluation 64 bit; any6 ideas? version 3 works fine by the way1 Oh and thanks for a superb mod

Xchange v3

Reply #829
I recieved the same error as the above poster. I run a m1330 with Windows Seven x64 RC 7100. On startup I do not get my cd covers on the playlist. When I click on the other tabs everything goes pink or green. I have used other themes by Br3tt this one is just more difficult. Currently I am running Ibiza until I can get xchange to work. Any help thanks!
If you need me to post a pic let me know! Any help is greatly appreciated.

Xchange v3

Reply #830
it's a WSH panel failed, post your problem in the WSH panel Mod thread if you expect a solution, i can't nothing for you. it looks that it concerns X64 Seven users ...

Xchange v3

Reply #831
My problem (missing font) above is solved. Thanks.

Just curious here, you intending to releasing 3.5.2 next? or Xchange 4.0.0!?


Xchange v3

Reply #833
I've just upgraded from v2.0 to v.3.5.1 and to my surprise some component introduced (or upgraded) in this version keeps my CPU at around 25-50% load even when foobar2000 itself is idle. Any ideas which one may be the culprit?

Xchange v3

Reply #834
it's abnormal. CPU % with v3.5.1 on my config (E6850 C2D) is around 4 or 5 %.

remove components by components to find which is in cause.

Xchange v3

Reply #835
i have problem when i instaled this Xchange skin, the problem is like this:


this is my console:
Code: [Select]
Ln: 19, Col: 3
<no source text available>
WSH Panel Mod (HWND: 0xa0604): initliased in 0.0000069 s
Error: WSH Panel Mod (HWND: 0x001005ca): Microsoft JScript runtime error:
Invalid procedure call or argument
Ln: 60, Col: 1
<no source text available>
Filter 0 msec
Group 0 msec
Populate 0 msec
Times: a0 - a1: 0msec
Times: a1 - a2: 0msec
Times: a2 - a3: 0msec
Times: a3 - a4: 0msec
Times: a4 - a5: 0msec
Synch: 0 msec (in mainthread!)


can someone help me to fix it???

Xchange v3

Reply #836
i have problem when i instaled this Xchange skin, the problem is like this:


this is my console:
Code: [Select]
Ln: 19, Col: 3
<no source text available>
WSH Panel Mod (HWND: 0xa0604): initliased in 0.0000069 s
Error: WSH Panel Mod (HWND: 0x001005ca): Microsoft JScript runtime error:
Invalid procedure call or argument
Ln: 60, Col: 1
<no source text available>
Filter 0 msec
Group 0 msec
Populate 0 msec
Times: a0 - a1: 0msec
Times: a1 - a2: 0msec
Times: a2 - a3: 0msec
Times: a3 - a4: 0msec
Times: a4 - a5: 0msec
Synch: 0 msec (in mainthread!)


can someone help me to fix it???


try the new WSH Panel Mod i think its v1.1.9 & see otherwise you have to wait till next version of xchange. thank you...

Xchange v3

Reply #837
i'm already use WSH Panel Mod v1.1.10 beta 9 but it still SCRIPT ERROR

Xchange v3

Reply #838
it's abnormal. CPU % with v3.5.1 on my config (E6850 C2D) is around 4 or 5 %.

remove components by components to find which is in cause.

I've tracked it down to foo_vis_shpeck/milkdrop. Changing the mesh size setting helped to bring CPU usage down. However, it became clear to me that shpeck is running no matter whether its panel is displayed or no. Is there a way of making it start only when its panel is displayed and stop when it is closed? I gather this is not quite a Xchange question, but you may happen to know the answer anyway.

Xchange v3

Reply #839
First of all great work, got this running in a few minutes, and first time I'm using a theme!

Have a couple of problems.

How do make the chronflow background transparent, as at the moment, I have a white background with my album covers.

Also, is it possible to move out of the 'edit' mode, as in, remove the various buttons on each panel for editing?

Thanks

Xchange v3

Reply #840
I've tracked it down to foo_vis_shpeck/milkdrop. Changing the mesh size setting helped to bring CPU usage down. However, it became clear to me that shpeck is running no matter whether its panel is displayed or no. Is there a way of making it start only when its panel is displayed and stop when it is closed? I gather this is not quite a Xchange question, but you may happen to know the answer anyway.


display shpeck context menu with a right click on the X button as shown below





@Audacity:

read first post (red parts!)

1) go to chronflow settings to change background colour (no transparency support for this panel)
2) Editor button

Xchange v3

Reply #841
Hi,

I just installed everything, and it works like charm, nice too, thanks for this.
But, this is the only issue I have, see the image below. How do I fix that font issue?



Edit: I do have the fonts installed in windows/fonts, I believe this is correct?

Xchange v3

Reply #842
Search this topic, I believe Fallstaff has answered this question already 3 times.


Xchange v3

Reply #844
I didn't find it here, but will read the manual.
Sorry, I'm always in such a hurry with things. Thanks.

Xchange v3

Reply #845
@Audacity:

read first post (red parts!)

1) go to chronflow settings to change background colour (no transparency support for this panel)
2) Editor button



Yes, I know, but had to use this. Loving, though I'm getting used to the functionality

Last question, how do I rate the songs? Click on the rating stars, but nothing happens. Sorry for stupid question.


Xchange v3

Reply #847
I tried to play my recommended last.fm station with Xchange but got an error in the seekbar (something like "File not exists" in Line 728, col 2).

Xchange v3

Reply #848
I tried to play my recommended last.fm station with Xchange but got an error in the seekbar (something like "File not exists" in Line 728, col 2).

since last.fm radios are no more free for french users, i can't test it.

could you try this fcl, and tell me if it fix the problem with last.fm radios please ?

or just replace the seekbar jscript with this one:

Code: [Select]
var bt_dir = fb.FoobarPath+"\\skins\\xchange\\bt\\";
var bg_dir = fb.FoobarPath+"\\skins\\xchange\\bg\\";
var moodbar_dir = fb.FoobarPath+"\\moodbar\\";

var track_path = fb.TitleFormat("$replace(%path%,%filename_ext%,)");
var track_fullpath = fb.TitleFormat("%path%");
var track_filename = fb.TitleFormat("%filename%");
var track_filename_ext = fb.TitleFormat("%filename_ext%");
var track_ext = fb.TitleFormat("$ext(%filename_ext%)");
var char_quote = fb.TitleFormat("$char(34)");
var is_archive = fb.TitleFormat("$add($strstr(%path%,'.zip|'),$strstr(%path%,'.rar|'))");

var s_track_path;
var s_track_fullpath;
var s_track_filename;
var s_track_filename_ext;
var archive;

var moodbar_fullpath;
var s_moodbar_fullpath;
var moodbar_filename;
var s_moodbar_filename;

var trk_filename;
var trk_fullpath;
var trk_ext;
var s_trk_fullpath;

var definitive_moodbar_fullpath;

var bool_movefile=1;


//Text formatting function
function StringFormat() {
var h_align = 0, v_align = 0, trimming = 0, flags = 0;
switch (arguments.length)
{
// fall-thru
case 4:
flags = arguments[3];
case 3:
trimming = arguments[2];
case 2:
v_align = arguments[1];
case 1:
h_align = arguments[0];
break;
default:
return 0;
}
return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
}

//Time formatting 00:00:00
function Format_hms(t){
var hms;
switch (t.length)
{
case 4:
hms="00:0"+t;
break;
case 5:
hms="00:"+t;
break;
case 7:
hms="0"+t;
break;
default:
hms=t;
break;
}
return hms;
}

//Time formatting secondes -> 0:00
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);
}

StringAlignment = {Near: 0,Centre: 1,Far: 2};

var font = gdi.Font("tahoma", 9, 0);
var l_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Centre);
var c_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Centre);
var r_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Centre);

//=====================================================================================// OBJECT button
button = function () {
this._attrb = {};

this.create = function (path_normal, path_hover, path_down) {
this._attrb.normal = gdi.Image(path_normal);
this._attrb.hover = gdi.Image(path_hover);
this._attrb.down= gdi.Image(path_down);
if (typeof this._attrb.x == "undefined") this._attrb.x= 0;
if (typeof this._attrb.y == "undefined") this._attrb.y= 0;
this._attrb.w = this._attrb.normal.Width;
this._attrb.h= this._attrb.normal.Height;
if (typeof this._attrb.state == "undefined") this._attrb.state=0;
}

this.draw = function (gr, bx, by, alpha) {
var image;
this._attrb.x = bx;
this._attrb.y = by;
switch(this._attrb.state)
{
case 0:
image = this._attrb.normal;
break;
case 1:
image = this._attrb.hover;
break;
case 2:
image = this._attrb.down;
break;
}
gr.DrawImage(image, bx, by, this._attrb.w, this._attrb.h, 0, 0, this._attrb.w, this._attrb.h, 0, alpha);
}

this.checkstate = function (action, x, y) {
  switch(action)
  {
    case "down":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
        this._attrb.state=2;
window.Repaint();
      } else if (this._attrb.state==2){
        this._attrb.state=0;     
        window.Repaint();
      }
      break;
    case "move":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
        this._attrb.state=1;
window.Repaint();
      } else if (this._attrb.state==1){
        this._attrb.state=0;
        window.Repaint();   
      }
      break;
    case "up":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
this._attrb.state=1;
      } else {
this._attrb.state=0;
      }
      break;
  }
  return this._attrb.state;
}
}
//=====================================================================================// OBJECT button
var mood_bt = new button;
var ButtonStates = {normal: 0,hover: 1,down: 2};

//=====================================================================================// Image Cache
image_cache = function () {
this._cachelist = {};
this.hit = function (path) {
var v = this._cachelist[path];
if (typeof v == "undefined") {
v = gdi.Image(path);
this._cachelist[path] = v;
}
return v;
}
}
//=====================================================================================// Image Cache
var g_image_cache = new image_cache;

var g_drag = 0;
var g_drag_seek = 0;
var g_drag_hov = 0;

var mA_hov = 0;
var mB_hov = 0;

// images
var hov_bg = gdi.Image(bg_dir+"hov_bg.png");
var seeker0 = gdi.Image(bt_dir+"scrollpos04.png");
var seeker1 = gdi.Image(bt_dir+"scrollpos03.png");
var seeker2 = gdi.Image(bt_dir+"scrollpos05.png");
var mark_A_on = gdi.Image(bt_dir+"mark_a.png");
var mark_B_on = gdi.Image(bt_dir+"mark_b.png");
var mark_A_off = gdi.Image(bt_dir+"mark_a0.png");
var mark_B_off = gdi.Image(bt_dir+"mark_b0.png");
var moodbar_img;

var ww = window.Width;
var wh = window.Height;

//Titleformatting
var len = fb.Titleformat("%length%");
var elap = fb.TitleFormat("%playback_time%");
var remain = fb.TitleFormat("%playback_time_remaining%");
var len_seconds = fb.Titleformat("%length_seconds%");

var pos = 0;
var seekpad = 0;
//var seekerwidth = 9/2;
var seekerwidth = 4;
var seekstart_bg = 65;
var seekend_bg = 60;
var seekstart = 62;
var seekend = 57;

var g_timer;
var g_metadb;

var lbtn_click=false;

var refresh_timer=50;
var hov_x;
var pad_y=15;

var mA_drag = 0;
var mA_drag_seek = 0;
var mA_drag_hov = 0;
var mB_drag = 0;
var mB_drag_seek = 1;
var mB_drag_hov = 0;
var marks_xmin;
var marks_xmax;
var mark_A_x=seekstart-10+seekerwidth;
var mark_B_x=window.Width-seekend+1-seekerwidth;
var size_changed=false;

var moodbar_bool=0;
var moodbar_enabled=0;
var moodbar_show=0;
var moodbar_radio=0;
var WshShell = new ActiveXObject("WScript.Shell");

var timer_t1=0;

// ================================================================================/ on_paint
function on_paint(gr)
{
var bg_x=0;
var bg_y=pad_y-1;
gr.SetTextRenderingHint(5);

// background
//gr.FillGradRect(0, 0, ww, wh, 90, 0xFF202040, 0x00F0F0F0);

// seebar bg
gr.SetSmoothingMode(2);
gr.DrawRoundRect(bg_x, bg_y+1, ww-(bg_x*2)-1, 10, 4, 5, 1, 0x99202020);
gr.DrawRoundRect(bg_x, bg_y, ww-(bg_x*2)-1, 10, 3, 3, 1, 0xFFFFFFFF);
gr.DrawRoundRect(bg_x, bg_y+1, ww-(bg_x*2)-1, 9, 3, 3, 1, 0xCB505050);

gr.FillRoundRect(bg_x, (bg_y), ww-(bg_x*2)-01, 10, 4, 4, 0x80F0F0F0);
gr.FillGradRect(bg_x+1, (bg_y), ww-(bg_x*2)-02, 10, 90, 0xAFF0F0F0, 0x00F0F0F0);
gr.FillRoundRect(bg_x, (bg_y), ww-(bg_x*2)-01, 5, 2, 2, 0x88FFFFFF);

if(ww-(bg_x*2)-seekstart-seekend>10) {
gr.DrawRoundRect(bg_x+seekstart, bg_y+1, ww-(bg_x*2)-seekstart-seekend, 8, 4, 4, 1, 0xFF202020);
gr.FillRoundRect(bg_x+seekstart, (bg_y+1), ww-(bg_x*2)-seekstart-seekend, 8, 4, 4, 0xD3101015);
}
gr.SetSmoothingMode(1);

// draw moodbar if file exists (.png)
if (moodbar_bool==1 && fb.IsPlaying && moodbar_show==1) {
gr.DrawImage(g_image_cache.hit(moodbar_fullpath), seekstart_bg, pad_y+1, ww-seekstart_bg-seekend_bg, 7, 0, 0, 1024, 2, 0, 150);
}

if(fb.PlaybackLength>0)
{
gr.DrawString(Format_hms(elap.Eval()), font, 0xff666666, 16, pad_y-5, seekstart+seekpad, 18, l_stringformat);
gr.DrawString(Format_hms(elap.Eval()), font, 0xff000000, 16, pad_y-5, seekstart+seekpad, 18, l_stringformat);
gr.DrawString(Format_hms(len.Eval()), font, 0xff666666, ww-seekend-12, pad_y-5, seekend+seekpad, 18, r_stringformat);
gr.DrawString(Format_hms(len.Eval()), font, 0xff000000, ww-seekend-12, pad_y-5, seekend+seekpad, 18, r_stringformat);
} else if (fb.IsPlaying && fb.PlaybackLength) {
gr.DrawString(Format_hms(elap.Eval()), font, 0xff666666, 16, pad_y-5, seekstart+seekpad, 18, l_stringformat);
gr.DrawString(Format_hms(elap.Eval()), font, 0xff000000, 16, pad_y-5, seekstart+seekpad, 18, l_stringformat);
gr.DrawString("~STREAM", font, 0xff2040EE, ww-seekend-12, pad_y-5, seekend+seekpad, 18, r_stringformat);
gr.DrawString("~STREAM", font, 0xff2040EE, ww-seekend-12, pad_y-5, seekend+seekpad, 18, r_stringformat);
} else {
gr.DrawString("00:00:00", font, 0xff999999, 16, pad_y-5, seekstart+seekpad, 18, l_stringformat);
gr.DrawString("00:00:00", font, 0xff555555, 16, pad_y-5, seekstart+seekpad, 18, l_stringformat);
gr.DrawString("00:00:00", font, 0xff999999, ww-seekend-12, pad_y-5, seekend+seekpad, 18, r_stringformat);
gr.DrawString("00:00:00", font, 0xff555555, ww-seekend-12, pad_y-5, seekend+seekpad, 18, r_stringformat);
}

if(fb.PlaybackLength>0)
{
gr.DrawImage(mA_drag_seek==0?mark_A_off:mark_A_on, mark_A_x, pad_y-7, 10, 20, 0, 0, 10, 20, 0, mA_drag_seek==0?(mA_hov?180:080):(mA_drag?250:175));
gr.DrawImage(mB_drag_seek==1?mark_B_off:mark_B_on, mark_B_x, pad_y-7, 10, 20, 0, 0, 10, 20, 0, mB_drag_seek==1?(mB_hov?180:080):(mB_drag?250:175));
if(mA_drag_seek!=0 || mB_drag_seek!=1) {
gr.FillGradRect(mark_A_x+10, (bg_y+2), mark_B_x-mark_A_x-10, 7, 00, 0x7730FF30, 0x77FF3030);
}

if(g_drag)
{
pos = seekstart+seekpad+seekerwidth+(ww-(seekstart+seekend+2*(seekpad+seekerwidth))) * g_drag_seek;
}
else
{
pos = seekstart+seekpad+seekerwidth+(ww-(seekstart+seekend+2*(seekpad+seekerwidth))) * (fb.PlaybackTime / fb.PlaybackLength);
}

// stop at the end if track time is corrupted (
pos = pos>marks_xmax-1?marks_xmax-1:pos;

gr.DrawImage(g_drag?seeker0:fb.IsPaused?seeker2:seeker1, pos-seekerwidth-0.5, pad_y-1, 15, 15, 0, 0, 15, 15, 0, 255);

if (g_drag_hov) {
gr.DrawImage(hov_bg, hov_x-29, 0, 60, 32, 0, 0, 60, 32, 0, (lbtn_click==true)?255:255);
gr.DrawString(Format_hms(TimeFmt(fb.PlaybackLength*g_drag_seek)), font, (lbtn_click==true)?0xFFFFFFFF:0xC2FFFFFF, hov_x-22, pad_y-17, 46, 18, c_stringformat);
}

}
//For streams
else if(fb.IsPlaying && fb.PlaybackLength)
{
//seekstart = 0;
//seekend = 0;
//gr.DrawString(elap.Eval()+" / continuous", font, 0xff000000, 0, 0, window.Width, 18, c_stringformat);
} else {
gr.DrawImage(seeker0, seekstart, pad_y-1, 15, 15, 0, 0, 15, 15, 0, 255);
}

if (archive==0 && moodbar_enabled && fb.PlaybackLength>0 && (trk_ext=="flac" || trk_ext=="fla" || trk_ext=="mp3" || trk_ext=="wav")) {
mood_bt.draw(gr,3,15,255);
} else {
mood_bt.draw(gr,3,15,110);
}
}

// ================================================================================/ on_size
function on_size()
{
var trk_fn;
var pref_fn;

refresh_timer = (fb.PlaybackLength>0)?(Math.floor(len_seconds.Eval()/60)*25):50;
if (refresh_timer<16) refresh_timer=16;

if(ww!=window.Width) {
size_changed=true;
}

ww = window.Width;
wh = window.Height;

marks_xmin=seekstart-1+seekerwidth;
marks_xmax=ww-seekend+1-seekerwidth;

// disable moodbar if moodbar.exe not found
if(file_exists(moodbar_dir+"moodbar.exe")) {
moodbar_enabled = true;
} else {
moodbar_enabled = false;
}

// disable moodbar if last.fm radio station!
trk_fn = track_filename.Eval();
pref_fn = trk_fn.substring(0,10);
if(pref_fn=="FOO_LASTFM")
{
moodbar_radio=1;
} else {
moodbar_radio=0;
}

mood_bt.create(bt_dir+"bt_moodbar0.png",bt_dir+"bt_moodbar1.png",bt_dir+"bt_moodbar1.png");
moodbar_bool = 0;
if(fb.IsPlaying && fb.PlaybackLength>0 && moodbar_radio!=1) {
// refresh file info (music path, filenames, moodbar)
get_file_info();
if(file_exists(moodbar_fullpath)) {
moodbar_bool = 1;
} else {
moodbar_bool = 0;
}
}

moodbar_show=0;

}

// ==============================================================/ mouse left click
function on_mouse_lbtn_down(x,y)
{
lbtn_click=true;

// Seeker
if(x>seekstart+seekpad && x<ww-(seekend+seekpad) && y>pad_y)
{
if(fb.PlaybackLength){g_drag = 1;}
g_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
}

// mark A
if(x>=mark_A_x && x<=mark_A_x+10 && y<12)
{
mA_drag = 1;
mA_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
mA_drag_seek = (mA_drag_seek<0) ? 0 : (mA_drag_seek<1) ? mA_drag_seek : 1;
}

// mark B
if(x>=mark_B_x && x<=mark_B_x+10 && y<12)
{
mB_drag = 1;
mB_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
mB_drag_seek = (mB_drag_seek<0) ? 0 : (mB_drag_seek<1) ? mB_drag_seek : 1;
}

if (archive==0 && moodbar_enabled && fb.PlaybackLength>0 && (trk_ext=="flac" || trk_ext=="fla" || trk_ext=="mp3" || trk_ext=="wav")) {
if(mood_bt.checkstate("down",x,y)==ButtonStates.down) {
if(moodbar_bool==1) {
moodbar_show=moodbar_show==1?0:1;
} else {
moodbar_show=1;
create_batch(trk_ext);
}
}
}

window.Repaint();
}

// ==============================================================/ double click
function on_mouse_lbtn_dblclk(x, y, mask) {

if((x>=mark_A_x && x<=mark_A_x+10 && y<12)||(x>=mark_B_x && x<=mark_B_x+10 && y<12))
{
mA_drag_seek=0;
mB_drag_seek=1;
mark_A_x = seekstart - 10 + seekerwidth;
mark_B_x = ww-seekend + 1 - seekerwidth;
}
window.Repaint();

}

// ==============================================================/ mouse move
function on_mouse_move(x, y)
{
// Seeker
hov_x = x;
if((fb.IsPlaying&&fb.PlaybackLength>0&&x>seekstart_bg&&x<ww-seekend_bg&&y>pad_y)||(g_drag&&x>seekstart_bg&&x<ww-seekend_bg))
{
g_drag_hov = true;
g_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
} else {
g_drag_hov = false;
}

// mark A
if(mA_drag && x+1<mark_B_x && x>=marks_xmin && x<=marks_xmax)
{
mA_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
mA_drag_seek = (mA_drag_seek<0) ? 0 : (mA_drag_seek<1) ? mA_drag_seek : 1;
mark_A_x = x-9;
}

// mouse over with no drag
if(x>=mark_A_x && x<=mark_A_x+10 && y<12)
{
mA_hov=true;
} else {
mA_hov=false;
}

// mark B
if(mB_drag && x>mark_A_x+10 && x>=marks_xmin && x<=marks_xmax)
{
mB_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
mB_drag_seek = (mB_drag_seek<0) ? 0 : (mB_drag_seek<1) ? mB_drag_seek : 1;
mark_B_x = x;
mB_hov=true;
} else {
mB_hov=false;
}

// mouse over with no drag
if(x>=mark_B_x && x<=mark_B_x+10 && y<12)
{
mB_hov=true;
} else {
mB_hov=false;
}

if (archive==0 && moodbar_enabled && fb.PlaybackLength>0 && moodbar_show==0 && (trk_ext=="flac" || trk_ext=="fla" || trk_ext=="mp3" || trk_ext=="wav")) {
mood_bt.checkstate("move",x,y);
}

window.Repaint();
}

// ==============================================================/ left button up
function on_mouse_lbtn_up(x, y)
{
lbtn_click=false;

// Seeker
if(g_drag)
{
g_drag = 0;
g_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}

// mark A
if(mA_drag)
{
mA_drag = 0;
if(x+1<mark_B_x && x>=marks_xmin && x<=marks_xmax)
{
mA_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
mA_drag_seek = (mA_drag_seek<0) ? 0 : (mA_drag_seek<1) ? mA_drag_seek : 1;
}
if (fb.PlaybackTime<fb.PlaybackLength*mA_drag_seek) {
fb.PlaybackTime = fb.PlaybackLength*mA_drag_seek;
}
}

// mark B
if(mB_drag)
{
mB_drag = 0;
if(mB_drag && x>mark_A_x+10 && x>=marks_xmin && x<=marks_xmax)
{
mB_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(ww-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(ww-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
mB_drag_seek = (mB_drag_seek<0) ? 0 : (mB_drag_seek<1) ? mB_drag_seek : 1;
}
if (fb.PlaybackTime>fb.PlaybackLength*mB_drag_seek) {
fb.PlaybackTime = fb.PlaybackLength*mA_drag_seek;
}
}

mood_bt.checkstate("up",0,0);

window.Repaint();
}

// ==============================================================/ mouse Leave
function on_mouse_leave()
{
g_drag_hov = false;
mA_hov = false;
mB_hov = false;

mood_bt.checkstate("up",0,0);

window.Repaint();
}

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

// ==============================================================/ playback time (every seconds)
function on_playback_time(time)
{
if(g_timer){window.KillTimer(g_timer);}
if(fb.PlaybackLength>0){
g_timer = window.CreateTimerInterval(refresh_timer);
}

if(moodbar_enabled && moodbar_bool==0) {
timer_t1+=1;
if (timer_t1>=3) {
timer_t1=0;
// check every seconds if moodbar .png file found in music folder
if(file_exists(moodbar_fullpath)) {
moodbar_bool = 1;
} else {
moodbar_bool = 0;
}
}
}

// renaming moodbar file from short name to long name
var fso;
if(file_exists(definitive_moodbar_fullpath)==0 && file_exists(s_moodbar_fullpath) && bool_movefile==2) {
bool_movefile=1;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.MoveFile(s_moodbar_fullpath, definitive_moodbar_fullpath);
}

window.Repaint();
}

function on_playback_stop()
{
if(g_timer){
window.KillTimer(g_timer);
}
window.Repaint();
}

function on_playback_pause(state)
{
window.Repaint();
}

// ==============================================================/ Playback starting
function on_playback_starting(cmd, is_paused)
{
refresh_timer=Math.floor(len_seconds.Eval()/60)*25;
if (refresh_timer<16) refresh_timer=16;
g_timer = window.CreateTimerInterval(refresh_timer);

// check if moodbar .png file found in music folder
if(file_exists(moodbar_fullpath)) {
moodbar_bool = 1;
} else {
moodbar_bool = 0;
}

window.Repaint();
}

// ==============================================================/ Redraw more than once per sec
function on_timer(id)
{

if(size_changed) {
mark_A_x=Math.round((ww-120)*mA_drag_seek+(seekstart-5));
mark_B_x=Math.round((ww-120)*mB_drag_seek+(seekend+2));
size_changed=false;
}

if(mB_drag_seek==0.9985 && mA_drag_seek==0) mB_drag_seek=1;

if(mA_drag_seek!=0 || mB_drag_seek!=1) {

if(mB_drag_seek==1) mB_drag_seek=0.9985;

if (fb.PlaybackTime >= fb.PlaybackLength*mB_drag_seek) {

if(mB_drag) {
fb.PlaybackTime =  fb.PlaybackLength*mB_drag_seek;
} else {
fb.PlaybackTime =  fb.PlaybackLength*mA_drag_seek;
}

}

}

if (fb.PlaybackTime < fb.PlaybackLength*mA_drag_seek) {
fb.PlaybackTime =  fb.PlaybackLength*mA_drag_seek;
}

window.Repaint();
}

//Seek using mouse wheel
function on_mouse_wheel(delta){
if(delta>0)
fb.RunMainMenuCommand("Seek Ahead by 10 Seconds");
else
fb.RunMainMenuCommand("Seek Back by 10 Seconds");
}

// ===============================================================================/ new track
function on_playback_new_track(info) {

bool_movefile=0;
var trk_fn;
var pref_fn;

trk_fn = track_filename.Eval();
pref_fn = trk_fn.substring(0,10);
if(pref_fn=="FOO_LASTFM")
{
moodbar_radio=1;
} else {
moodbar_radio=0;
}


refresh_timer=Math.floor(len_seconds.Eval()/60)*25;
if (refresh_timer<16) refresh_timer=16;

// reset markers A & B pos
mark_A_x = seekstart - 10 + seekerwidth;
mark_B_x = ww-seekend + 1 - seekerwidth;

mA_drag_seek = 0;
mB_drag_seek = 1;

CollectGarbage();

if(fb.PlaybackLength>0 && moodbar_radio!=1) get_file_info();

moodbar_bool = 0;
if(file_exists(moodbar_fullpath)) {
moodbar_bool = 1;
}

moodbar_show=0;

}

// ===============================================================================/ Seek using mouse wheel
function on_mouse_wheel(delta){
if(delta>0)
goto_bookmark_ahead();
else
goto_bookmark_back();
}

// ===============================================================================/ Seek ahead 5 sec.
function goto_bookmark_ahead()
{
var i;
for(i=0;i<5;i++) {
fb.RunMainMenuCommand("Seek Ahead by 1 Second");
}
window.Repaint();
}

// ===============================================================================/ Seek back 5 sec.
function goto_bookmark_back()
{
var i;
for(i=0;i<5;i++) {
fb.RunMainMenuCommand("Seek Back by 1 Second");
}
window.Repaint();
}

// ===============================================================================/ file_exists
function file_exists(chemin) {
  var fso, bool;
  fso = new ActiveXObject("Scripting.FileSystemObject");
  bool=fso.Fileexists(chemin);
  return bool;
}

function GrabShortPath(filespec)
{
var fso, f, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFile(filespec);
s = f.ShortPath;
return(s);
}

function GrabShortName(filespec)
{
var fso, f, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFile(filespec);
s = f.ShortName
return(s);
}

// ===============================================================================/ refresh file info (tf)
function get_file_info() {
 
  var s1, s2, s3, s4;
 
  archive = is_archive.Eval();
 
  trk_fullpath = track_fullpath.Eval();
  trk_ext = track_ext.Eval();
 
  if(archive==0) {
 
  s_trk_fullpath = GrabShortPath(trk_fullpath);
  s_trk_filename_ext = GrabShortName(trk_fullpath);
   
  s1 = trk_ext.length;
  s2 = trk_fullpath.length;
  s3 = s_trk_fullpath.length;
 
  moodbar_fullpath = trk_fullpath.substring(0,s2-s1-1) + ".png";
  s_moodbar_fullpath = s_trk_fullpath.substring(0,s3-4) + ".png";

  s4 = s_trk_filename_ext.length;

  trk_filename = track_filename.Eval();

  definitive_moodbar_fullpath = s_trk_fullpath.substring(0,s3-s4)+trk_filename+".png";

  bool_movefile=2;
 
  }

}

// ===============================================================================/ create .bat file to convert to mp3
function create_batch(ftype) {

var fso, f1, ts, s;
var ForReading = 1;
var ForWriting = 2;
var Str0, Str1, Str2, Str3, Str4;
var chem;
var mypath;
var wtitle="MoodBar";
var runcmd;
var c_quote;

c_quote = char_quote.Eval();

chem = track_path.Eval();
mypath = s_trk_fullpath.substring(0,s_trk_fullpath.length-12);

fso = new ActiveXObject("Scripting.FileSystemObject");

if (file_exists(moodbar_dir + "foobar.bat")==true) {
ts = fso.OpenTextFile(moodbar_dir + "foobar.bat", ForWriting);
} else {
ts = fso.CreateTextFile(moodbar_dir + "foobar.bat", ForWriting);
}

switch(ftype)
{
case "mp3":
// ts.WriteLine(GrabShortPath(moodbar_dir+"moodbar.exe")+" -r -p -c:3 -h:2 -w:1024 -mp3:"+s_trk_fullpath);
ts.WriteLine(GrabShortPath(moodbar_dir+"moodbar.exe")+" -r -p -c:3 -h:10 -w:1024 -mp3:\""+s_trk_fullpath+"\"");
break;

case "flac":
Str0 = GrabShortPath(moodbar_dir+"flac.exe");
Str1 = GrabShortPath(moodbar_dir+"gogo.exe");
Str2 = Str1.substring(0,Str1.length-8)+"moodbar.exe";
if(ftype.length==3) {
Str3 = s_trk_fullpath.substring(0,s_trk_fullpath.length-trk_ext.length-1)+".mp3";
} else {
Str3 = s_trk_fullpath.substring(0,s_trk_fullpath.length-trk_ext.length-0)+".mp3";
}
Str4 = s_trk_fullpath.substring(0,s_trk_fullpath.length-trk_ext.length)+".wav";
if(ftype=="flac") {
ts.WriteLine(Str0+" -d "+s_trk_fullpath);
ts.WriteLine(Str1+" -b 128 -m s -nopsy -q 9 "+Str4);
} else {
ts.WriteLine(Str1+" -b 128 -m s -nopsy -q 9 "+s_trk_fullpath);
}
ts.WriteLine(Str2+" -r -p -c:3 -h:10 -w:1024 -mp3:"+Str3);
ts.WriteLine("del "+Str3);
ts.WriteLine("del "+Str4);
break;

case "wav":

Str0 = GrabShortPath(moodbar_dir+"flac.exe");
Str1 = GrabShortPath(moodbar_dir+"gogo.exe");
Str2 = Str1.substring(0,Str1.length-8)+"moodbar.exe";
if(ftype.length==3) {
Str3 = s_trk_fullpath.substring(0,s_trk_fullpath.length-trk_ext.length-1)+".mp3";
} else {
Str3 = s_trk_fullpath.substring(0,s_trk_fullpath.length-trk_ext.length-0)+".mp3";
}
Str4 = s_trk_fullpath.substring(0,s_trk_fullpath.length-trk_ext.length)+".wav";
if(ftype=="flac") {
ts.WriteLine(Str0+" -d "+s_trk_fullpath);
ts.WriteLine(Str1+" -b 128 -m s -nopsy -q 9 "+Str4);
} else {
ts.WriteLine(Str1+" -b 128 -m s -nopsy -q 9 "+s_trk_fullpath);
}
ts.WriteLine(Str2+" -r -p -c:3 -h:10 -w:1024 -mp3:"+Str3);
ts.WriteLine("del "+Str3);
ts.WriteLine("del "+Str4);
break;
}
ts.WriteLine("del "+mypath+"*.mood");
ts.Close();
runcmd = "START "+c_quote+wtitle+c_quote+" /MIN cmd /C ";
WshShell.run("cmd /C "+runcmd+GrabShortPath(moodbar_dir+"foobar.bat"));
}

Xchange v3

Reply #849
Hm...
With this fcl all wsh panel mods are resetted to the default volume bar...