IPB

Welcome Guest ( Log In | Register )

60 Pages V  « < 54 55 56 57 58 > »   
Reply to this topicStart new topic
WSH Panel Mod, foo_uie_wsh_panel_mod
r0k
post Jun 4 2012, 15:38
Post #1376





Group: Members
Posts: 74
Joined: 8-September 11
Member No.: 93574



Suggestion : MetaDBHandles from Library

Hi again. Now a real suggestion.
Would it be possible to add some way to get an IFbMetadbHandleList directly from the library rather than a playlist.
According to this thread in the developpers forum, there are methods (library_manager::enum_items() or library_manager::get_all_items() )to do this. However i don't know how, or even if they can be used to create a WSH method as i know nothing of C++ prgramming.
Such a method could be used to code a library browser in WSH without dirty trick like creating a temporary auto-playlist.
Go to the top of the page
+Quote Post
Falstaff
post Jun 4 2012, 17:08
Post #1377





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



+1 wink.gif

http://www.hydrogenaudio.org/forums/index....st&p=797701


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Snivets
post Jun 7 2012, 05:58
Post #1378





Group: Members
Posts: 20
Joined: 22-May 09
From: Seattle, WA, USA
Member No.: 70034



Is there a simple way to draw rotated text?
Also! Is there a way to access the current playback mode?
My aim is to draw "REPEAT" or "LINEAR" or whatnot vertically along the left side of my playlist, so it takes up the least room and adds variety to the otherwise overwhelmingly horizontal layout I have going on.

One last question, is there a way to get rid of the ever so faint light gray border on between my panels that show up even if the 'border style' property is set to none on Win7?
Go to the top of the page
+Quote Post
Falstaff
post Jun 7 2012, 07:22
Post #1379





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



QUOTE (Snivets @ Jun 7 2012, 06:58) *
Is there a simple way to draw rotated text?

simple, no. But possible to write text in an image object (have to be defined first), then when image done, draw it with the desired angle

e.g.
CODE

// declare globals variable
var image;
....

// in a function called once on script launching, create the image ...
image = gdi.CreateImage(70, 25);
gb = image.GetGraphics();
var font = gdi.Font("tahoma", 10, 0);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT", font, 0xff000000, 0, 0, 70, 25, cc_stringformat); // cc_stringformat is to be defined (alignement... check WSH doc of DrawString api)
image.ReleaseGraphics(gb);
....

// then in on_paint function, you'll be able to draw this image but with a rotate of 90░ ....
var angle = 90;
gb.DrawImage(image, 100, 100, 70, 25, 0, 0, 70, 25, angle, 255);
....


QUOTE (Snivets @ Jun 7 2012, 06:58) *
Also! Is there a way to access the current playback mode?

read the doc (interfaces.txt), extract:

// Known playback orders:
// Default: 0,
// RepeatPlaylist: 1,
// RepeatTrack: 2,
// Random: 3,
// ShuffleTracks: 4,
// ShuffleAlbums: 5,
// ShuffleFolders: 6
(read, write) uint PlaybackOrder;

so just use in your script fb.PlaybackOrder

QUOTE (Snivets @ Jun 7 2012, 06:58) *
One last question, is there a way to get rid of the ever so faint light gray border on between my panels that show up even if the 'border style' property is set to none on Win7?

the only way to remove visible splitters (their colors math the windows visual style colors (button face)) is to use Panel Stack Splitter component for ColumnsUI. in DUI, you can't get rid off these splitters.
http://www.hydrogenaudio.org/forums/index....showtopic=62114

HTH



--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Perocat
post Jun 7 2012, 16:38
Post #1380





Group: Members
Posts: 11
Joined: 22-September 11
Member No.: 93883



Is it possible to create a button to run another program by click on it?

I'm able to create the button but don't know how to run the programm:

Buttons.a = new Button(0, 22, 58, 14, {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}, function(){??????????SOMETHING???????????});

thank you all!
Go to the top of the page
+Quote Post
ExtremeHunter
post Jun 7 2012, 17:04
Post #1381





Group: Members
Posts: 133
Joined: 5-October 08
From: Estonia
Member No.: 59398



var WshShell = new ActiveXObject("WScript.Shell");

Buttons.a = new Button(0, 22, 58, 14, {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}, function(){WshShell.Run("notepad.exe")});

This post has been edited by ExtremeHunter: Jun 7 2012, 17:06
Go to the top of the page
+Quote Post
Perocat
post Jun 7 2012, 19:57
Post #1382





Group: Members
Posts: 11
Joined: 22-September 11
Member No.: 93883



QUOTE (ExtremeHunter @ Jun 7 2012, 17:04) *
var WshShell = new ActiveXObject("WScript.Shell");

