Skip to main content

Topic: JScript Panel script discussion/help (Read 50267 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • MachineHead
  • [*][*][*][*][*]
Re: JScript Panel script discussion/help
Reply #600
Setting 'Mood' in the jsplaylist-mod causes an instant crash. Error message below. Version 1.3.0.

Code: [Select]
JScript Panel (jsplaylist-mod by Br3tt aka Falstaff >> modded by marc2003)
JavaScript runtime error:
Object doesn't support property or method 'UpdateFileInfoSimple'
File: C:\Users\*\Desktop\foo_test\user-components\foo_jscript_panel\samples\jsplaylist-mod\js\WSHplaylist.js
Line: 1077, Col: 10
<source text only available at compile time>

If someone else runs into this you may wish to inform marc2003 since I apparently tripped his trigger one too many times.

Re: JScript Panel script discussion/help
Reply #601
I use Line(2860-2866、2891-2892、2942-2970) and utils.MapString to translate the music tags from traditional Chinese into Simplified Chinese. When the music tags has a null value, it fails while running on JScript Panel, and no error occurs on WSH PLUS (with utils.LCMapString). I don't know if there is a problem with my code or the utils.MapString interface. Can you help me see where the problem is?
Can you add the word wrap function at the JScript Panel Configuration ?

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #602
You know I copied the function from WSH panel mod plus. The only difference is that I made it throw an error if you don't supply a flag.

I tested these examples and they perform the same in both components.

JScript Panel
Code: [Select]
var test = utils.MapString("", 0x0804, 0x04000000); //returns empty string
var test = utils.MapString(null, 0x0804, 0x04000000); //script error
var test = utils.MapString(undefined, 0x0804, 0x04000000); //returns empty string

WSH Panel Mod Plus
Code: [Select]
var test = utils.LCMapString("", 0x0804, 0x04000000); //returns empty string
var test = utils.LCMapString(null, 0x0804, 0x04000000); //script error
var test = utils.LCMapString(undefined, 0x0804, 0x04000000); //returns empty string

Just use something like this instead...

Code: [Select]
arr[k] = utils.MapString(fileinfo.MetaValue(idx,0) || "", 0x0804, ret - 3000 ? 0x04000000 : 0x02000000);

And no, I'm not adding word wrap to the configuration window. I'll be honest and say I wouldn't know how even if wanted to!
  • Last Edit: 13 October, 2017, 06:20:51 AM by marc2003

Re: JScript Panel script discussion/help
Reply #603
Thanks. It works. Now ttsping focuses on SUI. It's a new user interface that combines sciter and WSH interfaces...

Re: JScript Panel script discussion/help
Reply #604
(track info + seekbar + buttons) background color can be changed to automatically get the title bar or taskbar color? Like Groove.

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #605
I'm not changing it but you can get windows 10 colours from the registry...

https://hydrogenaud.io/index.php/topic,110516.msg941430.html#msg941430

  • MachineHead
  • [*][*][*][*][*]
Re: JScript Panel script discussion/help
Reply #606
If anyone is interested I've got a working jscript that switches PSS splitters with buttons from the latest JScript panel. You need to have Columns UI, PSS, and JScript panel installed (portable for testing recommended). I used images out of the mono folder from the jscript component folder for generic buttons images. Once those components are installed you can import this FCL file from within Columns UI.

Right clicking the Parent Splitter and selecting Splitter Settings (upper one) will show child splitter names in PanelList tab. The Script tab shows the PSS code that must be used in the parent splitter. Note names in Script tab (1-4) and their placement here. They need to match the names in the PanelList tab.

This type of switcher does not need to be in the same parent splitter as is the case for PSS buttons. You can even use this in the CUI toolbar to change the panels. Right click the toolbar > Panels > JScript panel > copy code from orange jscript panel.

I'm unsure if it could be cleaned up or optimized further, but it works quite well.
  • Last Edit: 18 October, 2017, 04:56:00 PM by MachineHead

  • zeremy
  • [*][*][*][*]
Re: JScript Panel script discussion/help
Reply #607
If anyone is interested I've got a working jscript that switches PSS splitters with buttons from the latest JScript panel. You need to have Columns UI, PSS, and JScript panel installed (portable for testing recommended). I used images out of the mono folder from the jscript component folder for generic buttons images. Once those components are installed you can import this FCL file from within Columns UI.

Right clicking the Parent Splitter and selecting Splitter Settings (upper one) will show child splitter names in PanelList tab. The Script tab shows the PSS code that must be used in the parent splitter. Note names in Script tab (1-4) and their placement here. They need to match the names in the PanelList tab.

This type of switcher does not need to be in the same parent splitter as is the case for PSS buttons. You can even use this in the CUI toolbar to change the panels. Right click the toolbar > Panels > JScript panel > copy code from orange jscript panel.

I'm unsure if it could be cleaned up or optimized further, but it works quite well.

I just want to mention that the reqiured "hack" to refresh the PSS panel
Code: [Select]
if (fb.IsPlaying || fb.IsPaused) {  
fb.RunMainMenuCommand("Playback/Play or Pause");
fb.RunMainMenuCommand("Playback/Play or Pause");
} else {
fb.RunMainMenuCommand("Playback/Play");
fb.RunMainMenuCommand("Playback/Stop");
}
works well with local media files, but not with internet radio streams where there is a noticable pause in the playback.

Re: JScript Panel script discussion/help
Reply #608
Replace Wsh panel mod with jscript panel on catrox. There are some undefined definitions. Who can help me? Like: line: 989 in Control_Scrollbar.js  line: 584 in Panel_Cover.js

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #609
Catrox was written for WSH panel mod... so use WSH panel mod. The main reason I created JScript Panel was because of my breaking changes so people can now run both components side by side if they don't know how to update the scripts.

edit: and of course you even have access to WSH panel mod PLUS which seems to contain most functions from both components.
  • Last Edit: 20 October, 2017, 12:25:07 PM by marc2003

  • TheQwertiest
  • [*][*][*]
Re: JScript Panel script discussion/help
Reply #610
@always.beta: Well, actually, original CaTRoX is pretty much compatible with JScript, you just need to follow this guide to make it work.
  • Last Edit: 20 October, 2017, 01:22:56 PM by TheQwertiest

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #611
Well that link is in the first post of this thread.... it's really for script authors who might want to update their scripts and then take advantage of newer features in this component. I figure for the casual user, it's just easier to use the old component - that is you can afford the 1MB or so of disk space it takes.  :P

Re: JScript Panel script discussion/help
Reply #612
@always.beta: Well, actually, original CaTRoX is pretty much compatible with JScript, you just need to follow this guide to make it work.
The interface has been updated as instructed. Now the error: createScrollbarImages(line: 989 in Control_Scrollbar.js) is undefined. However, it is defined in line: 165. I don't know how to fix the definition.

Just an act of compulsion. A new components appears, why not upgrade. :)

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #613

  • MachineHead
  • [*][*][*][*][*]
