IPB

Welcome Guest ( Log In | Register )

125 Pages V  « < 98 99 100 101 102 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
Jango
post Jun 1 2013, 11:18
Post #2476





Group: Members
Posts: 11
Joined: 31-August 10
From: Germany
Member No.: 83497



Thank You!!! It's working
Go to the top of the page
+Quote Post
Jango
post Jun 5 2013, 17:44
Post #2477





Group: Members
Posts: 11
Joined: 31-August 10
From: Germany
Member No.: 83497



I played a litle bit with the SetInterval function.
I want on playback new track that the text pop up in my pannel.
But only once and not untill eternity...
here Is my modified code from page 80

CODE
// -------------------------------------------------------------------------- //
// @name "TXT FX Alpha"
// -------------------------------------------------------------------------- //

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

DT_LEFT=0x00000000;
DT_CALCRECT = 0x00000400;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_NOPREFIX = 0x00000800;

var special_font = "Calibri";
var font_h = 1;
var font_h1 = 12;

function on_paint(gr) {
gr.GdiDrawText("XXXXXXXXXXXXXXX", gdi.Font(special_font, font_h, 1), RGB(0, 255, 0), 1,10, 404, 16, DT_LEFT | DT_CALCRECT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
}

var TXT_Interval = 150;
var TXT_Timer;
var TXT_TimerStarted = false;

function onTXT_Timer() {

if (!TXT_TimerStarted) {

TXT_Timer = window.SetInterval(function () {
if (font_h >= font_h1) font_h = 0;
font_h += 1;
window.Repaint();
}, TXT_Interval);

TXT_TimerStarted = true;

}}

function stopTXT_Timer() {
window.ClearInterval(TXT_Timer);
TXT_TimerStarted = false;
}

function on_playback_stop(reason) {
if (reason != 2) {
stopTXT_Timer();
}}

function on_playback_pause(state) {
if (state) stopTXT_Timer();
else onTXT_Timer();
}

function on_playback_new_track() {
onTXT_Timer();
}


I hope somebody can help me.
Thank You
Go to the top of the page
+Quote Post
ExtremeHunter
post Jun 5 2013, 19:56
Post #2478





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



Try this.

CODE
function onTXT_Timer() {

if (!TXT_TimerStarted) {
font_h = 0;
TXT_Timer = window.SetInterval(function () {

font_h += 1;
if (font_h >= font_h1) {
stopTXT_Timer();
}
window.Repaint();
}, TXT_Interval);

TXT_TimerStarted = true;

}}
Go to the top of the page
+Quote Post
Jango
post Jun 6 2013, 16:59
Post #2479





Group: Members
Posts: 11
Joined: 31-August 10
From: Germany
Member No.: 83497



Thank You Hunter!
Now it works.
Here is the Code...

CODE
// -------------------------------------------------------------------------- //
// @name "TXT FX Working"
// -------------------------------------------------------------------------- //

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

DT_CENTER = 0x00000001;
DT_CALCRECT = 0x00000400;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_NOPREFIX = 0x00000800;

var special_font = "Calibri";

var size_a0 = 12;
var size_a1 = 12;
var size_b0 = 11;
var size_b1 = 11;

function on_paint(gr) {

gr.GdiDrawText("FOOBAR", gdi.Font(special_font, size_a0, 1), RGB(0, 255, 0), 0,10, window.Width, 16, DT_CENTER | DT_CALCRECT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
gr.GdiDrawText("2000", gdi.Font(special_font, size_b0, 0), RGB(0, 255, 0), 0,30, window.Width, 16, DT_CENTER | DT_CALCRECT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);

}

var TXT_Interval = 75;
var TXT_Timer;
var TXT_TimerStarted = false;

function onTXT_Timer() {

if (!TXT_TimerStarted) {
size_a0 = 1;
size_b0 = 1;
TXT_Timer = window.SetInterval(function () {

size_a0 += 1;
size_b0 += 1;

if (size_b0 >= size_b1) size_b0 = size_b1;
if (size_a0 >= size_a1) {
stopTXT_Timer();
}
window.Repaint();
}, TXT_Interval);

TXT_TimerStarted = true;

}}



function stopTXT_Timer() {
window.ClearInterval(TXT_Timer);
TXT_TimerStarted = false;
}



function on_playback_new_track() {
onTXT_Timer();
}
Go to the top of the page
+Quote Post
patanpatan
post Jun 6 2013, 19:22
Post #2480





Group: Members
Posts: 9
Joined: 9-April 12
Member No.: 98584



Hi @marc2033, thanks for all your work.
I'm using Now Playing v1.4, and it's great. I've been trying to make a change, I want the thumbs to move forward one step on every image cycle.
I thought im.images was an array, so I've tried to do a .shift, and I've tried to change this.offset on every step, but I can't get it to work.
Is there some variable with the current image index? maybe I could use it to call this.wheel(index).
Let me know if it's feasible (and please consider a script update if you think it's worthy).

Thanks!
Go to the top of the page
+Quote Post
vothanhdat
post Jun 7 2013, 02:45
Post #2481





Group: Members
Posts: 2
Joined: 5-June 13
Member No.: 108497



How do I get library RelativePath in wshpanel mod.
I`m coding "WSH libray search and viewer" but I don`t know how to get library RelativePath;
WSH panel mod
Go to the top of the page
+Quote Post
marc2003
post Jun 7 2013, 07:00
Post #2482





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



@patanpatan, i might think about making that change but it won't be for a good few days.

@vothanhdat, there are no library features at all in WSH panel mod.
Go to the top of the page
+Quote Post
marc2003
post Jun 9 2013, 11:58
Post #2483





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



samples updated.

CODE
7.2013-06-09.01

"Thumbs" / "Now playing". Fix stupid bug where image cycle
mode would only work when the mouse pointer is over the
panel.


existing users: right click>Update script
full download: https://dl.dropboxusercontent.com/u/22801321/wsh/samples.zip
changelog: https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

files changed:
CODE
marc2003\common7.js
Go to the top of the page
+Quote Post
phool
post Jun 10 2013, 18:56
Post #2484





Group: Members
Posts: 87
Joined: 10-April 08
Member No.: 52685



QUOTE (ExtremeHunter @ Jan 22 2013, 21:31) *
antheo

Here's very simple script for rotating image on playback time.

CODE
var image = gdi.Image(fb.FoobarPath + "images\\vinyl.jpg");
var angle = 0;

function on_paint(gr) {

gr.DrawImage(image, 0, 0, 500, 500, 0, 0, image.width, image.height, angle);

}
function on_playback_time(time){

if(angle >= 360) angle = 0;
angle += 60;
window.Repaint();

}


I tested it with this Vinyl image smile.gif


Being a complete coding noob, how would I be able to get this to work with a folder not in the foobar media library stored with png files that have been saved as "%album artist% - %album%.png".

The other catch is that the filenames of the images are all lower case, while in the foobar media library they are effectively title case (I'm not sure if that makes a difference for wsh panel).

This post has been edited by phool: Jun 10 2013, 19:04
Go to the top of the page
+Quote Post
PureHydrogen
post Jun 19 2013, 22:02
Post #2485





Group: Members
Posts: 1
Joined: 6-June 13
Member No.: 108523



Hi,

First off I'm a totally new to Jscript or WSH Panel Mod but I'm trying to create a skin for foobar so I need it.
What I'm looking for is a script for a seek bar which is a half circle which slowly progresses as the song progresses.
And a similar one for the volume control. Where full volume would be and complete half circle and muted no circle.
I was wondering if this is at all possible. And if so, if somebody can help me with it.

Greetings,
Pure
Go to the top of the page
+Quote Post
Yeksfys
post Jun 19 2013, 22:34
Post #2486





Group: Members
Posts: 6
Joined: 16-December 12
Member No.: 105215



Example (PopupMenu): change and restore playlists.
foo_playcount is required to view the history and new.

CODE
// Use with MenuManager()
// {{
var MF_SEPARATOR = 0x00000800;
var MF_ENABLED = 0x00000000;
var MF_GRAYED = 0x00000001;
var MF_DISABLED = 0x00000002;
var MF_UNCHECKED = 0x00000000;
var MF_CHECKED = 0x00000008;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;
var MF_RIGHTJUSTIFY = 0x00004000;
// }}

function on_mouse_lbtn_up(x, y, mask) {
switch_playlist_menu(x, y);
return true;
}

function isQueuePlaylistPresent() {
for (var i = 0; i < plman.PlaylistCount; i++) {
if (plman.GetPlaylistName(i) == "Queue Content") {
return i;
}
}
return -1;
}

function isLibraryPlaylistPresent() {
for (var i = 0; i < plman.PlaylistCount; i++) {
if (plman.GetPlaylistName(i) == "Library") {
return i;
}
}
return -1;
}

function isHistoryPlaylistPresent() {
for (var i = 0; i < plman.PlaylistCount; i++) {
if (plman.GetPlaylistName(i) == "History") {
return i;
}
}
return -1;
}

function isNewPlaylistPresent() {
for (var i = 0; i < plman.PlaylistCount; i++) {
if (plman.GetPlaylistName(i) == "New") {
return i;
}
}
return -1;
}

function ShowPlaylistQueue(focus_id) {
var total_pl = plman.PlaylistCount;
var queue_pl_idx = isQueuePlaylistPresent();
if (queue_pl_idx < 0) {
plman.CreatePlaylist(total_pl, "Queue Content");
queue_pl_idx = total_pl;
plman.ActivePlaylist = queue_pl_idx;
} else {
plman.ActivePlaylist = queue_pl_idx;
fb.ClearPlaylist();
};
var queue_total = plman.GetPlaybackQueueCount();
var vbarr = plman.GetPlaybackQueueContents();
var arr = vbarr.toArray();
var q_handlelist = plman.GetPlaylistSelectedItems(queue_pl_idx);
q_handlelist.RemoveAll();
for (var i = 0; i < queue_total; i++) {
q_handlelist.Add(arr[i].Handle);
};
plman.InsertPlaylistItems(queue_pl_idx, i, q_handlelist, false);
plman.SetPlaylistFocusItem(queue_pl_idx, focus_id);
}

function RenamePL(idx) {
fb.ActivePlaylist = idx;
fb.RunMainMenuCommand("File/Rename Playlist");
}

function switch_playlist_menu(x, y) {

var p = window.CreatePopupMenu();
var pr = window.CreatePopupMenu();

var act = plman.ActivePlaylist;
var ply_act = plman.PlayingPlaylist;
var prm = plman.PlaylistRecyclerManager;
var pl_count = plman.PlaylistCount;

p.AppendMenuItem(MF_STRING, 2000, "New playlist");
p.AppendMenuItem(MF_STRING, 895, "Autoplaylist...");
p.AppendMenuItem(MF_STRING, 2001, "Load playlist...");

if (pl_count >= 2) {
p.AppendMenuItem(MF_SEPARATOR, 0, 0);
for (var i = 0; i < pl_count; i++) {
if (plman.GetPlaylistName(i) != "New" && plman.GetPlaylistName(i) != "History" && plman.GetPlaylistName(i) != "Queue Content" && plman.GetPlaylistName(i) != "Library") {
var np = i == plman.PlayingPlaylist ? " (playing)" : "";
//var ap = fb.IsAutoPlaylist(i) ? "*" : "";
p.AppendMenuItem(MF_STRING, 2003 + i, plman.GetPlaylistName(i) + np);
try {
p.CheckMenuRadioItem(2003, 2003 + i, act + 2003);
} catch (e) {}
}
}
}

p.AppendMenuItem(MF_SEPARATOR, 0, 0);
p.AppendMenuItem(MF_STRING, 983, "Show Library" + (plman.GetPlaylistName(ply_act) == "Library" ? " (playing)" : ""));
p.AppendMenuItem(MF_STRING, 981, "Show New" + (plman.GetPlaylistName(ply_act) == "New" ? " (playing)" : ""));
p.AppendMenuItem(MF_STRING, 980, "Show History" + (plman.GetPlaylistName(ply_act) == "History" ? " (playing)" : ""));
var q_count = plman.PlaylistItemCount(isQueuePlaylistPresent());
var count_plq = (q_count > 0 ? " - " + q_count + (q_count > 1 ? " songs" : " song") : "");
p.AppendMenuItem(plman.IsPlaybackQueueActive() ? MF_STRING : MF_GRAYED | MF_DISABLED, 982, "Show Queue" + count_plq);
var pl_prd = plman.GetPlaylistName(act) == "New" ? 981 : plman.GetPlaylistName(act) == "History" ? 980 : plman.GetPlaylistName(act) == "Queue Content" ? 982 : plman.GetPlaylistName(act) == "Library" ? 983 : false;
p.CheckMenuRadioItem(980, 983, pl_prd);

p.AppendMenuItem(MF_SEPARATOR, 0, 0);
pr.AppendTo(p, prm.Count >= 1 ? MF_STRING : MF_GRAYED | MF_DISABLED, "Restore");
if (prm.Count >= 1) {
for (var irm = 0; irm < prm.Count; irm++) {
pr.AppendMenuItem(MF_STRING, 3001 + irm, prm.Name(irm));
}
}

var ret = p.TrackPopupMenu(x, y);
if (ret < 1000) {
switch (ret) {
case 980:
var total_pl = plman.PlaylistCount;
var history_pl_idx = isHistoryPlaylistPresent();
if (history_pl_idx < 0) {
fb.ActivePlaylist = fb.CreateAutoPlaylist(fb.PlaylistCount, "History", "%last_played% DURING LAST 1 DAY SORT DESCENDING BY %last_played%", "", true);
history_pl_idx = total_pl;
plman.ActivePlaylist = history_pl_idx;
} else {
plman.ActivePlaylist = history_pl_idx;
fb.ClearPlaylist();
}
break;
case 981:
var total_pl = plman.PlaylistCount;
var new_pl_idx = isNewPlaylistPresent();
if (new_pl_idx < 0) {
fb.ActivePlaylist = fb.CreateAutoPlaylist(fb.PlaylistCount, "New", "%added% DURING LAST 1 WEEK SORT DESCENDING BY %added%", "", true);
new_pl_idx = total_pl;
plman.ActivePlaylist = new_pl_idx;
} else {
plman.ActivePlaylist = new_pl_idx;
fb.ClearPlaylist();
}
break;
case 982:
ShowPlaylistQueue(0);
break;
case 983:
var total_pl = plman.PlaylistCount;
var library_pl_idx = isLibraryPlaylistPresent();
if (library_pl_idx < 0) {
fb.ActivePlaylist = fb.CreateAutoPlaylist(fb.PlaylistCount, "Library", "%path% PRESENT");
library_pl_idx = total_pl;
plman.ActivePlaylist = library_pl_idx;
} else {
plman.ActivePlaylist = library_pl_idx;
fb.ClearPlaylist();
}
break;
case 895:
fb.ActivePlaylist = fb.CreateAutoPlaylist(fb.PlaylistCount, "", "");
RenamePL(fb.ActivePlaylist);
fb.ShowAutoPlaylistUI(fb.ActivePlaylist);
break;
}
} else {
switch (ret) {
case 2000:
fb.RunMainMenuCommand("File/New playlist");
break;
case 2001:
fb.RunMainMenuCommand("File/Load playlist...");
break;
default:
plman.ActivePlaylist = (ret - 2003);
}
}

if (ret > 3000) {
switch (ret) {
default:
(prm.Count >= 1) && prm.Restore(ret - 3001);
}
}

p.Dispose();
pr.Dispose();
return true;
}


This post has been edited by Yeksfys: Jun 19 2013, 23:00
Go to the top of the page
+Quote Post
millzeyweb
post Jun 29 2013, 16:34
Post #2487





Group: Members
Posts: 3
Joined: 4-May 12
Member No.: 99480



I'm finding Marc's weblinks (preferrably small weblinks version) quite useful, but I dont like the idea of it needing to generate web traffic to gather the artist links from the json data everytime a song is played. Would it be feasable and efficient enough to store successful retrieval of such data in a textfile or some other database type using WSH, and having an update button to manually update? If so, is there a script around already which works with a text/db file that does the same thing so I might could try to build something like this on my own, rather than begging Marc to do it? smile.gif

Thanks
Go to the top of the page
+Quote Post
marc2003
post Jun 29 2013, 18:39
Post #2488





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



it already caches data for each artist. it is stored for one week before it checks again for updates.
Go to the top of the page
+Quote Post
Reith
post Jul 10 2013, 14:10
Post #2489





Group: Members
Posts: 33
Joined: 11-July 09
From: California
Member No.: 71369



Hey marc, thanks again for the scripts, I've been using them for a while now.

Just out of curiosity, is it possible to hide the buttons (Myspace/Discogs/Allmusic/etc) in the Now Playing script by commenting some of it out? Could you maybe point me to the lines I would need for that? Lines 69-73 seem to work, but I just want to double check.

Edit: I want to keep the Youtube button, so I tried swapping that one with the one that appears in the last line and commenting the rest out. It works okay at first, but then whenever I re-launch foobar all the buttons are back until I open the panel config and hit apply again. It doesn't help that I actually have no idea what I'm doing. tongue.gif

This post has been edited by Reith: Jul 10 2013, 14:16
Go to the top of the page
+Quote Post
marc2003
post Jul 11 2013, 09:27
Post #2490





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



on line 60, replace the whole b.update function with this..

CODE
b.update = function() {
    if (p.metadb) {
        var artist = encodeURIComponent(p.eval("%artist%"));
        var title = encodeURIComponent(p.eval("%title%"));
        var youtube = "http://www.youtube.com/results?search_query=" + artist + "+" + title;
        b.buttons.youtube = new button(im.x + im.w - 32, bar2y - 1, 32, 32, {normal: "youtube.png", hover: "youtube_h.png"}, function() { p.browser(youtube); }, youtube);
    }
    window.RepaintRect(0, bar2y, im.w, bar2h);
}


Go to the top of the page
+Quote Post
Reith
post Jul 11 2013, 11:58
Post #2491





Group: Members
Posts: 33
Joined: 11-July 09
From: California
Member No.: 71369



Works perfect, thank you!
Go to the top of the page
+Quote Post
cliffflip
post Jul 15 2013, 12:16
Post #2492





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



Hi marc,
Is it possible to add blur effect for cover artwork?
pretty much like the background on Poweramp Music Player for Android : https://play.google.com/store/apps/details?...layer&hl=en

one more thing, the last.fm charts codes from your sample, Is there any way to make the background transparent,
or at least change its color?

thank you very much!

This post has been edited by cliffflip: Jul 15 2013, 12:16
Go to the top of the page
+Quote Post
marc2003
post Jul 15 2013, 12:45
Post #2493





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



you can draw any image you like behind the artwork display. are you looking to edit the CD jewel case or artreader panel?

as for the transparent background, edit line 9...

CODE
var p = new panel("Last.fm Charts", ["lastfm_charts"]);


so it becomes

CODE
var p = new panel("Last.fm Charts", ["lastfm_charts", "custom_background"]);


now you can right click the panel>Background>None (None only appears when using columns UI - it's obviously not available when using default UI)


Go to the top of the page
+Quote Post
cliffflip
post Jul 15 2013, 13:14
Post #2494





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



thanks marc,

the artreader panel, so the bigger & blurred artwork for the background, and draw the smaller one on top of it (with shadow effect if it's possible).
Go to the top of the page
+Quote Post
marc2003
post Jul 15 2013, 13:24
Post #2495





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



i'll be honest and say i don't really know what you mean. i can't make anything out from the screenshots in that link as they're all very small on a 1080p screen - i guess the page is more optimised for mobile devices.

also, i should say i'm useless at making things look pretty so i doubt i'd be able to implement it anyway. tongue.gif
Go to the top of the page
+Quote Post
cliffflip
post Jul 15 2013, 13:58
Post #2496





Group: Members
Posts: 9
Joined: 15-July 13
Member No.: 109123



sorry my bad laugh.gif

here's what I meant anyway : http://tinypic.com/r/2iup7oj/5
Go to the top of the page
+Quote Post
marc2003
post Jul 15 2013, 15:02
Post #2497





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



if that background image is dynamically generated from the colours in the artwork, i can't do that. it would be possible to use your own "wallpaper" image as a background. the shadow effect should be possible but i don't know how. i'll have to dig around and see if i can find someone else's code that does it.

hopefully someone with more artistic flair will read this and have a suggestion.

This post has been edited by marc2003: Jul 15 2013, 15:04
Go to the top of the page
+Quote Post
Falstaff
post Jul 15 2013, 17:08
Post #2498





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



QUOTE (cliffflip @ Jul 15 2013, 14:58) *
sorry my bad laugh.gif

here's what I meant anyway : http://tinypic.com/r/2iup7oj/5


i like the idea, i may consider it for a art cover panel


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
marc2003
post Jul 15 2013, 20:20
Post #2499





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



here's a couple of quick bodge jobs i've made. it requires the marc2003 folder from my samples package and also this image saved inside your foobar profile marc2003\images folder.

https://dl.dropboxusercontent.com/u/2280132.../july/splat.jpg

if you want to use your own background, you can edit the filename on line 14.

first one is just a plain front cover on the background...

screenshot - https://dl.dropboxusercontent.com/u/2280132...3/july/art1.png
download - https://dl.dropboxusercontent.com/u/2280132...3/july/art1.txt

the second one has a seekbar and track details.

screenshot - https://dl.dropboxusercontent.com/u/2280132...3/july/art2.png
download - https://dl.dropboxusercontent.com/u/2280132...3/july/art2.txt

(note the right click options to change centre/crop/stretch do not work. i'm not going to edit my common file just for this)
Go to the top of the page
+Quote Post
Rarn
post Jul 24 2013, 18:25
Post #2500





Group: Members
Posts: 12
Joined: 26-July 11
Member No.: 92568



Is there a way to send a command that jumps to the currently playing playlist, and highlights the playing track?

Basically I'd want a button that does the exact same thing as double clicking the status bar.

I know how to make the button I just don't know what the command would be, or if it is possible!

thanks!

edit: this is in DUI if that is relevant.

This post has been edited by Rarn: Jul 24 2013, 18:27
Go to the top of the page
+Quote Post

125 Pages V  « < 98 99 100 101 102 > » 
Reply to this topicStart new topic
3 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
1 Members: millzeyweb

 



RSS Lo-Fi Version Time is now: 27th August 2014 - 20:22