Buttons.a = new Button(0, 22, 58, 14, {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}, function(){WshShell.Run("notepad.exe")});


Thank you very much!

I got this error an error at line 13, so this line:

var WshShell = new ActiveXObject("WScript.Shell");

Go to the top of the page
+Quote Post
Falstaff
post Jun 7 2012, 21:32
Post #1383





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



QUOTE (Perocat @ Jun 7 2012, 20:57) *
I got this error an error at line 13, so this line:

var WshShell = new ActiveXObject("WScript.Shell");


go to foobar2000 Preferences>Tools>WSH Panel Mod, then untick "Safe Mode" option

that will fix the error.


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Perocat
post Jun 7 2012, 23:08
Post #1384





Group: Members
Posts: 11
Joined: 22-September 11
Member No.: 93883



QUOTE (Falstaff @ Jun 7 2012, 21:32) *
QUOTE (Perocat @ Jun 7 2012, 20:57) *
I got this error an error at line 13, so this line:

var WshShell = new ActiveXObject("WScript.Shell");


go to foobar2000 Preferences>Tools>WSH Panel Mod, then untick "Safe Mode" option

that will fix the error.


Thank you :-) now it's working perfect!!
Go to the top of the page
+Quote Post
r3v0
post Jul 22 2012, 19:15
Post #1385





Group: Members
Posts: 107
Joined: 25-August 08
From: Netherlands
Member No.: 57475



Is it possible to use fb.Titleformat to set a var which can be used everywhere in foobar?
For example set a var test with a value abc:

fb.Titleformat("$puts(test,abc)");

And than use anywhere else in foobar $get(test) to retrieve that value?



--------------------
<3 F00
Go to the top of the page
+Quote Post
Zao
post Jul 22 2012, 19:23
Post #1386





Group: Members (Donating)
Posts: 908
Joined: 25-September 03
From: Umeň, Sweden
Member No.: 9001



There was a time when you could do pretty much anything in titleformatting hooks. That time is thankfully long gone.


--------------------
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.
Go to the top of the page
+Quote Post
r3v0
post Jul 22 2012, 20:59
Post #1387





Group: Members
Posts: 107
Joined: 25-August 08
From: Netherlands
Member No.: 57475



QUOTE (Zao @ Jul 22 2012, 20:23) *
There was a time when you could do pretty much anything in titleformatting hooks. That time is thankfully long gone.


hmm, I wanted to pass the playlist name to the default playlist view.
Nothing serious tongue.gif


--------------------
<3 F00
Go to the top of the page
+Quote Post
MordredKLB
post Sep 5 2012, 22:28
Post #1388





Group: Members
Posts: 198
Joined: 1-May 09
From: Austin, TX
Member No.: 69413



I'm having a weird problem with gdi.Image. I've got the following four lines in the global declarations of my script:
CODE
pref["bg_image"]   = fb.ProfilePath+"images/WSHtpc04/wallpaper-blueish.jpg";
pref["settng_img"] = fb.ProfilePath+"images/WSHtpc04/settings.png";

var image_bg      = gdi.Image(pref["bg_image"]);   // background image
var settingsImg   = gdi.Image(pref["settng_img"]); // settings image


When I make changes to the script and hit OK or Apply both images appear just fine. When I close and reopen foobar, or switch between configs and back (i.e. loading the script in ANY other manner than OK/Apply) image_bg displays just fine, but settingsImg does not.

I put the following check in on_init():
CODE
    if (settingsImg == null) {
        fb.trace("settingsImg was null");
        settingsImg = gdi.Image(pref["settng_img"]);
        }

The trace line gets hit, but settingsImg still doesn't display. settingsImg is NEVER assigned anywhere else except the on_init or declaration. Anybody have any ideas? Is it because it's a .png?

And yes, I'm disposing and nulling both images in on_script_unload().
Go to the top of the page
+Quote Post
MordredKLB
post Sep 6 2012, 00:02
Post #1389





Group: Members
Posts: 198
Joined: 1-May 09
From: Austin, TX
Member No.: 69413



Figured it out. My on_init function is not a standard callback, just a function that gets called when the script loads. It calls on_size() manually which apparently doesn't have a window setup so Window.Width and Window.Height are both 0, therefore the image was being positioned offscreen because I was offsetting it from the right edge. Guess that's the dangers of editing from someone elses scripts.

This post has been edited by MordredKLB: Sep 6 2012, 00:03
Go to the top of the page
+Quote Post
T.P Wang
post Sep 11 2012, 09:05
Post #1390





Group: Developer
Posts: 486
Joined: 8-June 07
From: Chengdu
Member No.: 44175



WSH Panel Mod v1.5.4 is released, this is a maintenance build.

In the upcoming release (1.6.0 maybe), I'm considering separating scripts into files that allow users to choose their favorite editors , and, make changes while scripts stuck at start up.

