Cover art as tiled wallpaper

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

pl5bnsf
Posts: 14
Joined: Fri Jun 17, 2005 8:56 pm

Cover art as tiled wallpaper

Post by pl5bnsf »

I have finally stumbled upon and cobbled together a way to display MediaMonkey's currently playing song's cover art as the desktop tiled wallpaper.

Getting the cover art to display as tiled wallpaper requires:

o A small MediaMonkey script

o A small dos bat file

o A small Python language script (must install standard Python, nothing special)

o ImageMagick image software (to convert from jpg to bmp, here also, standard install of this freeware software)

Basically, the MM script calls the bat file with the full path and file name of the currently playing song. Then the Python script strips out the art from the MP3 file. ImageMagick software then converts the jpg cover art file into a bmp file for use as wallpaper. Then the MM script makes the registry updates to force the wallpaper switch. The wallpaper switch occurs within 1 or 2 seconds from the time the new song starts playing, often before MM updates it's own display.

I really like having the covers shown as the wallpaper, which is why I fought this for so long (tried from Winamp, QCD, etc). I can finally move totally off of MusicMatch!!!!!!

If there is anyone interested in this functionallity and is brave enough to try it, let me know and I'll put up a web page with the instructions.
onkel_enno
Posts: 2153
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno »

I would be interested. maybe you could post the scripts and batch, ... if you want.
pl5bnsf
Posts: 14
Joined: Fri Jun 17, 2005 8:56 pm

Post by pl5bnsf »

Here are the instructions for enabling the current song to display as your desktop wallpaper.
-------------------------------------------------------

Install python 2.4.1 (or greater) from http://python.org/.

Install ImageMagick from http://imagemagick.org I installed this one:
http://www.imagemagick.org/download/bin ... ws-dll.exe

Cut out and save the various scripts below as described.

You will end up with one directory like this
In c:\a\covers (any directory, recommend NO spaces in path name)
ShowCover.bat
ShowCover.py
cover.jpg (will be created, this is the extracted art)
cover.bmp (will be created, bmp for wallpaper)

Put ShowCover.vbs into the MediaMonkey script dir

Update your script.ini file.

Since the ShowCovers.vbs is setup in scripts.ini (ScriptType=2)
to fire when a song starts, once everything is in place
you should see the album covers show as your wallpaper.

No error checking is done, the last wallpaper shown
stays as your wallpaper when you leave MM, songs with no
image tags will not change anything, only the first image
contained in the MP3 file is used. Yes, I tried to remove
the hardcoded paths but it was a pain and went back
to hardcoding for now.

-----------------------------------------------------
-- ShowCover.vbs
-- Save this as the file 'ShowCover.vbs'
-- and place it in the MediaMonkey scripts directory.
-----------------------------------------------------
----CUT-----CUT-----CUT---------------------------------
' Change to the location where the scripts are
Const PgmPath = "C:\a\covers\ShowCover.bat"

Sub ShowCover
' Define variables
Dim X, WShell, Command, list, itm, WSHShell, N, RegLoc

' Get current track from MediaMonkey
Set itm = SDB.Player.CurrentSong

' Prepare WScript.Shell object
Set WShell = CreateObject("WScript.Shell")

' Prepare command to execute
Command = Chr(34) & PgmPath & Chr(34) & " " & Chr(34) & itm.Path & Chr(34)

' Run bat file, using mode 7 (minimized window)
WShell.Run Command, 7, 1

' The bat file just run created the Cover.bmp wallpaper file
' Tell the registry where the wallpaper image is and force an update.
' Change the bmp location below as needed.
WShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", "c:\a\covers\Cover.bmp"
WShell.RegWrite "HKCU\Control Panel\Desktop\TileWallpaper","1"
WShell.run "rundll32.exe user32.dll,UpdatePerUserSystemParameters 1,True"

end sub
----CUT-----CUT-----CUT---------------------------------
-----------------------------------------------------
-- End ShowCover.vbs
-----------------------------------------------------

-----------------------------------------------------
-- scripts.ini parms
-- Add this to your MediaMonkey scripts.ini file
-----------------------------------------------------
----CUT-----CUT-----CUT---------------------------------
[ShowCover]
FileName=ShowCover.vbs
ProcName=ShowCover
Order=1
DisplayName=&ShowCover
Description=ShowCover
Language=VBScript
ScriptType=2
ShowCoverDir=c:\MediaMonkey\Scripts\ShowCover
----CUT-----CUT-----CUT---------------------------------
-----------------------------------------------------
-- End scripts.ini
-----------------------------------------------------

-----------------------------------------------------
-- ShowCover.bat
-- Save this as file 'ShowCover.bat'
-- Place it in a working directoy.
-- The samples below use c:\a\covers - change as desired
-- NOT tested with directoy names containging spaces....
-----------------------------------------------------
----CUT-----CUT-----CUT---------------------------------

REM Change this chdir to point to where your bat file
REM and the python script is.
chdir c:\a\covers

c:\bin\python24\python ShowCover.py %1

c:\bin\ImageMagick\convert.exe Cover.jpg Cover.bmp
----CUT-----CUT-----CUT---------------------------------
-----------------------------------------------------
-- End ShowCover.bat
-----------------------------------------------------

-----------------------------------------------------
-- ShowCover.py
-- Save this as the file 'ShowCover.py'
-- place it in the same directory as the ShowCover.bat file
-- Those are splits look for HEX characters, leave them as-is.
-----------------------------------------------------
----CUT-----CUT-----CUT---------------------------------
import os, sys, re
from stat import *

# Open the MP3 file passed in on the command line
f = open(sys.argv[1], 'rb')

# Open the jpg file to be created
fo = open('Cover.jpg', 'wb')

# Read in the entire MP3 file
x = f.read()

# Remove everything up to the start of the embeded jpg cover art
y = re.split('\xFF\xD8\xFF\xE0\x00\x10\x4A\x46\x49\x46\x00\x01\x01', x, re.M)

# Put the jpg header back on
tmppic = '\xFF\xD8\xFF\xE0\x00\x10\x4A\x46\x49\x46\x00\x01\x01' + y[1]

# Remove everything after the end of the jpg image
z = re.split('\xFF\xD9', tmppic, re.M)

# Put the end-of-jpg string back
pic = z[0] + '\xFF\xD9'

# Write out the jpg image
fo.write(pic)

fo.close
f.close
----CUT-----CUT-----CUT---------------------------------
-----------------------------------------------------
-- End ShowCover.bat
-----------------------------------------------------
rovingcowboy
Posts: 14163
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy »

you have to convet to bmp? did you try to use jpg and or gif files, they will work if you have active desktop turned on.

8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
pl5bnsf
Posts: 14
Joined: Fri Jun 17, 2005 8:56 pm

Post by pl5bnsf »

I just tried it and Active Desktop does not tile the image, it just puts one image over on the right side of the desktop. Is there a way to have AD tile the image?
rovingcowboy
Posts: 14163
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy »

thats strange?

active desktop should put any gif and jpg over the orginal image for your desktop.

there must be something in your code someplace that is making the size of the desktop shrink? :-? :o

sounds like there is a gutter on it like there is on the documents in the word program maybe you have to resize the gutter in your code where ever it is?

:(

wait a second here i just remembered when i reread your message your only using a small image from the album art.

you might have to tell the desktop properties to center and strech the image to get it one image on the screen. as to why it did not tile it i am not sure unless it only tiles bmps
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
Post Reply