Re: JScript Panel script discussion/help
Reply #614
I just want to mention that the reqiured "hack" to refresh the PSS panel works well with local media files, but not with internet radio streams where there is a noticable pause in the playback.
That's a well known limitation of PSS and not exactly what the focus of this experiment was. Until there's another component that allows the same flexibility as PSS without it's warts we're sort of stuck with what we have at hand. If a user can live with the drawbacks then this simple script permits PSS switching from anywhere in the UI as long as the jscript panel doing the switching is visible. I even rolled this into my heavily modified 'track info + seekbar + buttons' control bar.

  • zeremy
  • [*][*][*][*]
Re: JScript Panel script discussion/help
Reply #615
I just want to mention that the reqiured "hack" to refresh the PSS panel works well with local media files, but not with internet radio streams where there is a noticable pause in the playback.
That's a well known limitation of PSS and not exactly what the focus of this experiment was. Until there's another component that allows the same flexibility as PSS without it's warts we're sort of stuck with what we have at hand. If a user can live with the drawbacks then this simple script permits PSS switching from anywhere in the UI as long as the jscript panel doing the switching is visible. I even rolled this into my heavily modified 'track info + seekbar + buttons' control bar.

I just wanted to mention a limitation of your experiment.

There exists a component that can switch & move panels with desired sizes and its called mega_panel_splitter.
http://1drv.ms/1EbzBou
It is based on wsh and old version [1.1.10].
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/foo-wsh-panel-mod/Source-1.1.10.7z

Proof of concept demo: https://www.dropbox.com/s/nvqh5d5y40ae74p/bandicam%202017-10-22%2018-58-27-047.avi?dl=0

If you need to control a jscript panel from PSS you can use marc2003 new callback, on_main_menu.
https://github.com/19379/foo-jscript-panel/blob/master/foo_jscript_panel/docs/Callbacks.txt#L61

The opposite is not possible though. (Use jscript panel  to notify PSS)

PSS only evaluates scripts on playback start or when  track info is modified.
  • Last Edit: 22 October, 2017, 12:04:07 PM by zeremy

  • MachineHead
  • [*][*][*][*][*]
Re: JScript Panel script discussion/help
Reply #616
I just wanted to mention a limitation of your experiment.
It does exactly what it was supposed to do; control PSS splitters with the only means available to do so at this time. Recommending undocumented components that a handful of people on the planet use (and probably even fewer understand) is going off-topic here.

  • davideleo
  • [*][*][*][*]
Re: JScript Panel script discussion/help
Reply #617
When does the on_mouse_move event actually take place?
I understand if I move the pointer from A to B an on_mouse_event takes place when the pointer stops on B, thus passing the B coordinates as arguments to the on_mouse_move function, but what happens during the path from A to B? Does the event take place only when the pointer stops, or also while it is still moving? In this latter case, is the motion detected on a time interval or a space interval basis?
I'm late

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #618
Start with a blank panel...

Code: [Select]
var tooltip = window.CreateTooltip("Segoe UI", 32, 1);

function on_mouse_move(x, y) {
    tt(x + "-" + y);
}

function tt(message) {
    if (tooltip.Text != message) { //must check values have changed otherwise tooltip will flicker
        tooltip.Text = message;
        tooltip.Activate();
    }
}

Now move your mouse and see how often the numbers update.

  • davideleo
  • [*][*][*][*]
Re: JScript Panel script discussion/help
Reply #619
Start with a blank panel...

Spoiler (click to show/hide)
Now move your mouse and see how often the numbers update.

Well, I can't really see in real time what happens if the mouse is moving too fast, however I traced the y value with the console and beyond a certain speed the increments can be greater than 1, therefore I'd say a minimum time interval is required before the event takes place.
I also tried removing the if statement to check if there is a minimum space interval, too, and when moving slow enough, some values were repeated. That means, if I'm correct, that no minimum space interval is required to trigger the event, and since the coordinates are rounded to an integer, an on_mouse_event does not necessarily mean the x and y values have changed. I guess this is something that must be handled with an if statement, like you did, in order to prevent flickering if the on_mouse_event triggers a repaint .
I'm late

Re: JScript Panel script discussion/help
Reply #620
I'm looking for a little help with falstaff's scripts. As an example I installed JS Smooth Playlist Manager and I get this error when applying it:

Code: [Select]
JScript Panel (JS Smooth Playlist Manager v20151115-1000-151 by Br3tt aka Falstaff >> http://br3tt.deviantart.com)
JavaScript compilation error:
Syntax error
File: C:\Users\Daniel\AppData\Roaming\foobar2000\js_br3tt\jsspm\js\JScommon.js
Line: 540, Col: 8
    }; else {

What am I doing wrong?

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #621
Looks like you have the original version from deviantart - they're not compatible with the latest versions of the component.

However, updated versions of the scripts are bundled inside the component folder so right click in a panel>Open component folder and browse to samples\js-mooth

edit: if you don't have a js-smooth folder, you'll need to update the component.
  • Last Edit: 04 December, 2017, 05:36:59 AM by marc2003

Re: JScript Panel script discussion/help
Reply #622
JS Smooth Playlist: when the music is played to 1/3, the selection box will automatically switch to the next one, and the current music loses the focus of the playback. How do I close it, please?

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel script discussion/help
Reply #623
I don't even understand the "question/problem" above! I know my component changes did break the originals some time ago and I did my best to change the code style to make them load. They all do that now and I don't understand the code well enough to make changes to the deeper features/functionality.

Simply put, I don't have the answers. If they don't work as expected, don't use them.

  • Last Edit: 06 December, 2017, 06:08:48 PM by marc2003

  • zeremy
  • [*][*][*][*]
Re: JScript Panel script discussion/help
Reply #624
JS Smooth Playlist: when the music is played to 1/3, the selection box will automatically switch to the next one, and the current music loses the focus of the playback. How do I close it, please?
It is a conflict that occurs when you select in ESLyrics , Lyrics save scheme "Save when 60s or 1/3 of length have played".