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 814873 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod

Reply #1100
Thanks for the recent updates to this component.  I'd just like to report that the function on_mouse_lbtn_dblclk() no longer seems to work with the new beta.  I am not currently using the dragdrop functionality.

WSH Panel Mod

Reply #1101
Thanks for the recent updates to this component.  I'd just like to report that the function on_mouse_lbtn_dblclk() no longer seems to work with the new beta.  I am not currently using the dragdrop functionality.


same issue here : on_mouse_lbtn_dblclk() no longer working with latest beta.

WSH Panel Mod

Reply #1102
...
And I've upload a new sample here:
http://foo-wsh-panel-mod.googlecode.com/hg...rop%20Basic.txt

one remark: to add item in the target playlist, we have to activate it in the on_drag_drop() function, then items are copied automatically. I think that the target playlist to fill should be user defined, and not forced by default to the active playlist, because when i want to copy a track from my active playlist to another one (from my wsh playlist manager) with drag'n'drop method, the target playlist became the active playlist and i lost my source playlist in my playlist viewer

could you consider that point and maybe let us filling the target playlist by coding it ourselves like done in my example below, with GetSelections and a loop on each metadb pointer selected, but it's requiring a method to add items to an existing playlist (for now i use a context command provided by foo_utils to add or send items to a 'named' playlist)

Code: [Select]
function on_drag_drop(test, x, y, mask) {
    var glist = fb.GetSelections();
    var pl_name;

    // grab the target playlist id from the y pos in the wsh playlist manager panel (not shared here)
    var target_pl_id = GetIDfromYpos(y);

    // get the name of the target playlist (in order to use the run context command that will do the add item to it!)
    pl_name = fb.GetPlaylistName(target_pl_id);

    // -- by passed -- Switch to the target playlist (on drag_drop, dragged item are copied to the active playlist by default...)
    // -- by passed -- fb.ActivePlaylist = target_pl_id;
   
    // for each item dragged, we add it to the target playlist
    for(i=0;i<glist.Count;i++) {
        fb.RunContextCommandWithMetadb(pl_name, glist.Item(i));
    }
   
    dragging = false;
    window.Repaint();
}

using the run context command is not adapted because it could exist playlists with same name , so a method to add items to a playlist(idx) would be required.

all other idea are welcomed ... btw, the actual works perfectly, so don't break it if my suggestion is to hard to provide.

WSH Panel Mod

Reply #1103
Thanks for the recent updates to this component.  I'd just like to report that the function on_mouse_lbtn_dblclk() no longer seems to work with the new beta.  I am not currently using the dragdrop functionality.

Confirmed, will be fixed in the next version.


one remark: to add item in the target playlist, we have to activate it in the on_drag_drop() function, then items are copied automatically. I think that the target playlist to fill should be user defined, and not forced by default to the active playlist

Agreed, so it's the time to make use of the preserved parameter "void".


WSH Panel Mod

Reply #1105
1.4.2 Beta 2 has just uploaded.
Note the drag and drop behavior has some slightly changes, see "Drag Drop Basic" sample and doc for more information.

Code: [Select]
v1.4.1 Beta 2:
- ADD: New sample "Drag Drop Basic".
- ADD: New IDropTargetAction interface.
- FIX: Fix a problem that callbacks for double clicks won't get called, introduced in 1.4.1 Beta 1.

WSH Panel Mod

Reply #1106
@T.P Wang:

I tend to get a crash of Pure virtual function call on foobar exit, if an async xmlhttp object is still running. Can you do something about that?

WSH Panel Mod

Reply #1107
1.4.2 Beta 2 has just uploaded.
Note the drag and drop behavior has some slightly changes, see "Drag Drop Basic" sample and doc for more information.

Code: [Select]
v1.4.1 Beta 2:
- ADD: New sample "Drag Drop Basic".
- ADD: New IDropTargetAction interface.
- FIX: Fix a problem that callbacks for double clicks won't get called, introduced in 1.4.1 Beta 1.

I ve code it like in the sample but it crashes and no error report in the console... Weird. ... Any idea why console is empty?

ok, error is now reported in the console, it crashes on the instruction :    action.SelectThem = false;

so, i decide to test the sample "Drag Drop Basic" with no changes, and it crashes too on the same instruction in function on_drag_drop(action)

why? it's your sample and it doesn't work  weird... could you test it again ?

console extract (in french)
WSH Panel Mod (Drag Drop Basic by T.P Wang): initialized in 5 ms
Error: WSH Panel Mod (Drag Drop Basic by T.P Wang): Erreur d'exécution Microsoft JScript:
Cet objet ne gère pas cette propriété ou cette méthode  <=> Object does not support this property or method
Ln: 58, Col: 5
<source text only available in compile time>

WSH Panel Mod

Reply #1108
other bug found in beta 2:

in function on_drag_drop(action, x, y, mask) {}

y always equal to 0 !!! it was ok in beta 1...

*waiting for the fix*

thanx T.P

here is my code to fix this issue for the moment (i save x and y in callback on_drag_over):

var dragging = false;
var dragndrop_y;

function on_drag_enter() {
    dragging = true;
    window.Repaint();
}

function on_drag_leave() {
    dragging = false;
    window.Repaint();
}

function on_drag_over(test, x, y, mask) {
    // saving y to use it in function on_drag_drop (due to a bug in v1.4.1 beta 2 on y value, always equal to 0!)
    dragndrop_y = y;
}

function on_drag_drop(action, x, y, mask) {
    dragging = false;
    window.Repaint();
    var idx = GetIDfromYpos(dragndrop_y);
    // We are going to process the dropped items to a playlist.
    action.ToPlaylist();
    action.Playlist = idx;
    // line below puts in comment cause it generate a script error in v1.4.1 beta 2
    //action.SelectThem = false;
}

WSH Panel Mod

Reply #1109
I'm trying with no success to rework some of the existing scripts to make %artist% - %title% move from right to left during playback in one of my wsh panels. Is there a sample code for smooth scrolling not based on the playback time because I'd like the speed to be more adjustable.
Thanks.

Look here my post

100% what I was looking for 
Unlimited thanks, ExtremeHunter.

WSH Panel Mod

Reply #1110
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.

WSH Panel Mod

Reply #1111
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.


thanx for the quick update.

ToSelect works and y coord is now ok in on_drag_drop() but it's now broken in on_drag_over() !!! y value is not the good one (x not tested)

nb: interface.txt still contains .SelectThem instead of ToSelect


WSH Panel Mod

Reply #1113
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.


thanx for the quick update.

ToSelect works and y coord is now ok in on_drag_drop() but it's now broken in on_drag_over() !!! y value is not the good one (x not tested)

nb: interface.txt still contains .SelectThem instead of ToSelect


i've found the bug : x and y coords are inverted in on_drag_over() in beta 3: x=y and y=x


 

WSH Panel Mod

Reply #1114
After Stop after current stops playback, when I press play button, on_playback_new_track(mdb) is not fired, is this intended? And what about the ActiveXObject question I asked.

WSH Panel Mod

Reply #1115
it would be great if T.P Wang add a special command to get playlist MetaDB Handles List.

Sorry but I didn't see any pros of that.

i've found the bug : x and y coords are inverted in on_drag_over() in beta 3: x=y and y=x

Thanks... what a stupid bug, it will be fixed in the next release.

After Stop after current stops playback, when I press play button, on_playback_new_track(mdb) is not fired, is this intended? And what about the ActiveXObject question I asked.

(1) No, you should get that callback.
(2) I'll see if I can do anything about that.

WSH Panel Mod

Reply #1116
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.

thanx for the quick update.

ToSelect works and y coord is now ok in on_drag_drop() but it's now broken in on_drag_over() !!! y value is not the good one (x not tested)

nb: interface.txt still contains .SelectThem instead of ToSelect

i've found the bug : x and y coords are inverted in on_drag_over() in beta 3: x=y and y=x

WEIRD, on another PC (laptop sony vaio under Seven x64), coords are correct (not inverted) ??? but they are still inverted on my desktop computer (Seven x64), my computer at work (under XP) and my personnal laptop (under Seven x64)

so 1 on 4 is ok ...

what about for you ?


EDIT: sorry my bad, i was using beta 2 on this one , so the bug is real in beta 3

EDIT 2: i've noticed that if a drag_drop on an other WSH panel (with no drag_drop support), items dragged are always sent to the active playlist !! it's not a normal way to do

WSH Panel Mod

Reply #1117
Quote
Sorry but I didn't see any pros of that.

We'll be able to:
1. Get some data from any playlist element.
2. Apply context commands to any playlist element without selecting it.
3. Calc playlist length through paragraph 1.
4. Create custom WSH playlist view.

I think it's not a full list. Are these features really useless? I'm surprised.

WSH Panel Mod

Reply #1118
it would be great if T.P Wang add a special command to get playlist MetaDB Handles List.

Sorry but I didn't see any pros of that.


I for one would really like to see this, as I have built (weighted) random track generator through WSH and it would simplify my code significantly if I could just use some function to get track pool from playlist (especially when fb.getselections() doesn't work from all callbacks: http://www.hydrogenaudio.org/forums/index....st&p=735563)

WSH Panel Mod

Reply #1119
(1) No, you should get that callback.
(2) I'll see if I can do anything about that.

(1) OK, problem on my side, as I check whether artist has changed to start Repaint, and when it does not in this case, my panel does not get repaint.
(2) If you can fix this, it would be awesome, in particularly I have problem with Microsoft.XMLHTTP object.

WSH Panel Mod

Reply #1120
i've noticed that if a drag_drop on an other WSH panel (with no drag_drop support), items dragged are always sent to the active playlist !! it's not a normal way to do

It's the default behavior in CUI, you won't meet that in DUI. But I'll add something to make it possible to override that.


We'll be able to:
1. Get some data from any playlist element.
2. Apply context commands to any playlist element without selecting it.
3. Calc playlist length through paragraph 1.
4. Create custom WSH playlist view.

I think it's not a full list. Are these features really useless? I'm surprised.

1. Maybe useful...
2. WSH Panel Mod is not aimed to the automatic jobs. They should be confirmed by user before executed.
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.

The only way to workaround them is to provide some mechanism to host scripts in the background, however, I don't have any plan on it.

WSH Panel Mod

Reply #1121
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.

In this reason we can now make hundreds of code variants with existing methods and Foo will be slowed great.  So I think it's a thing based on user needs and possibilities only.
Please think about adding said function. It would be good feature. Really. 

WSH Panel Mod

Reply #1122
i've noticed that if a drag_drop on an other WSH panel (with no drag_drop support), items dragged are always sent to the active playlist !! it's not a normal way to do

It's the default behavior in CUI, you won't meet that in DUI. But I'll add something to make it possible to override that.


it's nice, thanx, *waits*

WSH Panel Mod

Reply #1123
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.

In this reason we can now make hundreds of code variants with existing methods and Foo will be slowed great.  So I think it's a thing based on user needs and possibilities only.
Please think about adding said function. It would be good feature. Really. 


Actually I hope to see something like WSH UI much more.

And in my opinion, WSH panel was designed to be used as a Trackinfo panel or something like that, instead of a playlist viewer. If someone would develop a specified Script control playlist component, the situation would be better.
Only my personal opinion.
mad messy misanthropist morbid mused

WSH Panel Mod

Reply #1124
Some things do not belong in script at all. A wise man once told me to keep what I can in the native language, and as little as I can in script.

As for costly tasks, it would probably be possible (assuming that WSH is cool with it) to add asynchronous enumeration so that tasks could be performed in worker threads which would have a significantly restricted set of legal functions, and which would invoke a callback in the UI thread when done.

This however, would greatly increase the complexity of using an already complex component, and increase the risk for mistakes manyfold, not to mention being quite bothersome to implement, if at all possible.

As with everything else, there's tradeoffs involved.
Stay sane, exile.