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 script discussion/help (Read 1507171 times) previous topic - next topic
0 Members and 12 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #1300
What about playlist header contex menu? Is it possible to interact with it?

Thanks
foo foo foo

WSH Panel Mod script discussion/help

Reply #1301
r0lZ, you are a real champion...
I can't concentrate real hard right now, my eyes are welling up.
My cat Astro... I had him put down and I can't concentrate.
He liked coming into my room and listening to music with me; I feel a bit lost.
Thanks.

I'm really sorry, man.  I have a cat too, and I understand.

BTW, the ApplyMask() bug has been confirmed by T.P Wang, and will be fixed soon...


Hi r0lZ,

Many thanks for the script. Is it possible to draw a shadow around the album art?

WSH Panel Mod script discussion/help

Reply #1302
What is the point of copying that quote in full !!?? Why didn't you just ask r0lZ a question !!??

WSH Panel Mod script discussion/help

Reply #1303
What is the point of copying that quote in full !!?? Why didn't you just ask r0lZ a question !!??


I just clicked the reply button on the right but forgot to delete the quotes 

WSH Panel Mod script discussion/help

Reply #1304
                                                       [!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--]— WSH TextFile Viewer —[/size]

A script for displaying a text file in a WSH panel
View a screenshot of my own foobar2000 rendering the script (upper right side):
!!Read this before using the script...

+                                                 "WSH TextFile Viewer"
+
+  Displays a specified text file found in the same folder as the playing track in a foobar2000 panel.
+  When a track is played and the text file is not found, rather than display nothing, your panel will display:

+           _____________________________________________________
+           folder.txt
+
+
+  - To create the panel in your foobar2000 layout, use "WSH Panel Mod" component, and import this script.
+    It works with "Default User Interface" (DUI) or "Columns UI" (CUI).
+
+  - To display a text file with EVERY album one needs a very disciplined attitude to the presentation of his music collection;
+    it is time consuming, and essentially you are training yourself to be a professional librarian.
+    Personally, I find it highly educational and constructive.
+
+  - It is a good idea to create a standard name for your text file and stick to it;
+    My standard name for the text file is "folder.txt", which matches well with my standard name for all coverart "folder.jpg".
+    Also, for consistent display in foobar2000, try to create a standard template for your text file and stick to it;
+    To get you started, I have included a few sample templates further down this page.
+
+    Furthermore: If you discipline yourself to keep a TXT file in every album folder, it will be useful if
+    one day, filenames and tags are somehow all screwed up ...you have lost track of something,
+    you need to find where it is buried in your music collection...
+
+           So you fire up the Windows Command Prompt and type (example):
+              FINDSTR /I /S /P /M /C:"some string" "F:\my music" folder.txt
+           or for multiple items (example):
+              FINDSTR /I /S /P /M /C:"the beatles" "vinyl" "F:\my music" *.txt *.cue
+           and you have found your lost item(s) !!
+
+  - ALL text files MUST be saved with ANSI encoding (ie. not Unicode etc).
+    If you see wierd characters being rendered in your Panel, open the text file in "Notepad" and go to the menu: 
+    File -> Save As... -> and choose "ANSI" from the Encoding drop-down.
+
+  - If your panel continues to show wierd characters instead of rendering the text file,
+    there may be more than one text file in the containing folder. Remove the other text files.
+
+  - You MUST use a Monospace Font if you want correct text indenting.
+    I chose "Arial monospace" as my personal favourite. Therefore, the default font in this script is set to "Arial monospace - size 10". 
+    If it is not found, your Panel will default to your system font. To edit, go to the code section named "FONT SETTINGS".
+
+  - You can tweak text margins and alignments, if you wish. To edit, go to the code section named "DISPLAY PARAMETERS".
+
+  - I have edited this script to ONLY display text files named "folder.txt" ...ALL OTHER TEXT FILES WILL BE IGNORED !!!
+    If you prefer to change this to reading of ANY text file, then go to the code section named  "TEXT FILE PARAMETERS"



