It is currently May 18th, 2024, 6:33 pm

Possibility? Now Playing Art gird

Get help with creating, editing & fixing problems with skins
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Possibility? Now Playing Art gird

Post by Lightz39 »

So I have this idea that probably isn't something easy to accomplish but I figured I'd ask. What I hope to do is have my media player tile display a grid of say 25 of your recent album arts in a collage when the media player isnt open.

Example: Media player open display current tracks album cover. Media player closed display recent 25 album covers in collage.

My hopes aren't extremely high on this one. Sounds like it could be difficult but you never know.
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: Possibility? Now Playing Art gird

Post by haibusa2005 »

Impossible is nothing. !WriteKeyValue bang might help - executing it on TrackChangeAction after song is changed. It will keep track of the album art paths loaded and store them in a text file. Upon stopping player the WebParser parses the last 25 (or so) records and then image meters display the values. The disadvantages are that the text file will grow to an excessive size over time and also multiple entities in the records file will exist but that can be bypassed by using a good regular expression. I think a lua script should also do the trick but can't say, because I am not a script user
Last edited by haibusa2005 on August 8th, 2012, 7:15 pm, edited 1 time in total.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Possibility? Now Playing Art gird

Post by MerlinTheRed »

This is actually a really nice idea! It's no problem to read and write files in Lua. I'd also use the approach haibusa suggested. Using TrackChangeAction to call a Lua script that writes the current album art path into a file and deletes possible old files. Perhaps you don't even need a separate file. Create variables for the 25 last used covers inside your skin and let the Lua script handle them. Then you can have 25 different image meters that show the images specified by these variables. I'd perhaps use !WriteKeyValue and !SetVariable at the same time so you don't need to refresh the skin on every track change but also keep the variables when stopping Rainmeter.

Since I like the idea so much I'm ready to help you along the way. Just ask if you run into problems along the way.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Possibility? Now Playing Art gird

Post by Lightz39 »

Sounds good! Thanks. This will be my focus for now then. Since its something I'd like.
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: Possibility? Now Playing Art gird

Post by haibusa2005 »

I suggest you to use the file method, since the values of the variables are reset to their defaults upon skin refresh and you should play new 25 songs to get the album arts. The file is always available. As I think of it, on webparser error (not enough entities or non existing album art file) you might use some generic art or blurry image to fill in the grid.
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Possibility? Now Playing Art gird

Post by Lightz39 »

Ok I'm going to spit ball here because I'm new to this stuff. I'll need help. So I found where now playing keeps the artwork.

C:\Users\USERNAME\AppData\Local\Temp\jpgE95B.tmp - Location of currently playing artwork
C:\Users\USERNAME\AppData\Local\Temp\jpgC44D.tmp - Is another one, not sure what its supposed to be

You can change these to .jpg and they become 600x600(or whatever you have) image files. So basically what I am going to want to do is copy the currently playing file, change it to .jpg and save it to a folder like say "Album Collage". From there I will be able to have say 0-24 jpg that I can display as meters?
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: Possibility? Now Playing Art gird

Post by haibusa2005 »

That complicates the things a bit. No problem to copy the files but only the first 25 arts will be used in the meters unless you find a way to dynamically add only last 25 entities. Rainmeter doesn't have problem with files extensions so no renaming will be necessary. That will probably require some external tools that will categorize files by renaming files based on date modified parameter. Better copy first 25 files and leave them there to be available for "cold start" or skin refresh and just fill in variables as the songs are changed.
About the temp files - does NowPlaying give preference to local album art or internet found images? Does the plugin clear its temporary files upon skin refresh? If it does then the file method becomes irrelevant because the file will be filled with non existing images.
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Possibility? Now Playing Art gird

Post by Lightz39 »

So the name of the temp file changes once and a while it seems. I just checked it and the file is now jpg6916. When the skin is refreshed and or nothing is playing the image remains intact. So the file doesn't disappear when nothing is going on. It still has access to it until the next song comes on and it overwrites it. You only ever have access to the currently playing song it seems.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Possibility? Now Playing Art gird

Post by MerlinTheRed »

haibusa2005 wrote:I suggest you to use the file method, since the values of the variables are reset to their defaults upon skin refresh and you should play new 25 songs to get the album arts. The file is always available. As I think of it, on webparser error (not enough entities or non existing album art file) you might use some generic art or blurry image to fill in the grid.
If you use !WriteKeyValue the variables aren't reset.
Lightz39 wrote:Ok I'm going to spit ball here because I'm new to this stuff. I'll need help. So I found where now playing keeps the artwork.

C:\Users\USERNAME\AppData\Local\Temp\jpgE95B.tmp - Location of currently playing artwork
C:\Users\USERNAME\AppData\Local\Temp\jpgC44D.tmp - Is another one, not sure what its supposed to be

You can change these to .jpg and they become 600x600(or whatever you have) image files. So basically what I am going to want to do is copy the currently playing file, change it to .jpg and save it to a folder like say "Album Collage". From there I will be able to have say 0-24 jpg that I can display as meters?
Copying the images to a safe location where they won't be deleted is probably a good idea. putting some 25 images there as a start is probably also a good idea. I don't really know how to copy images with Lua though. Worst case you need to open the file in binary mode, read it and write it to the other file in binary mode. Don't know if this is the best idea. If somebody knows how to rename/copy a file in Lua let us know.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Possibility? Now Playing Art gird

Post by MerlinTheRed »

haibusa2005 wrote:That complicates the things a bit. No problem to copy the files but only the first 25 arts will be used in the meters unless you find a way to dynamically add only last 25 entities. Rainmeter doesn't have problem with files extensions so no renaming will be necessary. That will probably require some external tools that will categorize files by renaming files based on date modified parameter. Better copy first 25 files and leave them there to be available for "cold start" or skin refresh and just fill in variables as the songs are changed.
About the temp files - does NowPlaying give preference to local album art or internet found images? Does the plugin clear its temporary files upon skin refresh? If it does then the file method becomes irrelevant because the file will be filled with non existing images.
I think NowPlaying only gets the paths to the cover art from your media player. These temp files are probably created by the media player itself. Another possibility is that NowPlaying creates those temp files if the album art is embedded into the mp3 files. In any case, it doesn't download anything from the internet as far as I know.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!