For the library thing, I still have no plan to add these apis in the near future, sorry.
Go to the top of the page
+Quote Post
marc2003
post Sep 12 2012, 11:25
Post #1391





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



fb.CursorFollowPlayback and fb.PlaybackFollowCursor don't appear to be writeable. i can easily workaround this by using the main menu commands but i just thought i'd report it as the docs do say you can both read and write.....

This post has been edited by marc2003: Sep 12 2012, 11:25
Go to the top of the page
+Quote Post
T.P Wang
post Sep 12 2012, 12:26
Post #1392





Group: Developer
Posts: 486
Joined: 8-June 07
From: Chengdu
Member No.: 44175



@marc2003:
This is my test case, but I cannot reproduce your problem:
CODE

var bk_PlaybackFollowCursor = fb.PlaybackFollowCursor;
var bk_CursorFollowPlayback = fb.CursorFollowPlayback;

fb.PlaybackFollowCursor = !bk_PlaybackFollowCursor;
fb.CursorFollowPlayback = !bk_CursorFollowPlayback;

var error = false;
var message = "";

if (fb.PlaybackFollowCursor == bk_PlaybackFollowCursor) {
message += "[ERROR] PlaybackFollowCursor cannot be assigned.\r\n";
error = true;
}

if (fb.CursorFollowPlayback == bk_CursorFollowPlayback) {
message += "[ERROR] CursorFollowPlayback cannot be assigned.\r\n";
error = true;
}


if (!error) {
message = "[INFO] It seems that PlaybackFollowCursor and CursorFollowPlayback both work."
}

fb.ShowPopupMessage(message, "Test Case");


My guess is that some other things prevent you from changing these.
Go to the top of the page
+Quote Post
marc2003
post Sep 13 2012, 10:03
Post #1393





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



it's me being a complete idiot again. i realised pretty much straight away after i posted what i had done wrong but i couldn't get back to a computer until today. sorry for wasting your time. dry.gif
Go to the top of the page
+Quote Post
Falstaff
post Sep 14 2012, 20:56
Post #1394





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



i'm very pleased to see a new release of my favorite foobar2000 component smile.gif thanks T.P

I've a question and if possible a request tongue.gif

is it possible to get the color of a pixel of an image object? i'd like to draw a background with a color close to the album art color : by resizing the cover image to the size of 1x1 pixel, i think it will give me the main color of a cover, and if WSH panel mod could provide a method to get the color of this pixel, i could grab it and then use it ...

so, is it possible and so could you think about it for the v1.6.0 ^^'

thanx by advance for your feedback T.P

Cheers and long life to WSH Panel Mod


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
Falstaff
post Sep 18 2012, 22:07
Post #1395





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



any answer would be appreciated ...


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
T.P Wang
post Sep 19 2012, 07:47
Post #1396





Group: Developer
Posts: 486
Joined: 8-June 07
From: Chengdu
Member No.: 44175



I'll avoid adding methods like GetPixel(), its likely to be abused...
The best method for your need is a color scheme generator, I'll have a look later.
Go to the top of the page
+Quote Post
Falstaff
post Sep 19 2012, 17:51
Post #1397





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



hmm, you're maybe right, it's too "touchee" ^^

all other idea for the wanted result are of course very welcome, thanx T.P.


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
godrick
post Sep 19 2012, 18:38
Post #1398





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



On the topic of pixels, I've been trying to align text and images in scripts that maintain alignment as string length and font sizes change for different image and screen sizes, but without success. The .length of a string just provides the length in characters, not pixels as I desire.

I searched for something to do this, but could only find examples that seemed specific to HTML, and this approach , which i'm still trying to absorb.

Any advice on how to determine the pixel length of a string within a WSH script is appreciated. If there is no existing straightforward way, then it would be great to have the ability to do so via a future panel mod function. Thanks!
Go to the top of the page
+Quote Post
T.P Wang
post Sep 20 2012, 08:46
Post #1399





Group: Developer
Posts: 486
Joined: 8-June 07
From: Chengdu
Member No.: 44175



@godrick:

See references:
CalcTextHeight()
CalcTextWidth()

you'll probably want:
MeasureString()
Go to the top of the page
+Quote Post
Falstaff
post Sep 24 2012, 17:39
Post #1400





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



always about my Quest to grab color of a pixel (i've found a way to grab a pixel as an image to aply it as a biger image for an overlay color),

is there a way to compare 2 images object ?

@T.P. Wang: it's maybe a more acceptable method to add to GdiBitmap object than a getPixel one ? what about it ?

This post has been edited by Falstaff: Sep 24 2012, 18:00


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post

60 Pages V  « < 54 55 56 57 58 > » 
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: 17th September 2014 - 07:31