WSH_TextFile_Viewer.txt — Note: I have made this really easy and user friendly; guided comments and explanations are placed all through the script.
Code: [Select]
/* :::::::::::::::::::::: Script Engine: JScript :::::::::::::::::::::::::::::::
================================================================================
================================================================================
================================================================================
================================================================================
+
+                        "WSH TextFile Viewer"
+
+  Displays a specified text file found in the same folder as the playing track in a foobar2000 panel.
+  When a track is played and the text file is not found, rather than display nothing, your panel will display:

+      _____________________________________________________
+      folder.txt
+
+
+  - To create the panel in your foobar2000 layout, use "WSH Panel Mod" component, and import this script.
+    It works with "Default User Interface" (DUI) or "Columns UI" (CUI).
+
+  - To display a text file with EVERY album one needs a very disciplined attitude to the presentation of his music collection;
+    it is time consuming, and essentially you are training yourself to be a professional librarian.
+    Personally, I find it highly educational and constructive.
+
+  - It is a good idea to create a standard name for your text file and stick to it;
+    My standard name for the text file is "folder.txt", which matches well with my standard name for all coverart "folder.jpg".
+    Also, for consistent display in foobar2000, try to create a standard template for your text file and stick to it;
+    To get you started, I have included a few sample templates further down this page.
+
+    Furthermore: If you discipline yourself to keep a TXT file in every album folder, it will be useful if
+    one day, filenames and tags are somehow all screwed up ...you have lost track of something,
+    you need to find where it is buried in your music collection...
+
+        So you fire up the Windows Command Prompt and type (example):
+          FINDSTR /I /S /P /M /C:"some string" "F:\my music" folder.txt
+        or for multiple items (example):
+          FINDSTR /I /S /P /M /C:"the beatles" "vinyl" "F:\my music" *.txt *.cue
+        and you have found your lost item(s) !!
+
+  - ALL text files MUST be saved with ANSI encoding (ie. not Unicode etc).
+    If you see wierd characters being rendered in your Panel, open the text file in "Notepad" and go to the menu: 
+    File -> Save As... -> and choose "ANSI" from the Encoding drop-down.
+
+  - If your panel continues to show wierd characters instead of rendering the text file,
+    there may be more than one text file in the containing folder. Remove the other text files.
+
+  - You MUST use a Monospace Font if you want correct text indenting.
+    I chose "Arial monospace" as my personal favourite. Therefore, the default font in this script is set to "Arial monospace - size 10". 
+    If it is not found, your Panel will default to your system font. To edit, go to the code section named "FONT SETTINGS".
+
+  - You can tweak text margins and alignments, if you wish. To edit, go to the code section named "DISPLAY PARAMETERS".
+
+  - I have edited this script to ONLY display text files named "folder.txt" ...ALL OTHER TEXT FILES WILL BE IGNORED !!!
+    If you prefer to change this to reading of ANY text file, then go to the code section named  "TEXT FILE PARAMETERS" 
+
+
+    -- Enjoy ~derty2
+
+    -- This script is a modification of (".nfoo Viewer 1.1" ©2010 by Matthijs Brobbel). All credits go to him.     
+      [http://code.google.com/p/foobar-silk/][http://matthijsb.deviantart.com/art/nfoo-Viewer-1-1-170638369]
+
================================================================================
================================================================================
 


  // ------------------------------------------------------------------------
  // --- Useful Characters For Composing Your Text File  (Keyboard Mappings)
  // ------------------------------------------------------------------------


        —            Em Dash                    Alt+0151
        •            Bullet                    Alt+0149
        ©            Copyright Sign            Alt+0169

 


================================================================================
================================================================================



  // ---------------------------------------------------------------------
  // --- Useful Template for a Classical Music album - START TEXT FILE
  // ---------------------------------------------------------------------



Chicago Symphony Orchestra - Fritz Reiner, conductor

SERGEI PROKOFIEV (1891-1953): Lieutenant Kije, film score and symphonic suite for orchestra, Op.60 (1957)

IGOR STRAVINSKY (1882-1971): Song Of The Nightingale, symphonic poem for orchestra (1956)

• Composed, Classical, 20th Century, Orchestral Suite, Folk Tune, Tone Poem

• Most older listeners agree that Prokofiev's "Lieutenant Kije" suite was ideal repertoire for Fritz Reiner and the Chicago Symphony Orchestra. In this superb recording, Reiner and the Chicago were at the top of their form and their Kiji is witty, sassy, brave, ironic, and altogether hilarious. It was originally written for a movie. Contrastingly, Reiner and the Chicago were seemingly out of their element with Stravinsky's tone poem "Song of the Nightingale". With its spiky motifs, its primary colors, its hard harmonies, and its relentless rhythms, the repetoire did not seem a correct fit. But although their approach is essentially Straussian, Reiner and the Chicago still excel at Stravinsky's Nightingale. It was written as a tribute to Hans Christian Anderson.
____________________________________________________________________________________________________
_____
Vinyl LP 180g, RCA/Chesky #RC10, USA, Reissue from original 3-track master tape ~ Rip by NETTZ (Nov 2011)

———————— TRACKS ———————

Side 1
  01. Prokofiev — Lieutenant Kije, Op.60
        : The Birth of Kije
        : Romance
        : Kije's Wedding
        : Troika
        : The Burial of Kije

        • Recorded: 1957
        • Written: 1934; Paris, France

Side 2
  02. Stravinsky — Song Of The Nightingale
        : Presto
        : Chinese March
        : Song of The Nightingale
        : The Mechanical Nightingale
        : The Emperor's Displeasure at the departure of the real nightingale
        : The Emperor's sickroom
        : The real nightingale returns to thwart Death
        : Funeral march and Finale

        • Recorded: 1956
        • Written: 1917; Switzerland

———————— CREDITS ———————

**Composed By – Igor Stravinsky, Sergei Prokofiev      **Conductor – Fritz Reiner      **Orchestra – Chicago Symphony Orchestra      **Produced by - Richard Mohr      **Recording Engineer - Lewis Layton      |||      **Mastering Engineer – Jack Adelman      **Executive Producers - David and Norman Chesky      **Design [Photo] – Ben Rose      **Liner Notes – Irving Kolodin

———————— NOTES ———————

Premium Vinyl Pressing HQ-180 (180 gram vinyl)
Audiophile re-issue of RCA LSC-2150
"Master Recordings Owned Exclusively by RCA Records, a label of BMG Music"
Prokofiev has alternative spelling of "Prokofieff" on this album.

This record was reproduced from the original three-track master session tape. The playback machine was an Ampex 300 series three track tape recorder totally retubed and rebuilt to the highest standards available today. The three tracks were mixed to two, using a modified Perfectionist Audio Components Pro Reference Tube Preamp. The signal was fed from the preamp directly into the lathe, bypassing the mixing console and all equalizers, thus eliminating one more set of electronic coloration.

———————— COMMENTS ———————

"..This (RC10) is one of Chesky’s best efforts, I like it better than the newer Classic Records version, and it's the LP that got me interested in RCA Living Stereo! Bravo Chesky.." ---vinylfanatics.com/analoglovers/page26.html

———————— RIP LOG ———————

Ripped by NETTZ | Nov 2011

Technical Info:
• Turntable: Roksan Radius III
• Tonearm: Audioquest PT-9
• Cartridge: Ortofon X5-MC (Moving Coil)
• Phono Cable: Van den Hul D-502 Hybrid
• Pre-amplifier: Counterpoint SA 5.1 (vacuum tube Sovtek 6922)
• Interconnect: balanced, Belden 1813A cable with Neutrik XLR connectors
• Analog to Digital Converter: EMU 1212M (configured for balanced input +4dBu, 0 dB Gain)
• Capture software: Goldwave 5.58
• Post processing: ClickRepair, setting: 20, reverse, wavelet x2




  // -------------------------------------------------------------------
  // --- Useful Template for a Classical Music album - END TEXT FILE
  // -------------------------------------------------------------------




       
================================================================================
================================================================================




  // -------------------------------------------------------------------
  // --- Useful Template for a Popular Music album - START TEXT FILE
  // -------------------------------------------------------------------
 


 
The Romantics  —  The Romantics  (1980)

• Popular, Pop Rock, Power Pop, USA
• The Romantics didn't exactly reinvent the wheel with this album, but they sure knew how to make it roll, and for sheer party enhancing energy, this album is hard to beat. The songs are a glorious pastiche of period pop styles (think the Kinks and the Easybeats with a bit of the Hollies thrown in for melodic appeal) played with a hard-stomping energy and a genuine love for the vintage style that doesn't reek of nostalgia. The production is simple but smart enough to put the hooks at the energy end up front where they belong, and the Romantics never had a set of tunes this strong again.
____________________________________________________________________________
CD Album, Nemperor/Epic(Sony) #ZK 36273, USA, ©1993 ~ Exact Audio Copy 1.0b2

———————— TRACKS ————————

01. When I Look In Your Eyes
02. Tell It To Carrie
03. First In Line
04. Keep In Touch
05. Girl Next Door
06. What I Like About You
07. She's Got Everything
08. Till I See You Again
09. Hung On You
10. Little White Lies
11. Gimme One More Chance

———————— CREDITS ————————

**Bass, Vocals – Rich Cole      **Drums, Vocals – Jimmy Marinos      **Lead Guitar, Vocals – Mike Skill      **Rhythm Guitar, Vocals – Wally Palmar      **Producer – Peter Solley      **Engineer – Steve Brown      **Mastered By – Greg Calbi

———————— RIP LOG ————————

*** CD Rip by "JOHN CITIZEN" | Nov 2011 ***

Exact Audio Copy V1.0 beta 2 from 29. April 2011

EAC extraction logfile from 15. July 2011, 20:20

Used drive  : TDK    CDRW4800B  Adapter: 2  ID: 1

Read mode              : Secure
Utilize accurate stream : Yes
Defeat audio cache      : Yes
Make use of C2 pointers : No

Read offset correction                      : 6
Overread into Lead-In and Lead-Out          : No
Fill up missing offset samples with silence : Yes
Delete leading and trailing silent blocks  : No
Null samples used in CRC calculations      : Yes
Used interface                              : Native Win32 interface for Win NT & 2000

Used output format : Internal WAV Routines
Sample format      : 44.100 Hz; 16 Bit; Stereo


TOC of the extracted CD

    Track |  Start  |  Length  | Start sector | End sector
    ---------------------------------------------------------
        1  |  0:00.00 |  3:01.10 |        0    |    13584 
        2  |  3:01.10 |  3:23.55 |    13585    |    28864 
        3  |  6:24.65 |  2:38.00 |    28865    |    40714 
        4  |  9:02.65 |  3:42.02 |    40715    |    57366 
        5  | 12:44.67 |  4:41.65 |    57367    |    78506 
        6  | 17:26.57 |  2:55.30 |    78507    |    91661 
        7  | 20:22.12 |  2:35.40 |    91662    |  103326 
        8  | 22:57.52 |  3:53.70 |    103327    |  120871 
        9  | 26:51.47 |  3:25.50 |    120872    |  136296 
      10  | 30:17.22 |  2:39.65 |    136297    |  148286 
      11  | 32:57.12 |  4:28.08 |    148287    |  168394 

 
 


  // -----------------------------------------------------------------
  // --- Useful Template for a Popular Music album - END TEXT FILE
  // -----------------------------------------------------------------
 
 
 
 
================================================================================
================================================================================
================================================================================
================================================================================
*/





