IPB

Welcome Guest ( Log In | Register )

143 Pages V  « < 72 73 74 75 76 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help
onv
post Sep 14 2012, 10:25
Post #1826





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



@Falstaff

is it possible to add this option to a WSH Playlist Viewer (item.cover_type=2) ?

Go to the top of the page
+Quote Post
marc2003
post Sep 14 2012, 12:32
Post #1827





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



@godrick

CODE
fb.TitleFormat("$strrchr(" + e_1 + "),_)").Eval();


Go to the top of the page
+Quote Post
danielkza
post Sep 14 2012, 23:22
Post #1828





Group: Members
Posts: 18
Joined: 23-January 12
Member No.: 96658



A function I made to make my life a bit easier: it can register object methods to be called as if they were global callbacks. The following example will print 3 messages in the logs whenever the playback state is changed: one for each of the objects that registered their own callbacks in their constructors, and one for the global callback, that was properly stored before replacement. Get the actual code at github.

CODE

// Actual code ommited, grab the latest version from the link above!
// function registerFooCallbacks(obj);

function MyPlayMonitor(id)
{
this.id = id;
registerFooCallbacks(this);
};
MyPlayMonitor.prototype.on_play_order_changed = function(new_order_index)
{
fb.trace("Play order changed! (id = " + this.id + ")");
};
MyPlayMonitor.prototype.on_playback_pause = function(state)
{
fb.trace("Playback state changed! (id = " + this.id + ")");
};

function on_playback_pause(state)
{
fb.trace("Global callback, reporting for duty.");
};

var play_orders = [new MyPlayMonitor("foo"), new MyPlayMonitor("bar")];


This post has been edited by danielkza: Sep 14 2012, 23:23
Go to the top of the page
+Quote Post
godrick
post Sep 15 2012, 00:25
Post #1829





Group: Members
Posts: 334
Joined: 31-December 10
Member No.: 86948



QUOTE (marc2003 @ Sep 14 2012, 12:32) *
@godrick

CODE
fb.TitleFormat("$strrchr(" + e_1 + "),_)").Eval();


Wow, I should have been able to figure that out....but I didn't. Thanks very much marc2003, once again!
Go to the top of the page
+Quote Post
Falstaff
post Sep 15 2012, 10:23
Post #1830





Group: Members
Posts: 2804
Joined: 12-November 06
Member No.: 37463



@onv

possible yep, from me no, sorry, there are better things that are waiting to be done imho.

This post has been edited by Falstaff: Sep 15 2012, 10:23


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
marc2003
post Sep 18 2012, 12:57
Post #1831





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



samples updated: http://dl.dropbox.com/u/22801321/samples.zip

musicbrainz releases has been renamed to musicbrainz. this is because it has a new mode and that is to show some clickable links to various pages online. unlike my weblinks script which attempts to guess URLs based on artist metadata, these are all official pages. you can switch between releases and URLs via the context menu.



This post has been edited by marc2003: Sep 18 2012, 12:58
Go to the top of the page
+Quote Post
MrMonkey
post Sep 18 2012, 15:05
Post #1832





Group: Members
Posts: 85
Joined: 22-August 10
Member No.: 83276



Would it be possible to combine the artreader with the playback buttons so that the buttons are on top of the artwork and functional?
I previously did something similar with the normal artwork reader + rainmeter's NowPlaying plugin but it wasn't the cleanest solution.

I'm not asking for someone to do it - I'm just asking if it's possible.

Thx.

This post has been edited by MrMonkey: Sep 18 2012, 15:06
Go to the top of the page
+Quote Post
godrick
post Sep 20 2012, 18:22
Post #1833





Group: Members
Posts: 334
Joined: 31-December 10
Member No.: 86948



I think I'm out of luck of this, but I'll ask just in case: I'd like to deselect options in the main foobar2000 toolbar in a js script. I tried fb.RunMainMenuCommand and fb.RunContextMenuCommand but no joy. I wasn't surprised by that, since I understand those commands are limited to what you can select from the main menu and context menu for what is playing, and the toolbar selections are not normally available either of those ways. I also looked through all the commands exposed by foo_runcmd and also did not find anything on point. I'd like this to work for DUI, so I can't hide the toolbar or status pane as CUI does as has been discussed many times.

For what it's worth, I'd like to not display all main toolbar selections other than buttons when my display goes below a certain size, and restore the display of certain toolbars when the display goes above that size. I'd settle for turning all toolbars off instead of selective control if that were the only option.

Is there something I'm missing, or a workaround other than use CUI? Thanks for any advice as usual!
Go to the top of the page
+Quote Post
godrick
post Sep 20 2012, 18:40
Post #1834





Group: Members
Posts: 334
Joined: 31-December 10
Member No.: 86948



marc2003 and anyone interested - this is what I came up with to revise Thumbs to automatically download images for all artists in a multivalue artist tag field and other fields as defined in the code below. If one wanted this to also work for multivalue composer or conductor tag fields, this could be changed to accommodate that easily. The first function is an existing function revised to add a new call, and the following two functions are new. No other changes to Thumbs - the artist field remapping selection still works as it did before. Thanks for the help!


CODE
function on_playback_new_track() {
on_item_focus_change();
update_all_images();
}

// new function to update all artist, composer, conductor images
function update_all_images() {
crcs = [];
folderart = [];
num = fb.TitleFormat("$meta_num(artist)").Eval();
debug && fb.trace("Thumbs script: " + num + " total artists");
for(i =0; i < num; i++) {
crcs[i] = fb.TitleFormat("$meta(artist," + i + ")").Eval();
folderart[i]= data_folder + fb.TitleFormat("$crc32(" + crcs[i] + ")").Eval();
debug && fb.trace("Thumbs script: artist " + i + " " + crcs[i]);
download_my_images();
}
crcs[i] = fb.TitleFormat("[%conductor%]").Eval();
if (crcs[i] != "") {
folderart[i]= data_folder + fb.TitleFormat("$crc32(" + crcs[i] + ")").Eval();
debug && fb.trace("Thumbs script: conductor " + crcs[i]);
download_my_images();}

crcs[i] = fb.TitleFormat("[%composer%]").Eval();
if (crcs[i] != "") {
folderart[i]= data_folder + fb.TitleFormat("$crc32(" + crcs[i] + ")").Eval();
debug && fb.trace("Thumbs script: composer " + crcs[i]);
download_my_images();}

debug && fb.trace("Thumbs script: completed downloading");
update_image();
}

//borrowed from common4 and tweaked - custom function to download art
function download_my_images() {
working = true;
window.Repaint();
debug && fb.trace("Thumbs script: downloading art for " + crcs[i]);
WshShell.Run('"' + script_path + 'art.exe" "' + crcs[i] + '" "' + folderart[i] + '" ' + limit, 0, true);
working = false;
}


This post has been edited by godrick: Sep 20 2012, 18:41
Go to the top of the page
+Quote Post
marc2003
post Sep 21 2012, 15:10
Post #1835





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (MrMonkey @ Sep 18 2012, 15:05) *
I'm not asking for someone to do it - I'm just asking if it's possible.


i've done it anyway - just a quick bodge together of the 2 scripts. http://dl.dropbox.com/u/22801321/art%20rea...k%20buttons.txt

QUOTE (godrick)
I'd like to deselect options in the main foobar2000 toolbar in a js script.


i'm not really sure what you mean by this as you can't customise the menu in DUI. but you can re-create your own. look at the MainMenuManager All-In-One script bundled in the samples folder that comes with the component. this allows you to use only partial submenus such as file, view, help etc so you could omit ones you don't use but this is only useful for columns where you can hide the original toolbar.
Go to the top of the page
+Quote Post
godrick
post Sep 21 2012, 17:05
Post #1836





Group: Members
Posts: 334
Joined: 31-December 10
Member No.: 86948



Sorry for not being clear: within a js script, for a DUI layout, if any of the following toolbar items are displayed, I want to not display them when my foobar2000 display size goes below a certain size:
- layout editing mode toggle
- playback order
- playlist switcher
- any visualization
- volume control

... and then restore the ones from the list above that were previously displayed when the screen size increases.

Anyone have any experience with something like autohotkey to control these (i.e., commands not accessible from the main menu or context menu for what is playing)?

This post has been edited by godrick: Sep 21 2012, 17:21
Go to the top of the page
+Quote Post
MrMonkey
post Sep 21 2012, 17:54
Post #1837





Group: Members
Posts: 85
Joined: 22-August 10
Member No.: 83276



QUOTE (marc2003 @ Sep 21 2012, 10:10) *
i've done it anyway - just a quick bodge together of the 2 scripts.

Amazing. Thank you so much.
Go to the top of the page
+Quote Post
marc2003
post Sep 22 2012, 12:54
Post #1838





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



small update to my musicbrainz script - http://dl.dropbox.com/u/22801321/samples.zip

it now has icons for the most popular websites...



(existing users need to extract the marc2003 folder again as it contains the new images)

@godrick, what you're asking is well beyond the scope of WSH panel mod.

panel stack splitter (for columns UI) can do this easily because you can hide the main toolbar and add each toolbar as a panel. you then have full control over what displays and what doesn't when panels are resized etc...
Go to the top of the page
+Quote Post
godrick
post Sep 27 2012, 15:35
Post #1839





Group: Members
Posts: 334
Joined: 31-December 10
Member No.: 86948



QUOTE (T.P Wang @ Sep 20 2012, 08:46) *
@godrick:

See references:
CalcTextHeight()
CalcTextWidth()

you'll probably want:
MeasureString()


I've struggled to find examples of any of these in an actual javascript to help me use them - if anyone has any js scripts that use these, or have written any js code to facilitate their use, it would be much appreciated if you could post or PM them to me.

This post has been edited by godrick: Sep 27 2012, 15:36
Go to the top of the page
+Quote Post
marc2003
post Sep 28 2012, 11:53
Post #1840





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



CODE
ww = 0;
wh = 0;
text = "some text and some more text bifsdfsdf sf s fsdfsdf sfsdfsf ";
font = gdi.Font("Segoe UI", 14);
colour = RGB(255,0,0);

function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}

function on_size() {
    ww = window.Width;
    wh = window.Height;
}

function on_paint(gr) {
    gr.DrawString(text, font, colour, 0, 0, ww, wh, 0);
    line_length = gr.MeasureString(text, font, 0, 0, ww, wh, 0).Width;
    gr.DrawLine(0, 15, line_length, 15, 1, colour);
}
Go to the top of the page
+Quote Post
romka18
post Sep 28 2012, 19:34
Post #1841





Group: Members
Posts: 47
Joined: 30-September 11
Member No.: 94073



QUOTE (ExtremeHunter @ Jun 12 2012, 08:46) *
Well, there is AutoitX3 and DynamicWrapperX ActiveX components.

With these to components only the sky is the limit. You can send messages, get system handles, create 'AERO' glass and so on.


can i with this addons create a callback for cdrom tray insert and drives changed (for example, inserted usb device, disk to cdrom or hdd)?

Go to the top of the page
+Quote Post
marc2003
post Sep 29 2012, 11:35
Post #1842





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



samples updated: http://dl.dropbox.com/u/22801321/samples.zip

simple text reader now has a toggle on the right click menu to enable/disable fixed width fonts.

(existing users must extract the marc2003 folder again as well as importing the new script)
Go to the top of the page
+Quote Post
romka18
post Sep 29 2012, 21:29
Post #1843





Group: Members
Posts: 47
Joined: 30-September 11
Member No.: 94073



i use window.repaintrect with constant size, but cpu loading depends on window size. is it normal?
Go to the top of the page
+Quote Post
godrick
post Oct 3 2012, 23:52
Post #1844





Group: Members
Posts: 334
Joined: 31-December 10
Member No.: 86948



marc2003, a belated thanks for the script showing MeasureString in actual js use. I can't thank you enough for the help!
Go to the top of the page
+Quote Post
marc2003
post Oct 9 2012, 09:34
Post #1845





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



samples updated: http://dl.dropbox.com/u/22801321/samples.zip

no changes to scripts but the file foo_allmusic_mod.vbs inside the marc2003 folder has been updated to work with recent changes on the allmusic site. thanks to romor for his original script and providing this fix.
Go to the top of the page
+Quote Post
PeteG
post Oct 10 2012, 07:23
Post #1846





Group: Members
Posts: 56
Joined: 10-June 12
From: Denmark
Member No.: 100577



GdiDrawText-based text in panels doesn't automatically break words or phrases between e.g. () or "" nicely.
The parentheses and the quotation marks get widowed or orphaned:

Blah blah (
blah) blah.
Flip "flop
" flip flop.

The flag DT_WORDBREAK doesn't seem to handle (some?) glyphs and the like, or is the rub placed somewhere else?
Is it doable in JS or VBS to write a simple function that takes care of these situations?
As far as I can see, MSDN doesn't provide any solutions.
My limited mental capabilities prohibit me from composing a usable search string and google for a solution headbang.gif.

I'm very grateful to marc2003 for especially the Artreader and Allmusic scripts and of course to T.P Wang for making all this possible.
It's great fun reading the WSH fora.
(I'm not a programmer any more, it's 25 years since I made my last endless loop on a mainframe ... this GDI stuff is indeed terra incognita).

This post has been edited by PeteG: Oct 10 2012, 07:30
Go to the top of the page
+Quote Post
romka18
post Oct 10 2012, 08:00
Post #1847





Group: Members
Posts: 47
Joined: 30-September 11
Member No.: 94073



in new version (v1.5.5.1) this doesnt work:

CODE
//GetDeviceInfo by GiveMe9 http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=770121
var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;
//SoundDevice
g_text = "SoundDeviceInfo";
var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SoundDevice", "WQL",wbemFlagReturnImmediately|wbemFlagForwardOnly); //<<<<<---error there
var enumItems = new Enumerator(colItems);
for (; !enumItems.atEnd(); enumItems.moveNext()){
    var objItem = enumItems.item();
    g_text += "\nProductName:"+objItem.ProductName;
    g_text += "\nstatus:"+objItem.Status;
}
//END_GetDeviceInfo


any way to solve this problem?

also doesnt understand how custom tooltip works - cant put normally string on it

This post has been edited by romka18: Oct 10 2012, 08:02
Go to the top of the page
+Quote Post
Fractal_Mortalit...
post Oct 10 2012, 13:14
Post #1848





Group: Members
Posts: 374
Joined: 20-June 05
Member No.: 22863



With the seemingly apparent death of foo soft Playlists... I'm wondering if any of you WSH script wizards could conjure up an easy way to aggregate a last. Fm user's loved tracks onto a Playlist. I relied heavily on this to as a quick and easy way update my tracks that had not yet been tagged in foobar as loved.

This post has been edited by Fractal_Mortality: Oct 10 2012, 13:15


--------------------
http://www.last.fm/user/magnumforce2006
Go to the top of the page
+Quote Post
romor
post Oct 10 2012, 15:15
Post #1849





Group: Members
Posts: 682
Joined: 16-January 09
Member No.: 65630



Here is stylesheet (xspf.xslt) that transforms last.fm XML response to XSPF playlist: view or download

CLI Usage: msxsl lastfm-response.xml xspf.xslt -o lastfm-response.xspf

where lastfm-response.xml is response from i.e.:

CODE
GET http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=some_user_name&api_key=some_api_key

Of course it's not limited to just 'user.getlovedtracks' call

Some thoughts:

- obviously there is no other way, except XSPF, to reference tracks w/o providing track location
- foo_softplaylist is the only component able to handle XSPF paired to local library (I've done this in COM server component by iterating library, but it's not that great)
- user has to access menu (load xspf...) and browse to XSPF location, to be able to see result
- I have no idea if msxsl tool comes by default with Windows or I got it from office or by d/l msxml tools, anyway it's not necessary for end user to have this tool, as XSLT can be easily done with WSH, this is just one raw possibility with a small battery inside
- maybe foo_softplaylist developer will wake up in the meantime

This post has been edited by romor: Oct 10 2012, 15:17


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
marc2003
post Oct 15 2012, 09:58
Post #1850





Group: Members
Posts: 4895
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (PeteG @ Oct 10 2012, 07:23) *
GdiDrawText-based text in panels doesn't automatically break words or phrases between e.g. () or "" nicely.
The parentheses and the quotation marks get widowed or orphaned:

Blah blah (
blah) blah.
Flip "flop
" flip flop.

The flag DT_WORDBREAK doesn't seem to handle (some?) glyphs and the like, or is the rub placed somewhere else?


if you're talking about my scripts, then the problem is indeed elsewhere. i'm using the WSH panel mod EstimateLineWrap function which seems to be the cause of this problem. the reason i started using this is to get an accurate height for long bodies of text so i can control when to stop scrolling.

This post has been edited by marc2003: Oct 15 2012, 10:00
Go to the top of the page
+Quote Post

143 Pages V  « < 72 73 74 75 76 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th December 2014 - 05:06