Old 4th January 2010, 10:32   #1
JW
Senior Member
 
Join Date: Nov 2004
Location: Valencia, CA
Posts: 304
Timer question

The script below displays album art using a line inserted at the top of each of my playlists...

PHP Code:
#include ../../../lib/std.mi
#include ../../../lib/pldir.mi

Global container main;
Global 
layout normal;
Global 
PLEdit GetAlbumTitle;
Global 
layer albumcover;
Global 
string albumtitlefullpath;

System.OnScriptLoaded()
{
  
main getContainer("main"); 
  
Group maingroup getContainer("main").getLayout("normal");
  
albumcover maingroup.findobject("albumcover");
  
GetAlbumTitle = new PLEdit;
  
fullpath = (System.getPrivateString("Mobile PC""Cover"fullpath));
  
albumcover.setXMLParam("image"fullpath);
}

GetAlbumTitle.onPLEditModified()
{
  
albumtitle PLEdit.getTitle(0);
  
fullpath "../../../../Covers/" albumtitle ".jpg";
  
albumcover.setXMLParam("image"fullpath);
  
setPrivateString("Mobile PC""Cover"fullpath);

Having the extra line in the playlist file causes a "-" to be displayed in the playlist. I can remove it with the script but that is a playlist modification and blows away the album art.

Is it possible to use a timer to set a delay, where the script will ignore playlist modifications so the item can be removed, like so?

Playlist gets modified
Cover gets loaded
Start timer to ignore playlist modifications
Remove playlist item
Stop timer, wait for new playlist modifications
JW is offline   Reply With Quote
Old 5th January 2010, 15:24   #2
pjn123
Major Dude
 
pjn123's Avatar
 
Join Date: Jan 2006
Location: /\/¯¯¯¯¯\/\ , South-Africa
Posts: 1,030
Can you maybe explain what you want to do? Maybe add a picture.

From what I understand you want to show the albumart of the selected item in the playlist? But you dont want to display a - item (is this the playlist seperator plugin? or what?).

ClassicPro© v2.01 : This plugin allows you to use cPro skins in Winamp. ClassicPro skins are all SUI skins and loads very quickly. ClassicPro skins is even easier to skin than Winamp Classic skins. A new layout have been added since version 2.
Download ClassicPro© ==== cPro Skins ==== ClassicPro© Homepage ==== SC Forums
pjn123 is offline   Reply With Quote
Old 5th January 2010, 19:16   #3
JW
Senior Member
 
Join Date: Nov 2004
Location: Valencia, CA
Posts: 304
My script reads the first item in the playlist, which is just a line of text with the artist and album title. That shows up in the playlist as a dash. I want to get rid of that entry in the playlist, after loading the album art with the script.

Last edited by JW; 5th January 2010 at 20:55.
JW is offline   Reply With Quote
Old 6th January 2010, 07:04   #4
pjn123
Major Dude
 
pjn123's Avatar
 
Join Date: Jan 2006
Location: /\/¯¯¯¯¯\/\ , South-Africa
Posts: 1,030
Ah okay

I'll do this:

1) If the playlist is changed AND the first item in the playlist is a dash you load albumart and after that you delete the first entry. Don't need a timer for this though.

You'll need a timer if for example you want to add this:
- What if you play a file/files that doesn't have this first line? I'll do step1 above and then check to see if when the playlist additions is stopped (maybe check every 100ms after the dash was found). Then you will know that there was a dash and the album items in the playlist finished loading. Now as soon as the playlist change again (any change or just in number of items, your choice) the albumart is reset to the default no cover icon and the playlist is again checked for the cover line and if none is found you can just keep showing the no cover picture.

Btw can't you rather just check the metadata of the playing or selected file for the artist/album and then form the cover filename from that? Will make stuff a lot easier?

ClassicPro© v2.01 : This plugin allows you to use cPro skins in Winamp. ClassicPro skins are all SUI skins and loads very quickly. ClassicPro skins is even easier to skin than Winamp Classic skins. A new layout have been added since version 2.
Download ClassicPro© ==== cPro Skins ==== ClassicPro© Homepage ==== SC Forums
pjn123 is offline   Reply With Quote
Old 6th January 2010, 15:29   #5
JW
Senior Member
 
Join Date: Nov 2004
Location: Valencia, CA
Posts: 304
I don't use the metadata because some songs appear on multiple albums. If I'm playing a particular list (which in my case are always album track listings), I want one particular image to appear. And the dash only appears based on how I format the titles in the playlist (%artist% - %title%). The way the script works now, if there is no JPG file in the folder that matches, it displays nothing.
JW is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump