Simple Lyrics Viewer

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

Moderators: Peke, Gurus

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

Image
MeMeMe
Posts: 272
Joined: Fri Dec 23, 2005 11:42 am
Location: In front of my computer

Post by MeMeMe »

You may be right!

<slinks away quietly, hoping no-one notices that I actually posted in that thread... :oops: >

:D
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

It's a bit like that here. You almost need your 'Sherlock Holm' hat on at times to find stuff here.. ;)
Image
mynameistajmahal

Post by mynameistajmahal »

do you think it would be possible to have the lyrics window appear only when there are lyrics in the tag? So instead of having a window that wastes space and says No Lyrics for some songs, there would be no window at all for those songs. And then, when there are songs playing with lyrics, the window can pop up all docked and nice on the side and wow all my friends!

is that possible?
MCSmarties
Posts: 251
Joined: Tue Dec 06, 2005 8:01 pm

Need some help to tweak the code...

Post by MCSmarties »

I love Begges' lyrics panel and have been using it ever since I found it.

I also tried to tweak it a little. My version reformatted a bit the title display and also shows the song year:

<Album>
<Artist>
<Song Title> (<Year>)

Relevant code modified:

Code: Select all

strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
   strSongTitle =  "<h3>" & song.Title & " (" & song.Year & ")" & "</h3>"
   strArtistName = "<h2>" & song.ArtistName & "</h2>"
   strAlbumName = "<h1>" & song.AlbumName & "</h1>"
   strHeaderEnd = "<plaintext>"
   strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
I would like to modify it a bit more extensively, but I'm reaching the end of my (very limited) coding skills!
Can someone help me?

I would like to add the ORIGINAL YEAR (if it exists), like this:

<Album> (<Year>)
<Artist>
<Song Title> (<Original Year>)

Another neat feature would be to include links to allmusic.com.
What I have in mind is to search allmusic.com for <Album>, <Artist> and <Title> whenever these lines are clicked.
Is this possible?
Thanks!
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Have you tried "song.OriginalYear"? :)

For allmusic.com, try something like these...

http://allmusic.com/cg/amg.dll?P=amg&x= ... ql=<Artist>
http://allmusic.com/cg/amg.dll?P=amg&x= ... sql=<Album>
http://allmusic.com/cg/amg.dll?P=amg&x= ... sql=<Title>

I don't think you can search for all of them at once though.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
gege
Posts: 866
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

Try this...

Post by gege »

I did not test it but I think the code below may work for the (year) thing...
As always, use it at your own risk ;-)

Code: Select all

Sub ExportLyrics
	DIM origYear, albumYear

	....

	   If song.Year>0 Then
			albumYear= " (" & song.Year & ") "
	   else albumYear= ""
	   
	   If song.OriginalYear>0 Then
			origYear= " (" & song.OriginalYear & ")"
	   else origYear= ""
	
	   strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
	   strSongTitle =  "<h3>" & song.Title & origYear & "</h3>"
	   strArtistName = "<h2>" & song.ArtistName & "</h2>"
	   strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
	   strHeaderEnd = "<plaintext>"
	   strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics

	....

End Sub
Last edited by gege on Mon Feb 05, 2007 5:48 am, edited 1 time in total.
MCSmarties
Posts: 251
Joined: Tue Dec 06, 2005 8:01 pm

Post by MCSmarties »

Duh...! Of course I would have to define a variable to assign to song.OriginalYear first... so that's why it didn't work! :oops:

Thanks for the input guys, will play around with this over the weekend.

Now I need to find out how to add a HTML link but I think I can figure it out.
If I can get something to work, I'll post it here.
MCSmarties
Posts: 251
Joined: Tue Dec 06, 2005 8:01 pm

Got a working version

Post by MCSmarties »

OK guys, I managed to get something to work.
Don't be too hard on me, I'm a newbie in coding! :o

I replaced this part:

Code: Select all

   strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
   strSongTitle =  "<h1>" & song.Title & "</h1>"
   strArtistName = "<h2>" & song.ArtistName & "</h2>"
   strHeaderEnd = "<plaintext>"
   strCompleteLyrics = strHeaderBegin & strSongTitle & strArtistName & strHeaderEnd & strLyrics

   Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
   tmpFile.WriteLine strCompleteLyrics
End Sub 
with this:

Code: Select all

   Dim origYear, albumYear
   If song.Year>0 Then
        albumYear= " (" & song.Year & ") "
   Else 
        albumYear= ""
   End If
         
   If song.OriginalYear>0 Then
        origYear= " (" & song.OriginalYear & ")"
   Else 
        origYear= albumYear    
   End If
          
   strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
   strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
   strSongTitle="<a target=""_New"" href="""& FndTitle(song.Title) &""">"& strSongTitle &"</a>"
   strArtistName = "<h2>" & song.ArtistName & "</h2>"
   strArtistName="<a target=""_New"" href="""& FndArtist(song.ArtistName) &""">"& strArtistName &"</a>"
   strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
   strAlbumName="<a target=""_New"" href="""& FndAlbum(song.AlbumName) &""">"& strAlbumName &"</a>"
   strHeaderEnd = "<plaintext>"
   strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics

   Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
   tmpFile.WriteLine strCompleteLyrics
End Sub

Function FndArtist(cString)
FndArtist="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=1&sql="&cString&"&btnG"
End Function 

Function FndAlbum(cString)
FndAlbum="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=2&sql="&cString&"&btnG"
End Function 

Function FndTitle(cString)
FndTitle="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=3&sql="&cString&"&btnG"
End Function 
I also modified the lyrics_panel.css file to:

Code: Select all

body{font:8pt Verdana, Arial, sans serif;margin:0;padding:17px 14px;background:#bed7f4 url('lyrics_panel_bg.gif') no-repeat}
plaintext{font:8pt Verdana, Arial, sans serif;margin:0;padding:15px 5px}
h1{margin:5px;clear:both;font-size:150%;font-style:italic;color:#222}
h2{margin:5px;clear:both;font-size:130%;font-weight:normal;color:#222;padding:0 0 12px 0}
h3{margin:5px;clear:both;font-size:180%;font-weight:bolder;color:#222}
Like I said, this seems to be working for me but I'm not 100% happy.

Could somebody help me with the following questions?
1. How can I concatenate the functions FndArtist, FndAlbum and FndTitle into one? They're practically identical!

2. Is there a way to prevent the links from being underlined? Just nitpicking aesthetics...

3. This code opens a IE window even though I have Firefox installed and configured as my default internet browser. Can I make these links open in Firefox (or is there even a way to show that content within the lyrics panel?)

Thanks!
gege
Posts: 866
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

Here we go...

Post by gege »

1. Try this:

Code: Select all

   strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
   strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
   strSongTitle="<a target=""_New"" href="""& FndInfo("3",song.Title) &""">"& strSongTitle &"</a>"
   strArtistName = "<h2>" & song.ArtistName & "</h2>"
   strArtistName="<a target=""_New"" href="""& FndInfo("1",song.ArtistName) &""">"& strArtistName &"</a>"
   strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
   strAlbumName="<a target=""_New"" href="""& FndInfo("2",song.AlbumName) &""">"& strAlbumName &"</a>"
   strHeaderEnd = "<plaintext>"
   strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics

   Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
   tmpFile.WriteLine strCompleteLyrics
End Sub

Function FndInfo(infoType,cString)
   FndInfo="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=" & infoType & "&sql=" & cString & "&btnG"
End Function
Again, I did not test it!


2. Just add the following line to the end of the CSS file:

Code: Select all

a, a:hover{text-decoration:none} 
3. a) To force links to open in Firefox, install the FirefoxView extension in Firefox. It adds a "View this page in Firefox" option in IE context menu. This way you can right click the link and choose that option.
b) To open a link in the panel itself, without opening a new window, replace "<a target=""_New" by "<a target=""_self" in link's code.


Oh... And I want the complete code when you finish this ;-)
MCSmarties
Posts: 251
Joined: Tue Dec 06, 2005 8:01 pm

I see the light!

Post by MCSmarties »

Thanks Gege. Will wrap this up tonight.

And sure I'll post the "complete" code!

What between Begges 95%, your 3% and the 2% I figured out using one of DiddeLeeDoo's scripts as template, my own contribution is tending to nil... :P
mjs93
Posts: 158
Joined: Fri Jun 17, 2005 3:28 am

Post by mjs93 »

I have just gotten around to using this script. Works great, many thanks. :)
DickDiver
Posts: 51
Joined: Wed Feb 16, 2005 11:53 am

Post by DickDiver »

for I am total new to this could you please post the whole working code?

MM3 appreciated

I am using evillyrics.

thanks
Joe Dell Dell
gege
Posts: 866
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

Post by gege »

Use my Lyrics and Comment Viewer. Link in my signature.
julian1

Re: Simple Lyrics Viewer

Post by julian1 »

I have successfully installed the lyrics panel. However, how to make it view chinese characters? thx
Post Reply