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

WSH Panel Mod

Reply #1226
Hello!
do anyone know some way to get a list of dsp presets? maybe some additional libraries or anytging else? i want to create popup menu for switching dsp preset, now i switchin between two presets, which i create in main menu and call them by name.

also, can anybody explain how work with list of songs in playlist - for example, i need to sum length of all songs. how can i do this?

WSH Panel Mod

Reply #1227
WSH playlist viewer, soon a reality when the next version of WSH panel mod will be ready for release (thanx to T.P Wang for all his efforts put in this component)

http://www.youtube.com/watch?v=6Z8habWLFtI

my script is still in W.I.P stage, will be shared with the community when WSH panel mod associated version will be ready and released

WSH Panel Mod

Reply #1228
wow, playlist is cool, i always want to create my own playlist viewer, so when its released ill try it. but what about dsp? could developer put this function to this release?


WSH Panel Mod

Reply #1230
and no any additional libraries to do that? is possible to create library that send to wsh panel list of dsp presets?

WSH Panel Mod

Reply #1231
i stumbled across the 1.5.0 preview on falstaff's DA page and i've been having a play with it. thanks for fixing the estimatelinewrap thing.

i'm experimenting with the new playlist manager and i've run across 2 little issues. first of all there doesn't appear to be anyway to delete items from the playlist when using default UI. i can use the "edit" main menu commands in columns UI but they're greyed out in DUI. i guess this is because it expects a playlist to have focus. are they any other workarounds to get around this? secondly, i've been testing it side by side with a regular playlist and i have the selection stuff pretty much sorted. when i select items in my WSH playlist, the "proper" playlist updates just fine. but other components don't seem to register the selection change. it's only when changing the playing track that it triggers a change (same issue in both DUI and CUI).

anyway thanks for the all the work you've put into this.

WSH Panel Mod

Reply #1232
@marc2003

- point already reported to T.P. (Edit menu not available under DUI, no focus considered by the menu on a wsh panel)

- what components don't update the selection ? i haven't noticed a such issue here, but i haven't tested so many 3rd party panels with my wsh playlist viewer...

WSH Panel Mod

Reply #1233
with my 2nd problem, no panels at all update in default UI. i suspect this is related to a playlist not having focus, the same problem as with the edit menu. other playlist viewers recognise the change but not other components. i made this video to illustrate it....

http://dl.dropbox.com/u/22801321/wsh1.avi (2.5MB)

in columns UI, i tried the item details and default artwork view and they both update ok. but adding my own WSH panel does not work. it of course works fine when using a proper playlist view.

i must admit, i'm completely stumped with how i'm going to handle group headers. you've managed it but i don't think my poor little brain will be able to work it out. 

WSH Panel Mod

Reply #1234
ok, i see, seems to be close of the 1st issue (edit menu)

for me, biography panel & esplaylist grab the selection change, but Panel Properties & Album art viewer don't.

under CUI no problems

WSH Panel Mod

Reply #1235
under CUI no problems


what about another WSH panel? try this...

Code: [Select]
var font = gdi.Font("Segoe UI", 12);
var g_text = "";
var g_metadb = fb.GetFocusItem();
on_item_focus_change();

function on_paint(gr) {
    gr.GdiDrawText(g_text, font, 0, 0, 0, window.Width, window.Height, 0x00000001 | 0x00000004 |  0x00000010 | 0x00000400 | 0x00000800);
}

function on_item_focus_change() {
    if (g_metadb) window.UnwatchMetadb();
    g_metadb = fb.GetFocusItem();
    if (g_metadb) {
        window.WatchMetadb(g_metadb);
        g_text = fb.TitleFormat("%artist% - %title%").EvalWithMetadb(g_metadb);
    } else {
        g_text = "[no selection]";
    }
    window.Repaint();
}


it won't update using my WSH playlist but works fine from a proper playlist viewer.

edit: sorry T.P but i found another problem with estimatelinewrap. punctuation gets pushed onto a new line even when there is no space between it and the preceding word.



WSH Panel Mod

Reply #1237
i think i need to study the docs some more. i've obviously missed something you have in your script.

WSH Panel Mod

Reply #1238
on simple click, here is what i do :

                        plman.SetPlaylistFocusItem(fb.ActivePlaylist, this.id);
                        plman.ClearPlaylistSelection(fb.ActivePlaylist);
                        plman.SetPlaylistSelectionSingle(fb.ActivePlaylist, this.id, true);

HTH

WSH Panel Mod

Reply #1239
i wasn't using the first line there. thanks. <<edit2: that works in default UI. that's great as i don't really use any other components apart from EsPlaylist as my library viewer. if i can get a workaround for deleting items i'll be very happy.

edit: i've got ctrl+mouse click working for multiple selections just like you. have you managed to get shift+click working or simply using the mouse+drag yet? i haven't tried yet. that's something for tomorrow.

i notice also from your video, you have your context menu as root? have you created this manually meaning you can't use converter/file operation presets unless you hardcode them all in? i'm using the context menu manager which only seems to work as a sub-menu but at least all items are created dynamically....


WSH Panel Mod

Reply #1240
Shift + mouse selection coded here + click on group header to select the whole group too.

my context menu fontion called on right click is below :

Code: [Select]
function new_context_menu(x, y, id, array_id) {
    var MF_STRING = 0x00000000;
    var MF_SEPARATOR = 0x00000800;
    var MF_GRAYED = 0x00000001;
    var MF_DISABLED = 0x00000002;
      
    var _menu = window.CreatePopupMenu();
    var Context = fb.CreateContextMenuManager();
    Context.InitContext(IC.metadb_list);
    Context.BuildMenu(_menu, 1, -1);

    _menu.AppendMenuItem(MF_SEPARATOR, 0, "");
    _menu.AppendMenuItem(fb.IsPlaying?MF_STRING:MF_DISABLED, 800, "Show Now Playing");

    window.Repaint();
    
    IC.context_menu_called = true;
    
    var ret = _menu.TrackPopupMenu(x, y);
    if(ret<800) {
        Context.ExecuteByID(ret - 1);
    } else {
        switch (ret) {
        case 800:
            ShowNowPlaying();
            on_item_focus_change();
            break;
        }
    }
}


HTH

WSH Panel Mod

Reply #1241
hehe, i'm too stupid for all this. thanks again.


WSH Panel Mod

Reply #1243
i'm back again.... 

Code: [Select]
function on_playlist_items_selection_change() {
    fb.trace(plman.GetPlaylistFocusItemIndex(plman.ActivePlaylist));
}

displays 0 whatever i select. am i using it wrong or is it a bug?

WSH Panel Mod

Reply #1244
looks like a terrible bug  ... this feature was just added in preview4 but it make the panel crashed... i've wrote to T.P to check it, no feedback yet ... i think we have to wait for preview 5 now

until now, i have replaced this api by using the Find() methods of the handleList object :
Code: [Select]
var g_metadb_playlist = plman.GetPlaylistItems(fb.ActivePlaylist);
...
...
focused_idx = g_metadb_playlist.Find(fb.GetFocusItem());

WSH Panel Mod

Reply #1245
@marc2003!

i realize that you have no crash with it, have you got a new version of v1.5.0 ? because it crashes in preview 4

?

WSH Panel Mod

Reply #1246
yeah mine doesn't crash. looking at the changelog on the google code page, the spelling of the function was changed in the last update so you must have an older version. i compiled my own from source. it's still labelled as preview 4 though. here it is...

http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip

i've also corrected a typo in interface.api for the code completion (plman.PlayingPlaylist was plman.PlaylingPlaylist )

edit: thanks for your workaround, my playlist now jumps to the right place when foobar starts. nice.

WSH Panel Mod

Reply #1247
thanx a lot marc, it seems that GetPlaylistFocusItemIndex() works fine, it returns the focused item index, not the selected item index, that could explain why you get 0 on selection item changed

i've talked too quickly ... returns 0 too here, i test it more...

EDIT: yep, always return 0, so it doesn't work

WSH Panel Mod

Reply #1248
above link updated with preview 5.

Quote
ADD: Add "InsertPlaylistItems" and "InsertPlaylistItemsFilter" to plman object.
FIX: Fix a problem that "plman.GetPlaylistFocusItemIndex" doesn't exist


edit: oops, the console is getting spammed by some debugging code T.P must have left in. line 67 shouldn't be there.

http://code.google.com/p/foo-wsh-panel-mod...aylist_impl.cpp

i've updated my compile with that line removed.

edit2: @T.P if you read this, the typo i mentioned in interface.api with plman.PlaylingPlaylist is still there also.