function readTXT(){
displaytext = ""; 
    txt = "————————————————————————————————————————————————————————\nfolder.txt";
    if (! fb.IsPlaying) return;
    try{
        var xpath = fb.TitleFormat("%path%").EvalWithMetadb(fb.GetNowPlaying());
        var path = xpath.substring(0, xpath.lastIndexOf("\\")) + "\\";
        var Folder = fso.GetFolder(path);
        var filelist = new Enumerator(Folder.Files);
        for (i=0;!filelist.atEnd();filelist.moveNext()) {
if (filelist.item().name.match(/.*\.txt$/)) {

// ================================================================================================= TEXT FILE PARAMETERS - START
   
//txtfile = fso.OpenTextFile(path + filelist.item().name, 1, -1);  // <---------- THIS IS THE ORIGINAL CODE --- Enables reading of ANY text file found in folder of playing track --- !!KNOWN PROBLEM: it opens text files from wrong location in some instances, such as when opening URL STREAMS from a playlist ------------>

//txtfile = fso.OpenTextFile(path + "folder.txt", 1, -1);  <---------- "-1" PARAMETER --- Always auto-creates a blank specified text file (if not exist) in the same folder as the track being played ------------>

// --- MY PREFERENCE:  If specified text file (folder.txt) exists in folder of playing track, display it, ELSE show specified characters (at line 273).
txtfile = fso.OpenTextFile(path + "folder.txt", 1, 1); 

// ================================================================================================= TEXT FILE PARAMETERS - END

txt = txtfile.ReadALL() + "\n\n";
txtfile.Close();
//displaytext = displaytext + txt;
}
            displaytext = txt;                 
        }
    }
    catch(e){
        try {
            txtfile.Close();
        }
        catch(f) {
        }
    }
    calc();
    window.Repaint();
}

// ================================================================================================= DISPLAY PARAMETERS - START

// <---------- You can tweak the text margins and alignments in the panel by adjusting the parameters here ---------->
// <---------- FYI: Centering text can be done with DT_CENTER . add it to the line like this:  "gr.GdiDrawText(displaytext ... DT_NOPREFIX | DT_CENTER);" ---------->

function on_paint(gr){
    gr.FillGradRect( 0, 0, ww, wh, 90, backcolor, backcolor);
    gr.GdiDrawText(displaytext, gfont, txtcolor, 5, offset + 10, ww-10, 60*wh,DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
}

// <------------------------------------- Backup of Original Script -------------------------------------------------------->
// function on_paint(gr){
//    gr.FillGradRect( 0, 0, ww, wh, 90, backcolor, backcolor);
//    gr.GdiDrawText(displaytext, gfont, txtcolor, 10, offset + 10, ww-20, 50*wh,DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
// }
// <------------------------------------------------------------------------------------------------------------------------->

// ================================================================================================= DISPLAY PARAMETERS - END

function on_mouse_rbtn_up(x, y){
    var _backgroundcolor = window.CreatePopupMenu();
    var _textcolor = window.CreatePopupMenu();
    var _menu = window.CreatePopupMenu();
    var idx;
   
    _menu.AppendMenuItem(MF_STRING, 1, "Update");
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
   
    _menu.AppendMenuItem(MF_STRING | MF_POPUP, _textcolor.ID, "Text Color");
    _textcolor.AppendMenuItem(MF_STRING, 98, "Foobar Text");
    _textcolor.AppendMenuItem(MF_STRING, 99, "Foobar Highlight");
    _textcolor.AppendMenuItem(MF_STRING, 101, "White");
    _textcolor.AppendMenuItem(MF_STRING, 102, "Red");
    _textcolor.AppendMenuItem(MF_STRING, 103, "Green");
    _textcolor.AppendMenuItem(MF_STRING, 104, "Blue");
    _textcolor.AppendMenuItem(MF_STRING, 105, "Yellow");
    _textcolor.AppendMenuItem(MF_STRING, 106, "Black");
   
    _menu.AppendMenuItem(MF_STRING | MF_POPUP, _backgroundcolor.ID, "Background Color");
    _backgroundcolor.AppendMenuItem(MF_STRING, 210, "Foobar Background");
    _backgroundcolor.AppendMenuItem(MF_STRING, 211, "White");
    _backgroundcolor.AppendMenuItem(MF_STRING, 212, "Red");
    _backgroundcolor.AppendMenuItem(MF_STRING, 213, "Green");
    _backgroundcolor.AppendMenuItem(MF_STRING, 214, "Blue");
    _backgroundcolor.AppendMenuItem(MF_STRING, 215, "Brown-Black");
    _backgroundcolor.AppendMenuItem(MF_STRING, 216, "Black");

   
    if(window.GetProperty("textcolor")==101){
        _textcolor.CheckMenuItem(101, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==102)
        {_textcolor.CheckMenuItem(102, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==103)
        {_textcolor.CheckMenuItem(103, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==104)
        {_textcolor.CheckMenuItem(104, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==105)
        {_textcolor.CheckMenuItem(105, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==106)
        {_textcolor.CheckMenuItem(106, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==98)
        {_textcolor.CheckMenuItem(98, window.GetProperty("textcolor"));}
    else if (window.GetProperty("textcolor")==99)
        {_textcolor.CheckMenuItem(99, window.GetProperty("textcolor"));}
       
    if(window.GetProperty("backgroundcolor")==211){
        _backgroundcolor.CheckMenuItem(211, window.GetProperty("backgroundcolor"));}
    else if (window.GetProperty("backgroundcolor")==212)
        {_backgroundcolor.CheckMenuItem(212, window.GetProperty("backgroundcolor"));}
    else if (window.GetProperty("backgroundcolor")==213)
        {_backgroundcolor.CheckMenuItem(213, window.GetProperty("backgroundcolor"));}
    else if (window.GetProperty("backgroundcolor")==214)
        {_backgroundcolor.CheckMenuItem(214, window.GetProperty("backgroundcolor"));}
    else if (window.GetProperty("backgroundcolor")==215)
        {_backgroundcolor.CheckMenuItem(215, window.GetProperty("backgroundcolor"));}
    else if (window.GetProperty("backgroundcolor")==216)
        {_backgroundcolor.CheckMenuItem(216, window.GetProperty("backgroundcolor"));}
    else if (window.GetProperty("backgroundcolor")==210)       
        {_backgroundcolor.CheckMenuItem(210, window.GetProperty("backgroundcolor"));}

    _menu.AppendMenuItem(MF_STRING, 8, "Configure");
       
    idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
            case 1:readTXT();calc();window.Repaint();break;
            case 8:window.ShowConfigure();break;       
            case 98:window.SetProperty("textcolor", 98);txtcolor  = g_textcolor;window.Repaint();break;
            case 99:window.SetProperty("textcolor", 99);txtcolor  = g_textcolor_hl;window.Repaint();break;
            case 101:window.SetProperty("textcolor", 101);txtcolor  = RGB(255,255,255);window.Repaint();break;
            case 102:window.SetProperty("textcolor", 102);txtcolor = RGB(255,50,50);window.Repaint();break;
            case 103:window.SetProperty("textcolor", 103);txtcolor = RGB(50,255,50);window.Repaint();break;
            case 104:window.SetProperty("textcolor", 104);txtcolor = RGB(150,150,250);window.Repaint();break;
            case 105:window.SetProperty("textcolor", 105);txtcolor = RGB(255,255,50);window.Repaint();break;
            case 106:window.SetProperty("textcolor", 105);txtcolor = RGB(10,10,10);window.Repaint();break;
            case 210:window.SetProperty("backgroundcolor", 210);backcolor= g_backcolor;window.Repaint();break;
            case 211:window.SetProperty("backgroundcolor", 211);backcolor= RGB(255,255,255);window.Repaint();break;
            case 212:window.SetProperty("backgroundcolor", 212);backcolor= RGB(255,50,50);window.Repaint();break;
            case 213:window.SetProperty("backgroundcolor", 213);backcolor= RGB(50,255,50);window.Repaint();break;
            case 214:window.SetProperty("backgroundcolor", 214);backcolor= RGB(10,36,106);window.Repaint();break;
            case 215:window.SetProperty("backgroundcolor", 215);backcolor= RGB(28,28,28);window.Repaint();break;
            case 216:window.SetProperty("backgroundcolor", 216);backcolor= RGB(0,0,0);window.Repaint();break;}
         
           
    _menu.Dispose();_textcolor.Dispose();_backgroundcolor.Dispose();return true;
}

DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_WORDBREAK = 0x00000010;
DT_CALCRECT = 0x00000400;
DT_NOPREFIX = 0x00000800;
MF_SEPARATOR = 0x00000800;
MF_ENABLED = 0x00000000;
MF_UNCHECKED = 0x00000000;
MF_CHECKED = 0x00000008;
MF_STRING = 0x00000000;
MF_POPUP = 0x00000010;

var fso = new ActiveXObject("Scripting.FileSystemObject");
var dui = window.InstanceType;
var displaytext = "";

// ================================================================================================= FONT SETTINGS - START

// <---------- gdi.Font is changed, the last paramter is style flags ---------->

// <---------- Style Flags Reference:  FontStyleRegular = 0  |  FontStyleBold = 1  |  FontStyleItalic = 2  |  FontStyleBoldItalic = 3  |  FontStyleUnderline = 4  |  FontStyleStrikeout = 8 ---------->

// <---------- Choose Font:  Un-comment the font you want to use  !! Make sure the target font exists  !! You MUST use a monospace font if you want correct text indenting  ---------->

            // --- MY PREFERENCE:  Arial monospace has a good overall feature set. It renders a large set of characters, It displays well at small sizes, is easy to read, and has a dotted zero.
            var gfont =gdi.Font("Arial monospaced for SAP", 10, 0);
           
            // --- MY SECOND PREFERENCE:  They are nearly identical. Have unembelished zero (No slashes or dots) which is quite nice.
            // var gfont =gdi.Font("OCRBLetM", 10, 0);
            // var gfont =gdi.Font("OCR-BczykNorm", 11, 0);

// ================================================================================================= FONT SETTINGS - END

var offset =0;
var ColorTypeDUI = {text: 0,background: 1,highlight: 2,selection: 3};
var ColorTypeCUI = {text: 0,selection_text: 1,inactive_selection_text: 2,background: 3,selection_background: 4,inactive_selection_background: 5,active_item_frame: 6};
String.prototype.count=function(s1){return (this.length - this.replace(new RegExp(s1,"g"), '').length) / s1.length;}

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

function get_colors() {
if (dui) {
g_textcolor = window.GetColorDUI(ColorTypeDUI.text);
g_textcolor_hl = window.GetColorDUI(ColorTypeDUI.highlight);
g_backcolor = window.GetColorDUI(ColorTypeDUI.background);
} else {
g_textcolor = window.GetColorCUI(ColorTypeCUI.text);
g_textcolor_hl = window.GetColorCUI(ColorTypeCUI.text);
g_backcolor = window.GetColorCUI(ColorTypeCUI.background);
}
}
function on_size(){
    ww = window.Width;
    wh = window.Height;
    calc();
    window.Repaint();
}
function calc(){
    temp_bmp = gdi.CreateImage(1, 1);
    temp_gr = temp_bmp.GetGraphics();
    arr = temp_gr.GdiDrawText(displaytext, gfont, g_textcolor, 0, 0, ww, wh-40,DT_CENTER| DT_WORDBREAK | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX).toArray();
    textheight = arr[3] - arr[1] + (wh)  + (displaytext.count("\n") * 3);
    temp_bmp.ReleaseGraphics(temp_gr);
    temp_bmp.Dispose();
    temp_gr = null;
    temp_bmp = null;offset = 0;
}
function on_mouse_wheel(delta){
    step = gfont.height * 5;
    offset += (delta * step);
    if(offset > 0 || textheight < wh) {
        offset = 0;}
        else {
            temp = -textheight + wh;
            if(offset < temp) offset = Math.round(temp / step) * step;
    }
    window.Repaint();
}
function on_playback_new_track(){
    readTXT();calc();
    window.Repaint();
}

get_colors();
on_size();

tc = window.GetProperty("textcolor",98);
if(tc==98){txtcolor = g_textcolor}else if(tc==99){txtcolor=g_textcolor_hl}else if(tc ==101){txtcolor = RGB(255,255,255);}else if(tc==102){txtcolor=RGB(255,50,50)}else if(tc==103){txtcolor=RGB(50,255,50)}else if(tc==104){txtcolor=RGB(150,150,250)}else if(tc==105){txtcolor=RGB(255,255,50)}else if(tc==106){txtcolor=RGB(10,10,10)};

bc = window.GetProperty("backgroundcolor",210);
if(bc==210){backcolor = g_backcolor}else if(bc ==211){backcolor = RGB(255,255,255);}else if(bc==212){backcolor=RGB(255,50,50)}else if(bc==213){backcolor=RGB(50,255,50)}else if(bc==214){backcolor=RGB(10,36,106)}else if(bc==215){backcolor=RGB(28,28,28)}else if(bc==216){backcolor=RGB(0,0,0)};

readTXT();
window.Repaint();

WSH Panel Mod script discussion/help

Reply #1305
Marc, i hope this question to you is in the right place:

I have been enjoying your "thumbs" script for WSH panel mod, and it has been showing thumbnails of the pictures in the directories where the music files are. So, if I click on an album, I can see the artwork in the same directory as that album - great!

Question - I have noticed that this has been slowing down browsing through my collection, in particular the loading of front & rear album artwork (the front is displayed in a CD jewel case using your script, and the back is just in an album art window). Any thoughts on how to improve this performance. Alternatively, could the script not scan the directory by default, but only when that particular tab is selected (or a button in the tab to scan is pressed)?

Thanks

WSH Panel Mod script discussion/help

Reply #1306
Sorry for hijacking the thread, sort of, but is it possible to merge two consistent panels with each other so they are viewed together, using WSH Panel Mod?

What I want to do is that I want the panel "Item details" displayed above "Channel spectrum panel", like this:



I'm quite new to scripting and all but I just wanted to know if it is possible or if there already is a script for this.

WSH Panel Mod script discussion/help

Reply #1307
Marc, back once again for your help and guidance.

I have been using your last.fm similar artist script, and it works like a charm.

One thing, that i would like to know, how easy would it be, to change the output from

artist1
artist2
artist3
artist4
artist5
artist6
artist7
artist8
artist9

to this

artist1  artist2  artist3  artist4
artist5  artist6  artist7  artist8
artist9

And if it is possible, which function should i go scratch around in.

Thanks in advance,


WSH Panel Mod script discussion/help

Reply #1308
Marc, I continue to enjoy your scripts - thanks very much!  A question that I can't figure out: is there a way to configure your thumbs script to have a custom folder location for images to be saved and still have the script automatically download images from lastfm if there are no images found for that artist in the custom location?  I have several portable installations of Foobar2000 around the house and only one standard installation, and I'd like all of the installations to share a common storage location for lastfm art without only having this custom location as the only source for all images (I still want the script to download images if it can't find any in the custom location).  I could be misunderstanding how the current thumbs script works, but it seems to only allow automatic download of images for the default storage location.

Thanks for any thoughts.

 

WSH Panel Mod script discussion/help

Reply #1309
@extracampine, i don't think i can do anything about performance. i suppose not re-drawing on artist change/panel refresh and triggering it manually could be done but i'm not very motivated to do it at the moment. sorry.

@endlesslyonline, to add support for columns would require tweaking several functions. there's on_paint which controls the display but you'd also need to track the mouse pointer in on_mouse_move and on_mouse_lbtn_up

@godrick. you can browse the marc2003 folder you extracted and edit the file named common4.js find

Code: [Select]
var data_folder = fb.ProfilePath + "wsh_lastfm\\";


you can edit this path to a common network share. note the double backslash to separate folder names. i'm not sure if UNC paths would work. you can test that.

Code: [Select]
var data_folder = "g:\\foobar stuff\\wsh_lastfm\\";


this affects all my scripts that display artist info so be aware of that. obviously you need to make sure the network share is writeable.

WSH Panel Mod script discussion/help

Reply #1310
Hi,

I'm trying to install the xch4nge skin and right now I'm receiving an error on opening foobar. The error messages are:

Scripting Engine Initialization Failed ({05B7045B-7957-4F5C-9D6D-28ECC5B7EE1E}, CODE: 0x800401f3): Invalid class string 
and
Scripting Engine Initialization Failed ({3CF6B331-FD65-4FE2-A0CA-03BE6480BD13}, CODE: 0x800401f3): Invalid class string 

I was wondering what I could do to fix this? I'm currently running WSH panel mod 1.5.0 and foobar 1.1.10


Thanks in advance

WSH Panel Mod script discussion/help

Reply #1311
Hi,

I'm trying to install the xch4nge skin and right now I'm receiving an error on opening foobar. The error messages are:

Scripting Engine Initialization Failed ({05B7045B-7957-4F5C-9D6D-28ECC5B7EE1E}, CODE: 0x800401f3): Invalid class string 
and
Scripting Engine Initialization Failed ({3CF6B331-FD65-4FE2-A0CA-03BE6480BD13}, CODE: 0x800401f3): Invalid class string 

I was wondering what I could do to fix this? I'm currently running WSH panel mod 1.5.0 and foobar 1.1.10


Thanks in advance


bad topic! but answer is that Xch4nge is not compliant with any official WSH panel Mod component, you have to use the one provided in the archive, nothing else.

WSH Panel Mod script discussion/help

Reply #1312
Hi, I made few customizations to marc's web links script, most notably added Google, Discogs & Wikipedia search and improved title formating for Google & Dg (album aimed) search to optimize search results. Icons similar to icons already existing are included too. Panel is now alignable.

Feel free to download and share any part in your own builds, scripts packs etc, no credits needed

http://www.mediafire.com/?rpiuuxwcio4xhsr

WSH Panel Mod script discussion/help

Reply #1313
@Marc2003, your advice on how to create a single image save location in #1310 shared across several Foobar2000 installations was perfect - everything works great with the changes. Since I have spotty internet connectivity in some of my locations throughout the house, this is a big improvement for me.  Thanks very much!

WSH Panel Mod script discussion/help

Reply #1314
@Tigermess, I downloaded your mod of marc2003's 'web links' script...

It failed to load and crashed   AND   it crashed my 'autoplaylists' script by marc2003.
You included 'common4.js' and 'tooltip_buttons.js' in your package; are they modified? marc2003 already provides these in his packages!
I compared the JS files in Beyond Compare and I see differences.

Thankfully, I made backups of marc2003's JS files and I restored my system. Therefore I am WARNING any potential user of Tigermess' mod ...be careful, do not just overwrite your foobar2000/marc2003 config with what Tigermess has provided.

In my opinion, you should have taken the time to include a README.TXT and documented, what exactly you did and what exactly you modified; what lines, what files.

What you could have done is isolated your path from marc2003's path like this (for example): var script_path = fb.ProfilePath + "scripts\\Tigermess\\";
and added your whole package in there. That way users don't have to destroy their marc2003 configurations just to test your "mod".

WSH Panel Mod script discussion/help

Reply #1315
Hi, Derty, thanks for report. I apologize for causing you any trouble.

I'm not aware of including any modified files else than script itself. The *.js files shall be from latest marc2003 scripts pack which he ocassionally publishes via DropBox. I included them only for the sake of users who don't have marc's pack yet. If I included any other version, it's regretful mistake. Once I'll be at home, I'll check it and report.

WSH Panel Mod script discussion/help

Reply #1316
@derty2, you're the one in the wrong here. those files match mine so it's your files that must be out of date. also the script runs without any errors so perhaps an apology is in order.

just checking the dates, i last made changes to mine on the 11th november.

edit: i do see a little problem with the google and discogs links. if your files have no album tag, the search query is blank. perhaps it could just search for the artist in these instances.

WSH Panel Mod script discussion/help

Reply #1317
I'm glad if it is so.... thanks. Just to be sure I'll still compare the content of the files, 'coz I don't want to screw other people configs. I learned my lesson too, next time I'll include only modified files and include URL to your scripts repository. It will be up to the user if he already has the files or he chooses to download the latest version.

if your files have no album tag, the search query is blank. perhaps it could just search for the artist in these instances.

Is definitely good point. I can do that in next release. Actually I was thinking about creating some onClick content menu letting user choose if he wants to search for artist, artist+album or artist+title for each of the services.

Out of curiosity, I'd prefer to let it work with current selection instead of the now playing track. I am not sure if I have seen WSH script displaying anything for the current selection... OTOH you guys do marvelous playlist scripts which have to work with selections somehow. Before I'll spend hours trying, I want to ask just if there's no problem for WSH script to work with current selection instead of what's now playing?

WSH Panel Mod script discussion/help

Reply #1318
just edit line 25 of your script....

Code: [Select]
selection_mode = 1;


0 uses the setting found under file>preferences>display>selection viewers
1 uses now playing but follows selection if playback is stopped.
2 always follows the selected item

edit: i should mention that my other scripts don't need editing like this. all the last.fm scripts, cd jewel case, artreader and news-reviews-blogs all default to 0 and have context menu items allowing the user to change the option. under no circumstances should people edit my last.fm playcount sync as changing this setting will break it. it's stuck on now playing whether you like it or not.

WSH Panel Mod script discussion/help

Reply #1319
This is my marc2003 JS support script setup:
    foobar2000\scripts\marc2003\common4.js ===> Date Modified: 2011-11-12 10:07 PM — CRC32: 425EE6C0
     foobar2000\scripts\marc2003\common.js ===> Date Modified: 2011-04-14 7:21 PM — CRC32: B95550E7
     foobar2000\scripts\marc2003\tooltip_buttons.js ===> Date Modified: 2011-10-30 11:34 PM — CRC32: 7B643F3F


So why did your "Autoplaylists" program script work without a hitch when I installed it?
     foobar2000\scripts\marc2003\wsh_samples\autoplaylists.txt ===> 2011-11-12 8:46 PM — CRC32: F0065D32[/font]

So how am I supposed to "know" what are the exact requirements for running the modded script by Tigermess? He didn't leave any documentation with the download package. He didn't specify anything.

Is it not possible that my "test case" above could easily have happened to many other "ignorant" users. I think it is easily possible; and I think I have done ALL such users a BIG favour by outlining my experiences.

Since there is such a critical relationship between your JS support scripts and your program scripts, then why do you FAIL to provide clear verbose preamble comments in the headers of your JS support scripts and your program scripts?

Why don't you have a link to your file repository in your avatar, so people can easily find your "latest" stuff?

Don't you like cultivating an ongoing and updated README.TXT with your packages?

Would you like me to download and try Tigermess' script again? If yes, then point me to ALL NECESSARY REQUIREMENTS and I will try again.

Is it possible for a user to prefix/paste all the lines from the JS support scripts ("common4.js", "tooltip_buttons.js") into a program script such as ("web links.txt")? This way, your program script becomes self-contained and non-dependent on external support files. I would prefer to have things that way.

Thankyou.

WSH Panel Mod script discussion/help

Reply #1320
ok, perhaps Tigermess should have said you need to be running my very latest scripts for it to be compatible. but you should have thought of this before throwing around accusations that he/she somehow broke it when they haven't made any changes at all.

now because the latest common files seemingly breaks your autoplaylists script, all you need to do is update it to the latest. i know it's a PITA when i change stuff but i do guarantee that if you have common files and scripts from the same zip, they do work.

WSH Panel Mod script discussion/help

Reply #1321
I checked files... they matched. "Safe" pack is here - marc's web links+.

Code: [Select]
selection_mode = 1;

I don't mind undocumented features.. thanks  For me, it works perfectly in playlist, unfortunately not anywhere else. Is it supposed to work also with media library viewers? I use facets - and it ignores everything I select there.
[I have latest foobar (1.10), WSH Mod (1.5). I don't see file>preferences>display>selection viewers. Checked twice.]

WSH Panel Mod script discussion/help

Reply #1322
it only works with library viewers if set to 0 and the foobar display preferences set to prefer current selection

as i mentioned above, i provide a nice menu option for most of my scripts. this is the only one that doesn't use it.


WSH Panel Mod script discussion/help

Reply #1323
Just got a chance to play with Tigermess' script
From the first tries, I found that in certain cases and when the album contaiins more than one word, discogs does not recognize it as one album name.
What I get in the search box is a little odd:
6 <omm Content="" With="" Blood="">

Where 6 <omm is the actual artist name, and Content With Blood the album title. Maybe this is due to the odd chars in the artist name? It is from taging via discogs though.

WSH Panel Mod script discussion/help

Reply #1324
Hi marc2003,
I have a problem in your Simple Biography script that I think it might be a bug (a strange one). It was working all fine and then I played some music from Shlohmo, and then the script just crashed, and if you try to reload id while playing the same song then it crashes the entire Foobar.
I thought it could be a problem in my tags but it seems that it you just change the artist field with "Shlohmo" in any other artist then it reproduces the problem.
I suppose it's something coming from last.fm, but I don't know that 

Thanks in advance!