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: WSH Panel Mod (Read 855739 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod

Reply #1126
@T.P Wang:

i just tried Parsable properties to disable drag'n'drop when i drop items NOT over my target area (a wsh panel), but i can't make it works, it keeps adding dragged items to the active playlist even if i set action.Parsable to false

   // Set this value to false to disable drag and drop.
   (read, write) bool Parsable;


here is my on_drag_drop function coding, can you tell me what i'm doing wrong please ?

function on_drag_drop(action, x, y, mask) {
    dragging = false;
    window.Repaint();
    var idx = GetIDfromYpos(y);

    // We are going to process the dropped items to a playlist
    if (x>0 && x < ww-SCROLLBAR_W && y > 0 && y < wh) {
        action.Parsable = true;
    } else {
        action.Parsable = false;
    }

    action.ToPlaylist();
    action.Playlist = idx;
    action.ToSelect = false;
}

WSH Panel Mod

Reply #1127
@Zao:
You are right, it's bothersome to me to implement. 

@Falstaff:
1. You'd better to set Parsable property in on_drag_enter() and on_drag_over().
2. You cannot make Parsable true again, currently.

WSH Panel Mod

Reply #1128
I must admit that i had for a long time something like wsh_ui in my mind. Not that i feel the desire to leave the default ui but it would fulfill the wishes of a great part of users and could end the controversy of functionality vs visual pleasure if not the same mistake is made like in Panels Ui or PSS. A new Ui should allow the average user to download a file that represents the skin, to apply it through preferences and to avoid any contact with any code - no more, no less! But that would be even more bothersome, or?



 

WSH Panel Mod

Reply #1131
T.P Wang
Quote
3. Enumerating a full playlist should be avoid due to its performance, stuck UI.
4. This is the main reason I won't provide that. Much slower than 3, stuck UI a lot.


So with the new config ("Spotifoo") by Falstaff you can see that high perfomance with much WSH coding is possible.

WSH Panel Mod

Reply #1132
I tried Spotifoo and I think the playlist was written in ELPlaylist or am I wrong? I didn't use it for very long. I really like playlist switcher panel though, I might write my own version of that.

WSH Panel Mod

Reply #1133
Yes, Spotifoo based on ELPlaylist. But I think with .GetItems() (MetaDB Handles list) method it is possible to write WSH playlist with low CPU usage. If this method will be added.

WSH Panel Mod

Reply #1134
Yes, Spotifoo based on ELPlaylist. But I think with .GetItems() (MetaDB Handles list) method it is possible to write WSH playlist with low CPU usage. If this method will be added.


maybe true if the playlist contains less than 100 track, but i don't think that HandleList of big playlist would be so fast to use in a draw_playlist script engine. IMHO. Handling the display of a great number of lines in a such engine is possible, check my playlist switcher as an example, but the trick is that for playlist items, it would take more time to feed the HandleList and to decode after each handle in order to display the fetched track info...


WSH Panel Mod

Reply #1135
Quote
but i don't think that HandleList of big playlist would be so fast to use in a draw_playlist script engine <...> items, it would take more time to feed the HandleList and to decode after each handle in order to display the fetched track info..

If it is also possible to get MetaDB Handles list of only changed (added or removed) tracks in callbacks such as on_items_added(metadb) and on_items_removed(metadb) so we can work only with these tracks and it should be fast with window.RepaintRect().

P.S. I guess ELPlaylist code works in the same way.

WSH Panel Mod

Reply #1136
Using panel mod Beta 6 getting failed to load DLL specified procedure could not be found on 2 XP systems , works on Windows 7 Laptop ,  Beta 5 worked on all 3 systems , using  latest Foobar ver. DLL in correct folder , copying wsh_panel_mod folder  beta 5 back  to components folder restores back to normal ..
Any ideas , changelog doesn't seem to indicate anythinh that could cause this?


WSH Panel Mod

Reply #1137
v1.4.1 Beta 6:
- FIX: Fix possible bugs in GetAlbumArtAsync() and LoadImageAsync().
- ADD: Add fb.DuplicatePlaylist() method.

thanx T.P, i'm going to test this new method right now!

WSH Panel Mod

Reply #1138
v1.4.1 Beta 7 is out

// "chardet": Guess charset of a file, and return the codepage of it (it may not be accurate), returns 0 if any error occured.
VARIANT FileTest(path, mode);


Thanx for the new "chardet" arg in FileTest ... but :

I can't may the FileTest function working (crash), what am i doing wrong ?

                var arg = g_lyrics_path+g_lyrics_filename;
                fb.trace("arg="+g_lyrics_path+g_lyrics_filename);
                g_charset = utils.FileTest(arg, "chardet");


console display a correct path to me for arg : => arg=C:\Users\Br3tt\foobar2000 spotifoo\lyrics\ABBA -Chiquita.lrc

error is :

Argument ou appel de procédure incorrect (eng. translate: Argument or Invalid procedure call)
Ln: 1018, Col: 17
<source text only available at compile time>

WSH Panel Mod

Reply #1139
@Falstaff:
It should work, and you should always try new features in a "sandbox" instead of embedding it in an existing script immediately.
I think your problem is that the context of g_charset in your script is an user-friendly MIME string but "chardet" returns a decimal codepage value.

WSH Panel Mod

Reply #1140
it doesn't work

Code: [Select]
function on_paint(gr) {
    var g_path = "C:\\Users\\Br3tt\\foobar2000 spotifoo\\lyrics\\ABBA -Chiquita.lrc";
    
    var myvar = utils.FileTest(g_path, "chardet");

    fb.trace("pagecode = " + myvar);
    
}


same error on the utils.FileTest() line.

WSH Panel Mod

Reply #1141
Maybe you actually didn't upgrade to Beta 7? Because since you specify "mode" to "chardet", and "path" is not null, you won't get any exception thrown.


WSH Panel Mod

Reply #1143
Thanks for the new betas. But FileTest "split" seems to be broken in 1.4.1 beta 7:

var arr = utils.FileTest("D:\\Somdir\\Somefile.txt", "split").toArray();

WSH Panel Mod

Reply #1144
@WilB:
Confirmed, will be fixed soon.

WSH Panel Mod

Reply #1145
WSH panel Mod v1.4.1 final released 10 hours ago

Thanx a lot T.P Wang for your efforts and very good work


WSH Panel Mod

Reply #1146
@T.P : CHANGELOG not updated on first post

v1.4.1 works fine, the "chardet" feature is maybe to accurate, it often return utf8 as default charset at least for me.

WSH Panel Mod

Reply #1147
v1.4.2 released (check 1st post download link)
- CHG: Small optimization for "chardet" mode in utils.FileTest().

WSH Panel Mod

Reply #1148
@T.P Wang:

could you do something to fix this behaviour please : when i use main menu command Edit -> Select all, on_selection_changed is not trigged at all, why ? selection has changed btw. Weird because it works if i use keys CRTL+A on my playlist panel !

if it can't be fixed, maybe a fb.SelectAllIemsPlaylist(playlist_idx) new method coukd do the trick ?

* my goal is still to use fb.GetSelections() after a Select All command (manually with mouse or coded in a WSH panel, i don't care on how i do the selection ... also you'll said : so use CTRL+A if you don't care of the method selection ... lol, yep maybe but it's really weird that Edit > Select all don't trigger any selection changing event )

any idea?

thanx by advance

WSH Panel Mod

Reply #1149
Quote
fb.SelectAllIemsPlaylist(playlist_idx)

Is this for get playlist items list? If it is so I think fb.GetPlaylistItems() (see above in the topic) would be more comfortable.  But T.P Wang has some reasons not to do that.